This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git


The following commit(s) were added to refs/heads/master by this push:
     new e3dbf50  SLING-8621 - TestUtil.cleanup causes in WARNing due to 
SlingContext Rule
e3dbf50 is described below

commit e3dbf50c1e1dcccc00517b6e8df814ae77ce4f0f
Author: Robert Munteanu <[email protected]>
AuthorDate: Thu Aug 8 14:13:01 2019 +0300

    SLING-8621 - TestUtil.cleanup causes in WARNing due to SlingContext Rule
    
    Outright remove TestUtil.cleanup since it only operates on sessions managed 
by the SlingContext.
---
 .../java/org/apache/sling/jcr/repoinit/ExecutionOrderTest.java    | 8 +-------
 .../org/apache/sling/jcr/repoinit/RegisterNamespacesTest.java     | 6 ------
 .../java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java | 8 +-------
 .../java/org/apache/sling/jcr/repoinit/RegisterPrivilegeTest.java | 6 ------
 .../org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java  | 8 +-------
 src/test/java/org/apache/sling/jcr/repoinit/impl/TestUtil.java    | 4 ----
 6 files changed, 3 insertions(+), 37 deletions(-)

diff --git 
a/src/test/java/org/apache/sling/jcr/repoinit/ExecutionOrderTest.java 
b/src/test/java/org/apache/sling/jcr/repoinit/ExecutionOrderTest.java
index 0369d88..92fa512 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/ExecutionOrderTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/ExecutionOrderTest.java
@@ -27,7 +27,6 @@ import org.apache.sling.jcr.repoinit.impl.TestUtil;
 import org.apache.sling.repoinit.parser.RepoInitParsingException;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -58,14 +57,9 @@ public class ExecutionOrderTest {
         U.parseAndExecute(stmt);
     }
 
-    @After
-    public void cleanup() throws RepositoryException, RepoInitParsingException 
{
-        U.cleanup();
-    }
-    
     @Test
     public void pathCreated() throws PathNotFoundException, 
RepositoryException {
         final Node n = U.getAdminSession().getNode("/" + REL_PATH);
         assertEquals(NS_PREFIX + ":foo", 
n.getProperty("jcr:primaryType").getString());
     }
-}
\ No newline at end of file
+}
diff --git 
a/src/test/java/org/apache/sling/jcr/repoinit/RegisterNamespacesTest.java 
b/src/test/java/org/apache/sling/jcr/repoinit/RegisterNamespacesTest.java
index 03d1df9..004af9b 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/RegisterNamespacesTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/RegisterNamespacesTest.java
@@ -27,7 +27,6 @@ import org.apache.sling.jcr.repoinit.impl.TestUtil;
 import org.apache.sling.repoinit.parser.RepoInitParsingException;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -53,11 +52,6 @@ public class RegisterNamespacesTest {
         ns = U.getAdminSession().getWorkspace().getNamespaceRegistry();
     }
 
-    @After
-    public void cleanup() throws RepositoryException, RepoInitParsingException 
{
-        U.cleanup();
-    }
-    
     @Test
     public void NS1registered() throws Exception {
         assertEquals(NS1, ns.getURI("one"));
diff --git 
a/src/test/java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java 
b/src/test/java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java
index 8b652d1..efaed73 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/RegisterNodetypesTest.java
@@ -27,7 +27,6 @@ import org.apache.sling.jcr.repoinit.impl.TestUtil;
 import org.apache.sling.repoinit.parser.RepoInitParsingException;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -51,11 +50,6 @@ public class RegisterNodetypesTest {
         U.parseAndExecute(U.getTestCndStatement(NS_PREFIX, NS_URI));
     }
 
-    @After
-    public void cleanup() throws RepositoryException, RepoInitParsingException 
{
-        U.cleanup();
-    }
-    
     @Test
     public void NSregistered() throws Exception {
         final NamespaceRegistry ns = 
U.getAdminSession().getWorkspace().getNamespaceRegistry();
@@ -66,4 +60,4 @@ public class RegisterNodetypesTest {
     public void fooNodetypeRegistered() throws Exception {
         U.getAdminSession().getRootNode().addNode("test_" + TEST_ID, NS_PREFIX 
+ ":foo");
     }
- }
\ No newline at end of file
+ }
diff --git 
a/src/test/java/org/apache/sling/jcr/repoinit/RegisterPrivilegeTest.java 
b/src/test/java/org/apache/sling/jcr/repoinit/RegisterPrivilegeTest.java
index 6311167..c2ffe2f 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/RegisterPrivilegeTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/RegisterPrivilegeTest.java
@@ -21,7 +21,6 @@ import org.apache.sling.jcr.repoinit.impl.TestUtil;
 import org.apache.sling.repoinit.parser.RepoInitParsingException;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -53,11 +52,6 @@ public class RegisterPrivilegeTest {
         U.parseAndExecute("register abstract privilege 
withabstract_withaggregates with 
withoutabstract_withoutaggregates1,withoutabstract_withoutaggregates3");
     }
 
-    @After
-    public void cleanup() throws RepositoryException, RepoInitParsingException 
{
-        U.cleanup();
-    }
-
     @Test
     public void testRegisterPrivilegeWithoutAbstractWithoutAggregates() throws 
Exception {
         Privilege privilege = ((JackrabbitWorkspace) 
U.getAdminSession().getWorkspace()).getPrivilegeManager().getPrivilege("withoutabstract_withoutaggregates1");
diff --git 
a/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java 
b/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java
index aabbe4b..f3a1d99 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java
@@ -25,7 +25,6 @@ import javax.jcr.SimpleCredentials;
 import org.apache.sling.repoinit.parser.RepoInitParsingException;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -55,11 +54,6 @@ public class ManyServiceUsersTest {
         uniqueId = UUID.randomUUID().toString();
     }
     
-    @After
-    public void cleanup() {
-        U.cleanup();
-    }
-    
     @Test
     public void testSyncServiceUserCreation() throws Exception {
         
@@ -96,4 +90,4 @@ public class ManyServiceUsersTest {
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/apache/sling/jcr/repoinit/impl/TestUtil.java 
b/src/test/java/org/apache/sling/jcr/repoinit/impl/TestUtil.java
index f57fee9..b1b86e9 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/impl/TestUtil.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/impl/TestUtil.java
@@ -198,10 +198,6 @@ public class TestUtil {
         return adminSession;
     }
 
-    public void cleanup() {
-        adminSession.logout();
-    }
-
     public String getTestCndStatement(String nsPrefix, String nsURI) throws 
RepositoryException, RepoInitParsingException {
         return "register nodetypes\n"
                 + "<<===\n"

Reply via email to