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/05/30 19:22:45 UTC

cvs commit: jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/resources hello.txt test.xml

pnever      2003/05/30 10:22:45

  Modified:    proposals/wvcm/test/junit/src/org/apache/webdav
                        test.properties
               proposals/wvcm/test/junit/src/org/apache/wvcm
                        AbstractTest.java ControllableResourceTest.java
                        FolderTest.java LocationTest.java ProviderTest.java
                        ResourceTest.java SearchTest.java
                        WorkspaceTest.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/store/webdav
                        MultistatusResponseTest.java PropertiesTest.java
                        ReportRequestTest.java
               proposals/wvcm/test/junit/src/org/apache/webdav/resources
                        test.xml
  Added:       proposals/wvcm/test/junit/src/org/apache/wvcm
                        VersionTest.java
               proposals/wvcm/test/junit/src/org/apache/webdav/resources
                        hello.txt
  Log:
  Next bunch for WVCM. Includes:
  - support for LABEL
  - samples on how to use WVCM
  
  Revision  Changes    Path
  1.8       +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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- test.properties	26 May 2003 13:25:33 -0000	1.7
  +++ test.properties	30 May 2003 17:22:44 -0000	1.8
  @@ -3,6 +3,5 @@
   org.apache.webdav.test.username=root
   org.apache.webdav.test.password=root
   org.apache.webdav.test.context=slide
  -org.apache.webdav.test.rootfolder=files
  -org.apache.webdav.test.realm=Slide DAV Server
  +# org.apache.webdav.test.realm=Slide DAV Server
   
  
  
  
  1.7       +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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  
  
  
  1.8       +88 -17    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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ControllableResourceTest.java	26 May 2003 12:46:09 -0000	1.7
  +++ ControllableResourceTest.java	30 May 2003 17:22:44 -0000	1.8
  @@ -135,20 +135,20 @@
           resource.doCreateResource();
           assertTrue( resourceExistsOnServer(resourcePath) );
       }
  -
  +    
       public void testDoCreateResourceInFolder() throws Exception {
           Location location = provider.location( folderPath );
           Folder folder = location.folder();
           folder.doDelete();
           folder.doCreateResource();
           assertTrue( resourceExistsOnServer(folderPath) );
  -
  +        
           location = provider.location( resourceInFolderPath );
           ControllableResource resource = location.controllableResource();
           resource.doCreateResource();
           assertTrue( resourceExistsOnServer(resourceInFolderPath) );
       }
  -
  +    
       public void testPreResourceMustBeNull() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -163,7 +163,7 @@
               assertEquals( ReasonCode.RESOURCE_ALREADY_EXISTS_AT_LOCATION, e.getReasonCode() );
           }
       }
  -
  +    
       public void testDoCheckout() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -178,7 +178,7 @@
           resource = (ControllableResource)resource.doReadProperties( wantedprops );
           assertTrue( resource.getIsCheckedOut() );
       }
  -
  +    
       public void testDoCheckin() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -196,7 +196,7 @@
           resource = (ControllableResource)resource.doReadProperties( wantedprops );
           assertFalse( resource.getIsCheckedOut() );
       }
  -
  +    
       public void testGetVersionControllableFile() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -207,7 +207,7 @@
           resource = (ControllableResource)resource.doReadProperties( wantedprops );
           assertTrue( resource.getVersionControllable() );
       }
  -
  +    
       public void testGetVersionControllableFolder() throws Exception {
           Location location = provider.location( folderPath );
           Folder folder = location.folder();
  @@ -218,7 +218,7 @@
           folder = (Folder)folder.doReadProperties( wantedprops );
           assertFalse( folder.getVersionControllable() );
       }
  -
  +    
       public void testGetCheckedInNested() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -233,7 +233,7 @@
           System.out.println("Version: "+version.location().string());
           System.out.println("- version-name: "+version.getVersionName());
       }
  -
  +    
       public void testGetCheckedInPlain() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -247,7 +247,7 @@
           Version version = resource.getCheckedIn();
           System.out.println("Version: "+version.location().string());
       }
  -
  +    
       public void testDoUncheckout() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -265,7 +265,7 @@
           resource = (ControllableResource)resource.doReadProperties( wantedprops );
           assertFalse( resource.getIsCheckedOut() );
       }
  -
  +    
       public void testDoUpdate() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -302,7 +302,7 @@
               } catch (WvcmException e) {}
           }
       }
  -
  +    
       public void testDoCreateControllableResourceMissingFolder() throws Exception {
           Location location = provider.location( resourceInMissingFolderPath );
           ControllableResource resource = location.controllableResource();
  @@ -315,7 +315,7 @@
               assertTrue( "Should have thrown CONFLICT", false );
           } catch (Exception e) {}
       }
  -
  +    
       public void testDoCreateVersionControlledResource() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -348,5 +348,76 @@
           assertEquals(version.location().string(), version2.location().string());
       }
       
  +    public void testDoXyzLabel() throws Exception {
  +        Location location = provider.location( resourcePath );
  +        ControllableResource resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        resource.doControl();
  +        
  +        PropertyNameList wantedprops;
  +        PropertyName[] rPNames = {PropertyName.CHECKED_IN};
  +        wantedprops = new PropertyNameList( rPNames );
  +        resource = (ControllableResource)resource.doReadProperties( wantedprops );
  +        Version version = resource.getCheckedIn();
  +        System.out.println("Version: "+version.location().string());
  +        
  +        PropertyName[] vPNames = {PropertyName.LABEL_NAME_LIST};
  +        wantedprops = new PropertyNameList( vPNames );
  +        version = (Version)version.doReadProperties( wantedprops );
  +        System.out.println("Labels: "+version.getLabelNameList());
  +        
  +        System.out.println("Add label alpha");
  +        resource.doAddLabel( "alpha" );
  +        version = (Version)version.doReadProperties( wantedprops );
  +        System.out.println("Labels: "+version.getLabelNameList());
  +        
  +        System.out.println("Add label beta");
  +        resource.doAddLabel( "beta" );
  +        version = (Version)version.doReadProperties( wantedprops );
  +        System.out.println("Labels: "+version.getLabelNameList());
  +        
  +        System.out.println("Remove label alpha");
  +        resource.doRemoveLabel( "alpha" );
  +        version = (Version)version.doReadProperties( wantedprops );
  +        System.out.println("Labels: "+version.getLabelNameList());
  +        
  +        System.out.println("Set label rc1");
  +        resource.doSetLabel( "rc1" );
  +        version = (Version)version.doReadProperties( wantedprops );
  +        System.out.println("Labels: "+version.getLabelNameList());
  +    }
  +    
  +    public void testDoReadLabelledVersionProperties() throws Exception {
  +        Location location = provider.location( resourcePath );
  +        ControllableResource resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        resource.setComment( "Initial" );
  +        resource.doWriteProperties();
  +        resource.doControl();
  +        System.out.println("Add label alpha");
  +        resource.doAddLabel( "alpha" );
  +        
  +        PropertyNameList rprops = new PropertyNameList(
  +            new PropertyName[]{PropertyName.COMMENT,PropertyName.LABEL_NAME_LIST}
  +        );
  +        
  +        resource.doCheckout();
  +        resource.setComment( "Some changes" );
  +        resource.doWriteProperties();
  +        resource.doCheckin();
  +        System.out.println("Add label beta");
  +        resource.doAddLabel( "beta" );
  +        
  +        Version version = resource.doReadLabelledVersionProperties("alpha", rprops);
  +        System.out.println("Version: "+version.location().string());
  +        System.out.println("  - Comment: "+version.getComment());
  +        System.out.println("  - Labels: "+version.getLabelNameList());
  +        version = resource.doReadLabelledVersionProperties("beta", rprops);
  +        System.out.println("Version: "+version.location().string());
  +        System.out.println("  - Comment: "+version.getComment());
  +        System.out.println("  - Labels: "+version.getLabelNameList());
  +    }
   }
   
  
  
  
  1.8       +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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  
  
  
  1.4       +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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  
  
  
  1.8       +7 -7      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ProviderTest.java	26 May 2003 12:46:09 -0000	1.7
  +++ ProviderTest.java	30 May 2003 17:22:44 -0000	1.8
  @@ -119,10 +119,10 @@
       protected void tearDown() throws Exception {
       }
       
  -    public void testProviderWithNullCallback() throws Exception {
  -        Provider provider2 = ProviderFactory.createProvider(
  +    public void testProviderWithNullCallbackAndNoParameters() throws Exception {
  +        Provider provider3 = ProviderFactory.createProvider(
               "org.apache.wvcm.ProviderImpl", null );
  -        Location l = provider2.location( "http://"+host+":"+port+resourcePath );
  +        Location l = provider3.location( "http://"+host+":"+port+resourcePath );
           ControllableResource r = l.controllableResource();
           try {
               r.doDelete();
  
  
  
  1.10      +50 -4     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ResourceTest.java	26 May 2003 12:46:09 -0000	1.9
  +++ ResourceTest.java	30 May 2003 17:22:44 -0000	1.10
  @@ -176,6 +176,31 @@
               c.indexOf("World!") < 0 );
       }
       
  +    public void testDoWriteContentWithContentType() throws Exception {
  +        Location location = provider.location( rootFolderPath()+"/Hello.txt" );
  +        ControllableResource resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        PropertyNameList wantedprops =
  +            new PropertyNameList( new PropertyName[]{PropertyName.CONTENT_IDENTIFIER} );
  +        resource = (ControllableResource)resource.doReadProperties( wantedprops );
  +        String cid = resource.getContentIdentifier();
  +        resource.setContentType( "text/plain" );
  +        resource.setContentCharacterSet( "UTF-8" );
  +        resource.doWriteContent(
  +            getClass().getResourceAsStream("/org/apache/webdav/resources/hello.txt"), cid );
  +
  +        wantedprops =
  +            new PropertyNameList( new PropertyName[]{PropertyName.CONTENT_TYPE,PropertyName.CONTENT_CHARACTER_SET} );
  +        OutputStream 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/plain; charset=\"UTF-8\"", resource.getContentType());
  +        assertEquals("UTF-8", resource.getContentCharacterSet());
  +    }
  +    
       public void testDoReadPropertiesWithNullList() throws Exception {
           Location location = provider.location( resourcePath );
           ControllableResource resource = location.controllableResource();
  @@ -448,6 +473,27 @@
           assertTrue( "Expecting ControllableResource but got "+r, r instanceof ControllableResource );
           ControllableResource r2 = (ControllableResource)r;
           System.out.println("\ncontent-language: "+r2.getContentLanguage());
  +    }
  +    
  +    public void testGetContentCharacterSet() throws Exception {
  +        Location location = provider.location( resourcePath );
  +        ControllableResource resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        PropertyNameList wantedprops =
  +            new PropertyNameList( new PropertyName[]{PropertyName.CONTENT_IDENTIFIER} );
  +        resource = (ControllableResource)resource.doReadProperties( wantedprops );
  +        String cid = resource.getContentIdentifier();
  +        resource.doWriteContent(
  +            getClass().getResourceAsStream("/org/apache/webdav/resources/test.xml"), cid );
  +        
  +        wantedprops = new PropertyNameList( new PropertyName[]{PropertyName.CONTENT_CHARACTER_SET} );
  +        
  +        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());
       }
       
       public void testDoWriteProperties() throws Exception {
  
  
  
  1.4       +8 -6      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SearchTest.java	26 May 2003 12:46:09 -0000	1.3
  +++ SearchTest.java	30 May 2003 17:22:44 -0000	1.4
  @@ -122,13 +122,15 @@
           ControllableResource resource = location.controllableResource();
           resource.doDelete();
           resource.doCreateResource();
  -        resource.setComment( "My Comment" );
  -        resource.doWriteProperties();
  +        location = provider.location( resourcePath+".bak" );
  +        resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
           
           PropertyNameList wantedprops =
               new PropertyNameList( new PropertyName[]{PropertyName.DISPLAY_NAME} );
           List result = resource.doSearch(wantedprops, null);
  -        assertEquals( "test.xml", ((ControllableResource)result.get(0)).getDisplayName() );
  +        assertEquals( "IGNORE FOR NOW! This is a bug in the DASL implementation of Slide", "test.xml", ((ControllableResource)result.get(0)).getDisplayName() );
       }
       
       public void testPropertyExpression() throws Exception {
  
  
  
  1.9       +80 -4     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WorkspaceTest.java	26 May 2003 12:46:09 -0000	1.8
  +++ WorkspaceTest.java	30 May 2003 17:22:44 -0000	1.9
  @@ -67,6 +67,7 @@
   import junit.framework.TestSuite;
   import javax.wvcm.*;
   import javax.wvcm.WvcmException.*;
  +import javax.wvcm.PropertyNameList.*;
   import java.util.*;
   
   /**
  @@ -77,6 +78,7 @@
    */
   public class WorkspaceTest extends AbstractTest {
       
  +    private String resourcePath = null;
       private String workspacePath = null;
       private String invalidWorkspacePath = null;
       
  @@ -85,6 +87,7 @@
        */
       public WorkspaceTest(String testName) throws Exception {
           super(testName);
  +        resourcePath = rootFolderPath()+"/test.xml";
           this.invalidWorkspacePath = contextPath()+"/invalidWsPath";
       }
       
  @@ -161,6 +164,79 @@
           }
           catch (WvcmException e) {
               assertEquals( ReasonCode.CANNOT_CREATE_AT_THIS_LOCATION, e.getReasonCode() );
  +        }
  +    }
  +    
  +    public void testLocateByHistoryReport() throws Exception {
  +        // Create the workspace
  +        List wfl = provider.serverWorkspaceFolderList( null );
  +        assertNotNull( wfl );
  +        assertFalse( wfl.size() == 0 );
  +        workspacePath = wfl.get(0)+"/ws1";
  +        Location location = provider.location( workspacePath );
  +        Workspace workspace = location.workspace();
  +        workspace.doDelete();
  +        workspace.doCreateResource();
  +        String wspath = workspace.location().string();
  +        
  +        // create the files
  +        List vhlist = new ArrayList();
  +        ControllableResource resource;
  +        Version v;
  +        PropertyNameList pnlist = new PropertyNameList(
  +            new PropertyName[]{PropertyName.DISPLAY_NAME, PropertyName.VERSION_HISTORY, PropertyName.CHECKED_IN}
  +        );
  +        // ... in history list only
  +        location = provider.location( resourcePath+".1" );
  +        resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        resource.doControl();
  +        resource = (ControllableResource)resource.doReadProperties( pnlist );
  +        vhlist.add( resource.getVersionHistory() );
  +        // ... in history list and in workspace
  +        location = provider.location( resourcePath+".2" );
  +        resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        resource.doControl();
  +        resource = (ControllableResource)resource.doReadProperties( pnlist );
  +        vhlist.add( resource.getVersionHistory() );
  +        v = resource.getCheckedIn();
  +        location = provider.location( wspath+"/test.2.xml" );
  +        resource = location.controllableResource();
  +        resource.doCreateVersionControlledResource( v );
  +        // ... in history list and in workspace
  +        location = provider.location( resourcePath+".3" );
  +        resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        resource.doControl();
  +        resource = (ControllableResource)resource.doReadProperties( pnlist );
  +        vhlist.add( resource.getVersionHistory() );
  +        v = resource.getCheckedIn();
  +        location = provider.location( wspath+"/test.3.xml" );
  +        resource = location.controllableResource();
  +        resource.doCreateVersionControlledResource( v );
  +        // ... in workspace only
  +        location = provider.location( resourcePath+".4" );
  +        resource = location.controllableResource();
  +        resource.doDelete();
  +        resource.doCreateResource();
  +        resource.doControl();
  +        resource = (ControllableResource)resource.doReadProperties( pnlist );
  +        v = resource.getCheckedIn();
  +        location = provider.location( wspath+"/test.4.xml" );
  +        resource = location.controllableResource();
  +        resource.doCreateVersionControlledResource( v );
  +        
  +        System.out.println( "Expecting: test.2.xml and test.3.xml: " );
  +        Iterator i = workspace.doLocateByHistoryReport(vhlist, pnlist).iterator();
  +        while( i.hasNext() ) {
  +            ControllableResource r = (ControllableResource)i.next();
  +            System.out.println("- "+r.location().string());
  +            System.out.println("  display-name: "+r.getDisplayName());
  +            System.out.println("  version-history: "+r.getVersionHistory().location().string());
           }
       }
   }
  
  
  
  1.1                  jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/VersionTest.java
  
  Index: VersionTest.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/wvcm/VersionTest.java,v 1.1 2003/05/30 17:22:44 pnever Exp $
   * $Revision: 1.1 $
   * $Date: 2003/05/30 17:22:44 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Slide", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  
  package org.apache.wvcm;
  
  import junit.framework.Test;
  import junit.framework.TestSuite;
  import javax.wvcm.*;
  import javax.wvcm.PropertyNameList.*;
  import javax.wvcm.WvcmException.*;
  import java.util.*;
  
  /**
   * Tests VersionImpl.
   *
   * @author <a href="mailto:peter.nevermann@softwareag.com">Peter Nevermann</a>
   * @version $Revision: 1.1 $
   */
  public class VersionTest extends AbstractTest {
      
      private String resourcePath = null;
      private String folderPath = null;
      private String resourceInFolderPath = null;
      private String missingFolderPath = null;
      private String resourceInMissingFolderPath = null;
      
      /**
       * Default cosntructor
       */
      public VersionTest(String testName) throws Exception {
          super(testName);
          resourcePath = rootFolderPath()+"/test.xml";
          folderPath = rootFolderPath()+"/foo";
          resourceInFolderPath = folderPath+"/test.xml";
          missingFolderPath = rootFolderPath()+"/bar";
          resourceInMissingFolderPath = rootFolderPath()+"/bar/test.xml";
      }
      
      /**
       * Method suite
       *
       * @return   a Test
       */
      public static Test suite() {
          return new TestSuite(VersionTest.class);
      }
      
      /**
       * Start precisely this test suite with the commandline interface.
       *
       * @param args   commandline options (none are evaluated)
       */
      public static void main( String[] args ) {
          junit.textui.TestRunner.run( suite() );
      }
      
      /**
       *
       */
      protected void setUp() throws Exception {
          super.setUp ();
      }
      
      /**
       * Tears down the fixture, for example, close a network connection.
       * This method is called after a test is executed.
       */
      protected void tearDown() throws Exception {
      }
      
      public void testDoXyzLabel() throws Exception {
          Location location = provider.location( resourcePath );
          ControllableResource resource = location.controllableResource();
          resource.doDelete();
          resource.doCreateResource();
          resource.doControl();
          
          PropertyNameList wantedprops;
          PropertyName[] rPNames = {PropertyName.CHECKED_IN};
          wantedprops = new PropertyNameList( rPNames );
          resource = (ControllableResource)resource.doReadProperties( wantedprops );
          Version version = resource.getCheckedIn();
          System.out.println("Version: "+version.location().string());
          
          PropertyName[] vPNames = {PropertyName.LABEL_NAME_LIST};
          wantedprops = new PropertyNameList( vPNames );
          version = (Version)version.doReadProperties( wantedprops );
          System.out.println("Labels: "+version.getLabelNameList());
          
          System.out.println("Add label alpha");
          version.doAddLabel( "alpha" );
          version = (Version)version.doReadProperties( wantedprops );
          System.out.println("Labels: "+version.getLabelNameList());
          
          System.out.println("Add label beta");
          version.doAddLabel( "beta" );
          version = (Version)version.doReadProperties( wantedprops );
          System.out.println("Labels: "+version.getLabelNameList());
          
          System.out.println("Remove label alpha");
          version.doRemoveLabel( "alpha" );
          version = (Version)version.doReadProperties( wantedprops );
          System.out.println("Labels: "+version.getLabelNameList());
          
          System.out.println("Set label rc1");
          version.doSetLabel( "rc1" );
          version = (Version)version.doReadProperties( wantedprops );
          System.out.println("Labels: "+version.getLabelNameList());
      }
  }
  
  
  
  
  1.7       +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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  
  
  
  1.7       +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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  
  
  
  1.4       +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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  
  
  
  1.7       +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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  
  
  
  1.7       +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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  
  
  
  1.7       +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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  
  
  
  1.7       +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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  
  
  
  1.4       +5 -5      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PropertiesTest.java	26 May 2003 12:46:08 -0000	1.3
  +++ PropertiesTest.java	30 May 2003 17:22:45 -0000	1.4
  @@ -185,7 +185,7 @@
       }
       
       private void printPropMapping(PropertyName pname) {
  -        String webdavname = Properties.webdavNameForPropertyName(pname);
  +        String webdavname = WebdavProperties.webdavNameForPropertyName(pname);
           if( webdavname != null ) {
               if( webdav.length() > 0 )
                   webdav.append("\n");
  
  
  
  1.7       +7 -5      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ReportRequestTest.java	26 May 2003 12:46:08 -0000	1.6
  +++ ReportRequestTest.java	30 May 2003 17:22:45 -0000	1.7
  @@ -68,6 +68,8 @@
   import javax.wvcm.*;
   import javax.wvcm.PropertyNameList.*;
   import org.apache.wvcm.*;
  +import org.apache.wvcm.store.webdav.ReportRequest.*;
  +
   
   /**
    * Tests ReportRequest.
  @@ -132,7 +134,7 @@
                   PropertyName.VERSION_HISTORY, new PropertyNameList(vhrPnames) )
           };
           PropertyNameList pnlist = new PropertyNameList( pnames );
  -        ReportRequest reportReq = new ReportRequest( pnlist );
  +        ReportRequest reportReq = new ExpandPropertyReportRequest( pnlist );
           System.out.println( reportReq.reqBodyAsString() );
   //        String expected =
   //            "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"+
  
  
  
  1.2       +0 -1      jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/resources/test.xml
  
  Index: test.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/resources/test.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test.xml	13 Mar 2003 14:59:39 -0000	1.1
  +++ test.xml	30 May 2003 17:22:45 -0000	1.2
  @@ -1,3 +1,2 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <test>Hello</test>
  -
  
  
  
  1.1                  jakarta-slide/proposals/wvcm/test/junit/src/org/apache/webdav/resources/hello.txt
  
  Index: hello.txt
  ===================================================================
  Hellö Wörld!
  
  

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