Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: exoplatform/data-upgrade
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 18aa56fd2e4558a06ba01985cad167adb15aad4f
Choose a base ref
..
head repository: exoplatform/data-upgrade
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 47b52e0f3700f46e28d91cf4612802dfa009a831
Choose a head ref
22 changes: 21 additions & 1 deletion data-upgrade-move-folders/pom.xml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
<parent>
<groupId>org.exoplatform.addons.upgrade</groupId>
<artifactId>upgrade</artifactId>
<version>6.5.x-maintenance-SNAPSHOT</version>
<version>6.4.x-SNAPSHOT</version>
</parent>

<artifactId>data-upgrade-move-folders</artifactId>
@@ -48,5 +48,25 @@
<artifactId>ecms-core-services</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@
<value-param>
<name>plugin.upgrade.target.version</name>
<description>Target version of the plugin</description>
<value>6.5.0</value>
<value>6.4.4</value>
</value-param>
<!-- Configuration parameters specific to the current upgrade plugin -->
<value-param>
@@ -104,7 +104,7 @@
<value-param>
<name>plugin.upgrade.target.version</name>
<description>Target version of the plugin</description>
<value>6.5.0</value>
<value>6.4.4</value>
</value-param>
<!-- Configuration parameters specific to the current upgrade plugin -->
<value-param>
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package org.exoplatform.jcr.upgrade;

import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.services.cms.impl.Utils;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.core.ManageableRepository;
@@ -15,19 +19,21 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import javax.jcr.Item;
import javax.jcr.Session;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;

@RunWith(MockitoJUnitRunner.class)
@RunWith(PowerMockRunner.class)
@PrepareForTest({ExoContainerContext.class, PortalContainer.class, RequestLifeCycle.class})
@PowerMockIgnore({ "javax.management.*", "jdk.internal.reflect.*", "javax.naming.*", "javax.xml.*", "org.apache.xerces.*", "org.xml.*", "com.sun.*", "org.w3c.*" })
public class MoveNodesUpgradePluginTest {
@Mock
private RepositoryService repositoryService;
@@ -59,6 +65,9 @@ public void setUp() throws Exception {
Item node = mock(Item.class);
when(session.getItem(anyString())).thenReturn(node);
lenient().when(sessionProvider.getSession(any(), any(ManageableRepository.class))).thenReturn(session);
PowerMockito.mockStatic(ExoContainerContext.class);
PowerMockito.mockStatic(PortalContainer.class);
PowerMockito.mockStatic(RequestLifeCycle.class);
}

@Test