maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r449240 - /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java
Date Sat, 23 Sep 2006 13:50:50 GMT
Author: evenisse
Date: Sat Sep 23 06:50:50 2006
New Revision: 449240

URL: http://svn.apache.org/viewvc?view=rev&rev=449240
Log:
[SCM-231] Fix bug in test case when maven-scm-api  checkout is under a target directory
Submitted by: John Tolentino

Modified:
    maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java

Modified: maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java?view=diff&rev=449240&r1=449239&r2=449240
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java (original)
+++ maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java Sat
Sep 23 06:50:50 2006
@@ -48,6 +48,11 @@
         return basedirPath;
     }
 
+    private String removeBasedir( String filename )
+    {
+        return filename.substring( getBasedir().length(), filename.length() );
+    }
+
     public void testExcludes()
         throws IOException
     {
@@ -57,7 +62,7 @@
 
         for ( int i = 0; i < files.length; ++i )
         {
-            if ( files[i].getAbsolutePath().indexOf( "target" ) != -1 )
+            if ( removeBasedir( files[i].getAbsolutePath() ).indexOf( "target" ) != -1 )
             {
                 fail( "Found excludes in file set: " + files[i] );
             }
@@ -75,7 +80,7 @@
         while ( it.hasNext() )
         {
             File file = (File) it.next();
-            if ( file.getAbsolutePath().indexOf( "target" ) != -1 )
+            if ( removeBasedir( file.getAbsolutePath() ).indexOf( "target") != -1 )
             {
                 fail( "Found excludes in file set: " + file );
             }



Mime
View raw message