chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1028010 [1/2] - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-test/chemistry-opencmis-test-tck/ chemistry-opencmis-test/chemistry-opencmis-test-tck/src/ chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/ chemistry-o...
Date Wed, 27 Oct 2010 15:43:25 GMT
Author: fmui
Date: Wed Oct 27 15:43:24 2010
New Revision: 1028010

URL: http://svn.apache.org/viewvc?rev=1028010&view=rev
Log:
initial TCK framework check-in

Added:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTest.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestGroup.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestProgressMonitor.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestReport.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResult.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResultStatus.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTest.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTestGroup.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTestGroup.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/CmisTestResultImpl.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/FatalTestException.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/WrapperCmisTestGroup.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/AbstractCmisTestReport.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/HtmlReport.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/XmlReport.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/AbstractRunner.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/CmisTckAntTask.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/runner/ConsoleRunner.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/BasicsTestGroup.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/RepositoryInfoTest.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/RootFolderTest.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/TypesTest.java   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/resources/
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/resources/cmis-tck-groups.txt   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/resources/sample-build.xml   (with props)
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/resources/sample-parameters.properties   (with props)
Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/MIMETypes.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml?rev=1028010&r1=1028009&r2=1028010&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/pom.xml Wed Oct 27 15:43:24 2010
@@ -26,5 +26,16 @@
         <parentBasedir>../../</parentBasedir>
     </properties>
     
