jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r155766 - in incubator/jackrabbit/trunk: applications/test/repositoryStubImpl.properties src/test/org/apache/jackrabbit/test/JackrabbitRepositoryStub.java
Date Tue, 01 Mar 2005 10:18:15 GMT
Author: mreutegg
Date: Tue Mar  1 02:18:14 2005
New Revision: 155766

URL: http://svn.apache.org/viewcvs?view=rev&rev=155766
Log:
Added ability to specify the jaas configuration path in the stub properties file. This allows
to quickly run test cases from within IntelliJ.

Modified:
    incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.properties
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/JackrabbitRepositoryStub.java

Modified: incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.properties?view=diff&r1=155765&r2=155766
==============================================================================
--- incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.properties (original)
+++ incubator/jackrabbit/trunk/applications/test/repositoryStubImpl.properties Tue Mar  1
02:18:14 2005
@@ -5,10 +5,11 @@
 # Stub implementation class
 javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.test.JackrabbitRepositoryStub
 
-# repository name
+# repository specific configuration
 org.apache.jackrabbit.repository.config=applications/test/repository.xml
 org.apache.jackrabbit.repository.name=repo
 org.apache.jackrabbit.repository.home=applications/test
+org.apache.jackrabbit.repository.jaas.config=applications/test/jaas.config
 
 # credential configuration
 javax.jcr.tck.superuser.name=superuser

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/JackrabbitRepositoryStub.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/JackrabbitRepositoryStub.java?view=diff&r1=155765&r2=155766
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/JackrabbitRepositoryStub.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/JackrabbitRepositoryStub.java
Tue Mar  1 02:18:14 2005
@@ -38,12 +38,26 @@
      * Property for the repository configuration file (used for repository instantiation)
      */
     public static final String PROP_REPOSITORY_CONFIG = "org.apache.jackrabbit.repository.config";
+
     /**
      * Property for the repository home directory (used for repository instantiation)
      */
     public static final String PROP_REPOSITORY_HOME = "org.apache.jackrabbit.repository.home";
 
     /**
+     * Property for the jaas config path. If the system property
+     * <code>java.security.auth.login.config</code> is not set this repository
+     * stub will try to read this property from the environment and use the
+     * value retrieved as the value for the system property.
+     */
+    public static final String PROP_JAAS_CONFIG = "org.apache.jackrabbit.repository.jaas.config";
+
+    /**
+     * The name of the jaas config system property.
+     */
+    private static final String SYS_JAAS_CONFIG = "java.security.auth.login.config";
+
+    /**
      * The repository instance
      */
     private Repository repository;
@@ -72,6 +86,13 @@
                 String repName = environment.getProperty(PROP_REPOSITORY_NAME, "repo");
                 String repConfig = environment.getProperty(PROP_REPOSITORY_CONFIG);
                 String repHome = environment.getProperty(PROP_REPOSITORY_HOME);
+                String jaasConfig = environment.getProperty(PROP_JAAS_CONFIG);
+
+                // set jaas config from stub properties if system property is
+                // not set.
+                if (System.getProperty(SYS_JAAS_CONFIG) == null && jaasConfig !=
null) {
+                    System.setProperty(SYS_JAAS_CONFIG, jaasConfig);
+                }
 
                 // register repository instance
                 Hashtable env = new Hashtable();



Mime
View raw message