chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1236625 - in /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit: ./ src/test/java/org/apache/chemistry/opencmis/fit/ src/test/java/org/apache/chemistry/opencmis/fit/bindings/ src/test/java/org/apache/chemistry/op...
Date Fri, 27 Jan 2012 10:26:32 GMT
Author: fmui
Date: Fri Jan 27 10:26:32 2012
New Revision: 1236625

URL: http://svn.apache.org/viewvc?rev=1236625&view=rev
Log:
replaced FIT tests with TCK

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AbstractTckIT.java
  (with props)
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AtomPubTckIT.java
  (with props)
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/BrowserTckIT.java
  (with props)
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServicesTckIT.java
  (with props)
Removed:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/SessionFactory.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/bindings/
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/runtime/
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/sample/
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml?rev=1236625&r1=1236624&r2=1236625&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/pom.xml Fri
Jan 27 10:26:32 2012
@@ -59,7 +59,7 @@
 					<encoding>UTF-8</encoding>
 					<forkMode>once</forkMode>
 					<forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
-					<argLine>-Xmx128m</argLine>
+					<argLine>-Xmx256m</argLine>
 				</configuration>
 				<executions>
 					<execution>
@@ -121,22 +121,7 @@
 	<dependencies>
 		<dependency>
 			<groupId>${project.groupId}</groupId>