-
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.chemistry.opencmis</groupId>
+            <artifactId>chemistry-opencmis-client-impl</artifactId>
+            <version>0.2.0-incubating-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.8.1</version>
+        </dependency>
+    </dependencies>
 </project>

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTest.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTest.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTest.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * CMIS TCK Test.
+ */
+public interface CmisTest {
+
+    /**
+     * Initializes the test with test parameters.
+     */
+    void init(Map<String, String> parameters) throws Exception;
+
+    /**
+     * Returns the name of the test.
+     */
+    String getName();
+
+    /**
+     * Runs the test.
+     */
+    void run() throws Exception;
+
+    /**
+     * Returns if the test is enabled or not.
+     */
+    boolean isEnabled();
+
+    /**
+     * Enables or disables the test.
+     */
+    void setEnabled(boolean enabled);
+
+    /**
+     * Returns the results of the test after {@link #run()} has be called.
+     */
+    List<CmisTestResult> getResults();
+
+    /**
+     * Gets the time (in milliseconds) that the test took to run.
+     */
+    long getTime();
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestGroup.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestGroup.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestGroup.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestGroup.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * CMIS TCK Test Group.
+ */
+public interface CmisTestGroup {
+
+    /**
+     * Initializes the test group with test parameters.
+     */
+    void init(Map<String, String> parameters) throws Exception;
+
+    /**
+     * Sets the progress monitor that should be used during a run.
+     */
+    void setProgressMonitor(CmisTestProgressMonitor progressMonitor);
+
+    /**
+     * Returns the name of the test group.
+     */
+    String getName();
+
+    /**
+     * Returns the all tests in this group.
+     */
+    List<CmisTest> getTests();
+
+    /**
+     * Runs all enabled tests in this group.
+     */
+    void run() throws Exception;
+
+    /**
+     * Returns if the test group is enabled or not.
+     */
+    boolean isEnabled();
+
+    /**
+     * Enables or disables this test group.
+     */
+    void setEnabled(boolean enabled);
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestProgressMonitor.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestProgressMonitor.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestProgressMonitor.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestProgressMonitor.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck;
+
+/**
+ * CMIS Progress Monitor.
+ */
+public interface CmisTestProgressMonitor {
+
+    /**
+     * Called before a new group run starts.
+     */
+    void startGroup(CmisTestGroup group);
+
+    /**
+     * Called after a group run ended.
+     */
+    void endGroup(CmisTestGroup group);
+
+    /**
+     * Called before a new test run starts.
+     */
+    void startTest(CmisTest test);
+
+    /**
+     * Called after a test run ended.
+     */
+    void endTest(CmisTest test);
+
+    /**
+     * Called when a group or test wants to print out a message.
+     */
+    void message(String msg);
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestProgressMonitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestReport.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestReport.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestReport.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestReport.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck;
+
+import java.io.File;
+import java.io.Writer;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * CMIS TCK Test Report.
+ */
+public interface CmisTestReport {
+
+    /**
+     * Creates a new report and writes it to a writer.
+     */
+    void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer) throws Exception;
+
+    /**
+     * Creates a new report and writes it to a file.
+     */
+    void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, File file) throws Exception;
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestReport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResult.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResult.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResult.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResult.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck;
+
+import java.util.List;
+
+/**
+ * CMIS TCK Test Result.
+ */
+public interface CmisTestResult {
+
+    /**
+     * Returns the group name.
+     */
+    String getGroupName();
+
+    /**
+     * Returns the test name.
+     */
+    String getTestName();
+
+    /**
+     * Returns the check status.
+     */
+    CmisTestResultStatus getStatus();
+
+    /**
+     * Returns the check message.
+     */
+    String getMessage();
+
+    /**
+     * Returns the exception if available.
+     */
+    Throwable getException();
+
+    /**
+     * Returns the stack trace. The first element should point to check.
+     */
+    StackTraceElement[] getStackTrace();
+
+    /**
+     * Returns the URL of the request if available.
+     */
+    String getUrl();
+
+    /**
+     * Returns the request body if available.
+     */
+    String getRequest();
+
+    /**
+     * Returns the response body if available.
+     */
+    String getResponse();
+
+    /**
+     * Returns children of the result that contain more details.
+     */
+    List<CmisTestResult> getChildren();
+
+    /**
+     * Returns if the result was fatal for the test.
+     */
+    boolean isFatal();
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResultStatus.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResultStatus.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResultStatus.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResultStatus.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck;
+
+/**
+ * CMIS TCK Test Result Status.
+ */
+public enum CmisTestResultStatus {
+    INFO(0), // no check, just for reports
+    SKIPPED(1), // check has been skipped
+    OK(2), // check passed
+    WARNING(3), // check failed but it is not specification violation
+    FAILURE(4), // check failed and it is specification violation
+    UNEXPECTED_EXCEPTION(5); // exception caught that is not handled by the test
+
+    private int level;
+
+    private CmisTestResultStatus(int level) {
+        this.level = level;
+    }
+
+    public int getLevel() {
+        return level;
+    }
+
+    public static CmisTestResultStatus fromLevel(int level) {
+        for (CmisTestResultStatus c : CmisTestResultStatus.values()) {
+            if (c.level == level) {
+                return c;
+            }
+        }
+        throw new IllegalArgumentException("" + level);
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/CmisTestResultStatus.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTest.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTest.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTest.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,272 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.tck.CmisTest;
+import org.apache.chemistry.opencmis.tck.CmisTestResult;
+import org.apache.chemistry.opencmis.tck.CmisTestResultStatus;
+
+/**
+ * Base class for tests.
+ */
+public abstract class AbstractCmisTest implements CmisTest {
+    private Map<String, String> parameters;
+    private AbstractCmisTestGroup group;
+    private String name;
+    private boolean isEnabled = true;
+    private List<CmisTestResult> results;
+    private long time;
+
+    public void init(Map<String, String> parameters) {
+        this.parameters = parameters;
+        results = new ArrayList<CmisTestResult>();
+    }
+
+    protected Map<String, String> getParameters() {
+        return parameters;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setGroup(AbstractCmisTestGroup group) {
+        this.group = group;
+    }
+
+    public AbstractCmisTestGroup getGroup() {
+        return group;
+    }
+
+    public abstract void run() throws Exception;
+
+    public List<CmisTestResult> getResults() {
+        return results;
+    }
+
+    public boolean isEnabled() {
+        return isEnabled;
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.isEnabled = enabled;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public void setTime(long time) {
+        this.time = time;
+    }
+
+    public CmisTestResultImpl createResult(CmisTestResultStatus status, String message, Throwable exception,
+            boolean isFatal) {
+        return new CmisTestResultImpl(group.getName(), name, message, status, exception, isFatal);
+    }
+
+    public CmisTestResultImpl createResult(CmisTestResultStatus status, String message, boolean isFatal) {
+        return new CmisTestResultImpl(group.getName(), name, message, status, null, isFatal);
+    }
+
+    public CmisTestResultImpl createResult(CmisTestResultStatus status, String message) {
+        return new CmisTestResultImpl(group.getName(), name, message, status, null, false);
+    }
+
+    public CmisTestResultImpl createInfoResult(String message) {
+        return new CmisTestResultImpl(group.getName(), name, message, CmisTestResultStatus.INFO, null, false);
+    }
+
+    public void addResult(CmisTestResult result) {
+        if (result != null) {
+            if (result instanceof CmisTestResultImpl) {
+                ((CmisTestResultImpl) result).setStackTrace(getStackTrace());
+            }
+
+            results.add(result);
+            if (result.isFatal()) {
+                throw new FatalTestException();
+            }
+        }
+    }
+
+    protected StackTraceElement[] getStackTrace() {
+        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+        StackTraceElement[] shortStackTrace = new StackTraceElement[0];
+        if (stackTrace.length > 3) {
+            shortStackTrace = new StackTraceElement[stackTrace.length - 3];
+            System.arraycopy(stackTrace, 3, shortStackTrace, 0, stackTrace.length - 3);
+        }
+
+        return shortStackTrace;
+    }
+
+    protected CmisTestResult addResultChild(CmisTestResult result, CmisTestResult child) {
+        if (result == null) {
+            return null;
+        }
+
+        result.getChildren().add(child);
+
+        return result;
+    }
+
+    // --- asserts ----
+
+    protected boolean isEqual(Object expected, Object actual) {
+        if ((expected == null) && (actual == null)) {
+            return true;
+        }
+
+        if ((expected != null) && expected.equals(actual)) {
+            return true;
+        }
+
+        return false;
+    }
+
+    protected CmisTestResult assertIsTrue(Boolean test, CmisTestResult success, CmisTestResult failure) {
+        if ((test != null) && (test.booleanValue())) {
+            return success;
+        }
+
+        if (test == null) {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "Null!"));
+        } else {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "False!"));
+        }
+    }
+
+    protected CmisTestResult assertIsFalse(Boolean test, CmisTestResult success, CmisTestResult failure) {
+        if ((test != null) && (!test.booleanValue())) {
+            return success;
+        }
+
+        if (test == null) {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "Null!"));
+        } else {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "True!"));
+        }
+    }
+
+    protected CmisTestResult assertNull(Object object, CmisTestResult success, CmisTestResult failure) {
+        if (object == null) {
+            return success;
+        }
+
+        return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "Object is not null!"));
+    }
+
+    protected CmisTestResult assertNotNull(Object object, CmisTestResult success, CmisTestResult failure) {
+        if (object != null) {
+            return success;
+        }
+
+        return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "Object is null!"));
+    }
+
+    protected CmisTestResult assertStringNotEmpty(String str, CmisTestResult success, CmisTestResult failure) {
+        if ((str != null) && (str.length() > 0)) {
+            return success;
+        }
+
+        if (str == null) {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "String is null!"));
+        } else {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "String is empty!"));
+        }
+    }
+
+    protected CmisTestResult assertListNotEmpty(List<?> list, CmisTestResult success, CmisTestResult failure) {
+        if ((list != null) && (list.size() > 0)) {
+            return success;
+        }
+
+        if (list == null) {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "List is null!"));
+        } else {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "List is empty!"));
+        }
+    }
+
+    protected CmisTestResult assertEquals(Object expected, Object actual, CmisTestResult success, CmisTestResult failure) {
+        if (isEqual(expected, actual)) {
+            return success;
+        }
+
+        return addResultChild(failure,
+                createResult(CmisTestResultStatus.INFO, "expected: " + expected + " / actual: " + actual));
+    }
+
+    protected CmisTestResult assertContains(Collection<?> collection, Object value, CmisTestResult success,
+            CmisTestResult failure) {
+        if (collection == null) {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "Collection is null!"));
+        }
+
+        if (collection.contains(value)) {
+            return success;
+        }
+
+        return addResultChild(failure,
+                createResult(CmisTestResultStatus.INFO, "Collection does not contain '" + value + "'"));
+    }
+
+    protected CmisTestResult assertEqualLists(List<?> expected, List<?> actual, CmisTestResult success,
+            CmisTestResult failure) {
+        if ((expected == null) && (actual == null)) {
+            return success;
+        }
+
+        if (expected == null) {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "Expected list is null!"));
+        }
+
+        if (actual == null) {
+            return addResultChild(failure, createResult(CmisTestResultStatus.INFO, "Actual list is null!"));
+        }
+
+        if (expected.size() != actual.size()) {
+            return addResultChild(
+                    failure,
+                    createResult(CmisTestResultStatus.INFO, "List sizes don't match! expected: " + expected.size()
+                            + " / actual: " + actual.size()));
+        }
+
+        for (int i = 0; i < expected.size(); i++) {
+            if (!isEqual(expected, actual)) {
+                return addResultChild(
+                        failure,
+                        createResult(CmisTestResultStatus.INFO, "expected list item[" + i + "]: " + expected
+                                + " / actual list item[" + i + "]: " + actual));
+            }
+        }
+
+        return success;
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTestGroup.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTestGroup.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTestGroup.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTestGroup.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.tck.CmisTest;
+import org.apache.chemistry.opencmis.tck.CmisTestGroup;
+import org.apache.chemistry.opencmis.tck.CmisTestProgressMonitor;
+
+/**
+ * Base class for test groups.
+ */
+public abstract class AbstractCmisTestGroup implements CmisTestGroup {
+    private Map<String, String> parameters;
+    private String name;
+    private List<CmisTest> tests = new ArrayList<CmisTest>();
+    private boolean isEnabled = true;
+    private CmisTestProgressMonitor progressMonitor;
+
+    public void init(Map<String, String> parameters) throws Exception {
+        this.parameters = parameters;
+    }
+
+    protected Map<String, String> getParameters() {
+        return parameters;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public List<CmisTest> getTests() {
+        return tests;
+    }
+
+    public void addTest(CmisTest test) throws Exception {
+        if (test != null) {
+            tests.add(test);
+            if (test instanceof AbstractCmisTest) {
+                ((AbstractCmisTest) test).setGroup(this);
+            }
+            test.init(parameters);
+        }
+    }
+
+    public void setProgressMonitor(CmisTestProgressMonitor progressMonitor) {
+        this.progressMonitor = progressMonitor;
+    }
+
+    protected CmisTestProgressMonitor getProgressMonitor() {
+        return this.progressMonitor;
+    }
+
+    public void run() throws Exception {
+        if (progressMonitor != null) {
+            progressMonitor.startGroup(this);
+        }
+
+        try {
+            preRun();
+            for (CmisTest test : tests) {
+                if ((test == null) || (!test.isEnabled())) {
+                    continue;
+                }
+
+                try {
+                    if (progressMonitor != null) {
+                        progressMonitor.startTest(test);
+                    }
+
+                    preTest(test);
+
+                    long start = System.currentTimeMillis();
+
+                    test.run();
+
+                    long end = System.currentTimeMillis();
+                    if (test instanceof AbstractCmisTest) {
+                        ((AbstractCmisTest) test).setTime(end - start);
+                    }
+
+                    postTest(test);
+
+                    if (progressMonitor != null) {
+                        progressMonitor.endTest(test);
+                    }
+                } catch (Exception e) {
+                    if (!(e instanceof FatalTestException)) {
+                        throw e;
+                    }
+                }
+            }
+        } finally {
+            postRun();
+        }
+
+        if (progressMonitor != null) {
+            progressMonitor.endGroup(this);
+        }
+    }
+
+    protected void preRun() {
+    }
+
+    protected void postRun() {
+    }
+
+    protected void preTest(CmisTest test) {
+    }
+
+    protected void postTest(CmisTest test) {
+    }
+
+    public boolean isEnabled() {
+        return isEnabled;
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.isEnabled = enabled;
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractCmisTestGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,401 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.impl;
+
+import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.FAILURE;
+import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.OK;
+import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.UNEXPECTED_EXCEPTION;
+import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.WARNING;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.client.api.FileableCmisObject;
+import org.apache.chemistry.opencmis.client.api.Folder;
+import org.apache.chemistry.opencmis.client.api.Property;
+import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.client.api.SessionFactory;
+import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.enums.Action;
+import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+import org.apache.chemistry.opencmis.tck.CmisTestResult;
+import org.apache.chemistry.opencmis.tck.CmisTestResultStatus;
+
+/**
+ * Base class for tests that require an OpenCMIS session.
+ */
+public abstract class AbstractSessionTest extends AbstractCmisTest {
+
+    private SessionFactory factory = SessionFactoryImpl.newInstance();
+
+    public BindingType getBinding() {
+        if (getParameters() == null) {
+            return null;
+        }
+
+        try {
+            return BindingType.fromValue(getParameters().get(SessionParameter.BINDING_TYPE));
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    @Override
+    public String getName() {
+        return super.getName() + " (" + getBinding() + ")";
+    }
+
+    @Override
+    public void run() throws Exception {
+        Session session;
+
+        Map<String, String> parameters = getParameters();
+        if (parameters.containsKey(SessionParameter.REPOSITORY_ID)) {
+            session = factory.createSession(parameters);
+        } else {
+            session = factory.getRepositories(parameters).get(0).createSession();
+        }
+
+        try {
+            run(session);
+        } catch (Exception e) {
+            if (!(e instanceof FatalTestException)) {
+                addResult(createResult(UNEXPECTED_EXCEPTION, "Exception: " + e.getMessage(), e, true));
+            }
+        }
+    }
+
+    public abstract void run(Session session) throws Exception;
+
+    protected RepositoryInfo getRepositoryInfo(Session session) {
+        RepositoryInfo ri = session.getRepositoryInfo();
+
+        CmisTestResult failure = createResult(FAILURE, "Repository info is null!", true);
+        addResult(assertNotNull(ri, null, failure));
+
+        return ri;
+    }
+
+    // --- checks ----
+
+    protected CmisTestResult checkObject(CmisObject object, String message) {
+        List<CmisTestResult> results = new ArrayList<CmisTestResult>();
+
+        CmisTestResult f;
+
+        f = createResult(FAILURE, "Object is null!", true);
+        addResult(results, assertNotNull(object, null, f));
+
+        if (object != null) {
+            f = createResult(FAILURE, "Object id is not set!");
+            addResult(results, assertStringNotEmpty(object.getId(), null, f));
+
+            // properties
+            Property<?> prop;
+            prop = object.getProperty(PropertyIds.OBJECT_ID);
+            addResult(results, checkProperty(prop, "Property " + PropertyIds.OBJECT_ID));
+
+            prop = object.getProperty(PropertyIds.BASE_TYPE_ID);
+            addResult(results, checkProperty(prop, "Property " + PropertyIds.BASE_TYPE_ID));
+
+            prop = object.getProperty(PropertyIds.OBJECT_TYPE_ID);
+            addResult(results, checkProperty(prop, "Property " + PropertyIds.OBJECT_TYPE_ID));
+
+            prop = object.getProperty(PropertyIds.NAME);
+            addResult(results, checkProperty(prop, "Property " + PropertyIds.NAME));
+
+            prop = object.getProperty(PropertyIds.CREATED_BY);
+            addResult(results, checkProperty(prop, "Property " + PropertyIds.CREATED_BY));
+
+            prop = object.getProperty(PropertyIds.CREATION_DATE);
+            addResult(results, checkProperty(prop, "Property " + PropertyIds.CREATION_DATE));
+
+            prop = object.getProperty(PropertyIds.LAST_MODIFIED_BY);
+            addResult(results, checkProperty(prop, "Property " + PropertyIds.LAST_MODIFIED_BY));
+
+            prop = object.getProperty(PropertyIds.LAST_MODIFICATION_DATE);
+            addResult(results, checkProperty(prop, "Property " + PropertyIds.LAST_MODIFICATION_DATE));
+
+            // allowable actions
+            f = createResult(FAILURE, "Object has no CAN_GET_PROPERTIES allowable action!");
+            addResult(results, assertNotAllowableAction(object, Action.CAN_GET_PROPERTIES, null, f));
+        }
+
+        CmisTestResultImpl result = createResult(getWorst(results), message);
+        result.getChildren().addAll(results);
+
+        return (result.getStatus().getLevel() <= OK.getLevel() ? null : result);
+    }
+
+    protected CmisTestResult assertAllowableAction(CmisObject object, Action action, CmisTestResult success,
+            CmisTestResult failure) {
+        if ((object.getAllowableActions() != null) && (object.getAllowableActions().getAllowableActions() != null)) {
+            if (object.getAllowableActions().getAllowableActions().contains(action)) {
+                return success;
+            }
+        }
+
+        return failure;
+    }
+
+    protected CmisTestResult assertNotAllowableAction(CmisObject object, Action action, CmisTestResult success,
+            CmisTestResult failure) {
+        if ((object.getAllowableActions() != null) && (object.getAllowableActions().getAllowableActions() != null)) {
+            if (!object.getAllowableActions().getAllowableActions().contains(action)) {
+                return success;
+            }
+        }
+
+        return failure;
+    }
+
+    protected CmisTestResult checkProperty(Property<?> property, String message) {
+        List<CmisTestResult> results = new ArrayList<CmisTestResult>();
+
+        CmisTestResult f;
+
+        f = createResult(FAILURE, "Property is null!");
+        addResult(results, assertNotNull(property, null, f));
+
+        if (property != null) {
+            f = createResult(FAILURE, "Property id is not set or empty!");
+            addResult(results, assertStringNotEmpty(property.getId(), null, f));
+
+            f = createResult(WARNING, "Display name is not set!");
+            addResult(results, assertNotNull(property.getDisplayName(), null, f));
+
+            f = createResult(WARNING, "Query name is not set!");
+            addResult(results, assertNotNull(property.getQueryName(), null, f));
+
+            f = createResult(WARNING, "Local name is not set!");
+            addResult(results, assertNotNull(property.getLocalName(), null, f));
+        }
+
+        CmisTestResultImpl result = createResult(getWorst(results), message);
+        result.getChildren().addAll(results);
+
+        return (result.getStatus().getLevel() <= OK.getLevel() ? null : result);
+    }
+
+    protected CmisTestResult checkChildren(Folder folder, String message) {
+        List<CmisTestResult> results = new ArrayList<CmisTestResult>();
+
+        CmisTestResult f;
+
+        f = createResult(FAILURE, "Folder is null!");
+        addResult(results, assertNotNull(folder, null, f));
+
+        if (folder != null) {
+            for (CmisObject child : folder.getChildren()) {
+                addResult(results, checkObject(folder, "Child check: " + (child == null ? "?" : child.getId())));
+
+                if (child != null) {
+                    f = createResult(FAILURE, "Child is not fileable! Id: " + child.getId() + " / Type: "
+                            + child.getType().getId());
+                    addResult(results, assertIsTrue(child instanceof FileableCmisObject, null, f));
+
+                    if (child instanceof FileableCmisObject) {
+                        FileableCmisObject fileableChild = (FileableCmisObject) child;
+                        List<Folder> parents = fileableChild.getParents();
+
+                        f = createResult(FAILURE, "Child has no parents! Id: " + child.getId());
+                        addResult(results, assertIsTrue(parents.size() > 0, null, f));
+
+                        boolean foundParent = false;
+                        for (Folder parent : parents) {
+                            if (parent == null) {
+                                f = createResult(FAILURE, "One of childs parents is null! Id: " + child.getId());
+                                addResult(results, assertIsTrue(parents.size() > 0, null, f));
+                            }
+
+                            if (folder.getId().equals(parent.getId())) {
+                                foundParent = true;
+                                break;
+                            }
+                        }
+
+                        if (!foundParent) {
+                            f = createResult(FAILURE, "Folder is not found in childs parents! Id: " + child.getId());
+                            addResult(results, assertIsTrue(parents.size() > 0, null, f));
+                        }
+                    }
+
+                    f = createResult(FAILURE,
+                            "Child has no CAN_GET_FOLDER_PARENT allowable action! Id: " + child.getId());
+                    addResult(results, assertAllowableAction(folder, Action.CAN_GET_FOLDER_PARENT, null, f));
+                }
+            }
+        }
+
+        CmisTestResultImpl result = createResult(getWorst(results), message);
+        result.getChildren().addAll(results);
+
+        return (result.getStatus().getLevel() <= OK.getLevel() ? null : result);
+    }
+
+    protected CmisTestResult checkTypeDefinition(TypeDefinition type, String message) {
+        List<CmisTestResult> results = new ArrayList<CmisTestResult>();
+
+        CmisTestResult f;
+
+        f = createResult(FAILURE, "Type is null!");
+        addResult(results, assertNotNull(type, null, f));
+
+        if (type != null) {
+            f = createResult(FAILURE, "Type id is not set!");
+            addResult(results, assertStringNotEmpty(type.getId(), null, f));
+
+            f = createResult(FAILURE, "Base type id is not set!");
+            addResult(results, assertNotNull(type.getBaseTypeId(), null, f));
+
+            f = createResult(FAILURE, "Local name is not set!");
+            addResult(results, assertStringNotEmpty(type.getLocalName(), null, f));
+
+            f = createResult(FAILURE, "Local namespace is not set!");
+            addResult(results, assertStringNotEmpty(type.getLocalNamespace(), null, f));
+
+            f = createResult(FAILURE, "Query name is not set!");
+            addResult(results, assertStringNotEmpty(type.getQueryName(), null, f));
+
+            if ((type.getId() != null) && (type.getBaseTypeId() != null)) {
+                if (type.getBaseTypeId().value().equals(type.getId())) {
+                    f = createResult(FAILURE, "Base type has parent type!");
+                    addResult(results, assertNull(type.getParentTypeId(), null, f));
+                } else {
+                    f = createResult(FAILURE, "Parent type is not set!");
+                    addResult(results, assertStringNotEmpty(type.getParentTypeId(), null, f));
+                }
+            }
+
+            f = createResult(FAILURE, "Creatable flag is not set!");
+            addResult(results, assertNotNull(type.isCreatable(), null, f));
+
+            f = createResult(FAILURE, "Fileable flag is not set!");
+            addResult(results, assertNotNull(type.isFileable(), null, f));
+
+            f = createResult(FAILURE, "Controllable ACL flag is not set!");
+            addResult(results, assertNotNull(type.isControllableAcl(), null, f));
+
+            f = createResult(FAILURE, "Controllable Policy flag is not set!");
+            addResult(results, assertNotNull(type.isControllablePolicy(), null, f));
+
+            f = createResult(FAILURE, "Fulltext indexed flag is not set!");
+            addResult(results, assertNotNull(type.isFulltextIndexed(), null, f));
+
+            f = createResult(FAILURE, "Included in super type flag is not set!");
+            addResult(results, assertNotNull(type.isIncludedInSupertypeQuery(), null, f));
+
+            f = createResult(FAILURE, "Queryable flag is not set!");
+            addResult(results, assertNotNull(type.isQueryable(), null, f));
+
+            f = createResult(WARNING, "Type display name is not set!");
+            addResult(results, assertStringNotEmpty(type.getDisplayName(), null, f));
+
+            f = createResult(WARNING, "Type description is not set!");
+            addResult(results, assertStringNotEmpty(type.getDescription(), null, f));
+
+            if (BaseTypeId.CMIS_DOCUMENT.equals(type.getBaseTypeId())) {
+                // TODO
+            } else if (BaseTypeId.CMIS_FOLDER.equals(type.getBaseTypeId())) {
+                // TODO
+            } else if (BaseTypeId.CMIS_RELATIONSHIP.equals(type.getBaseTypeId())) {
+                // TODO
+            } else if (BaseTypeId.CMIS_POLICY.equals(type.getBaseTypeId())) {
+                // TODO
+            }
+
+            // TODO check base property definitions
+
+            f = createResult(FAILURE, "Type has no property definitions!");
+            addResult(results, assertNotNull(type.getPropertyDefinitions(), null, f));
+
+            if (type.getPropertyDefinitions() != null) {
+                for (PropertyDefinition<?> propDef : type.getPropertyDefinitions().values()) {
+                    if (propDef == null) {
+                        addResult(results, createResult(FAILURE, "A property definition is null!"));
+                    } else if (propDef.getId() == null) {
+                        addResult(results, createResult(FAILURE, "A property definition id is null!"));
+                    } else {
+                        addResult(results, checkPropertyDefinition(propDef, "Property definition: " + propDef.getId()));
+                    }
+                }
+            }
+        }
+
+        CmisTestResultImpl result = createResult(getWorst(results), message);
+        result.getChildren().addAll(results);
+
+        return (result.getStatus().getLevel() <= OK.getLevel() ? null : result);
+    }
+
+    protected CmisTestResult checkPropertyDefinition(PropertyDefinition<?> propDef, String message) {
+        List<CmisTestResult> results = new ArrayList<CmisTestResult>();
+
+        CmisTestResult f;
+
+        f = createResult(FAILURE, "Property definition is null!");
+        addResult(results, assertNotNull(propDef, null, f));
+
+        if (propDef != null) {
+            // TODO
+        }
+
+        CmisTestResultImpl result = createResult(getWorst(results), message);
+        result.getChildren().addAll(results);
+
+        return (result.getStatus().getLevel() <= OK.getLevel() ? null : result);
+    }
+
+    private void addResult(List<CmisTestResult> results, CmisTestResult result) {
+        if (result != null) {
+            if (result instanceof CmisTestResultImpl) {
+                ((CmisTestResultImpl) result).setStackTrace(getStackTrace());
+            }
+
+            results.add(result);
+            if (result.isFatal()) {
+                throw new FatalTestException();
+            }
+        }
+    }
+
+    private CmisTestResultStatus getWorst(List<CmisTestResult> results) {
+        if ((results == null) || (results.isEmpty())) {
+            return CmisTestResultStatus.OK;
+        }
+
+        int max = 0;
+
+        for (CmisTestResult result : results) {
+            if (max < result.getStatus().getLevel()) {
+                max = result.getStatus().getLevel();
+            }
+        }
+
+        return CmisTestResultStatus.fromLevel(max);
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTestGroup.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTestGroup.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTestGroup.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTestGroup.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.impl;
+
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+
+/**
+ * Base class for test groups that require an OpenCMIS session.
+ */
+public abstract class AbstractSessionTestGroup extends AbstractCmisTestGroup {
+    
+    private BindingType getBinding() {
+        if (getParameters() == null) {
+            return null;
+        }
+
+        try {
+            return BindingType.fromValue(getParameters().get(SessionParameter.BINDING_TYPE));
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    @Override
+    public String getName() {
+        return super.getName() + " (" + getBinding() + ")";
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/AbstractSessionTestGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/CmisTestResultImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/CmisTestResultImpl.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/CmisTestResultImpl.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/CmisTestResultImpl.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.tck.CmisTestResult;
+import org.apache.chemistry.opencmis.tck.CmisTestResultStatus;
+
+/**
+ * CmisTestResult implementation.
+ */
+public class CmisTestResultImpl implements CmisTestResult {
+    private String groupName;
+    private String testName;
+    private String message;
+    private CmisTestResultStatus status;
+    private Throwable exception;
+    private StackTraceElement[] stackTrace;
+    private String url;
+    private String request;
+    private String response;
+    private List<CmisTestResult> children = new ArrayList<CmisTestResult>();
+    private boolean isFatal;
+
+    public CmisTestResultImpl(String groupName, String testName, String message, CmisTestResultStatus status,
+            Throwable exception, boolean isFatal) {
+        this.groupName = groupName;
+        this.testName = testName;
+        this.message = message;
+        this.status = status;
+        this.exception = exception;
+        this.isFatal = isFatal;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public String getTestName() {
+        return testName;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public CmisTestResultStatus getStatus() {
+        return status;
+    }
+
+    public Throwable getException() {
+        return exception;
+    }
+
+    public StackTraceElement[] getStackTrace() {
+        return stackTrace;
+    }
+
+    public void setStackTrace(StackTraceElement[] stackTrace) {
+        this.stackTrace = stackTrace;
+    }
+
+    public String getRequest() {
+        return request;
+    }
+
+    public void setRequest(String request) {
+        this.request = request;
+    }
+
+    public String getResponse() {
+        return response;
+    }
+
+    public void setResponse(String response) {
+        this.response = response;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public List<CmisTestResult> getChildren() {
+        return children;
+    }
+
+    public boolean isFatal() {
+        return isFatal;
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/CmisTestResultImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/FatalTestException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/FatalTestException.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/FatalTestException.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/FatalTestException.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.impl;
+
+/**
+ * This exception will be thrown if a result is fatal and the test has to
+ * stopped.
+ */
+public class FatalTestException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    public FatalTestException() {
+        super();
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/FatalTestException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/WrapperCmisTestGroup.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/WrapperCmisTestGroup.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/WrapperCmisTestGroup.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/WrapperCmisTestGroup.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.impl;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.tck.CmisTest;
+
+/**
+ * Helper group implementation that just hold one test.
+ */
+public class WrapperCmisTestGroup extends AbstractCmisTestGroup {
+    private CmisTest test;
+
+    public WrapperCmisTestGroup(CmisTest test) throws Exception {
+        if (test == null) {
+            throw new IllegalArgumentException("Test is null!");
+        }
+
+        this.test = test;
+    }
+
+    @Override
+    public void init(Map<String, String> parameters) throws Exception {
+        super.init(parameters);
+
+        setName("Wrapper Group: " + test.getName());
+        addTest(test);
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/impl/WrapperCmisTestGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/AbstractCmisTestReport.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/AbstractCmisTestReport.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/AbstractCmisTestReport.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/AbstractCmisTestReport.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.report;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.Writer;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.tck.CmisTestGroup;
+import org.apache.chemistry.opencmis.tck.CmisTestReport;
+
+/**
+ * Base class for reports.
+ */
+public abstract class AbstractCmisTestReport implements CmisTestReport {
+
+    public abstract void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer)
+            throws Exception;
+
+    public void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, File file) throws Exception {
+        createReport(parameters, groups, new FileWriter(file));
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/AbstractCmisTestReport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/HtmlReport.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/HtmlReport.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/HtmlReport.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/HtmlReport.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.report;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.chemistry.opencmis.tck.CmisTest;
+import org.apache.chemistry.opencmis.tck.CmisTestGroup;
+import org.apache.chemistry.opencmis.tck.CmisTestResult;
+
+/**
+ * HTML Report.
+ */
+public class HtmlReport extends AbstractCmisTestReport {
+    public HtmlReport() {
+    }
+
+    @Override
+    public void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer)
+            throws IOException {
+        writer.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n");
+        writer.write("<html><head><title>Report</title></head><body>\n");
+
+        writer.write("\n<h1>Report</h1>\n");
+
+        writer.write("\n<h2>Parameters</h2>\n");
+
+        if (parameters != null) {
+            writer.write("<table>\n");
+            for (Map.Entry<String, String> p : (new TreeMap<String, String>(parameters)).entrySet()) {
+                writer.write("<tr><td>" + p.getKey() + "</td><td>" + p.getValue() + "</td></tr>\n");
+            }
+            writer.write("</table>\n");
+        }
+
+        writer.write("\n<h2>Groups</h2>\n");
+
+        if (groups != null) {
+            for (CmisTestGroup group : groups) {
+                printGroupResults(group, writer);
+            }
+        }
+
+        writer.write("\n</body></html>\n");
+
+        writer.flush();
+    }
+
+    private void printGroupResults(CmisTestGroup group, Writer writer) throws IOException {
+        writer.write("\n<h3>" + group.getName() + "</h3>\n");
+
+        if (group.getTests() != null) {
+            for (CmisTest test : group.getTests()) {
+                printTestResults(test, writer);
+            }
+        }
+    }
+
+    private void printTestResults(CmisTest test, Writer writer) throws IOException {
+        writer.write("\n<h4>" + test.getName() + " (" + test.getTime() + " ms)</h4>\n");
+
+        if (test.getResults() != null) {
+            for (CmisTestResult result : test.getResults()) {
+                printResult(result, writer);
+            }
+        }
+    }
+
+    private void printResult(CmisTestResult result, Writer writer) throws IOException {
+        writer.write("<div style=\"padding:5px\">\n");
+
+        writer.write("<b>" + result.getStatus() + "</b>: " + result.getMessage());
+
+        if ((result.getStackTrace() != null) && (result.getStackTrace().length > 0)) {
+            writer.write(" (" + result.getStackTrace()[0].getFileName() + ":"
+                    + result.getStackTrace()[0].getLineNumber() + ")");
+        }
+
+        writer.write("<br/>\n");
+
+        for (CmisTestResult child : result.getChildren()) {
+            printResult(child, writer);
+        }
+
+        writer.write("</div>\n");
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/HtmlReport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java?rev=1028010&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java Wed Oct 27 15:43:24 2010
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.chemistry.opencmis.tck.report;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.chemistry.opencmis.tck.CmisTest;
+import org.apache.chemistry.opencmis.tck.CmisTestGroup;
+import org.apache.chemistry.opencmis.tck.CmisTestResult;
+
+/**
+ * Text Report.
+ */
+public class TextReport extends AbstractCmisTestReport {
+    public TextReport() {
+    }
+
+    @Override
+    public void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer)
+            throws IOException {
+        writer.write("***************************************************************\n");
+        writer.write("Test Report: " + (new Date()) + "\n");
+
+        writer.write("***************************************************************\n");
+        if (parameters != null) {
+            for (Map.Entry<String, String> p : (new TreeMap<String, String>(parameters)).entrySet()) {
+                writer.write(p.getKey() + " = " + p.getValue() + "\n");
+            }
+        }
+        writer.write("***************************************************************\n");
+
+        if (groups != null) {
+            for (CmisTestGroup group : groups) {
+                printGroupResults(group, writer);
+            }
+        }
+
+        writer.flush();
+    }
+
+    private void printGroupResults(CmisTestGroup group, Writer writer) throws IOException {
+        writer.write("===============================================================\n");
+        writer.write(group.getName() + "\n");
+        writer.write("===============================================================\n");
+
+        if (group.getTests() != null) {
+            for (CmisTest test : group.getTests()) {
+                printTestResults(test, writer);
+            }
+        }
+    }
+
+    private void printTestResults(CmisTest test, Writer writer) throws IOException {
+        writer.write("---------------------------------------------------------------\n");
+        writer.write(test.getName() + " (" + test.getTime() + " ms)\n");
+        writer.write("---------------------------------------------------------------\n\n");
+
+        if (test.getResults() != null) {
+            for (CmisTestResult result : test.getResults()) {
+                printResult(1, result, writer);
+                writer.write("\n");
+            }
+        }
+
+        writer.write("\n");
+    }
+
+    private void printResult(int level, CmisTestResult result, Writer writer) throws IOException {
+        printIntend(level, writer);
+        writer.write(result.getStatus() + ": " + result.getMessage());
+
+        if ((result.getStackTrace() != null) && (result.getStackTrace().length > 0)) {
+            writer.write(" (" + result.getStackTrace()[0].getFileName() + ":"
+                    + result.getStackTrace()[0].getLineNumber() + ")");
+        }
+
+        writer.write("\n");
+
+        if (result.getException() != null) {
+            printIntend(level, writer);
+            writer.write("Exception: " + result.getException().getMessage() + "\n");
+        }
+
+        if (result.getRequest() != null) {
+            printIntend(level, writer);
+            writer.write("Request: " + result.getRequest() + "\n");
+        }
+
+        if (result.getRequest() != null) {
+            printIntend(level, writer);
+            writer.write("Response: " + result.getRequest() + "\n");
+        }
+
+        for (CmisTestResult child : result.getChildren()) {
+            printResult(level + 1, child, writer);
+        }
+    }
+
+    private void printIntend(int x, Writer writer) throws IOException {
+        for (int i = 0; i < x; i++) {
+            writer.write("  ");
+        }
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/report/TextReport.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message