maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject cvs commit: maven-scm/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout LocalCheckoutCommandTest.java
Date Wed, 20 Oct 2004 19:04:06 GMT
trygvis     2004/10/20 12:04:06

  Modified:    maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout
                        LocalCheckoutCommandTest.java
  Log:
  o Sorting the files before asserting them to get the same ordering on all systems.
  
  Revision  Changes    Path
  1.2       +10 -5     maven-scm/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckoutCommandTest.java
  
  Index: LocalCheckoutCommandTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckoutCommandTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocalCheckoutCommandTest.java	20 Oct 2004 18:03:43 -0000	1.1
  +++ LocalCheckoutCommandTest.java	20 Oct 2004 19:04:06 -0000	1.2
  @@ -18,6 +18,8 @@
    */
   
   import java.io.File;
  +import java.util.SortedSet;
  +import java.util.TreeSet;
   
   import org.apache.maven.scm.ScmException;
   import org.apache.maven.scm.ScmFile;
  @@ -94,15 +96,18 @@
   
           assertEquals( 2, result.getCheckedOutFiles().size() );
   
  -        ScmFile file1 = (ScmFile) result.getCheckedOutFiles().get( 0 );
  +        // Sort the files as we're not guaranteed any ordering
  +        SortedSet files = new TreeSet( result.getCheckedOutFiles() );
   
  -        assertEquals( "/test-repo/readme.txt", file1.getPath( ) );
  +        ScmFile file1 = (ScmFile) files.first();
  +
  +        assertEquals( "/test-repo/src/main/java/Test.java", file1.getPath( ) );
   
           assertEquals( ScmFileStatus.CHECKED_OUT, file1.getStatus() );
   
  -        ScmFile file2 = (ScmFile) result.getCheckedOutFiles().get( 1 );
  +        ScmFile file2 = (ScmFile) files.last();
   
  -        assertEquals( "/test-repo/src/main/java/Test.java", file2.getPath( ) );
  +        assertEquals( "/test-repo/readme.txt", file2.getPath( ) );
   
           assertEquals( ScmFileStatus.CHECKED_OUT, file2.getStatus() );
   
  
  
  

Mime
View raw message