jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r156980 - in incubator/jackrabbit/trunk/contrib/tck-webapp/src: java/org/apache/jackrabbit/tck/ java/org/apache/jackrabbit/tck/j2ee/ webapp/ webapp/WEB-INF/classes/ webapp/WEB-INF/content-repository/ webapp/docroot/imgs/
Date Thu, 10 Mar 2005 19:30:53 GMT
Author: mreutegg
Date: Thu Mar 10 11:30:50 2005
New Revision: 156980

URL: http://svn.apache.org/viewcvs?view=rev&rev=156980
Log:
Enhanced ui and updated configuration. Patch provided by Philipp Koch.

Modified:
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/WebAppTestConfig.java
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/classes/repositoryStubImpl.properties
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/content-repository/repository.xml
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/config.jsp
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/error.png
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/failure.png
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/pass.png

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?view=diff&r1=156979&r2=156980
==============================================================================
--- 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
Thu Mar 10 11:30:50 2005
@@ -20,9 +20,7 @@
 import org.apache.jackrabbit.test.JNDIRepositoryStub;
 import org.apache.jackrabbit.test.RepositoryStub;
 
-import javax.jcr.Session;
-import javax.jcr.RepositoryException;
-import javax.jcr.Node;
+import javax.jcr.*;
 import javax.servlet.http.HttpServletRequest;
 import java.util.*;
 import java.io.InputStream;
