You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2005/04/26 14:47:09 UTC

svn commit: r164780 - in /incubator/jackrabbit/trunk/contrib/tck-webapp: ./ src/java/org/apache/jackrabbit/tck/ src/java/org/apache/jackrabbit/tck/j2ee/ src/webapp/ src/webapp/WEB-INF/ src/webapp/WEB-INF/classes/ src/webapp/WEB-INF/content-repository/ src/webapp/docroot/js/ src/webapp/docroot/ui/

Author: mreutegg
Date: Tue Apr 26 05:47:08 2005
New Revision: 164780

URL: http://svn.apache.org/viewcvs?rev=164780&view=rev
Log:
Extend webapp with exclude list, contributed by Philipp Koch.

Added:
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestResultParser.java   (with props)
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/excludelisttest.jsp   (with props)
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp   (with props)
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp   (with props)
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp   (with props)
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/update_exclude_list.jsp   (with props)
Modified:
    incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TckTestRunner.java
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestFinder.java
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/Tester.java
    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/WEB-INF/web.xml
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/config.jsp
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp
    incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/project.xml Tue Apr 26 05:47:08 2005
@@ -22,7 +22,7 @@
     <id>tck-webapp</id>
     <!-- <type>war</type> -->
     <name>Day TCK web application</name>
-    <currentVersion>0.1</currentVersion>
+    <currentVersion>0.16.4</currentVersion>
 
 
     <!-- ====================================================================== -->
@@ -66,13 +66,13 @@
         <dependency>
             <groupId>jsr170</groupId>
             <artifactId>jcr</artifactId>
-            <version>0.16.2</version>
-            <url>http://www.day.com/maven/jsr170/jars/jcr-0.16.2.jar</url>
+            <version>0.16.4</version>
+            <url>http://www.day.com/maven/jsr170/jars/jcr-0.16.4.jar</url>
         </dependency>
         <!-- dependencies from jcr that we want to bundle -->
         <dependency>
             <id>jackrabbit</id>