-			<artifactId>chemistry-opencmis-commons-api</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>${project.groupId}</groupId>
-			<artifactId>chemistry-opencmis-client-api</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>${project.groupId}</groupId>
-			<artifactId>chemistry-opencmis-client-impl</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>${project.groupId}</groupId>
-			<artifactId>chemistry-opencmis-client-bindings</artifactId>
+			<artifactId>chemistry-opencmis-test-tck</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 		<dependency>

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AbstractTckIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AbstractTckIT.java?rev=1236625&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AbstractTckIT.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AbstractTckIT.java
Fri Jan 27 10:26:32 2012
@@ -0,0 +1,132 @@
+/*
+ * 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.fit.tck;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+import org.apache.chemistry.opencmis.tck.CmisTest;
+import org.apache.chemistry.opencmis.tck.CmisTestGroup;
+import org.apache.chemistry.opencmis.tck.CmisTestProgressMonitor;
+import org.apache.chemistry.opencmis.tck.CmisTestReport;
+import org.apache.chemistry.opencmis.tck.CmisTestResult;
+import org.apache.chemistry.opencmis.tck.CmisTestResultStatus;
+import org.apache.chemistry.opencmis.tck.impl.TestParameters;
+import org.apache.chemistry.opencmis.tck.report.TextReport;
+import org.apache.chemistry.opencmis.tck.runner.AbstractRunner;
+import org.junit.Test;
+
+public abstract class AbstractTckIT extends AbstractRunner {
+    public static final String HOST = "localhost";
+    public static final int PORT = 19080;
+
+    public static final String REPOSITORY_ID = "test";
+    public static final String USER = "test";
+    public static final String PASSWORD = "test";
+
+    public abstract Map<String, String> getSessionParameters();
+
+    public abstract BindingType getBindingType();
+
+    public Map<String, String> getBaseSessionParameters() {
+        Map<String, String> parameters = new HashMap<String, String>();
+
+        parameters.put(SessionParameter.REPOSITORY_ID, REPOSITORY_ID);
+        parameters.put(SessionParameter.USER, USER);
+        parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+        parameters.put(TestParameters.DEFAULT_DOCUMENT_TYPE, "VersionableType");
+        parameters.put(TestParameters.DEFAULT_FOLDER_TYPE, "cmis:folder");
+
+        return parameters;
+    }
+
+    @Test
+    public void runTck() throws Exception {
+        // set up TCK and run it
+        setParameters(getSessionParameters());
+        loadDefaultTckGroups();
+
+        run(new TestProgressMonitor());
+
+        // write report
+        File target = new File("target");
+        target.mkdir();
+
+        CmisTestReport report = new TextReport();
+        report.createReport(getParameters(), getGroups(), new File(target, "tck-result-"
+ getBindingType().value()
+                + ".txt"));
+
+        // find failures
+        for (CmisTestGroup group : getGroups()) {
+            for (CmisTest test : group.getTests()) {
+                for (CmisTestResult result : test.getResults()) {
+                    assertTrue(result.getStatus() != CmisTestResultStatus.FAILURE);
+                    assertTrue(result.getStatus() != CmisTestResultStatus.UNEXPECTED_EXCEPTION);
+                }
+            }
+        }
+    }
+
+    public static 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);
+    }
+
+    private static class TestProgressMonitor implements CmisTestProgressMonitor {
+        public void startGroup(CmisTestGroup group) {
+            System.out.println();
+            System.out.println(group.getName() + " (" + group.getTests().size() + " tests)");
+        }
+
+        public void endGroup(CmisTestGroup group) {
+            System.out.println();
+        }
+
+        public void startTest(CmisTest test) {
+            System.out.print("  " + test.getName());
+        }
+
+        public void endTest(CmisTest test) {
+            System.out.print(" (" + test.getTime() + "ms): ");
+            System.out.println(getWorst(test.getResults()));
+        }
+
+        public void message(String msg) {
+            System.out.println(msg);
+        }
+    }
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AbstractTckIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AtomPubTckIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AtomPubTckIT.java?rev=1236625&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AtomPubTckIT.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AtomPubTckIT.java
Fri Jan 27 10:26:32 2012
@@ -0,0 +1,47 @@
+/*
+ * 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.fit.tck;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+
+public class AtomPubTckIT extends AbstractTckIT {
+
+    public static final String ATOMPUB_PATH = "/opencmis/atom";
+
+    @Override
+    public Map<String, String> getSessionParameters() {
+        Map<String, String> parameters = getBaseSessionParameters();
+
+        String url = "http://" + HOST + ":" + PORT + ATOMPUB_PATH;
+
+        parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
+        parameters.put(SessionParameter.ATOMPUB_URL, url);
+
+        return parameters;
+    }
+
+    @Override
+    public BindingType getBindingType() {
+        return BindingType.ATOMPUB;
+    }
+
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/AtomPubTckIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/BrowserTckIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/BrowserTckIT.java?rev=1236625&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/BrowserTckIT.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/BrowserTckIT.java
Fri Jan 27 10:26:32 2012
@@ -0,0 +1,47 @@
+/*
+ * 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.fit.tck;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+
+public class BrowserTckIT extends AbstractTckIT {
+
+    public static final String BROWSER_PATH = "/opencmis/browser";
+
+    @Override
+    public Map<String, String> getSessionParameters() {
+        Map<String, String> parameters = getBaseSessionParameters();
+
+        String url = "http://" + HOST + ":" + PORT + BROWSER_PATH;
+
+        parameters.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());
+        parameters.put(SessionParameter.BROWSER_URL, url);
+
+        return parameters;
+    }
+
+    @Override
+    public BindingType getBindingType() {
+        return BindingType.BROWSER;
+    }
+
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/BrowserTckIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServicesTckIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServicesTckIT.java?rev=1236625&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServicesTckIT.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServicesTckIT.java
Fri Jan 27 10:26:32 2012
@@ -0,0 +1,54 @@
+/*
+ * 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.fit.tck;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+
+public class WebServicesTckIT extends AbstractTckIT {
+
+    public static final String WEBSERVICES_PATH = "/opencmis/services/";
+
+    @Override
+    public Map<String, String> getSessionParameters() {
+        Map<String, String> parameters = getBaseSessionParameters();
+
+        String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
+
+        parameters.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
+        parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
+        parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
+
+        return parameters;
+    }
+
+    @Override
+    public BindingType getBindingType() {
+        return BindingType.WEBSERVICES;
+    }
+}

Propchange: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServicesTckIT.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message