@@ -65,16 +63,13 @@
     public static Map getConfig() {
         Map config = new HashMap();
         try {
-            Iterator allPropNames = getOriConfig().keySet().iterator();
-
             Session repSession = RepositoryServlet.getSession();
             Node configNode = repSession.getRootNode().getNode("testconfig");
+            PropertyIterator pitr = configNode.getProperties();
 
-            while (allPropNames.hasNext()) {
-                String pName = (String) allPropNames.next();
-                if (configNode.hasProperty(pName)) {
-                    config.put(pName, configNode.getProperty(pName).getString());
-                }
+            while (pitr.hasNext()) {
+                Property p = pitr.nextProperty();
+                config.put(p.getName(), p.getString());
             }
         } catch (RepositoryException e) {
             return new HashMap();
@@ -124,7 +119,7 @@
         }
 
         // save config entries
-        Iterator allPropNames = getOriConfig().keySet().iterator();
+        Iterator allPropNames = getCurrentConfig().keySet().iterator();
 
         while (allPropNames.hasNext()) {
             String pName = (String) allPropNames.next();
@@ -136,6 +131,30 @@
     }
 
     /**
+     * This method saves a single property
+     *
+     * @param propName property name
+     * @param propValue property value
+     * @param repSession session
+     * @throws RepositoryException
+     */
+    public static void saveProperty(String propName, String propValue, Session repSession)
throws RepositoryException {
+        // create config node if not yet existing
+        Node testConfig;
+        if (repSession.getRootNode().hasNode("testconfig")) {
+            testConfig = repSession.getRootNode().getNode("testconfig");
+        } else {
+            testConfig = repSession.getRootNode().addNode("testconfig", "nt:unstructured");
+            repSession.getRootNode().save();
+        }
+
+        testConfig.setProperty(propName, propValue);
+
+        // save
+        testConfig.save();
+    }
+
+    /**
      * Set config entry
      *
      * @param propname config property name
@@ -220,5 +239,18 @@
             }
         }
         return props;
+    }
+
+    /**
+     * Removes the custom config entries
+     *
+     * @throws RepositoryException
+     */
+    public static void resetConfiguration() throws RepositoryException {
+        Session repSession = RepositoryServlet.getSession();
+        if (repSession.getRootNode().hasNode("testconfig")) {
+            repSession.getRootNode().getNode("testconfig").remove();
+        }
+        repSession.getRootNode().save();
     }
 }

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java?view=diff&r1=156979&r2=156980
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java
(original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/j2ee/RepositoryServlet.java
Thu Mar 10 11:30:50 2005
@@ -143,13 +143,15 @@
 
             log_info("JSR170 RI Repository initialized.");
 
-            // set jaas config file
+            // set jaas config file path
             String jaasConfigFile = getServletConfig().getInitParameter(JAAS_CONFIG_FILE);
-            if (jaasConfigFile == null) {
-                jaasConfigFile = "etc/jaas.config";
+            if (jaasConfigFile != null && !"".equals(jaasConfigFile)) {
+                System.setProperty("java.security.auth.login.config", jaasConfigFile);
+                log_info("JAAS config path set by the tck webapp. java.security.auth.login.config
= " + jaasConfigFile);
+            } else {
+                log_info("No JAAS config path set by the tck webapp.");
             }
-            System.setProperty("java.security.auth.login.config", jaasConfigFile);
-            log_info("JAAS config set");
+
 
             // set user id and password to read/write test results and configuration
             uid = getServletConfig().getInitParameter(USER_ID);

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?view=diff&r1=156979&r2=156980
==============================================================================
--- 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
Thu Mar 10 11:30:50 2005
@@ -44,67 +44,70 @@
 # ==============================================================================
 
 # Test class: ItemDefTest
-javax.jcr.tck.ItemDefTest.testroot=/
+javax.jcr.tck.ItemDefTest.testroot=/testdata
 
 # Test class: ItemReadMethodsTest
-javax.jcr.tck.ItemReadMethodsTest.testroot=/
+javax.jcr.tck.ItemReadMethodsTest.testroot=/testdata
 
 # Test class: NodeReadMethodsTest
-javax.jcr.tck.NodeReadMethodsTest.testroot=/
+javax.jcr.tck.NodeReadMethodsTest.testroot=/testdata
 
 # Test class: PropertyTypeTest
-javax.jcr.tck.PropertyTypeTest.testroot=/
+javax.jcr.tck.PropertyTypeTest.testroot=/testdata
 
 # Test class: BinaryPropertyTest
-javax.jcr.tck.BinaryPropertyTest.testroot=/
+javax.jcr.tck.BinaryPropertyTest.testroot=/testdata
 
 # Test class: BooleanPropertyTest
-javax.jcr.tck.BooleanPropertyTest.testroot=/
+javax.jcr.tck.BooleanPropertyTest.testroot=/testdata
 
 # Test class: DatePropertyTest
-javax.jcr.tck.DatePropertyTest.testroot=/
+javax.jcr.tck.DatePropertyTest.testroot=/testdata
 
 # Test class: DoublePropertyTest
-javax.jcr.tck.DoublePropertyTest.testroot=/
+javax.jcr.tck.DoublePropertyTest.testroot=/testdata
 
 # Test class: LongPropertyTest
-javax.jcr.tck.LongPropertyTest.testroot=/
+javax.jcr.tck.LongPropertyTest.testroot=/testdata
 
 # Test class: NamePropertyTest
-javax.jcr.tck.NamePropertyTest.testroot=/
+javax.jcr.tck.NamePropertyTest.testroot=/testdata
 
 # Test class: PathPropertyTest
-javax.jcr.tck.PathPropertyTest.testroot=/
+javax.jcr.tck.PathPropertyTest.testroot=/testdata
 
 # Test class: ReferencePropertyTest
-javax.jcr.tck.ReferencePropertyTest.testroot=/
+javax.jcr.tck.ReferencePropertyTest.testroot=/testdata
 
 # Test class: StringPropertyTest
-javax.jcr.tck.StringPropertyTest.testroot=/
+javax.jcr.tck.StringPropertyTest.testroot=/testdata
 
 # Test class: UndefinedPropertyTest
-javax.jcr.tck.UndefinedPropertyTest.testroot=/
+javax.jcr.tck.UndefinedPropertyTest.testroot=/testdata
 
 # Test class: PropertyReadMethodsTest
-javax.jcr.tck.PropertyReadMethodsTest.testroot=/
+javax.jcr.tck.PropertyReadMethodsTest.testroot=/testdata
 
 # Test class: NodeIteratorTest
-javax.jcr.tck.NodeIteratorTest.testroot=/
+javax.jcr.tck.NodeIteratorTest.testroot=/testdata
+
+# Test class: NodeDiscoveringNodeTypesTest
+javax.jcr.tck.NodeDiscoveringNodeTypesTest.testroot=/testdata
 
 # Test class: RepositoryDescriptorTest
-javax.jcr.tck.RepositoryDescriptorTest.testroot=/
+javax.jcr.tck.RepositoryDescriptorTest.testroot=/testdata
 
 # Test class: WorkspaceReadMethodsTest
-javax.jcr.tck.WorkspaceReadMethodsTest.testroot=/
+javax.jcr.tck.WorkspaceReadMethodsTest.testroot=/testdata
 
 # Test class: SessionReadMethodsTest
-javax.jcr.tck.SessionReadMethodsTest.testroot=/
+javax.jcr.tck.SessionReadMethodsTest.testroot=/testdata
 
 # Test class: NamespaceRegistryReadMethodsTest
-javax.jcr.tck.NamespaceRegistryReadMethodsTest.testroot=/
+javax.jcr.tck.NamespaceRegistryReadMethodsTest.testroot=/testdata
 
 # Test class: NamespaceRemappingTest
-javax.jcr.tck.NamespaceRemappingTest.testroot=/
+javax.jcr.tck.NamespaceRemappingTest.testroot=/testdata
 
 # Test class: SessionTest
 # Test method: testMoveItemExistsException
@@ -318,6 +321,3 @@
 javax.jcr.tck.OnParentVersionCopyTest.nodetype=nt:unstructured
 javax.jcr.tck.OnParentVersionAbortTest.nodename4=test:abortOnParentVersion
 javax.jcr.tck.OnParentVersionAbortTest.nodetype=nt:unstructured
-
-# Test class: MergeNodeTest
-javax.jcr.tck.MergeNodeTest.nodetype=test:versionable

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/content-repository/repository.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/content-repository/repository.xml?view=diff&r1=156979&r2=156980
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/content-repository/repository.xml
(original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/content-repository/repository.xml
Thu Mar 10 11:30:50 2005
@@ -180,12 +180,20 @@
         <PersistenceManager class="org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager"/>
         <!--
             Search index and the file system it uses.
+            class: FQN of class implementing the QueryHandler interface
+            Supported Parameters:
+            - useCompoundFile: advises lucene to use compound files for the index files
+            - minMergeDocs: minimum number of nodes in an index until segments are merged
+            - maxMergeDocs: maximum number of nodes in segments that will be merged
+            - mergeFactor: determines how often segment indices are merged
+            - redoSize: maximum number of entries in the redo log until the in-memory index
is merged
         -->
         <SearchIndex class="org.apache.jackrabbit.core.search.lucene.SearchIndex">
             <param name="useCompoundFile" value="true"/>
             <param name="minMergeDocs" value="1000"/>
             <param name="maxMergeDocs" value="10000"/>
             <param name="mergeFactor" value="10"/>
+            <param name="redoSize" value="1000"/>
 
             <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
                 <param name="path" value="${wsp.home}/index"/>

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/config.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/config.jsp?view=diff&r1=156979&r2=156980
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/config.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/config.jsp Thu Mar 10 11:30:50
2005
@@ -59,9 +59,23 @@
                 <td colspan="3">
                     <%
                     if (mode == null || !mode.equals("view")) {
+                        // check for property additions
+                        String newid = request.getParameter("newid");
+                        String newvalue = request.getParameter("newvalue");
+                        if (newvalue != null && !"".equals(newvalue) && newid
!= null && !"".equals(newid)) {
+                            WebAppTestConfig.saveProperty(newid, newvalue, repSession);
+                        }
+
+                        // reset to default configuration (from properties file) if requested
+                        String resetConfig = request.getParameter("resetconfig");
+                        if (resetConfig != null && "yes".equals(resetConfig)) {
+                            WebAppTestConfig.resetConfiguration();
+                        }
+
+                        // load current configuration
                         Map props = WebAppTestConfig.getCurrentConfig();
                         %>
-                        <form name="test" action="graph.jsp?" target="graph" method="post">
+                        <form name="test" action="graph.jsp" target="graph" method="post">
                             <table width="100%">
                                 <tr><th class="content" width="40%" >Default
Configuration</td><td width="60%" class="content" align="right"><input type="submit"
value="start" class="submit"><input type="hidden" name="mode" value="testnow"></td></tr>
                                 <%
@@ -93,9 +107,11 @@
                                             String title = (ckey.length() > 80) ? ckey.substring(0,
80) + " " + ckey.substring(81) : ckey;
                                             %><tr><td class="graph"><%=
title %></td><td class="graph"><input class="input" name="<%= ckey %>"
value="<%= configs.get(ckey) %>"></td><%
                                         }
+                                        %><tr><td class="graph" valign="top"><input
class="input" id="newid<%= key  %>"></td><td class="graph"><input
class="input" id="newvalue<%= key  %>"></td></tr>
+                                          <tr><td class="content" colspan="2" align="right"><input
type="button" value="add" class="submit" onclick="window.location.href='config.jsp?newid='+document.getElementById('newid<%=
key  %>').value+'&newvalue='+document.getElementById('newvalue<%= key  %>').value;"></td></tr><%
                                     }
                                 }
-                                %>
+                                %><tr><td class="content">Set default configuration</td></td><td
class="content" align="right"><input type="button" value="reset" class="submit" onclick="window.location.href='config.jsp?resetconfig=yes';"></td></tr>
                             </table>
                         </form>
                     <%

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/error.png
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/error.png?view=diff&r1=156979&r2=156980
==============================================================================
Binary files - no diff available.

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/failure.png
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/failure.png?view=diff&r1=156979&r2=156980
==============================================================================
Binary files - no diff available.

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/pass.png
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/imgs/pass.png?view=diff&r1=156979&r2=156980
==============================================================================
Binary files - no diff available.



Mime
View raw message