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/scm-providers/cvslib/src/test/repository/CVSROOT history
Date Mon, 05 Jul 2004 19:17:07 GMT
trygvis     2004/07/05 12:17:07

  Modified:    scm-providers/cvslib/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog
                        CvsChangeLogCommand.java
               scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command
                        AbstractCvsCommandTest.java
                        CvsCommandWrapperTest.java
                        TestAbstractCvsCommand.java
               scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog
                        CvsChangeLogCommandTest.java
                        CvsChangeLogConsumerTest.java
               scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/checkout
                        CvsCheckoutCommandTest.java
               scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/tag
                        CvsTagCommandTest.java
               scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/update
                        CvsUpdateCommandTest.java
               scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/repository
                        CvsRepositoryTest.java
               scm-providers/cvslib/src/test/repository/CVSROOT history
  Log:
  o Refactored some tests to fix the broken build.
  
  Revision  Changes    Path
  1.4       +8 -32     maven-scm/scm-providers/cvslib/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java
  
  Index: CvsChangeLogCommand.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CvsChangeLogCommand.java	2 Jul 2004 16:51:21 -0000	1.3
  +++ CvsChangeLogCommand.java	5 Jul 2004 19:17:07 -0000	1.4
  @@ -40,46 +40,32 @@
       private Date startDate;
       private Date endDate;
       
  -    public CvsChangeLogCommand() throws ScmException
  +    public CvsChangeLogCommand()
  +        throws ScmException
       {
           setConsumer(new CvsChangeLogConsumer());
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.changelog.ChangeLogCommand#setStartDate(java.util.Date)
  -     */
       public void setStartDate(Date startDate)
       {
           this.startDate = startDate;
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.changelog.ChangeLogCommand#getStartDate()
  -     */
       public Date getStartDate()
       {
           return startDate;
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.changelog.ChangeLogCommand#setEndDate(java.util.Date)
  -     */
       public void setEndDate(Date endDate)
       {
           this.endDate = endDate;
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.changelog.ChangeLogCommand#getEndDate()
  -     */
       public Date getEndDate()
       {
           return endDate;
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.changelog.ChangeLogCommand#setRange(int)
  -     */
       public void setRange(int numDays)
       {
           setStartDate(
  @@ -91,23 +77,18 @@
                   System.currentTimeMillis() + (long)1 * 24 * 60 * 60 * 1000));
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.Command#getName()
  -     */
       public String getName()
       {
           return NAME;
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.Command#getDisplayName()
  -     */
       public String getDisplayName()
       {
           return "ChangeLog";
       }
   
  -    public Commandline getCommandLine() throws ScmException
  +    public Commandline getCommandLine()
  +        throws ScmException
       {
           Commandline cl = new Commandline();
           cl.setExecutable("cvs");
  @@ -154,10 +135,8 @@
           return cl;
       }
       
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.Command#setConsumer(org.codehaus.plexus.util.cli.StreamConsumer)
  -     */
  -    public void setConsumer(StreamConsumer consumer) throws ScmException
  +    public void setConsumer(StreamConsumer consumer)
  +        throws ScmException
       {
   		if (consumer instanceof ChangeLogConsumer)
   		{
  @@ -169,11 +148,8 @@
   		}
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.maven.scm.command.Command#getConsumer()
  -     */
       public StreamConsumer getConsumer()
       {
           return consumer;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +3 -6      maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/AbstractCvsCommandTest.java
  
  Index: AbstractCvsCommandTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/AbstractCvsCommandTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractCvsCommandTest.java	20 Apr 2004 19:05:55 -0000	1.1
  +++ AbstractCvsCommandTest.java	5 Jul 2004 19:17:07 -0000	1.2
  @@ -30,13 +30,10 @@
   {
       private TestAbstractCvsCommand cmd;
       
  -    public AbstractCvsCommandTest(String name)
  -    {
  -        super(name);
  -    }
  -    
       public void setUp() throws Exception
       {
  +        super.setUp();
  +
           cmd = new TestAbstractCvsCommand();
       }
       
  
  
  
  1.2       +23 -30    maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/CvsCommandWrapperTest.java
  
  Index: CvsCommandWrapperTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/CvsCommandWrapperTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CvsCommandWrapperTest.java	20 Apr 2004 19:05:55 -0000	1.1
  +++ CvsCommandWrapperTest.java	5 Jul 2004 19:17:07 -0000	1.2
  @@ -17,54 +17,47 @@
    * ====================================================================
    */
   
  -import junit.framework.TestCase;
  -
   import org.apache.maven.scm.ScmException;
  +import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest;
   import org.apache.maven.scm.provider.cvslib.repository.CvsRepository;
   
   /**
    * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
    * @version $Id$
    */
  -public class CvsCommandWrapperTest extends TestCase
  +public class CvsCommandWrapperTest
  +    extends AbstractCvsScmTest
   {
  -    private CvsCommandWrapper wrapper;
  -    
  -    public CvsCommandWrapperTest(String testName)
  -    {
  -        super(testName);
  -    }
  -    
  -    public void setUp() throws Exception
  -    {
  -        wrapper = new CvsCommandWrapper();
  -    }
  -    
       public void testSetValidRepository()
  +        throws Exception
       {
  -        try
  -        {
  -            CvsRepository repo = new CvsRepository();
  -            repo.setDelimiter(":");
  -            repo.setConnection("pserver:anonymous@cvs.apache.org:/scm:maven");
  -            wrapper.setRepository(repo);
  -            assertEquals(repo, wrapper.getRepository());
  -        }
  -        catch(ScmException e)
  -        {
  -            fail(e.getMessage());
  -        }
  +        CvsCommandWrapper wrapper = new CvsCommandWrapper();
  +
  +        CvsRepository repo = new CvsRepository();
  +
  +        repo.setDelimiter( ":" );
  +
  +        repo.setConnection( "pserver:anonymous@cvs.apache.org:/scm:maven" );
  +
  +        wrapper.setRepository( repo );
  +
  +        assertEquals( repo, wrapper.getRepository() );
       }
       
       public void testSetInvalidRepository()
  +        throws Exception
       {
           try
           {
  +            CvsCommandWrapper wrapper = new CvsCommandWrapper();
  +
               wrapper.setRepository(null);
  -            fail();
  +
  +            fail( "Expected exception." );
           }
           catch(ScmException e)
           {
  +            // expected
           }
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +5 -3      maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/TestAbstractCvsCommand.java
  
  Index: TestAbstractCvsCommand.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/TestAbstractCvsCommand.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestAbstractCvsCommand.java	2 Jul 2004 16:51:21 -0000	1.3
  +++ TestAbstractCvsCommand.java	5 Jul 2004 19:17:07 -0000	1.4
  @@ -24,9 +24,11 @@
    * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
    * @version $Id$
    */
  -public class TestAbstractCvsCommand extends AbstractCvsCommand
  +public class TestAbstractCvsCommand
  +    extends AbstractCvsCommand
   {
  -    public Commandline getCommandLine() throws ScmException
  +    public Commandline getCommandLine()
  +        throws ScmException
       {
           return null;
       }
  
  
  
  1.5       +132 -130  maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommandTest.java
  
  Index: CvsChangeLogCommandTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommandTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CvsChangeLogCommandTest.java	2 May 2004 22:10:58 -0000	1.4
  +++ CvsChangeLogCommandTest.java	5 Jul 2004 19:17:07 -0000	1.5
  @@ -20,178 +20,180 @@
   import java.util.Calendar;
   import java.util.Date;
   
  -import junit.framework.TestCase;
  -
   import org.apache.maven.scm.ScmException;
  +import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest;
   import org.apache.maven.scm.provider.cvslib.repository.CvsRepository;
  +
   import org.codehaus.plexus.util.cli.Commandline;
   
   /**
  - * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  - * @version $Id$
  + * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse </a>
  + * @version $Id: CvsChangeLogCommandTest.java,v 1.4 2004/05/02 22:10:58 jvanzyl
  + *          Exp $
    */
  -public class CvsChangeLogCommandTest extends TestCase
  +public class CvsChangeLogCommandTest
  +    extends AbstractCvsScmTest
   {
  -    private CvsChangeLogCommand instance;
  -    private String baseDir;
  -
  -    public CvsChangeLogCommandTest(String testName)
  +    public void testGetCommandWithEndDate()
  +        throws Exception
       {
  -        super(testName);
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
  +        CvsRepository repo = new CvsRepository();
  +
  +        repo.setDelimiter( ":" );
  +
  +        repo.setConnection( "pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven" );
  +
  +        instance.setRepository( repo );
  +
  +        instance.setWorkingDirectory( getBasedir() );
  +
  +        Calendar cal = Calendar.getInstance();
  +        cal.set( 2003, 8, 10 );
  +        Date startDate = cal.getTime();
  +
  +        cal.set( 2003, 9, 10 );
  +        Date endDate = cal.getTime();
  +
  +        instance.setStartDate( startDate );
  +        instance.setEndDate( endDate );
  +
  +        Commandline cl = instance.getCommandLine();
  +
  +        assertEquals(
  +            "cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic -q log -d2003-09-10<2003-10-10",
  +            cl.toString() );
       }
   
  -    /**
  -     * Initialize per test data
  -     * @throws Exception when there is an unexpected problem
  -     */
  -    public void setUp() throws Exception
  +    public void testGetCommandWithoutEndDate()
  +        throws Exception
       {
  -        baseDir = System.getProperty("basedir");
  -        assertNotNull("The system property basedir was not defined.", baseDir);
  -        instance = new CvsChangeLogCommand();
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
  +        CvsRepository repo = new CvsRepository();
  +
  +        repo.setDelimiter( ":" );
  +        repo.setConnection( "pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven" );
  +        instance.setRepository( repo );
  +        Calendar cal = Calendar.getInstance();
  +        cal.set( 2003, 8, 10 );
  +        Date startDate = cal.getTime();
  +        instance.setStartDate( startDate );
  +
  +        Commandline cl = instance.getCommandLine();
  +
  +        assertEquals(
  +            "cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic -q log -d>2003-09-10",
cl
  +                .toString() );
       }
   
  -    public void testGetCommandWithEndDate()
  +    public void testGetCommandWithBranchOrTag()
  +        throws Exception
       {
  -        try
  -        {
  -            CvsRepository repo = new CvsRepository();
  -            repo.setDelimiter(":");
  -            repo.setConnection(
  -                "pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven");
  -            instance.setRepository(repo);
  -            instance.setWorkingDirectory(baseDir);
  -            Calendar cal = Calendar.getInstance();
  -			cal.set(2003, 8, 10);
  -            Date startDate = cal.getTime();
  -            instance.setStartDate(startDate);
  -			cal.set(2003, 9, 10);
  -			Date endDate = cal.getTime();
  -			instance.setEndDate(endDate);
  -            Commandline cl = instance.getCommandLine();
  -            System.out.println(cl.toString());
  -            assertEquals(
  -                "cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic -q log -d2003-09-10<2003-10-10",
  -                cl.toString());
  -        }
  -        catch (Exception e)
  -        {
  -            fail(e.getMessage());
  -        }
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
  +        CvsRepository repo = new CvsRepository();
  +
  +        repo.setDelimiter( ":" );
  +
  +        repo.setConnection( "pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven" );
  +
  +        instance.setRepository( repo );
  +
  +        instance.setBranch( "branchName" );
  +
  +        Commandline cl = instance.getCommandLine();
  +
  +        assertEquals( "cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic -q log -rbranchName",
  +            cl.toString() );
       }
  -    
  -	public void testGetCommandWithoutEndDate()
  -	{
  -		try
  -		{
  -			CvsRepository repo = new CvsRepository();
  -			repo.setDelimiter(":");
  -			repo.setConnection(
  -				"pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven");
  -			instance.setRepository(repo);
  -			Calendar cal = Calendar.getInstance();
  -			cal.set(2003, 8, 10);
  -			Date startDate = cal.getTime();
  -			instance.setStartDate(startDate);
  -			Commandline cl = instance.getCommandLine();
  -			System.out.println(cl.toString());
  -			assertEquals(
  -				"cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic -q log -d>2003-09-10",
  -				cl.toString());
  -		}
  -		catch (Exception e)
  -		{
  -			fail(e.getMessage());
  -		}
  -	}
  -	
  -	public void testGetCommandWithBranchOrTag()
  -	{
  -		try
  -		{
  -			CvsRepository repo = new CvsRepository();
  -			repo.setDelimiter(":");
  -			repo.setConnection(
  -				"pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven");
  -			instance.setRepository(repo);
  -			instance.setBranch("branchName");
  -			Commandline cl = instance.getCommandLine();
  -			System.out.println(cl.toString());
  -			assertEquals(
  -				"cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic -q log -rbranchName",
  -				cl.toString());
  -		}
  -		catch (Exception e)
  -		{
  -			fail(e.getMessage());
  -		}
  -	}
  -	
  +
       public void testSetDateRange()
  +        throws Exception
       {
  -        instance.setRange(30);
  -        assertNotNull(instance.getStartDate());
  -        assertNotNull(instance.getEndDate());
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
  +        instance.setRange( 30 );
  +
  +        assertNotNull( instance.getStartDate() );
  +
  +        assertNotNull( instance.getEndDate() );
       }
  -    
  +
       public void testSetStartDate()
  +        throws Exception
       {
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
           Calendar cal = Calendar.getInstance();
  -		cal.set(2003, 12, 13);
  +
  +        cal.set( 2003, 12, 13 );
  +
           Date startDate = cal.getTime();
  -        instance.setStartDate(startDate);
  -        assertEquals(startDate, instance.getStartDate());
  +
  +        instance.setStartDate( startDate );
  +
  +        assertEquals( startDate, instance.getStartDate() );
       }
  -    
  +
       public void testSetEndDate()
  +        throws Exception
       {
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
           Calendar cal = Calendar.getInstance();
  -		cal.set(2003, 12, 13);
  +
  +        cal.set( 2003, 12, 13 );
  +
           Date endDate = cal.getTime();
  -        instance.setEndDate(endDate);
  -        assertEquals(endDate, instance.getEndDate());
  +
  +        instance.setEndDate( endDate );
  +
  +        assertEquals( endDate, instance.getEndDate() );
       }
  -    
  +
       public void testGetName()
  +        throws Exception
       {
  -        assertEquals("changelog", instance.getName());
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
  +        assertEquals( "changelog", instance.getName() );
       }
  -    
  +
       public void testGetDisplayName()
  +        throws Exception
       {
  -        try
  -        {
  -            assertEquals("ChangeLog", instance.getDisplayName());
  -        }
  -        catch(Exception e)
  -        {
  -            fail(e.getMessage());
  -        }
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
  +        assertEquals( "ChangeLog", instance.getDisplayName() );
       }
  -    
  +
       public void testSetValidConsumer()
  +        throws Exception
       {
  -        try
  -        {
  -            CvsChangeLogConsumer cons = new CvsChangeLogConsumer();
  -            instance.setConsumer(cons);
  -            assertEquals(cons, instance.getConsumer());
  -        }
  -        catch(ScmException e)
  -        {
  -            fail(e.getMessage());
  -        }
  +        CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
  +        CvsChangeLogConsumer cons = new CvsChangeLogConsumer();
  +
  +        instance.setConsumer( cons );
  +
  +        assertEquals( cons, instance.getConsumer() );
       }
  -    
  +
       public void testSetInvalidConsumer()
       {
           try
           {
  -            instance.setConsumer(null);
  -            fail();
  +            CvsChangeLogCommand instance = new CvsChangeLogCommand();
  +
  +            instance.setConsumer( null );
  +
  +            fail( "Expected exception." );
           }
  -        catch(ScmException e)
  +        catch ( ScmException e )
           {
  +            // expected
           }
       }
  -}
  +}
  \ No newline at end of file
  
  
  
  1.2       +15 -24    maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java
  
  Index: CvsChangeLogConsumerTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CvsChangeLogConsumerTest.java	20 Apr 2004 19:05:55 -0000	1.1
  +++ CvsChangeLogConsumerTest.java	5 Jul 2004 19:17:07 -0000	1.2
  @@ -23,58 +23,49 @@
   import java.util.Collection;
   import java.util.Iterator;
   
  -import junit.framework.TestCase;
  -
   import org.apache.maven.scm.command.changelog.ChangeLogEntry;
  +import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest;
   
   /**
    * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
    * @version $Id$
    */
  -public class CvsChangeLogConsumerTest extends TestCase
  +public class CvsChangeLogConsumerTest
  +    extends AbstractCvsScmTest
   {
  -	/** the {@link CvsChangeLogConsumer} used for testing */
  -	private CvsChangeLogConsumer instance;
  -	/** file with test results to check against */
  +    /** file with test results to check against */
   	private String testFile;
   
   	/**
  -	 * Create a test with the given name
  -	 * @param testName the name of the test
  -	 */
  -	public CvsChangeLogConsumerTest(String testName)
  -	{
  -		super(testName);
  -	}
  -
  -	/**
   	 * Initialize per test data
   	 * @throws Exception when there is an unexpected problem
   	 */
   	public void setUp() throws Exception
   	{
  -		String baseDir = System.getProperty("basedir");
  -		assertNotNull("The system property basedir was not defined.", baseDir);
  -		testFile = baseDir + "/src/test/resources/cvslib/changelog/cvslog.txt";
  -		instance = new CvsChangeLogConsumer();
  +        super.setUp();
  +
  +        testFile = getTestFile( "/src/test/resources/cvslib/changelog/cvslog.txt" );
   	}
   
   	/**
   	 * Test of parse method
   	 * @throws Exception when there is an unexpected problem
   	 */
  -	public void testParse() throws Exception
  +	public void testParse()
  +        throws Exception
   	{
  -		FileInputStream fis = new FileInputStream(testFile);
  +        CvsChangeLogConsumer command = new CvsChangeLogConsumer();
  +
  +        FileInputStream fis = new FileInputStream( testFile );
   		BufferedReader in = new BufferedReader(new InputStreamReader(fis));
   		String s = in.readLine();
   		while ( s != null )
   		{
  -			instance.consumeLine( s );
  +			command.consumeLine( s );
   			s = in.readLine();
   		}
   
  -		Collection entries = instance.getModifications();
  +		Collection entries = command.getModifications();
   		assertEquals("Wrong number of entries returned", 3, entries.size());
   		ChangeLogEntry entry = null;
   		for (Iterator i = entries.iterator(); i.hasNext(); )
  
  
  
  1.6       +3 -2      maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.java
  
  Index: CvsCheckoutCommandTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CvsCheckoutCommandTest.java	2 Jul 2004 16:51:21 -0000	1.5
  +++ CvsCheckoutCommandTest.java	5 Jul 2004 19:17:07 -0000	1.6
  @@ -27,7 +27,8 @@
    * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
    * @version $Id$
    */
  -public class CvsCheckoutCommandTest extends AbstractCvsScmTest
  +public class CvsCheckoutCommandTest
  +    extends AbstractCvsScmTest
   {
       public void testGetCommand()
           throws Exception
  
  
  
  1.6       +37 -82    maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommandTest.java
  
  Index: CvsTagCommandTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommandTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CvsTagCommandTest.java	2 Jul 2004 16:51:21 -0000	1.5
  +++ CvsTagCommandTest.java	5 Jul 2004 19:17:07 -0000	1.6
  @@ -17,104 +17,59 @@
    * ====================================================================
    */
   
  -import junit.framework.TestCase;
  -
  -import org.apache.maven.scm.ScmException;
  +import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest;
   import org.apache.maven.scm.provider.cvslib.repository.CvsRepository;
  +
   import org.codehaus.plexus.util.cli.Commandline;
   
   /**
  - * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  + * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse </a>
    * @version $Id$
    */
  -public class CvsTagCommandTest extends TestCase
  +public class CvsTagCommandTest
  +    extends AbstractCvsScmTest
   {
  -    private CvsTagCommand instance;
  -    private String baseDir;
  -
  -    /**
  -     * @param testName
  -     */
  -    public CvsTagCommandTest(String testName)
  +    public void testGetCommandWithTag() throws Exception
       {
  -        super(testName);
  -    }
  +        CvsTagCommand command = new CvsTagCommand();
   
  -    /**
  -     * Initialize per test data
  -     * @throws Exception when there is an unexpected problem
  -     */
  -    public void setUp() throws Exception
  -    {
  -        baseDir = System.getProperty("basedir");
  -        assertNotNull("The system property basedir was not defined.", baseDir);
  -        instance = new CvsTagCommand();
  -    }
  +        CvsRepository repo = new CvsRepository();
   
  -    public void testGetCommandWithTag()
  -    {
  -        try
  -        {
  -            CvsRepository repo = new CvsRepository();
  -            repo.setDelimiter(":");
  -            repo.setConnection(
  -                "pserver:anonymous@cvs.codehaus.org:/scm/cvspublic:test-repo");
  -            repo.setPassword("anonymous@cvs.codehaus.org");
  -
  -            instance.setRepository(repo);
  -            instance.setTagName("my_tag");
  -            Commandline cl = instance.getCommandLine();
  -            System.out.println(cl.toString());
  -            assertEquals(
  -                "cvs -d :pserver:anonymous@cvs.codehaus.org:/scm/cvspublic -q tag -c my_tag",
  -                cl.toString());
  -        }
  -        catch (Exception e)
  -        {
  -            e.printStackTrace();
  -            fail(e.getMessage());
  -        }
  +        repo.setDelimiter( ":" );
  +        repo.setConnection( "pserver:anonymous@cvs.codehaus.org:/scm/cvspublic:test-repo"
);
  +        repo.setPassword( "anonymous@cvs.codehaus.org" );
  +
  +        command.setRepository( repo );
  +        command.setTagName( "my_tag" );
  +        Commandline cl = command.getCommandLine();
  +        assertEquals( "cvs -d :pserver:anonymous@cvs.codehaus.org:/scm/cvspublic -q tag
-c my_tag", cl.toString() );
       }
  -    
  +
       public void testGetCommandWithoutTag()
  +        throws Exception
       {
  -        try
  -        {
  -            CvsRepository repo = new CvsRepository();
  -            repo.setDelimiter(":");
  -            repo.setConnection(
  -                "pserver:anonymous@cvs.codehaus.org:/scm/cvspublic:test-repo");
  -            repo.setPassword("anonymous@cvs.codehaus.org");
  -
  -            instance.setRepository(repo);
  -            fail("an exception must be throw");
  -        }
  -        catch(ScmException e)
  -        {
  -        }
  +        CvsTagCommand command = new CvsTagCommand();
  +        CvsRepository repo = new CvsRepository();
  +        repo.setDelimiter( ":" );
  +        repo.setConnection( "pserver:anonymous@cvs.codehaus.org:/scm/cvspublic:test-repo"
);
  +        repo.setPassword( "anonymous@cvs.codehaus.org" );
  +
  +        command.setRepository( repo );
       }
  -    
  +
       public void testGetDisplayNameName()
  +        throws Exception
       {
  -        try
  -        {
  -            assertEquals("Tag", instance.getDisplayName());
  -        }
  -        catch(Exception e)
  -        {
  -            fail();
  -        }
  +        CvsTagCommand command = new CvsTagCommand();
  +
  +        assertEquals( "Tag", command.getDisplayName() );
       }
  -    
  +
       public void testGetName()
  +        throws Exception
       {
  -        try
  -        {
  -            assertEquals("tag", instance.getName());
  -        }
  -        catch(Exception e)
  -        {
  -            fail();
  -        }
  +        CvsTagCommand command = new CvsTagCommand();
  +
  +        assertEquals( "tag", command.getName() );
       }
  -}
  +}
  \ No newline at end of file
  
  
  
  1.6       +3 -2      maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java
  
  Index: CvsUpdateCommandTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CvsUpdateCommandTest.java	2 Jul 2004 16:51:21 -0000	1.5
  +++ CvsUpdateCommandTest.java	5 Jul 2004 19:17:07 -0000	1.6
  @@ -28,7 +28,8 @@
    * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
    * @version $Id$
    */
  -public class CvsUpdateCommandTest extends AbstractCvsScmTest
  +public class CvsUpdateCommandTest
  +    extends AbstractCvsScmTest
   {
       public void testCommand()
           throws Exception
  
  
  
  1.3       +4 -4      maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsRepositoryTest.java
  
  Index: CvsRepositoryTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsRepositoryTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CvsRepositoryTest.java	2 Jul 2004 16:51:21 -0000	1.2
  +++ CvsRepositoryTest.java	5 Jul 2004 19:17:07 -0000	1.3
  @@ -17,15 +17,15 @@
    * ====================================================================
    */
   
  -import junit.framework.TestCase;
  -
   import org.apache.maven.scm.ScmException;
  +import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest;
   
   /**
    * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
    * @version $Id$
    */
  -public class CvsRepositoryTest extends TestCase
  +public class CvsRepositoryTest
  +    extends AbstractCvsScmTest
   {
       public void testParseRemotePserverConnection()
           throws Exception
  
  
  
  1.2       +12 -0     maven-scm/scm-providers/cvslib/src/test/repository/CVSROOT/history
  
  Index: history
  ===================================================================
  RCS file: /home/cvs/maven-scm/scm-providers/cvslib/src/test/repository/CVSROOT/history,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- history	2 Jul 2004 16:42:20 -0000	1.1
  +++ history	5 Jul 2004 19:17:07 -0000	1.2
  @@ -35,3 +35,15 @@
   O40e1e618|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo||test-repo
   U40e1e619|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo/checkout|1.1|Foo.java
   O40e1e61a|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckoutCommandTest/testGetCommand/*0|test-repo||test-repo
  +O40e5a4ea|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo||test-repo
  +U40e5a4eb|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo/checkout|1.1|Foo.java
  +O40e5a4ec|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckoutCommandTest/testGetCommand/*0|test-repo||test-repo
  +O40e9a5d4|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckoutCommandTest/testGetCommand/*0|test-repo||test-repo
  +O40e9a5d5|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo||test-repo
  +U40e9a5d6|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo/checkout|1.1|Foo.java
  +O40e9a84a|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckoutCommandTest/testGetCommand/*0|test-repo||test-repo
  +O40e9a84b|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo||test-repo
  +U40e9a84c|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo/checkout|1.1|Foo.java
  +O40e9a88f|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckoutCommandTest/testGetCommand/*0|test-repo||test-repo
  +O40e9a890|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo||test-repo
  +U40e9a891|trygvis|~/jakarta/maven-scm/scm-providers/cvslib/target/workingDirectory/org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest/testCommand/*0|test-repo/checkout|1.1|Foo.java
  
  
  

Mime
View raw message