sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sseif...@apache.org
Subject svn commit: r1707737 - in /sling/trunk/samples/slingshot: pom.xml src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java
Date Fri, 09 Oct 2015 14:35:52 GMT
Author: sseifert
Date: Fri Oct  9 14:35:51 2015
New Revision: 1707737

URL: http://svn.apache.org/viewvc?rev=1707737&view=rev
Log:
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.

Modified:
    sling/trunk/samples/slingshot/pom.xml
    sling/trunk/samples/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java

Modified: sling/trunk/samples/slingshot/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/pom.xml?rev=1707737&r1=1707736&r2=1707737&view=diff
==============================================================================
--- sling/trunk/samples/slingshot/pom.xml (original)
+++ sling/trunk/samples/slingshot/pom.xml Fri Oct  9 14:35:51 2015
@@ -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>

Modified: sling/trunk/samples/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java?rev=1707737&r1=1707736&r2=1707737&view=diff
==============================================================================
--- sling/trunk/samples/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java
(original)
+++ sling/trunk/samples/slingshot/src/test/java/org/apache/sling/sample/slingshot/impl/SetupServiceTest.java
Fri Oct  9 14:35:51 2015
@@ -27,23 +27,15 @@ import static org.mockito.Matchers.anySt
 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 @@ import org.osgi.service.cm.Configuration
 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);
         



Mime
View raw message