jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1729385 - in /jackrabbit/branches/2.10: ./ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
Date Tue, 09 Feb 2016 14:11:41 GMT
Author: reschke
Date: Tue Feb  9 14:11:40 2016
New Revision: 1729385

URL: http://svn.apache.org/viewvc?rev=1729385&view=rev
Log:
OAK-3949: fix DbClusterTestJCR3162 to restore system property SYSTEM_PROPERTY_NODE_ID to previous
value (ported to 2.10)

Modified:
    jackrabbit/branches/2.10/   (props changed)
    jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java
    jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/RepositoryConfigTest.java

Propchange: jackrabbit/branches/2.10/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb  9 14:11:40 2016
@@ -1,2 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
+/jackrabbit/trunk:1729382

Modified: jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java?rev=1729385&r1=1729384&r2=1729385&view=diff
==============================================================================
--- jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java
(original)
+++ jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/cluster/DbClusterTestJCR3162.java
Tue Feb  9 14:11:40 2016
@@ -53,6 +53,8 @@ public class DbClusterTestJCR3162 extend
     private String clusterId1 = UUID.randomUUID().toString();
     private String clusterId2 = UUID.randomUUID().toString();
 
+    private String prevClusterId;
+
     public void setUp() throws Exception {
         deleteAll();
         FileUtils
@@ -66,7 +68,7 @@ public class DbClusterTestJCR3162 extend
                                 "./src/test/resources/org/apache/jackrabbit/core/cluster/repository-h2.xml"),
                         new File("./target/dbClusterTest/node2/repository.xml"));
 
-        System.setProperty(ClusterNode.SYSTEM_PROPERTY_NODE_ID, clusterId1);
+        prevClusterId = System.setProperty(ClusterNode.SYSTEM_PROPERTY_NODE_ID, clusterId1);
         rep1 = RepositoryImpl.create(RepositoryConfig.create(new File(
                 "./target/dbClusterTest/node1")));
 
@@ -75,6 +77,14 @@ public class DbClusterTestJCR3162 extend
     }
 
     public void tearDown() throws Exception {
+        // revert change to system property
+        if (prevClusterId == null) {
+            System.clearProperty(ClusterNode.SYSTEM_PROPERTY_NODE_ID);
+        }
+        else {
+            System.setProperty(ClusterNode.SYSTEM_PROPERTY_NODE_ID, prevClusterId);
+        }
+
         try {
             rep1.shutdown();
             if (rep2 != null) {

Modified: jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/RepositoryConfigTest.java?rev=1729385&r1=1729384&r2=1729385&view=diff
==============================================================================
--- jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
(original)
+++ jackrabbit/branches/2.10/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
Tue Feb  9 14:11:40 2016
@@ -245,6 +245,10 @@ public class RepositoryConfigTest extend
     public void testAutomaticClusterNodeIdCreation() throws Exception {
         final long syncDelay = 12;
 
+        assertNull(
+                "This test requires the system property " + ClusterNode.SYSTEM_PROPERTY_NODE_ID
+ " not to be set; found value: "
+                        + System.getProperty(ClusterNode.SYSTEM_PROPERTY_NODE_ID) + " (leftover
from broken unit test?)",
+                System.getProperty(ClusterNode.SYSTEM_PROPERTY_NODE_ID));
         System.setProperty("cluster.syncDelay", Long.toString(syncDelay));
         try {
             File file = new File(DIR, "cluster_node.id");



Mime
View raw message