chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r915924 - in /incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit: SessionFactory.java sample/AbstractSampleIT.java
Date Wed, 24 Feb 2010 18:51:24 GMT
Author: fmui
Date: Wed Feb 24 18:51:24 2010
New Revision: 915924

URL: http://svn.apache.org/viewvc?rev=915924&view=rev
Log:
- activated client API integration tests

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/SessionFactory.java
    incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/sample/AbstractSampleIT.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/SessionFactory.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/SessionFactory.java?rev=915924&r1=915923&r2=915924&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/SessionFactory.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/SessionFactory.java
Wed Feb 24 18:51:24 2010
@@ -23,7 +23,9 @@
 
 import org.apache.opencmis.client.api.Session;
 import org.apache.opencmis.client.provider.factory.CmisProviderFactory;
+import org.apache.opencmis.client.runtime.SessionFactoryImpl;
 import org.apache.opencmis.commons.SessionParameter;
+import org.apache.opencmis.commons.enums.BindingType;
 import org.apache.opencmis.commons.provider.CmisProvider;
 
 /**
@@ -66,12 +68,15 @@
 
     Map<String, String> parameters = new HashMap<String, String>();
 
+    parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
+
+    parameters.put(SessionParameter.ATOMPUB_URL, url);
+    parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
+
     parameters.put(SessionParameter.USER, USER);
     parameters.put(SessionParameter.PASSWORD, PASSWORD);
-    parameters.put(SessionParameter.ATOMPUB_URL, url);
 
-    // ToDo: creates session
-    return null;
+    return SessionFactoryImpl.newInstance().createSession(parameters);
   }
 
   /**
@@ -82,8 +87,8 @@
 
     Map<String, String> parameters = new HashMap<String, String>();
 
-    parameters.put(SessionParameter.USER, USER);
-    parameters.put(SessionParameter.PASSWORD, PASSWORD);
+    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");
@@ -96,8 +101,11 @@
     parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
     parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
 
-    // ToDo: create session
-    return null;
+    parameters.put(SessionParameter.REPOSITORY_ID, getRepositoryId());
+    parameters.put(SessionParameter.USER, USER);
+    parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
+    return SessionFactoryImpl.newInstance().createSession(parameters);
   }
 
   /**
@@ -110,6 +118,7 @@
 
     parameters.put(SessionParameter.USER, USER);
     parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
     parameters.put(SessionParameter.ATOMPUB_URL, url);
 
     return CmisProviderFactory.newInstance().createCmisAtomPubProvider(parameters);
@@ -125,6 +134,7 @@
 
     parameters.put(SessionParameter.USER, USER);
     parameters.put(SessionParameter.PASSWORD, PASSWORD);
+
     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");

Modified: incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/sample/AbstractSampleIT.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/sample/AbstractSampleIT.java?rev=915924&r1=915923&r2=915924&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/sample/AbstractSampleIT.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-fit/src/test/java/org/apache/opencmis/fit/sample/AbstractSampleIT.java
Wed Feb 24 18:51:24 2010
@@ -18,10 +18,11 @@
  */
 package org.apache.opencmis.fit.sample;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.*;
 
 import org.apache.opencmis.client.api.Session;
 import org.apache.opencmis.client.api.repository.RepositoryInfo;
+import org.apache.opencmis.fit.SessionFactory;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -65,7 +66,8 @@
    */
   @Test
   public void testRepositoryInfo() {
-    // RepositoryInfo ri = getSession().getRepositoryInfo();
-    // assertNotNull(ri);
+    RepositoryInfo ri = getSession().getRepositoryInfo();
+    assertNotNull(ri);
+    assertEquals(SessionFactory.getRepositoryId(), ri.getId());
   }
 }



Mime
View raw message