You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2010/11/08 16:35:32 UTC

svn commit: r1032602 - in /incubator/chemistry/cmislib/trunk/src/tests: cmislibtest.py settings.py

Author: fguillaume
Date: Mon Nov  8 15:35:32 2010
New Revision: 1032602

URL: http://svn.apache.org/viewvc?rev=1032602&view=rev
Log:
Fix test suite to not confuse name and path segment

Modified:
    incubator/chemistry/cmislib/trunk/src/tests/cmislibtest.py
    incubator/chemistry/cmislib/trunk/src/tests/settings.py

Modified: incubator/chemistry/cmislib/trunk/src/tests/cmislibtest.py
URL: http://svn.apache.org/viewvc/incubator/chemistry/cmislib/trunk/src/tests/cmislibtest.py?rev=1032602&r1=1032601&r2=1032602&view=diff
==============================================================================
--- incubator/chemistry/cmislib/trunk/src/tests/cmislibtest.py (original)
+++ incubator/chemistry/cmislib/trunk/src/tests/cmislibtest.py Mon Nov  8 15:35:32 2010
@@ -302,16 +302,19 @@ class RepositoryTest(CmisTestBase):
         # create the folder structure
         parentFolder = self._testFolder.createFolder(parentFolderName)
         subFolder = parentFolder.createFolder(subFolderName)
-        searchFolder = self._repo.getObjectByPath("/".join([TEST_ROOT_PATH, testFolderName, parentFolderName, subFolderName]))
+        # name and path segment are not the same thing
+        subFolderPath = subFolder.getProperties().get("cmis:path")
+        searchFolder = self._repo.getObjectByPath(subFolderPath)
         self.assertEquals(subFolder.getObjectId(), searchFolder.getObjectId())
 
         # create a test doc
         doc = subFolder.createDocument(docName)
-        searchDoc = self._repo.getObjectByPath("/".join([TEST_ROOT_PATH, testFolderName, parentFolderName, subFolderName, docName]))
+        searchDocPath = subFolderPath + '/' + docName # TODO use proper path segment
+        searchDoc = self._repo.getObjectByPath(searchDocPath)
         self.assertEquals(doc.getObjectId(), searchDoc.getObjectId())
 
         # get the subfolder by path, then ask for its children
-        subFolder = self._repo.getObjectByPath("/".join([TEST_ROOT_PATH, testFolderName, parentFolderName, subFolderName]))
+        subFolder = self._repo.getObjectByPath(subFolderPath)
         self.assertEquals(len(subFolder.getChildren().getResults()), 1)
 
     def testGetUnfiledDocs(self):
@@ -1227,6 +1230,10 @@ def isInResultSet(resultSet, targetDoc):
 if __name__ == "__main__":
     #unittest.main()
     tts = TestSuite()
+    #tts.addTests(TestLoader().loadTestsFromName('testGetObjectByPath', RepositoryTest))
+    #unittest.TextTestRunner().run(tts)
+    #import sys; sys.exit(0)
+
     tts.addTests(TestLoader().loadTestsFromTestCase(CmisClientTest))
     tts.addTests(TestLoader().loadTestsFromTestCase(RepositoryTest))
     tts.addTests(TestLoader().loadTestsFromTestCase(FolderTest))

Modified: incubator/chemistry/cmislib/trunk/src/tests/settings.py
URL: http://svn.apache.org/viewvc/incubator/chemistry/cmislib/trunk/src/tests/settings.py?rev=1032602&r1=1032601&r2=1032602&view=diff
==============================================================================
--- incubator/chemistry/cmislib/trunk/src/tests/settings.py (original)
+++ incubator/chemistry/cmislib/trunk/src/tests/settings.py Mon Nov  8 15:35:32 2010
@@ -20,7 +20,8 @@
 #REPOSITORY_URL = 'http://localhost:8080/cmis/repository' # Apache Chemistry
 #REPOSITORY_URL = 'http://cmis.dnsdojo.com:8080/p8cmis/resources/DaphneA/Service'
 REPOSITORY_URL = 'http://localhost:8080/alfresco/s/api/cmis'  # Alfresco
-#REPOSITORY_URL = 'http://cmis.demo.nuxeo.org/nuxeo/site/cmis/repository'
+#REPOSITORY_URL = 'http://cmis.demo.nuxeo.org/nuxeo/atom/cmis' # Nuxeo demo
+#REPOSITORY_URL = 'http://localhost:8080/nuxeo/atom/cmis' # Nuxeo local
 #REPOSITORY_URL = 'http://localhost:8080/opencmis/atom'  # OpenCMIS from the OpenText guys
 #REPOSITORY_URL = 'http://ec2-174-129-218-67.compute-1.amazonaws.com/cmis/atom' #OpenText on Amazon
 #REPOSITORY_URL = 'http://localhost:8080/chemistry/atom'  # Apache Chemistry OpenCMIS