You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by vg...@apache.org on 2003/12/24 16:23:53 UTC

cvs commit: xml-xindice/java/tests/src/org/apache/xindice/integration/client/basic CollectionTest.java DocumentTest.java

vgritsenko    2003/12/24 07:23:53

  Modified:    java/tests/src/org/apache/xindice/integration/client/basic
                        CollectionTest.java DocumentTest.java
  Log:
  Add one more test
  
  Revision  Changes    Path
  1.14      +12 -2     xml-xindice/java/tests/src/org/apache/xindice/integration/client/basic/CollectionTest.java
  
  Index: CollectionTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/tests/src/org/apache/xindice/integration/client/basic/CollectionTest.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CollectionTest.java	12 Dec 2003 01:28:38 -0000	1.13
  +++ CollectionTest.java	24 Dec 2003 15:23:53 -0000	1.14
  @@ -153,6 +153,16 @@
           fail();
       }
   
  +    public void testCreateCollectionInvalidName() throws Exception {
  +        try {
  +            this.client.createCollection(TEST_COLLECTION_PATH, "my/collection");
  +        } catch (XMLDBException e) {
  +            // TODO assertTrue(e.vendorErrorCode == FaultCodes.COL_CANNOT_CREATE);
  +            return;
  +        }
  +        fail();
  +    }
  +
       public void testDropCollectionTwice() throws Exception {
           this.client.createCollection(TEST_COLLECTION_PATH, "droptwice");
   
  
  
  
  1.8       +13 -24    xml-xindice/java/tests/src/org/apache/xindice/integration/client/basic/DocumentTest.java
  
  Index: DocumentTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/tests/src/org/apache/xindice/integration/client/basic/DocumentTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DocumentTest.java	7 Aug 2003 20:13:26 -0000	1.7
  +++ DocumentTest.java	24 Dec 2003 15:23:53 -0000	1.8
  @@ -81,11 +81,9 @@
    * @version CVS $Revision$, $Date$
    * @author Vladimir R. Bossicard <vl...@apache.org>
    */
  -public class DocumentTest
  -      extends AbstractXmlDbClientTest {
  +public class DocumentTest extends AbstractXmlDbClientTest {
   
  -   public void testInsertDocument()
  -         throws Exception {
  +   public void testInsertDocument() throws Exception {
         this.client.insertDocument(TEST_COLLECTION_PATH, "testdoc", "<test>test data</test>");
         assertEquals(1, this.client.countDocument(TEST_COLLECTION_PATH));
   
  @@ -93,8 +91,7 @@
         assertEquals(0, this.client.countDocument(TEST_COLLECTION_PATH));
      }
   
  -   public void testRemoveDocumentInvalidName()
  -         throws Exception {
  +   public void testRemoveDocumentInvalidName() throws Exception {
         try {
            this.client.removeDocument(TEST_COLLECTION_PATH, "invalidname");
         } catch (XMLDBException e) {
  @@ -103,8 +100,7 @@
         }
      }
   
  -   public void testRemoveDocumentEmptyName()
  -         throws Exception {
  +   public void testRemoveDocumentEmptyName() throws Exception {
         try {
            this.client.removeDocument(TEST_COLLECTION_PATH, "");
         } catch (XMLDBException e) {
  @@ -113,8 +109,7 @@
         }
      }
   
  -   public void testRemoveDocumentNullName()
  -         throws Exception {
  +   public void testRemoveDocumentNullName() throws Exception {
         try {
            this.client.removeDocument(TEST_COLLECTION_PATH, null);
         } catch (XMLDBException e) {
  @@ -123,8 +118,7 @@
         }
      }
   
  -   public void testGetDocument()
  -         throws Exception {
  +   public void testGetDocument() throws Exception {
         String testDocument = "<?xml version=\"1.0\"?>\n<data><test>test data</test></data>";
         this.client.insertDocument(TEST_COLLECTION_PATH, "doc1", testDocument);
   
  @@ -151,26 +145,22 @@
   		this.client.removeDocument(TEST_COLLECTION_PATH, "doc1");
   	}	
   	
  -   public void testGetInexistantDocument()
  -         throws Exception {
  +   public void testGetInexistantDocument() throws Exception {
         String doc = this.client.getDocument(TEST_COLLECTION_PATH, "ghostdoc");
         assertNull(doc);
      }
   
  -   public void testGetDocumentEmptyName()
  -         throws Exception {
  +   public void testGetDocumentEmptyName() throws Exception {
         String doc = this.client.getDocument(TEST_COLLECTION_PATH, "");
         assertNull(doc);
      }
   
  -   public void testGetDocumentNullName()
  -         throws Exception {
  +   public void testGetDocumentNullName() throws Exception {
         String doc = this.client.getDocument(TEST_COLLECTION_PATH, null);
         assertNull(doc);
      }
   
  -   public void testListDocuments()
  -         throws Exception {
  +   public void testListDocuments() throws Exception {
         String[] documents = this.client.listDocuments(TEST_COLLECTION_PATH);
         assertEquals(0, this.client.listDocuments(TEST_COLLECTION_PATH).length);
   
  @@ -195,8 +185,7 @@
         assertEquals(0, documents.length);
      }
   
  -   public void testGetDocumentCount()
  -         throws Exception {
  +   public void testGetDocumentCount() throws Exception {
         assertEquals(0, this.client.countDocument(TEST_COLLECTION_PATH));
   
         this.client.insertDocument(TEST_COLLECTION_PATH, "doc1", "<data>\n<test>\ntest data</test>\n</data>");