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-api/src/main/java/org/apache/maven/scm/command/checkin AbstractCheckInCommand.java
Date Fri, 29 Oct 2004 11:43:28 GMT
trygvis     2004/10/29 04:43:28

  Modified:    maven-scm-api/src/main/java/org/apache/maven/scm
                        ScmFile.java ScmTestCase.java
               maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin
                        AbstractCheckInCommand.java
  Log:
  o Adding some utility methods for creating files for testing.
  o Adding a toString() method on the ScmFile for easier debugging.
  
  Revision  Changes    Path
  1.3       +6 -1      maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFile.java
  
  Index: ScmFile.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFile.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ScmFile.java	26 Oct 2004 12:37:05 -0000	1.2
  +++ ScmFile.java	29 Oct 2004 11:43:27 -0000	1.3
  @@ -71,4 +71,9 @@
       {
           return path.hashCode();
       }
  +
  +    public String toString()
  +    {
  +        return "[" + path + ":" + status + "]";
  +    }
   }
  
  
  
  1.4       +42 -1     maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTestCase.java
  
  Index: ScmTestCase.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ScmTestCase.java	28 Oct 2004 23:26:47 -0000	1.3
  +++ ScmTestCase.java	29 Oct 2004 11:43:27 -0000	1.4
  @@ -17,6 +17,8 @@
    */
   
   import java.io.File;
  +import java.io.IOException;
  +import java.io.FileWriter;
   
   import org.apache.maven.scm.manager.ScmManager;
   import org.apache.maven.scm.repository.ScmRepository;
  @@ -142,5 +144,44 @@
       	throws Exception
       {
           assertEquals( StringUtils.replace( expectedPath, "\\", "/" ), StringUtils.replace(
expectedPath, "\\", "/" ) );
  +    }
  +
  +    // ----------------------------------------------------------------------
  +    // Util methods
  +    // ----------------------------------------------------------------------
  +
  +    public static void makeDirectory( File basedir, String fileName )
  +    {
  +        File dir = new File( basedir, fileName );
  +
  +        if ( !dir.exists() )
  +        {
  +            assertTrue( dir.mkdirs() );
  +        }
  +    }
  +
  +    public static void makeFile( File basedir, String fileName )
  +    	throws IOException
  +    {
  +        makeFile( basedir, fileName, fileName );
  +    }
  +
  +    public static void makeFile( File basedir, String fileName, String contents )
  +    	throws IOException
  +    {
  +        File file = new File( basedir, fileName );
  +
  +        File parent = file.getParentFile();
  +
  +        if ( !parent.exists() )
  +        {
  +            assertTrue( parent.mkdirs() );
  +        }
  +
  +        FileWriter writer = new FileWriter( file );
  +
  +        writer.write( contents );
  +
  +        writer.close();
       }
   }
  
  
  
  1.3       +1 -4      maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java
  
  Index: AbstractCheckInCommand.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractCheckInCommand.java	26 Oct 2004 12:37:05 -0000	1.2
  +++ AbstractCheckInCommand.java	29 Oct 2004 11:43:28 -0000	1.3
  @@ -25,9 +25,6 @@
   import org.apache.maven.scm.command.AbstractCommand;
   import org.apache.maven.scm.provider.ScmProviderRepository;
   
  -
  -
  -
   /**
    * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
    * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  
  
  

Mime
View raw message