jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r149384 - incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/AbstractJCRTest.java
Date Tue, 01 Feb 2005 10:17:48 GMT
Author: mreutegg
Date: Tue Feb  1 02:17:45 2005
New Revision: 149384

URL: http://svn.apache.org/viewcvs?view=rev&rev=149384
Log:
Provide ability to specify test properties on package level.

Modified:
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/AbstractJCRTest.java

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/AbstractJCRTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/AbstractJCRTest.java?view=diff&r1=149383&r2=149384
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/AbstractJCRTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/AbstractJCRTest.java Tue
Feb  1 02:17:45 2005
@@ -152,25 +152,35 @@
     protected String getProperty(String name) throws RepositoryException {
         String testCaseName = getName();
         String testClassName = getClass().getName();
+        String testPackName = "";
         int idx;
         if ((idx = testClassName.lastIndexOf('.')) > -1) {
+            testPackName = testClassName.substring(testClassName.lastIndexOf('.', idx - 1)
+ 1, idx);
             testClassName = testClassName.substring(idx + 1);
         }
 
-        // check test case specific property first
+        // 1) test case specific property first
         String value = helper.getProperty(RepositoryStub.PROP_PREFIX + "."
                 + testClassName + "." + testCaseName + "." + name);
         if (value != null) {
             return value;
         }
 
-        // then check test class property
+        // 2) check test class property
         value = helper.getProperty(RepositoryStub.PROP_PREFIX + "."
                 + testClassName + "." + name);
         if (value != null) {
             return value;
         }
 
+        // 3) check package property
+        value = helper.getProperty(RepositoryStub.PROP_PREFIX + "."
+                + testPackName + "." + name);
+        if (value != null) {
+            return value;
+        }
+
+        // finally try global property
         return helper.getProperty(RepositoryStub.PROP_PREFIX + "." + name);
     }
 



Mime
View raw message