You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by pn...@apache.org on 2003/06/03 11:05:39 UTC

cvs commit: jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav test.properties

pnever      2003/06/03 02:05:39

  Modified:    proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav
                        MultistatusResponseTest.java PropertiesTest.java
                        ReportRequestTest.java
               proposals/wvcm/test/junit/src/org/apache/webdav/methods
                        AbstractTest.java PropfindMethodTest.java
                        ProppatchMethodTest.java PutMethodTest.java
                        ReportMethodTest.java VersionControlMethodTest.java
               proposals/wvcm/test/junit/src/org/apache/wvcm
                        AbstractTest.java ControllableResourceTest.java
                        FolderTest.java LocationTest.java ProviderTest.java
                        ResourceTest.java SearchTest.java VersionTest.java
                        WorkspaceTest.java
               proposals/wvcm/test/junit/src/org/apache/webdav
                        test.properties
  Log:
  Bug fixing
  
  Revision  Changes    Path
  1.8       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/MultistatusResponseTest.java
  
  Index: MultistatusResponseTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/MultistatusResponseTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.5       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/PropertiesTest.java
  
  Index: PropertiesTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/PropertiesTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  
  
  
  1.8       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/ReportRequestTest.java
  
  Index: ReportRequestTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/store/webdav/ReportRequestTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.8       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/AbstractTest.java
  
  Index: AbstractTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/AbstractTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.8       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/PropfindMethodTest.java
  
  Index: PropfindMethodTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/PropfindMethodTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.5       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/ProppatchMethodTest.java
  
  Index: ProppatchMethodTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/ProppatchMethodTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  
  
  
  1.8       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/PutMethodTest.java
  
  Index: PutMethodTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/PutMethodTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.8       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/ReportMethodTest.java
  
  Index: ReportMethodTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/ReportMethodTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.8       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/VersionControlMethodTest.java
  
  Index: VersionControlMethodTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/methods/VersionControlMethodTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.8       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/AbstractTest.java
  
  Index: AbstractTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/AbstractTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.9       +59 -2     jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ControllableResourceTest.java
  
  Index: ControllableResourceTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ControllableResourceTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ControllableResourceTest.java	30 May 2003 17:22:44 -0000	1.8
  +++ ControllableResourceTest.java	3 Jun 2003 09:05:38 -0000	1.9
  @@ -170,13 +170,28 @@
           resource.doDelete();
           resource.doCreateResource();
           resource.doControl();
  -        PropertyNameList wantedprops =
  -            new PropertyNameList( new PropertyName[]{PropertyName.IS_CHECKED_OUT} );
  +        PropertyNameList wantedprops = new PropertyNameList(
  +            new PropertyName[]{
  +                PropertyName.IS_CHECKED_OUT,
  +                PropertyName.CHECKED_IN,
  +                PropertyName.CHECKED_OUT
  +            }
  +        );
           resource = (ControllableResource)resource.doReadProperties( wantedprops );
           assertFalse( resource.getIsCheckedOut() );
  +        try {
  +            System.out.println("Checked-Out: "+resource.getCheckedOut().location().string());
  +            assertTrue("Exception expected", false);
  +        } catch (WvcmException e) {}
  +        System.out.println("Checked-In: "+resource.getCheckedIn().location().string());
           resource.doCheckout();
           resource = (ControllableResource)resource.doReadProperties( wantedprops );
           assertTrue( resource.getIsCheckedOut() );
  +        System.out.println("Checked-Out: "+resource.getCheckedOut().location().string());
  +        try {
  +            System.out.println("Checked-In: "+resource.getCheckedIn().location().string());
  +            assertTrue("Exception expected", false);
  +        } catch (WvcmException e) {}
       }
       
       public void testDoCheckin() throws Exception {
  @@ -246,6 +261,48 @@
           resource = (ControllableResource)resource.doReadProperties( wantedprops );
           Version version = resource.getCheckedIn();
           System.out.println("Version: "+version.location().string());
  +    }
  +    
  +    public void testGetWorkspace() throws Exception {
  +        Location location = provider.location( resourcePath );
  +        ControllableResource resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        resource.doControl();
  +        PropertyNameList wantedprops = new PropertyNameList(
  +            new PropertyName[]{
  +                PropertyName.CHECKED_IN,
  +                PropertyName.WORKSPACE
  +            }
  +        );
  +        resource = (ControllableResource)resource.doReadProperties( wantedprops );
  +        Version version = resource.getCheckedIn();
  +        System.out.println("Version: "+version.location().string());
  +        // create workspace
  +        List wfl = provider.serverWorkspaceFolderList( null );
  +        assertNotNull( wfl );
  +        assertFalse( wfl.size() == 0 );
  +        String workspacePath = wfl.get(0)+"/ws1";
  +        location = provider.location( workspacePath );
  +        Workspace workspace = location.workspace();
  +        workspace.doDelete();
  +        workspace.doCreateResource();
  +        
  +        String resourceInWsPath = workspacePath+"/test.xml";
  +        location = provider.location( resourceInWsPath );
  +        ControllableResource resourceInWs = location.controllableResource();
  +        resourceInWs.doCreateVersionControlledResource( version );
  +        resourceInWs = (ControllableResource)resourceInWs.doReadProperties( wantedprops );
  +        System.out.println("Workspace: "+resourceInWs.getWorkspace().location().string());
  +        assertEquals(workspace.location().string(), resourceInWs.getWorkspace().location().string());
  +
  +        String resource2InWsPath = workspacePath+"/test2.xml";
  +        location = provider.location( resource2InWsPath );
  +        ControllableResource resource2InWs = location.controllableResource();
  +        resource2InWs.doCreateResource();
  +        resource2InWs = (ControllableResource)resource2InWs.doReadProperties( wantedprops );
  +        System.out.println("Workspace: "+resource2InWs.getWorkspace().location().string());
  +        assertEquals(workspace.location().string(), resource2InWs.getWorkspace().location().string());
       }
       
       public void testDoUncheckout() throws Exception {
  
  
  
  1.9       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/FolderTest.java
  
  Index: FolderTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/FolderTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  
  
  
  1.5       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/LocationTest.java
  
  Index: LocationTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/LocationTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  
  
  
  1.9       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ProviderTest.java
  
  Index: ProviderTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ProviderTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  
  
  
  1.11      +21 -9     jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ResourceTest.java
  
  Index: ResourceTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/ResourceTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ResourceTest.java	30 May 2003 17:22:44 -0000	1.10
  +++ ResourceTest.java	3 Jun 2003 09:05:38 -0000	1.11
  @@ -197,8 +197,19 @@
           System.out.println(resource.location().string());
           System.out.println("  - Content-Type: "+resource.getContentType());
           System.out.println("  - Content-Character-Set: "+resource.getContentCharacterSet());
  -        assertEquals("text/plain; charset=\"UTF-8\"", resource.getContentType());
  +        assertEquals("text/plain", resource.getContentType());
           assertEquals("UTF-8", resource.getContentCharacterSet());
  +
  +        resource.setContentType( "text/xml" );
  +        resource.setContentCharacterSet( null );
  +        resource.doWriteContent(
  +            getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), resource.getContentIdentifier() );
  +        out = new ByteArrayOutputStream();
  +        resource = (ControllableResource)resource.doReadContent( wantedprops, out );
  +        System.out.println(resource.location().string());
  +        System.out.println("  - Content-Type: "+resource.getContentType());
  +        System.out.println("  - Content-Character-Set: "+resource.getContentCharacterSet());
  +        assertEquals("text/xml", resource.getContentType());
       }
       
       public void testDoReadPropertiesWithNullList() throws Exception {
  @@ -489,11 +500,12 @@
           
           wantedprops = new PropertyNameList( new PropertyName[]{PropertyName.CONTENT_CHARACTER_SET} );
           
  +        ControllableResource r = (ControllableResource)resource.doReadProperties(wantedprops);
  +        System.out.println("\nContent-Character-Set: "+r.getContentCharacterSet());
  +
           ByteArrayOutputStream out = new ByteArrayOutputStream();
  -        Resource r = resource.doReadContent(wantedprops, out);
  -        assertTrue( "Expecting ControllableResource but got "+r, r instanceof ControllableResource );
  -        ControllableResource r2 = (ControllableResource)r;
  -        System.out.println("\ncontent-character-set: "+r2.getContentCharacterSet());
  +        r = (ControllableResource)resource.doReadContent(wantedprops, out);
  +        System.out.println("\nContent-Character-Set: "+r.getContentCharacterSet());
       }
       
       public void testDoWriteProperties() throws Exception {
  
  
  
  1.5       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/SearchTest.java
  
  Index: SearchTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/SearchTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  
  
  
  1.2       +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/VersionTest.java
  
  Index: VersionTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/VersionTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  
  
  
  1.10      +0 -0      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/WorkspaceTest.java
  
  Index: WorkspaceTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/WorkspaceTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  
  
  
  1.9       +1 -2      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/test.properties
  
  Index: test.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/test.properties,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- test.properties	30 May 2003 17:22:44 -0000	1.8
  +++ test.properties	3 Jun 2003 09:05:39 -0000	1.9
  @@ -3,5 +3,4 @@
   org.apache.webdav.test.username=root
   org.apache.webdav.test.password=root
   org.apache.webdav.test.context=slide
  -# org.apache.webdav.test.realm=Slide DAV Server
  -
  +org.apache.webdav.test.realm=Slide DAV Server
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org