jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r280815 - in /incubator/jackrabbit/trunk/contrib/tck-webapp/src: java/org/apache/jackrabbit/tck/WebAppTestConfig.java webapp/WEB-INF/classes/repositoryStubImpl.properties
Date Wed, 14 Sep 2005 10:23:54 GMT
Author: mreutegg
Date: Wed Sep 14 03:23:44 2005
New Revision: 280815

URL: http://svn.apache.org/viewcvs?rev=280815&view=rev
Log:
- Improve handling of jndi properties in test configuration

Modified:
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/WebAppTestConfig.java
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/classes/repositoryStubImpl.properties

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/WebAppTestConfig.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/WebAppTestConfig.java?rev=280815&r1=280814&r2=280815&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/WebAppTestConfig.java
(original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/WebAppTestConfig.java
Wed Sep 14 03:23:44 2005
@@ -22,6 +22,7 @@
 
 import javax.jcr.*;
 import javax.servlet.http.HttpServletRequest;
+import javax.naming.Context;
 import java.io.InputStream;
 import java.io.IOException;
 import java.util.Map;
@@ -29,6 +30,7 @@
 import java.util.Properties;
 import java.util.Iterator;
 import java.util.Enumeration;
+import java.util.Set;
 
 import junit.framework.TestSuite;
 import junit.framework.TestCase;
@@ -38,11 +40,14 @@
  * The <code>WebAppTestConfig</code> class reads and saves the config in the
tck web app specific way.
  */
 public class WebAppTestConfig {
+
+
+
     /** default property names */
     public final static String[] propNames = {JNDIRepositoryStub.PROP_PREFIX + "." + JNDIRepositoryStub.PROP_WORKSPACE_NAME,
                                               JNDIRepositoryStub.REPOSITORY_LOOKUP_PROP,
-                                              "java.naming.provider.url",
-                                              "java.naming.factory.initial",
+                                              Context.PROVIDER_URL,
+                                              Context.INITIAL_CONTEXT_FACTORY,
                                               JNDIRepositoryStub.PROP_PREFIX + "." + JNDIRepositoryStub.PROP_SUPERUSER_NAME,
                                               JNDIRepositoryStub.PROP_PREFIX + "." + JNDIRepositoryStub.PROP_SUPERUSER_PWD,
                                               JNDIRepositoryStub.PROP_PREFIX + "." + JNDIRepositoryStub.PROP_READWRITE_NAME,
@@ -98,9 +103,16 @@
         }
 
         // add additional props
-        props.put(JNDIRepositoryStub.REPOSITORY_LOOKUP_PROP, "");
-        props.put("java.naming.provider.url", "");
-        props.put("java.naming.factory.initial", "");
+        Set keys = props.keySet();
+        if (!keys.contains(JNDIRepositoryStub.REPOSITORY_LOOKUP_PROP)) {
+            props.put(JNDIRepositoryStub.REPOSITORY_LOOKUP_PROP, "");
+        }
+        if (!keys.contains(Context.PROVIDER_URL)) {
+            props.put(Context.PROVIDER_URL, "");
+        }
+        if (!keys.contains(Context.INITIAL_CONTEXT_FACTORY)) {
+            props.put(Context.INITIAL_CONTEXT_FACTORY, "");
+        }
 
         return props;
     }

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/classes/repositoryStubImpl.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/classes/repositoryStubImpl.properties?rev=280815&r1=280814&r2=280815&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/classes/repositoryStubImpl.properties
(original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/classes/repositoryStubImpl.properties
Wed Sep 14 03:23:44 2005
@@ -5,6 +5,10 @@
 # Stub implementation class
 javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.test.JNDIRepositoryStub
 
+# some default values for testing jackrabbit
+javax.jcr.tck.jndi.repository_lookup_name=jackrabbit.repository
+java.naming.provider.url=http://www.apache.org/jackrabbit
+java.naming.factory.initial=com.day.crx.jndi.provider.MemoryInitialContextFactory
 
 # repository specific configuration
 org.apache.jackrabbit.repository.config=applications/test/repository.xml



Mime
View raw message