chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1531945 - /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/RepositoryInfoTest.java
Date Mon, 14 Oct 2013 15:45:24 GMT
Author: fmui
Date: Mon Oct 14 15:45:23 2013
New Revision: 1531945

URL: http://svn.apache.org/r1531945
Log:
TCK: added thin client test

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/RepositoryInfoTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/RepositoryInfoTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/RepositoryInfoTest.java?rev=1531945&r1=1531944&r2=1531945&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/RepositoryInfoTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/basics/RepositoryInfoTest.java
Mon Oct 14 15:45:23 2013
@@ -22,6 +22,8 @@ import static org.apache.chemistry.openc
 import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.OK;
 import static org.apache.chemistry.opencmis.tck.CmisTestResultStatus.WARNING;
 
+import java.net.HttpURLConnection;
+import java.net.URL;
 import java.util.Map;
 
 import org.apache.chemistry.opencmis.client.api.Session;
@@ -112,11 +114,29 @@ public class RepositoryInfoTest extends 
         failure = createResult(FAILURE, "Root folder id is not set!");
         addResult(assertStringNotEmpty(ri.getRootFolderId(), success, failure));
 
-        // thin client uri
+        // thin client URI
         success = createResult(OK, "Thin client URI: " + ri.getThinClientUri());
         failure = createResult(WARNING, "Thin client URI is not set!");
         addResult(assertStringNotEmpty(ri.getThinClientUri(), success, failure));
 
+        if (ri.getThinClientUri() != null && ri.getThinClientUri().length() >
0) {
+            try {
+                HttpURLConnection conn = (HttpURLConnection) (new URL(ri.getThinClientUri())).openConnection();
+
+                conn.connect();
+
+                int responseCode = conn.getResponseCode();
+                failure = createResult(WARNING, "Unable to connect to thin client '" + ri.getThinClientUri()
+                        + "'. HTTP status code: " + responseCode);
+                addResult(assertIsTrue(responseCode >= 200 && responseCode <
400, null, failure));
+
+                conn.disconnect();
+            } catch (Exception e) {
+                addResult(createResult(WARNING, "Unable to connect to thin client '" + ri.getThinClientUri()
+ "': "
+                        + e.getMessage(), e, false));
+            }
+        }
+
         // principal id anonymous
         success = createResult(OK, "Principal Id anonymous: " + ri.getPrincipalIdAnonymous());
         failure = createResult(WARNING, "Principal Id anonymous is not set!");



Mime
View raw message