-            <version>0.16.2-dev</version>
+            <version>0.16.4-dev</version>
             <properties>
                 <war.bundle>true</war.bundle>
             </properties>

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TckTestRunner.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TckTestRunner.java?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TckTestRunner.java (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TckTestRunner.java Tue Apr 26 05:47:08 2005
@@ -146,7 +146,7 @@
     private void write(String msg, boolean newTestClass) {
         if (writer != null) {
             try {
-                String html = "";
+                String html;
                 if (logString!= null && !"".equals(logString)) {
                     html = MessageFormat.format(logString, new String[]{msg, TckHelper.getStatus(state)});
                     writer.write(html);

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestFinder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestFinder.java?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestFinder.java (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestFinder.java Tue Apr 26 05:47:08 2005
@@ -18,10 +18,16 @@
 
 import junit.framework.TestSuite;
 import junit.framework.Test;
-import java.io.*;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.File;
+import java.io.OutputStream;
+import java.io.FileOutputStream;
+import java.io.InputStreamReader;
+import java.io.BufferedReader;
 
 /**
  * The <code>TestFinder</code> class is responsible to find all <code>TestCase</code>s which are
@@ -39,10 +45,8 @@
 
     /**
      * The path where the jar containing the test classes and its sources is residing is passed here.
-     *
-     * @throws IOException
      */
-    public TestFinder() throws IOException {
+    public TestFinder() {
         allTests = new HashMap();
         suites = new HashMap();
     }
@@ -154,7 +158,7 @@
         BufferedReader reader = new BufferedReader(isr);
         String line;
         while ((line = reader.readLine()) != null) {
-            String keyword = null;
+            String keyword;
             if ((keyword = parseLine(line)) != null) {
                 return keyword;
             }

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestResultParser.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestResultParser.java?rev=164780&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestResultParser.java (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestResultParser.java Tue Apr 26 05:47:08 2005
@@ -0,0 +1,82 @@
+package org.apache.jackrabbit.tck;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.ByteArrayOutputStream;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.xml.parsers.*;
+import javax.jcr.Node;
+import javax.jcr.Session;
+import javax.jcr.RepositoryException;
+
+import org.xml.sax.*;
+import org.xml.sax.helpers.*;
+
+
+
+/**
+ * Builds a simple HTML page which lists tip titles
+ * and provides links to HTML and text versions
+ */
+public class TestResultParser extends DefaultHandler {
+
+    Map results = new TreeMap();
+    String strLevels[] = new String[]{"level1", "level2", "sql", "locking", "versioning", "uuid", "observation"};
+    String currLevel = "";
+
+    boolean status = false;
+    boolean getStatValue = false;
+
+    public TestResultParser() {
+        super();
+
+        for (int i = 0; i < strLevels.length; i++) {
+            results.put(strLevels[i], null);
+        }
+    }
+
+    public void startElement(String namespace,
+                            String localName,
+                            String qName,
+                            Attributes atts) {
+        if (localName.equals("node")) {
+            String name = atts.getValue("sv:name");
+            if (results.containsKey(name)) {
+                currLevel = name;
+                results.put(currLevel, new Boolean(true));
+            }
+        } else if (localName.equals("property")) {
+            String name = atts.getValue("sv:name");
+            if (name.equals("status")) {
+                status = true;
+            }
+        } else if (localName.equals("value") && status) {
+            getStatValue = true;
+            status = false;
+        }
+    }
+
+    public Map interpretResult(String xmldoc) throws ParserConfigurationException, SAXException, IOException {
+
+        SAXParserFactory spf = SAXParserFactory.newInstance();
+        SAXParser sp = spf.newSAXParser();
+        ParserAdapter pa = new ParserAdapter(sp.getParser());
+        pa.setContentHandler(this);
+        pa.parse(new InputSource(new StringReader(xmldoc)));
+        return results;
+    }
+
+    public void characters (char ch[], int start, int length) {
+        if (getStatValue) {
+            String val = new String(ch, start, length);
+            if (!"0".equals(val)) {
+                results.put(currLevel, new Boolean(false));
+            }
+            getStatValue = false;
+        }
+    }
+}
+

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/TestResultParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/Tester.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/Tester.java?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/Tester.java (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/java/org/apache/jackrabbit/tck/Tester.java Tue Apr 26 05:47:08 2005
@@ -18,12 +18,20 @@
 
 import junit.framework.TestSuite;
 import junit.framework.TestResult;
-import javax.jcr.*;
+import junit.framework.TestCase;
+
 import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.AccessDeniedException;
 import javax.servlet.jsp.JspWriter;
-import java.util.*;
 import java.io.IOException;
 import java.text.MessageFormat;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Enumeration;
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.RepositoryHelper;
@@ -48,16 +56,20 @@
     /** The string to be writen after finishing a suite */
     String finishedSuiteString;
 
+    /** the exclude list */
+    Map excludeList;
+
     /**
      * The constructor...
      *
      * @param tests All tests found using <code>TestFinder</code>
      */
-    public Tester(TestFinder tests, TckTestRunner runner, JspWriter writer) {
+    public Tester(TestFinder tests, TckTestRunner runner, JspWriter writer, Map excludeList) {
         this.tests = tests;
         results = new HashMap();
         this.runner = runner;
         this.writer = writer;
+        this.excludeList = excludeList;
 
         // set the configuration for the to be tested repository
         AbstractJCRTest.helper = new RepositoryHelper(WebAppTestConfig.getCurrentConfig());
@@ -79,10 +91,13 @@
 
             TestResult result = new TestResult();
             result.addListener(runner);
+
+            TestSuite updatedTS = applyExcludeList(suite);
+
             try {
-                suite.run(result);
+                updatedTS.run(result);
                 results.putAll(runner.getResults());
-                write(suite);
+                write(updatedTS);
             } catch (Exception e) {
                 // ignore
             }
@@ -90,6 +105,58 @@
         return results;
     }
 
+    /**
+     * This method goes through the exclude list and removes tests in the test suites
+     * which should NOT be performed.
+     *
+     * @param suite Test suite
+     * @return false if the whole test suite has to be skipped
+     */
+    private TestSuite applyExcludeList(TestSuite suite) {
+        TestSuite updatedTS = new TestSuite();
+        updatedTS.setName(suite.getName());
+        Enumeration suiteMemberClasses = suite.tests();
+
+        while (suiteMemberClasses.hasMoreElements()) {
+            TestSuite testClass = (TestSuite) suiteMemberClasses.nextElement();
+            String testClassName = testClass.toString();
+
+            if (excludeList.containsKey(testClassName)) {
+                continue;
+            } else {
+                TestSuite ts = new TestSuite();
+                ts.setName(testClassName);
+                Map testcases = new HashMap();
+                boolean recreate = false;
+
+                Enumeration testMethods = testClass.tests();
+                while (testMethods.hasMoreElements()) {
+                    TestCase tc = (TestCase) testMethods.nextElement();
+                    String methodname = tc.getName();
+                    if (excludeList.containsKey(testClassName + "#" + methodname)) {
+                        recreate = true;
+                    } else {
+                        testcases.put(methodname, tc);
+                    }
+                }
+                if (recreate) {
+                    TestSuite recreatedTS = new TestSuite(ts.toString());
+                    Iterator itr = testcases.keySet().iterator();
+
+                    while (itr.hasNext()) {
+                        String key = (String) itr.next();
+                        recreatedTS.addTest((TestCase) testcases.get(key));
+                    }
+                    updatedTS.addTest(recreatedTS);
+                } else {
+                    updatedTS.addTest(testClass);
+                }
+
+            }
+        }
+        return updatedTS;
+    }
+
 
     public void setfinishedSuiteString(String line) {
         finishedSuiteString = line;
@@ -119,10 +186,10 @@
      *  ....
      * </pre>
      * @param node parent <code>Node</code> for storage
-     * @throws RepositoryException
+     * @throws javax.jcr.RepositoryException
      * @throws ConstraintViolationException
-     * @throws InvalidItemStateException
-     * @throws AccessDeniedException
+     * @throws javax.jcr.InvalidItemStateException
+     * @throws javax.jcr.AccessDeniedException
      */
     public void storeResults(Node node) throws RepositoryException, ConstraintViolationException, InvalidItemStateException, AccessDeniedException {
         // create categories: level1, level2....

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=164780&r1=164779&r2=164780&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 Tue Apr 26 05:47:08 2005
@@ -22,9 +22,13 @@
 
 import javax.jcr.*;
 import javax.servlet.http.HttpServletRequest;
-import java.util.*;
 import java.io.InputStream;
 import java.io.IOException;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Properties;
+import java.util.Iterator;
+import java.util.Enumeration;
 
 import junit.framework.TestSuite;
 import junit.framework.TestCase;

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?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- 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 Tue Apr 26 05:47:08 2005
@@ -27,11 +27,10 @@
 import javax.jcr.*;
 import java.io.*;
 import java.util.Properties;
-import javax.servlet.http.HttpServletRequest;
 
 /**
  * The RepositoryServlet connects (starts) to a jsr170 repository and
- * puts the reference into the application context
+ * puts the reference into a class variable.
  */
 public class RepositoryServlet extends HttpServlet {
 
@@ -47,15 +46,21 @@
     /** repository name */
     public final static String INIT_PARAM_REPOSITORY_NAME = "repository-name";
 
-    /** jaas configuration file path */
-    public static final String JAAS_CONFIG_FILE = "jaas-config-file";
-
     /** user id name */
     public static final String USER_ID = "jcr-userid";
 
     /** user password name */
     public static final String  USER_PASSWORD = "jcr-password";
 
+    /** submit url name */
+    public static final String  SUBMIT_URL = "submit-url";
+
+    /** exclude list url name */
+    public static final String  EXCLUDE_LIST_URL = "exclude-list-url";
+
+    /** tck webapp jar path name */
+    public static final String  TCK_WEBAPP_JAR_PATH = "tck-webapp-jar-path";
+
     /** log4j config */
     public final static String PARAM_LOG4J_CONFIG = "log4j-config";
 
@@ -68,6 +73,15 @@
     /** the password */
     private static String pw;
 
+    /** the submit url */
+    private static String submitUrl;
+
+    /** the tck webapp jar path */
+    private static String tckWebappJarPath;
+
+    /** the exclude list url */
+    private static String excludeListUrl;
+
     /**
      * The init method starts the repository to read/write test results and configuration,
      * sets the jaas config and the user id and the user password
@@ -143,20 +157,19 @@
 
             log_info("JSR170 RI Repository initialized.");
 
-            // set jaas config file path
-            String jaasConfigFile = getServletConfig().getInitParameter(JAAS_CONFIG_FILE);
-            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.");
-            }
-
-
             // set user id and password to read/write test results and configuration
             uid = getServletConfig().getInitParameter(USER_ID);
             pw = getServletConfig().getInitParameter(USER_PASSWORD);
 
+            // set submit url
+            submitUrl = getServletConfig().getInitParameter(SUBMIT_URL);
+
+            // set tck webapp jar path
+            tckWebappJarPath = getServletConfig().getInitParameter(TCK_WEBAPP_JAR_PATH);
+
+            // set exclude list url
+            excludeListUrl = getServletConfig().getInitParameter(EXCLUDE_LIST_URL);
+
         } catch (RepositoryException e) {
             log_info("Unable to initialize repository: " + e.toString(), e);
             throw new ServletException("Unable to initialize repository: " + e.toString(), e);
@@ -218,4 +231,25 @@
         return repSession;
     }
 
+    /**
+     * Returns the url where the test result have to be submitted
+     *
+     * @return submit url
+     */
+    public static String getSubmitUrl() {
+        return submitUrl;
+    }
+
+    /**
+     * Returns the path where the tck webapp jar file is placed
+     *
+     * @return path to jar
+     */
+    public static String getTckWebappJarPath() {
+        return tckWebappJarPath;
+    }
+
+    public static String getExcludeListUrl() {
+        return excludeListUrl;
+    }
 }

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=164780&r1=164779&r2=164780&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 Tue Apr 26 05:47:08 2005
@@ -2,9 +2,6 @@
 # This is the configuration file for the jackrabbit repository test stub.
 #
 
-# Stub implementation class
-javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.test.JNDIRepositoryStub
-
 # repository specific configuration
 org.apache.jackrabbit.repository.config=applications/test/repository.xml
 org.apache.jackrabbit.repository.name=repo
@@ -181,10 +178,53 @@
 # valid node type that can be added as child of nodetype 2
 javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOperationException.nodetype3=nt:hierarchyNode
 
+# Test class: SetPropertyNodeTest
+# nodetype which is referenceable
+javax.jcr.tck.SetPropertyNodeTest.nodetype=test:setProperty
+
+# Test class: SetPropertyValueTest
+# property that allows multiple values
+javax.jcr.tck.SetPropertyValueTest.propertyname2=test:multiProperty
+javax.jcr.tck.SetPropertyValueTest.nodetype=test:setProperty
+
+# Test class: SetPropertyStringTest
+# property that allows multiple values
+javax.jcr.tck.SetPropertyStringTest.propertyname2=test:multiProperty
+javax.jcr.tck.SetPropertyStringTest.nodetype=test:setProperty
+
+# Test class: WorkspaceCloneSameNameSibsTest
+javax.jcr.tck.WorkspaceCloneSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDefinition
+javax.jcr.tck.WorkspaceCloneSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceCopyBetweenWorkspacesSameNameSibsTest
+javax.jcr.tck.WorkspaceCopyBetweenWorkspacesSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDefinition
+javax.jcr.tck.WorkspaceCopyBetweenWorkspacesSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceCopySameNameSibsTest
+javax.jcr.tck.WorkspaceCopySameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDefinition
+javax.jcr.tck.WorkspaceCopySameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: WorkspaceMoveSameNameSibsTest
+javax.jcr.tck.WorkspaceMoveSameNameSibsTest.sameNameSibsFalseNodeType=test:sameNameSibsFalseChildNodeDefinition
+javax.jcr.tck.WorkspaceMoveSameNameSibsTest.sameNameSibsTrueNodeType=nt:unstructured
+
+# Test class: RepositoryLoginTest
+javax.jcr.tck.RepositoryLoginTest.testroot=/testdata
+
+# Test class: ReferenceableRootNodesTest
+javax.jcr.tck.ReferenceableRootNodesTest.testroot=/testdata
+
+# Test class: ExportDocViewTest
+javax.jcr.tck.ExportDocViewTest.testroot=/testdata
+
 # ------------------------------------------------------------------------------
 # observation configuration
 # ------------------------------------------------------------------------------
 
+# Test class: AddEventListenerTest
+# Test method: testNodeType
+javax.jcr.tck.AddEventListenerTest.testNodeType.nodetype2=nt:folder
+
 # Configuration settings for the serialization.
 # Note that the serialization test tries to use as many features of the repository
 # as possible, but fails silently if a feature is not available. You have to
@@ -238,6 +278,9 @@
 # specified nodetype must be versionable and allow child nodes of the same type.
 javax.jcr.tck.SerializationTest.testVersioningExceptionSessionFileParent.nodetype=test:versionable
 
+# Test class: ExportSysViewTest
+javax.jcr.tck.ExportSysViewTest.testroot=/testdata
+
 # ==============================================================================
 # JAVAX.JCR.QUERY CONFIGURATION
 # ==============================================================================
@@ -262,6 +305,9 @@
 # Test class: XPathSyntaxTest
 javax.jcr.tck.XPathSyntaxTest.testroot=/testdata/query
 
+# Test class: XPathJcrPathTest
+javax.jcr.tck.XPathJcrPathTest.testroot=/testdata
+
 # Test class: SQLQueryLevel1Test
 javax.jcr.tck.SQLQueryLevel1Test.testroot=/testdata/query
 
@@ -271,6 +317,24 @@
 # Test class: SQLOrderByTest
 javax.jcr.tck.SQLOrderByTest.testroot=/testdata/query
 
+# Test class: DerefQueryLevel1Test
+javax.jcr.tck.DerefQueryLevel1Test.testroot=/testdata
+
+# Test class: GetPropertyNamesTest
+javax.jcr.tck.GetPropertyNamesTest.testroot=/testdata
+
+# Test class: SQLJcrPathTest
+javax.jcr.tck.SQLJcrPathTest.testroot=/testdata
+
+# Test class: SQLPathTest
+javax.jcr.tck.SQLPathTest.testroot=/testdata
+
+# Test class: PredicatesTest
+javax.jcr.tck.PredicatesTest.testroot=/testdata
+
+# Test class: SimpleSelectionTest
+javax.jcr.tck.SimpleSelectionTest.testroot=/testdata
+
 # ==============================================================================
 # JAVAX.JCR.VERSIONING CONFIGURATION
 # ==============================================================================
@@ -309,6 +373,11 @@
 javax.jcr.tck.OnParentVersionIgnoreTest.propertyname1=test:ignoreOnParentVersionProp
 javax.jcr.tck.OnParentVersionInitializeTest.propertyname1=test:initializeOnParentVersionProp
 
+# Test class: RestoreTest
+# Test method: testRestoreWithUUIDConflict
+# nodename4 must be the name of a child node with a OPV definition COPY or VERSION
+javax.jcr.tck.RestoreTest.testRestoreWithUUIDConflict.nodename4=test:versionOnParentVersion
+
 # config for nodes that show the indicated OPV behaviour:
 # nodes are added in order to test the versioning behaviour indicated by the test-class name.
 # NOTE:
@@ -321,3 +390,5 @@
 javax.jcr.tck.OnParentVersionCopyTest.nodetype=nt:unstructured
 javax.jcr.tck.OnParentVersionAbortTest.nodename4=test:abortOnParentVersion
 javax.jcr.tck.OnParentVersionAbortTest.nodetype=nt:unstructured
+
+

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?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- 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 Tue Apr 26 05:47:08 2005
@@ -42,11 +42,11 @@
 
     <!--
         the Security element specifies the name (appName attribute)
-        of the JAAS configuration app-entry for this repository. 
+        of the JAAS configuration app-entry for this repository.
 
         it also specifies the access manager to be used (AccessManager element).
     -->
-    <!ELEMENT Security (AccessManager)>
+    <!ELEMENT Security (AccessManager, LoginModule?)>
     <!ATTLIST Security
       appName CDATA #REQUIRED>
 
@@ -67,7 +67,16 @@
       name CDATA #REQUIRED
       value CDATA #REQUIRED>
 
-    <!--
+     <!--
+        the LoginModule element optionally specifies a JAAS login module to
+        authenticate users. This feature allows the use of Jackrabbit in a
+        non-JAAS environment.
+    -->
+    <!ELEMENT LoginModule (param*)>
+    <!ATTLIST LoginModule
+      class CDATA #REQUIRED>
+
+   <!--
         the Workspaces element specifies the workspaces root directory
         (rootPath attribute) and the name of the default workspace
         (defaultWorkspace attribute).
@@ -137,6 +146,11 @@
         <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager">
             <!-- <param name="config" value="${rep.home}/access.xml"/> -->
         </AccessManager>
+
+        <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
+           <!-- anonymous user name ('anonymous' is the default value) -->
+           <param name="anonymousId" value="anonymous"/>
+        </LoginModule>
     </Security>
 
     <!--
@@ -191,7 +205,7 @@
         <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
             <param name="useCompoundFile" value="true"/>
             <param name="minMergeDocs" value="1000"/>
-            <param name="maxMergeDocs" value="10000"/>
+            <param name="maxMergeDocs" value="100000"/>
             <param name="mergeFactor" value="10"/>
             <param name="bufferSize" value="10"/>
 
@@ -215,13 +229,13 @@
             <param name="blockSize" value="128"/>
             <param name="autoSync" value="false"/>
         </FileSystem>
-    
+
         <!--
             <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
                 <param name="path" value="${rep.home}/version"/>
             </FileSystem>
         -->
-        
+
         <!--
             Configures the perisistence manager to be used for persisting version state.
             Please note that the current versioning implementation is based on

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/WEB-INF/web.xml Tue Apr 26 05:47:08 2005
@@ -37,12 +37,6 @@
         </init-param>
 
         <init-param>
-            <param-name>jaas-config-file</param-name>
-            <param-value>etc/jaas.config</param-value>
-            <description>Path of the jaas config file</description>
-        </init-param>
-
-        <init-param>
             <param-name>jcr-userid</param-name>
             <param-value>superuser</param-value>
             <description>User to read/write from the repository where test results and config is stored</description>
@@ -52,6 +46,24 @@
             <param-name>jcr-password</param-name>
             <param-value>superuser</param-value>
             <description>User password</description>
+        </init-param>
+
+        <init-param>
+            <param-name>submit-url</param-name>
+            <param-value>http://www.day.com</param-value>
+            <description>Url pointing to test result submit receiver</description>
+        </init-param>
+
+        <init-param>
+            <param-name>tck-webapp-jar-path</param-name>
+            <param-value>/WEB-INF/lib/tck-webapp-0.16.4.jar</param-value>
+            <description>Path to the tck webapp jar, where the test sources reside</description>
+        </init-param>
+
+        <init-param>
+            <param-name>exclude-list-url</param-name>
+            <param-value>excludelisttest.jsp</param-value>
+            <description>Url pointing to exclude list provider</description>
         </init-param>
 
         <load-on-startup>1</load-on-startup>

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?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/config.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/config.jsp Tue Apr 26 05:47:08 2005
@@ -26,141 +26,83 @@
                  junit.framework.TestSuite"
 %><%@page session="false" %><%
 
-// get path from jar where the test sources are stored
-String TEST_JCR_PATH = "/WEB-INF/lib/tck-webapp-0.1.jar";
-
 Session repSession = RepositoryServlet.getSession();
 if (repSession == null) {
     return;
 }
-
-String mode = request.getParameter("mode");
-
-%><html>
+%>
+<html>
     <head>
         <link rel="stylesheet" href="docroot/ui/default.css" type="text/css" title="style" />
+        <script>
+            function showConfig(id) {
+                parent.config.document.location.href="config.jsp#" + id;
+            }
+        </script>
     </head>
     <body style="margin-top:0px;border-width:0px">
         <table width="100%">
             <tr>
-                <td colspan="3" id="technavcell">
-                    <div id="technav">
-                    <%
-                    if (mode == null || !mode.equals("view")) {
-                        %><span class="technavat">New Test</span><a href="config.jsp?mode=view">View Results</a><%
-                    } else {
-                        %><a href="config.jsp?mode=">New Test</a><span class="technavat">View Results</span></a><%
-                    }
-                        %>
-                    </div>
-                </td>
-            </tr>
-            <tr>
                 <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">
-                            <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>
-                                <%
-                                // display default config
-                                for (int i = 0; i < WebAppTestConfig.propNames.length; i++) {
-                                    String name = WebAppTestConfig.propNames[i];
-                                    String value = (String) props.get(name);
-                                    %><tr><td class="graph"><%= name %></td><td class="graph"><input class="input" name="<%= name %>" value="<%= value %>"></td></tr><%
-                                }
+                    // save test configuration
+                    WebAppTestConfig.save(request, repSession);
 
-                                // display test suite specific configs
-                                TestFinder tf = new TestFinder();
-                                tf.find(getServletConfig().getServletContext().getResource(TEST_JCR_PATH).openStream(),
-                                        "TestAll.java");
-                                Iterator  tests = tf.getSuites().keySet().iterator();
-                                tests = tf.getSuites().keySet().iterator();
-
-                                while (tests.hasNext()) {
-                                    String key = (String) tests.next();
-                                    TestSuite t = (TestSuite) tf.getSuites().get(key);
-                                    Map configs = WebAppTestConfig.getTestCaseSpecificConfigs(t);
-                                    if (configs.size() > 0) {
-                                        %><tr><th class="content" colspan="2"><a id="<%= key  %>"></a><%= key  %></td></tr><%
-
-                                        Iterator citr = configs.keySet().iterator();
-                                        while (citr.hasNext()) {
-                                            String ckey = (String) citr.next();
-                                            // split title if too long
-                                            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>
-                    <%
-                    } else {
-                        %>
-                        <form name="view" action="graph.jsp" target="graph">
-                        <input type="hidden" name="mode" value="view">
-                        <table>
-                        <%
-                        Node rootNode = repSession.getRootNode();
-
-                        if (rootNode.hasNode("testing")) {
-                            %>
-                            <tr><td class="graph" valign="top">Select test to be viewed</td><td>
-                            <select name="test" size="10" onchange="document.view.submit();">
-                            <%
-                            NodeIterator tests = rootNode.getNode("testing").getNodes();
+                    // 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);
+                    }
 
-                            ArrayList al = new ArrayList();
-                            //hack : todo??
-                            while (tests.hasNext()) {
-                                al.add(tests.nextNode());
-                            }
+                    // reset to default configuration (from properties file) if requested
+                    String resetConfig = request.getParameter("resetconfig");
+                    if (resetConfig != null && "yes".equals(resetConfig)) {
+                        WebAppTestConfig.resetConfiguration();
+                    }
 
-                            Collections.reverse(al);
-                            Iterator itr = al.iterator();
-                            // eoh
-
-                            while (itr.hasNext()) {
-                                Node n = (Node) itr.next();
-                                String sdate = n.getName();
-                                Calendar cal = Calendar.getInstance();
-                                cal.setTimeInMillis(Long.parseLong(sdate));
-                                SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
-                                sdate = formatter.format(cal.getTime());
-                                %><option value="<%= n.getName() %>"><%= sdate %><%
+                    // load current configuration
+                    Map props = WebAppTestConfig.getCurrentConfig();
+                    %>
+                    <form name="configform" action="config.jsp" method="post">
+                        <table width="100%">
+                            <tr><th class="content" width="40%" colspan="2">Default Configuration</td></tr>
+                            <%
+                            // display default config
+                            for (int i = 0; i < WebAppTestConfig.propNames.length; i++) {
+                                String name = WebAppTestConfig.propNames[i];
+                                String value = (String) props.get(name);
+                                %><tr><td class="graph"><%= name %></td><td class="graph"><input class="input" name="<%= name %>" value="<%= value %>"></td></tr><%
                             }
-                            %>
-                            </select>
 
-                            </td></tr>
-                        <%
-                        }
-                        %>
+                            // display test suite specific configs
+                            TestFinder tf = new TestFinder();
+                            tf.find(getServletConfig().getServletContext().getResource(RepositoryServlet.getTckWebappJarPath()).openStream(),
+                                    "TestAll.java");
+                            Iterator  tests = tf.getSuites().keySet().iterator();
+                            tests = tf.getSuites().keySet().iterator();
+
+                            while (tests.hasNext()) {
+                                String key = (String) tests.next();
+                                TestSuite t = (TestSuite) tf.getSuites().get(key);
+                                Map configs = WebAppTestConfig.getTestCaseSpecificConfigs(t);
+                                if (configs.size() > 0) {
+                                    %><tr><th class="content" colspan="2"><a id="<%= key  %>"></a><%= key  %></td></tr><%
+
+                                    Iterator citr = configs.keySet().iterator();
+                                    while (citr.hasNext()) {
+                                        String ckey = (String) citr.next();
+                                        // split title if too long
+                                        String title = (ckey.length() > 70) ? ckey.substring(0, 70) + " " + ckey.substring(71) : 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>
-                        <%
-                    }
-                    %>
+                    </form>
                 </td>
             </tr>
         </table>

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js?rev=164780&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/js/server_call.js Tue Apr 26 05:47:08 2005
@@ -0,0 +1,93 @@
+var IFrameObj; // our IFrame object
+var IFrameDoc;
+var successfull = false;
+function callToServer(url) {
+  if (!document.createElement) {
+    return true
+  }
+  IFrameDoc;
+  if (!IFrameObj && document.createElement) {
+      // create the IFrame and assign a reference to the
+      // object to our global variable IFrameObj.
+      // this will only happen the first time
+      // callToServer() is called
+      var tempIFrame=document.createElement('iframe');
+      tempIFrame.setAttribute('id','RSIFrame');
+      tempIFrame.style.border='0px';
+      tempIFrame.style.width='0px';
+      tempIFrame.style.height='0px';
+      IFrameObj = document.body.appendChild(tempIFrame);
+
+      if (document.frames) {
+        // this is for IE5 Mac, because it will only
+        // allow access to the document object
+        // of the IFrame if we access it through
+        // the document.frames array
+        IFrameObj = document.frames['RSIFrame'];
+      }
+    }
+
+  if (IFrameObj.contentDocument) {
+    // For NS6
+    IFrameDoc = IFrameObj.contentDocument;
+  } else if (IFrameObj.contentWindow) {
+    // For IE5.5 and IE6
+    IFrameDoc = IFrameObj.contentWindow.document;
+  } else if (IFrameObj.document) {
+    // For IE5
+    IFrameDoc = IFrameObj.document;
+  } else {
+    return true;
+  }
+
+  IFrameDoc.location.replace(url);
+
+  return successfull;
+}
+
+function startTest(url, currentVersion, useExcludeList) {
+    if (!useExcludeList) {
+        window.graph.document.location.href="graph.jsp?mode=testnow&useExcludeList=no";
+    } else {
+        callToServer(url + "?checkVersion=" + currentVersion);
+    }
+}
+
+function checkAndUpdate(doc) {
+        if (!excludeListIsUpToDate(doc)) {
+        	// start update process
+        	alert("The Exclude List is no more valid.\nGoing to download the the latest version");
+        	updateExcludeList("update_exclude_list.jsp?action=update", doc);
+        	alert("The Exclude List is update.\nGoing to start the test.");
+     	}
+
+     	window.graph.document.location.href="graph.jsp?mode=testnow";
+}
+
+function excludeListIsUpToDate(doc) {
+    var response = doc.getElementById("isUpToDate").innerHTML;
+    if (response == "yes") {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+function getExcludeList(doc) {
+    return doc.getElementById("list").innerHTML;
+}
+
+function getVersion(doc) {
+    return doc.getElementById("version").innerHTML;
+}
+
+function updateExcludeList(url, doc) {
+    var httpcon = document.all ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+    if (httpcon) {
+    	url += "&version=" + escape(getVersion(doc)) + "&ExcludeList=" + escape(getExcludeList(doc))
+        httpcon.open('POST', url, false);
+        //httpcon.send("version=" + escape(getVersion(doc)) + "&ExcludeList=" + escape(getExcludeList(doc)));
+        httpcon.send(null);
+    }
+}
+

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/docroot/ui/default.css Tue Apr 26 05:47:08 2005
@@ -23,7 +23,7 @@
 	background-color: #ffffff;
 	padding: 0px;
 	margin: 0px;
-	margin-top: 30px;
+	margin-top: 15px;
 	vertical-align: top;
 	text-align: left;
 	}

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id?rev=164780&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/download.id Tue Apr 26 05:47:08 2005
@@ -0,0 +1 @@
+id="jackrabbit tck check out"
\ No newline at end of file

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/excludelisttest.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/excludelisttest.jsp?rev=164780&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/excludelisttest.jsp (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/excludelisttest.jsp Tue Apr 26 05:47:08 2005
@@ -0,0 +1,7 @@
+<html>
+<body onload="parent.checkAndUpdate(document)">
+<div id="version">0.16.4</div>
+<div id="list">org.apache.jackrabbit.test.api.version.CheckoutTest,org.apache.jackrabbit.test.api.WorkspaceMoveTest#testMoveNodesLocked</div> 
+<div id="isUpToDate">yes</div>
+</body>
+</html>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/excludelisttest.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/graph.jsp Tue Apr 26 05:47:08 2005
@@ -13,17 +13,19 @@
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
---%><%@ page import="javax.jcr.Session,
-         javax.jcr.Node,
-         javax.jcr.NodeIterator,
-         junit.framework.Test,
+--%><%@ page import="junit.framework.Test,
          junit.framework.TestSuite,
          java.util.*,
          junit.framework.TestCase,
-         javax.jcr.Property,
-         java.text.SimpleDateFormat,
+                     java.text.SimpleDateFormat,
          org.apache.jackrabbit.tck.*,
-         org.apache.jackrabbit.tck.j2ee.RepositoryServlet"
+         org.apache.jackrabbit.tck.j2ee.RepositoryServlet,
+         java.io.ByteArrayOutputStream,
+                     javax.jcr.*,
+                     java.io.IOException,
+                     javax.xml.parsers.ParserConfigurationException,
+                     org.xml.sax.SAXException,
+                     java.io.ByteArrayInputStream"
 %><%@page session="false" %><%
 
 // get the repository session for read(config and test results) and write (config and test results) access
@@ -32,9 +34,6 @@
     return;
 }
 
-// get path from jar where the test sources are stored
-String TEST_JCR_PATH = "/WEB-INF/lib/tck-webapp-0.1.jar";
-
 // display mode:
 // - testnow : new test
 // - view: view results
@@ -56,7 +55,7 @@
     if (mode == null || (mode != null && mode.equals("testnow"))) {
         // prepare test
         TestFinder tf = new TestFinder();
-        tf.find(getServletConfig().getServletContext().getResource(TEST_JCR_PATH).openStream(),
+        tf.find(getServletConfig().getServletContext().getResource(RepositoryServlet.getTckWebappJarPath()).openStream(),
                 "TestAll.java");
         Iterator  tests = tf.getSuites().keySet().iterator();
 
@@ -67,7 +66,8 @@
             String key = (String) tests.next();
             TestSuite t = (TestSuite) tf.getSuites().get(key);
             Enumeration members = t.tests();
-            out.write("<tr><th class=\"content\">" + t.toString() + "</th><th style=\"text-align: right;\" colspan=\"2\" class=\"content\"><a href=\"javascript:showConfig('" + key + "');\">Config</a></th></tr>");
+            out.write("<tr><th class=\"content\">" + t.toString() + "</th><th style=\"text-align: right;\" colspan=\"2\" " +
+                    "class=\"content\"><a href=\"javascript:showConfig('" + key + "');\">Config</a></th></tr>");
 
             // list tests ordered by key (level1, level2, ....)
             while (members.hasMoreElements()) {
@@ -96,8 +96,28 @@
 
     // start testing or show results
     if (mode != null && mode.equals("testnow")) {
-        // read and save test configuration
-        WebAppTestConfig.save(request, repSession);
+        // exclude list
+        Map tckExcludeList = Collections.EMPTY_MAP;
+        String excludelist = request.getParameter("useExcludeList");
+        boolean useExcludeList = (excludelist != null && excludelist.equals("no")) ? false : true;
+
+        if (useExcludeList) {
+            // check if exclude list is up to date or even existing
+            if (repSession.getRootNode().hasNode("excludeList")) {
+                Node excludeListNode = repSession.getRootNode().getNode("excludeList");
+                String list = excludeListNode.getProperty("list").getString();
+
+                if (list != null && !"".equals(list)) {
+                    String splittedList[] = list.split(",");
+                    tckExcludeList = new HashMap();
+
+                    for (int i = 0; i < splittedList.length; i++) {
+                        String name = splittedList[i];
+                        tckExcludeList.put(name, name);
+                    }
+                }
+            }
+        }
 
         // start testing
         Node rootNode = repSession.getRootNode();
@@ -106,11 +126,12 @@
         rootNode.save();
 
         out.write("<script>parent.statuswin.document.write(\"<html><head><title></title>\");");
-        out.write("parent.statuswin.document.write('<link rel=\"stylesheet\" href=\"docroot/ui/default.css\" type=\"text/css\" title=\"style\" /></head>');");
+        out.write("parent.statuswin.document.write('<link rel=\"stylesheet\" href=\"docroot/ui/default.css\" " +
+                "type=\"text/css\" title=\"style\" /></head>');");
         out.write("parent.statuswin.document.write('<body style=\"margin-top:5px;margin-left:10px;border-width:0px;font-size:11px;\">');");
         out.write("parent.statuswin.document.write(\"starting\");</script>");
         TestFinder testfinder = new TestFinder();
-        testfinder.find(getServletConfig().getServletContext().getResource(TEST_JCR_PATH).openStream(),
+        testfinder.find(getServletConfig().getServletContext().getResource(RepositoryServlet.getTckWebappJarPath()).openStream(),
                 "TestAll.java");
         TckTestRunner runner = new TckTestRunner(out);
         String logStr = "<script>" +
@@ -126,43 +147,111 @@
                 "</script>";
         runner.setInteractionString(interAStr);
         runner.setNewTestString("<script>window.scrollBy(0,21);</script>");
-        Tester t = new Tester(testfinder, runner, out);
+        Tester t = new Tester(testfinder, runner, out, tckExcludeList);
         t.setfinishedSuiteString("<script>parent.statuswin.document.write(\"finished {0} tests<br>\");window.scrollBy(0,40);</script>");
         long startMillies = System.currentTimeMillis();
         t.run();
         Node results = testResNode.addNode(String.valueOf(startMillies));
         testResNode.save();
         t.storeResults(results);
+
+        // test summary
+        Map summary = buildSummary(results, repSession);
+
+        out.write("<table width=\"100%\">");
+        out.write("<tr><th class=\"content\" width=<\"100%\" colspan=\"" + String.valueOf(summary.size()) + "\">Test Summary</th></tr>");
+
+        Iterator itr = summary.keySet().iterator();
+
+        out.write("<tr>");
+        String width = String.valueOf(Math.round(100 / summary.size()));
+
+        while (itr.hasNext()) {
+            out.write("<td width=\"" + width + "%\" align=\"center\" class=\"content\">" + itr.next() + "</td>");
+        }
+        out.write("</tr>");
+
+        itr = summary.keySet().iterator();
+        out.write("<tr>");
+        while (itr.hasNext()) {
+            String key = (String) itr.next();
+            Boolean passed = (Boolean) summary.get(key);
+
+            String res = (passed.booleanValue()) ? "pass" : "failure";
+
+            out.write("<td align=\"center\" class=\"content\">" + "<img src=\"docroot/imgs/" + res + ".png\" border=\"0\"></td>");
+
+        }
+        out.write("</tr>");
+        out.write("</table>");
+
         out.write("<script>parent.statuswin.document.write(\"...finished. Test took " +
                 String.valueOf(System.currentTimeMillis() - startMillies) + "ms<br>\");</script>");
         out.write("<script>parent.statuswin.scrollBy(0,30);</script>");
         out.write("<script>parent.statuswin.document.write(\"</body></html>\");</script>");
+        out.write("<script>window.scrollBy(0,200);</script>");
     } else if (mode != null && mode.equals("view")) {
         out.write("<script>parent.statuswin.document.write(\"<html><head><title></title>\");");
-        out.write("parent.statuswin.document.write('<link rel=\"stylesheet\" href=\"docroot/ui/default.css\" type=\"text/css\" title=\"style\" /></head>');");
+        out.write("parent.statuswin.document.write('<link rel=\"stylesheet\" href=\"docroot/ui/default.css\" " +
+                "type=\"text/css\" title=\"style\" /></head>');");
         out.write("parent.statuswin.document.write('<body style=\"margin-top:5px;margin-left:10px;border-width:0px;0px;font-size:11px;\">');");
         out.write("parent.statuswin.document.write(\"view test result<br>\");</script>");
 
-        TestFinder tf = new TestFinder();
-        tf.find(getServletConfig().getServletContext().getResource(TEST_JCR_PATH).openStream(), "TestAll.java");
-
         // the test to be viewed is defined by the timestamp
         String testTimeInMs = request.getParameter("test");
 
         // load "test root"
         Node testroot = repSession.getRootNode().getNode("testing/" + testTimeInMs);
 
+        // build summary
+        Map summary = buildSummary(testroot, repSession);
+
+        // Iterate through all tests
+        TestFinder tf = new TestFinder();
+        tf.find(getServletConfig().getServletContext().getResource(RepositoryServlet.getTckWebappJarPath()).openStream(), "TestAll.java");
+
         Calendar cal = Calendar.getInstance();
         cal.setTimeInMillis(Long.parseLong(testTimeInMs));
         SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
         String formatedTestTime = formatter.format(cal.getTime());
 
+        // test header
         out.write("<table width=\"100%\">");
         out.write("<tr><th class=\"content\" width=<\"100%\">Test: " + formatedTestTime + "</th></tr>");
         out.write("</table>");
 
+        // test summary
+        out.write("<table width=\"100%\">");
+        out.write("<tr><th class=\"content\" width=<\"100%\" colspan=\"" + String.valueOf(summary.size()) + "\">Test Summary</th></tr>");
+
+        Iterator itr = summary.keySet().iterator();
+
+        out.write("<tr>");
+        String width = String.valueOf(Math.round(100 / summary.size()));
+
+        while (itr.hasNext()) {
+            out.write("<td width=\"" + width + "%\" align=\"center\" class=\"content\">" + itr.next() + "</td>");
+        }
+        out.write("</tr>");
+
+        itr = summary.keySet().iterator();
+        out.write("<tr>");
+        while (itr.hasNext()) {
+            String key = (String) itr.next();
+            Boolean passed = (Boolean) summary.get(key);
+
+            String res = (passed.booleanValue()) ? "pass" : "failure";
+
+            out.write("<td align=\"center\" class=\"content\">" + "<img src=\"docroot/imgs/" + res + ".png\" border=\"0\"></td>");
+
+        }
+        out.write("</tr>");
+        out.write("</table>");
+
+        // all tests in detail
         out.write("<table width=\"100%\">");
-        out.write("<tr><th colspan=\"100\" class=\"content\">&nbsp;</th></tr>");
+        out.write("<tr><th colspan=\"3\" class=\"content\">&nbsp;</th></tr>");
+        out.write("<tr><th colspan=\"3\" class=\"content\">Detailed Test Report</th></tr>");
 
         // display the test result categorized by the test suites:
         // - level1
@@ -174,7 +263,7 @@
             String key = (String) tests.next();
             TestSuite t = (TestSuite) tf.getSuites().get(key);
             Enumeration members = t.tests();
-            out.write("<tr><th class=\"content\" colspan=\"3\">" + t.toString() + "</th></tr>");
+            out.write("<tr><td class=\"content\" colspan=\"3\">" + t.toString() + "</td></tr>");
             while (members.hasMoreElements()) {
                 TestSuite aTest = (TestSuite) members.nextElement();
 
@@ -246,4 +335,12 @@
     }
     %>
     </body>
-</html>
\ No newline at end of file
+</html><%!
+public Map buildSummary(Node startNode, Session session) throws RepositoryException, IOException, ParserConfigurationException, SAXException {
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    session.exportSystemView(startNode.getPath(), baos, false, false);
+    TestResultParser parser = new TestResultParser();
+    Map summary = parser.interpretResult(baos.toString());
+    return summary;
+}
+%>
\ No newline at end of file

Modified: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp?rev=164780&r1=164779&r2=164780&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp (original)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/index.jsp Tue Apr 26 05:47:08 2005
@@ -14,25 +14,55 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 --%><%@ page import="javax.jcr.Session,
-		 java.util.List,
-		 java.util.ArrayList"
+                     javax.jcr.Node,
+                     javax.jcr.NodeIterator,
+                     java.util.*,
+                     java.text.SimpleDateFormat,
+                     org.apache.jackrabbit.tck.j2ee.RepositoryServlet,
+                     javax.jcr.RepositoryException,
+                     java.io.InputStream,
+                     org.apache.jackrabbit.test.RepositoryStub,
+                     java.io.IOException,
+                     org.apache.jackrabbit.test.RepositoryStubException"
 %><%@page session="false" %><%
 
-    String parent = request.getRequestURI();
-    if (parent.length() > 1) {
-        parent = parent.substring(0,parent.lastIndexOf('/'));
+Session repSession = RepositoryServlet.getSession();
+if (repSession == null) {
+    return;
+}
+
+// copy download id into repo
+if (!repSession.getRootNode().hasNode("licNode")) {
+    Properties props = new Properties();
+    InputStream is = RepositoryStub.class.getClassLoader().getResourceAsStream("/download.id");
+    if (is != null) {
+        try {
+            props.load(is);
+        } catch (IOException e) {
+            throw new RepositoryStubException("Exception reading "
+                    + "/download.id" + ": " + e.toString());
+        }
     }
+}
+
+String parent = request.getRequestURI();
+if (parent.length() > 1) {
+    parent = parent.substring(0,parent.lastIndexOf('/'));
+}
+String mode = request.getParameter("mode");
+mode = (mode == null || mode.equals("")) ? "test" : mode;
 
 %><html>
     <head><title>TCK for JSR170</title>
     <link rel="stylesheet" href="docroot/ui/default.css" type="text/css" title="style" />
+    <script type="text/javascript" src="docroot/js/server_call.js"></script>
     <script>
         function setImage(id, url) {
-		var logoImg = new Image();
+            var logoImg = new Image();
             logoImg.src = url;
             var img = document.getElementById(id);
 
-            if (logoImg .width > 0) {
+            if (logoImg.width > 0) {
                 img.src= logoImg.src;
             } else {
                 img.src = "docroot/imgs/banner_right.jpg";
@@ -41,28 +71,150 @@
 
     </script>
     </head>
-    <body onload="setImage('logo', 'http://jsr170tools.day.com/crx/crx_main_files/banner_right.jpg');">
+    <body onload="setImage('logo', 'http://jsr170tools.day.com/crx/crx_main_files/banner_right.gif');">
         <center>
             <table cellpadding="0" cellspacing="0" border="0" id="maintable">
                 <!-- banner -->
                 <tr>
-                    <td class="leadcell"><span class="leadcelltext">TCK for JSR 170<br>Content Repository Standard</span></td><td class="logocell"><a target="_blank" href="http://www.day.com" title="www.day.com"><img id="logo" border="0"></td>
+                    <td class="leadcell"><span class="leadcelltext">TCK for JSR 170<br>Content Repository for Java Technology API</span></td><td class="logocell"><a target="_blank" href="http://www.day.com" title="www.day.com"><img id="logo" border="0"></td>
                 </tr>
                 <tr>
-                <td colspan="2">
-                    <iframe name="graph" src="graph.jsp" height="500" width="960" frameborder="0"></iframe>
-                </td>
-                </tr>
-                <tr>
-                <td colspan="2">
-                    <iframe name="config" style="margin-top: 20px;border-top: 1px solid #000000;" src="config.jsp" height="200" width="960" frameborder="0"></iframe>
-                </td>
-                </tr>
-                <tr>
-                <td colspan="2">
-                    <iframe name="statuswin" style="margin-top: 20px;border-top: 1px solid #000000;" src="status.jsp" height="100" width="960" frameborder="0"></iframe>
+                    <td colspan="2" id="technavcell">
+                    <div id="technav">
+                    <%
+                    if (mode.equals("test")) {
+                        %><span class="technavat">Test</span><a href="index.jsp?mode=view">View Results</a>
+                        <a href="index.jsp?mode=config">Test Config</a><a href="index.jsp?mode=preferences">Preferences</a><%
+                    } else if (mode.equals("view")){
+                        %><a href="index.jsp?mode=">Test</a><span class="technavat">View Results</span></a>
+                        <a href="index.jsp?mode=config">Test Config</a><a href="index.jsp?mode=preferences">Preferences</a><%
+                    } else if (mode.equals("config")){
+                        %><a href="index.jsp?mode=">Test</a><a href="index.jsp?mode=view">View Results</a>
+                        <span class="technavat">Test Config</span><a href="index.jsp?mode=preferences">Preferences</a><%
+                    } else {
+                        %><a href="index.jsp?mode=">Test</a><a href="index.jsp?mode=view">View Results</a>
+                        <a href="index.jsp?mode=config">Test Config</a><span class="technavat">Preferences</span><%
+                    }
+                    %>
+                    </div>
                 </td>
                 </tr>
+                <%
+                if (mode.equals("test")) {
+                    // get exclude list version currently stored in the tck repository
+                    String excludeListVersion = "";
+                    if (repSession.getRootNode().hasNode("excludelist")) {
+                        Node excludeListNode = repSession.getRootNode().getNode("excludelist");
+                        excludeListVersion = excludeListNode.getProperty("version").getString();
+                    }
+                    %><tr>
+                        <td colspan="2">
+                            <iframe name="graph" src="graph.jsp" height="600" width="960" frameborder="0"></iframe>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td id="technavcell" colspan="2">
+                            <table width="100%">
+                                <tr>
+                                    <td width="10%"><input type="button" value="Start" class="submit" onclick="startTest('<%= RepositoryServlet.getExcludeListUrl() %>','<%= excludeListVersion %>', document.getElementById('excudelist').checked)"></td>
+                                    <td width="20%">Start Test</td>
+                                    <td width="40%" align="center"><input type="checkbox" id="excudelist" checked>Exclude List</td>
+                                    <td width="20%" align="right">Submit Test Data</td>
+                                    <td width="10%" align="right"><input type="button" value="Submit" class="submit" onclick="var strwin = window.open('submit_result.jsp','SubmitTestResult', 'width=500,height=400');strwin.focus()"></td>
+                                </tr>
+                            </table>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">
+                            <iframe name="statuswin" style="margin-top: 0px;border-top: 1px solid #000000;" src="status.jsp" height="80" width="960" frameborder="0"></iframe>
+                        </td>
+                    </tr><%
+                } else if (mode.equals("view")){
+                    %><tr>
+                        <td colspan="2">
+                            <iframe name="graph" src="graph.jsp" height="590" width="960" frameborder="0"></iframe>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td id="technavcell" colspan="2">
+                            <form name="view" action="graph.jsp" target="graph">
+                                <input type="hidden" name="mode" value="view">
+                                <%
+                                Node rootNode = repSession.getRootNode();
+
+                                if (rootNode.hasNode("testing")) {
+                                    %>
+                                    <table width="100%">
+                                        <tr>
+                                            <td valign="top" width="90%">Select test to be viewed</td>
+                                            <td width="10%" align="right">
+                                            <select name="test" onchange="document.view.submit();">
+                                                <option value="">Select date</option>
+                                                <%
+                                                NodeIterator tests = rootNode.getNode("testing").getNodes();
+
+                                                ArrayList al = new ArrayList();
+                                                //hack : todo??
+                                                while (tests.hasNext()) {
+                                                    al.add(tests.nextNode());
+                                                }
+
+                                                Collections.reverse(al);
+                                                Iterator itr = al.iterator();
+                                                // eoh
+
+                                                while (itr.hasNext()) {
+                                                    Node n = (Node) itr.next();
+                                                    String sdate = n.getName();
+                                                    if ("props".equals(sdate)) {
+                                                        continue;
+                                                    }
+                                                    Calendar cal = Calendar.getInstance();
+                                                    cal.setTimeInMillis(Long.parseLong(sdate));
+                                                    SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
+                                                    sdate = formatter.format(cal.getTime());
+                                                    %><option value="<%= n.getName() %>"><%= sdate %></option><%
+                                                }
+                                                %>
+                                                </select></td>
+                                        </tr>
+                                    </table>
+                                <%
+                                }
+                                %>
+                            </form>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td colspan="2">
+                            <iframe name="statuswin" style="margin-top: 0px;border-top: 1px solid #000000;" src="status.jsp" height="80" width="960" frameborder="0"></iframe>
+                        </td>
+                    </tr><%
+                } else if (mode.equals("config")){
+                    %><tr>
+                        <td colspan="2">
+                            <iframe name="config" src="config.jsp" height="680" width="960" frameborder="0"></iframe>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td id="technavcell" colspan="2">
+                            <table width="100%">
+                                <tr>
+                                    <td width="40%" align="left">Save Configuration</td>
+                                    <td width="10%" align="right"><input type="button" value="Save" class="submit" onclick="window.config.document.configform.submit();"></td>
+                                </tr>
+                            </table>
+                        </td>
+                    </tr><%
+                } else if (mode.equals("preferences")){
+                %><tr>
+                    <td colspan="2">
+                        <iframe name="preferences" src="preferences.jsp" height="680" width="960" frameborder="0"></iframe>
+                    </td>
+                </tr><%
+                }
+                %>
             </table>
         </center>
     </body>

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp?rev=164780&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp Tue Apr 26 05:47:08 2005
@@ -0,0 +1,57 @@
+<%--
+Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                    as applicable.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%><%@ page import="javax.jcr.Session,
+                     org.apache.jackrabbit.tck.j2ee.RepositoryServlet,
+                     javax.jcr.Node,
+                     javax.jcr.RepositoryException,
+                     java.util.HashMap,
+                     java.io.IOException"
+%><%@page session="false" %><%
+Session repSession = RepositoryServlet.getSession();
+if (repSession == null) {
+    return;
+}
+
+String alertBox = "";
+
+// save download key if needed
+String key = request.getParameter("key");
+if (key != null) {
+    // save
+    Node lk = repSession.getRootNode().getNode("licNode");
+    if (!key.equals(lk.getProperty("key").getString())) {
+        lk.setProperty("key", key);
+        repSession.getRootNode().save();
+    }
+}
+
+Node rootNode = repSession.getRootNode();
+
+%>
+<html>
+    <head>
+        <link rel="stylesheet" href="docroot/ui/default.css" type="text/css" title="style" />
+    </head>
+    <body style="margin-top:0px;border-width:0px">
+        <%= alertBox %>
+        <form name="prefsform" action="preferences.jsp" method="post">
+            <table width="100%">
+                <tr><td class="content">Licence Key</td><td class="content"><input name="key" value="<%= rootNode.getNode("licNode").getProperty("key").getString() %>"></td></tr>
+                <tr><td colspan="2"><input type="submit" value="Save" class="submit"></td></tr>
+            </table>
+        </form>
+    </body>
+</html>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/preferences.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp?rev=164780&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp Tue Apr 26 05:47:08 2005
@@ -0,0 +1,39 @@
+<%--
+Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                    as applicable.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%><%@ page import="javax.jcr.Session,
+                     org.apache.jackrabbit.tck.j2ee.RepositoryServlet,
+                     javax.jcr.Node,
+                     javax.jcr.RepositoryException,
+                     java.util.HashMap,
+                     java.io.IOException,
+                     java.io.ByteArrayOutputStream,
+                     org.apache.jackrabbit.tck.TestResultParser,
+                     java.util.Map"
+%><%@page session="false" %><%
+Session repSession = RepositoryServlet.getSession();
+if (repSession == null) {
+    return;
+}
+
+String sampleDate = request.getParameter("sampledate");
+if (sampleDate != null && repSession.getRootNode().hasNode("testing/" + sampleDate)) {
+    // build xml
+    Node testroot = repSession.getRootNode().getNode("testing/" + sampleDate);
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    repSession.exportSysView(testroot.getPath(), baos, false, false);
+    %><%= baos.toString() %><%
+    }
+%>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/resultlookup.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp?rev=164780&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp Tue Apr 26 05:47:08 2005
@@ -0,0 +1,135 @@
+<%--
+Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                    as applicable.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%><%@ page import="javax.jcr.Session,
+                     org.apache.jackrabbit.tck.j2ee.RepositoryServlet,
+                     javax.jcr.Node,
+                     javax.jcr.NodeIterator,
+                     java.text.SimpleDateFormat,
+                     java.util.*,
+                     org.apache.jackrabbit.test.RepositoryHelper,
+                     org.apache.jackrabbit.tck.WebAppTestConfig,
+                     java.net.URLEncoder,
+                     java.net.URL,
+                     java.net.URLConnection,
+                     java.io.*,
+                     org.apache.jackrabbit.tck.TestResultParser"
+%><%@page session="false" %><%
+Session repSession = RepositoryServlet.getSession();
+if (repSession == null) {
+    return;
+}
+String lookupURL = "resultlookup.jsp?sampledate=";
+
+Node rootNode = repSession.getRootNode();
+%>
+<html>
+    <head>
+        <link rel="stylesheet" href="docroot/ui/default.css" type="text/css" title="style" />
+        <script>
+            function getTestResult(url, inputfield) {
+                var httpcon = document.all ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
+                if (httpcon) {
+                	httpcon.open('GET', url, false);
+                	httpcon.send(null);
+                	inputfield.value = httpcon.responseText;
+                } else {
+                	inputfield.value = "";
+                    window.alert("Select a valid sample date");
+                }
+            }
+        </script>
+    </head>
+    <body style="margin-top:0px;border-width:0px">
+        <form name="submit" action="<%= RepositoryServlet.getSubmitUrl() %>" method="post">
+        <%
+        // build submit form
+        if (rootNode.hasNode("testing")) {
+            // create properties "file" containing system (java) and repository information
+            String properties = "#system properties\n";
+            String[] propertyNames = {"java.class.version", "java.vendor", "java.vendor.url",
+                                      "java.version", "os.name", "os.arch", "os.version"};
+            for (int i = 0; i < propertyNames.length; i++) {
+                String pval = System.getProperty(propertyNames[i]);
+                properties += propertyNames[i] + "=" + pval + "\n";
+            }
+
+            properties = "#repository properties\n";
+            RepositoryHelper helper = new RepositoryHelper(WebAppTestConfig.getCurrentConfig());
+            String dkeys[] = helper.getRepository().getDescriptorKeys();
+            for (int i = 0; i < dkeys.length; i++) {
+                String dval = helper.getRepository().getDescriptor(dkeys[i]);
+                properties += dkeys[i] + "\t" + dval + "\n";
+            }
+            
+            // license info
+            Node lk = repSession.getRootNode().getNode("licNode");
+            String lickey = lk.getProperty("key").getString();
+            String installid = lk.getUUID();
+            %>
+            <table width="100%">
+                <tr>
+                    <td colspan="2">
+                         <iframe name="userinfo" style="margin-top: 0px;border-top: 1px solid #000000;" src="http://www.day.com" height="200" width="450" frameborder="0"></iframe>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="content" valign="top" width="40%">Test Date</td>
+                    <td class="content" width="60%" align="right">
+                    <select name="test" onchange="getTestResult('<%= lookupURL %>'+this.options[this.selectedIndex].value, document.submit.resultxml);">
+                        <option value="">Sample date</option>
+                        <%
+                        NodeIterator tests = rootNode.getNode("testing").getNodes();
+
+                        ArrayList al = new ArrayList();
+                        //hack : todo??
+                        while (tests.hasNext()) {
+                            al.add(tests.nextNode());
+                        }
+
+                        Collections.reverse(al);
+                        Iterator itr = al.iterator();
+                        // eoh
+
+                        while (itr.hasNext()) {
+                            Node n = (Node) itr.next();
+                            String sdate = n.getName();
+                            if ("props".equals(sdate)) {
+                                continue;
+                            }
+                            Calendar cal = Calendar.getInstance();
+                            cal.setTimeInMillis(Long.parseLong(sdate));
+                            SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
+                            sdate = formatter.format(cal.getTime());
+                            %><option value="<%= n.getName() %>"><%= sdate %></option><%
+                        }
+                        %>
+                        </select></td>
+                </tr>
+                <tr>
+                    <td colspan="2">
+                        &nbsp;<input type="hidden" name="properties" value="<%= properties %>"><input type="hidden" name="resultxml"><input type="hidden" name="licencekey" value="<%= lickey %>"><input type="hidden" name="istallid" value="<%= installid %>">
+                    </td>
+                </tr>
+                <tr><td><input type="submit" value="Send" class="submit"></td><td align="right"><input type="button" value="Cancel" class="submit" onclick="window.close();"></td></tr>
+            </table>
+            <%
+        } else {
+            %>No test(s) executed so far.<%
+        }
+        %>
+        </form>
+    </body>
+</html>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/submit_result.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/update_exclude_list.jsp
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/update_exclude_list.jsp?rev=164780&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/update_exclude_list.jsp (added)
+++ incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/update_exclude_list.jsp Tue Apr 26 05:47:08 2005
@@ -0,0 +1,41 @@
+<%--
+Copyright 2004-2005 The Apache Software Foundation or its licensors,
+                    as applicable.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%><%@ page import="javax.jcr.Session,
+                     org.apache.jackrabbit.tck.j2ee.RepositoryServlet,
+                     javax.jcr.Node,
+                     javax.jcr.RepositoryException,
+                     java.util.HashMap,
+                     java.io.IOException"
+%><%@page session="false" %><%
+Session repSession = RepositoryServlet.getSession();
+if (repSession == null) {
+    return;
+}
+
+String excludeList = request.getParameter("ExcludeList");
+String version = request.getParameter("version");
+%>version:<%= version %>%><br><%
+%>excludeList:<%= excludeList %>%><br><%
+if (excludeList != null && version != null) {
+    Node excludeListNode = (repSession.getRootNode().hasNode("excludeList")) ?
+            repSession.getRootNode().getNode("excludeList") :
+            repSession.getRootNode().addNode("excludeList", "nt:unstructured");
+
+    excludeListNode.setProperty("version", version);
+    excludeListNode.setProperty("list", excludeList);
+    repSession.save();
+}
+%>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/tck-webapp/src/webapp/update_exclude_list.jsp
------------------------------------------------------------------------------
    svn:eol-style = native