update to released versions of sling mocks
switch to sling-mock-oak because i did not get sling-mock-jackrabbit test to run at windows.
no need any longer to manually register sling node types with latest sling-mock version.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1707737 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/slingshot/pom.xml b/slingshot/pom.xml
index ba49747..e74a21c 100644
--- a/slingshot/pom.xml
+++ b/slingshot/pom.xml
@@ -132,6 +132,15 @@
</profiles>
<dependencies>
+
+ <!-- Put sling-mock-oak dependency to top to get latest jcr-resource dependencies for running it -->
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
@@ -194,19 +203,13 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.osgi-mock</artifactId>
- <version>1.5.1-SNAPSHOT</version>
+ <version>1.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.sling-mock</artifactId>
- <version>1.5.1-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.testing.sling-mock-jackrabbit</artifactId>
- <version>0.1.3-SNAPSHOT</version>
+ <version>1.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java b/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java
index d20e7b6..9915ae5 100644
--- a/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java
+++ b/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java
@@ -27,23 +27,15 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import java.io.File;
-import java.io.IOException;
-
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
-import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.api.security.user.UserManager;
import org.apache.sling.api.resource.Resource;
-import org.apache.sling.commons.testing.jcr.RepositoryUtil;
import org.apache.sling.jcr.base.util.AccessControlUtil;
import org.apache.sling.sample.slingshot.SlingshotConstants;
-import org.apache.sling.sample.slingshot.impl.InternalConstants;
-import org.apache.sling.sample.slingshot.impl.SetupService;
import org.apache.sling.testing.mock.sling.ResourceResolverType;
import org.apache.sling.testing.mock.sling.junit.SlingContext;
-import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.osgi.service.cm.Configuration;
@@ -52,18 +44,11 @@
public class SetupServiceTest {
@Rule
- public SlingContext context = new SlingContext(ResourceResolverType.JCR_JACKRABBIT);
-
- @Before
- public void cleanupIfNeeded() throws IOException {
- FileUtils.deleteDirectory(new File("target/repository"));
- }
+ public SlingContext context = new SlingContext(ResourceResolverType.JCR_OAK);
@Test
public void setup() throws Exception{
- RepositoryUtil.registerSlingNodeTypes(context.resourceResolver().adaptTo(Session.class));
-
// create expected content structure
context.load().json("/slingshot.json", SlingshotConstants.APP_ROOT_PATH);