You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm-commits@maven.apache.org by ev...@apache.org on 2003/12/10 22:07:07 UTC

cvs commit: maven-scm/generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command AbstractCvsCommandTest.java CvsCommandWrapperTest.java TestAbstractCvsCommand.java

evenisse    2003/12/10 13:07:07

  Modified:    generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/checkout
                        CvsCheckoutCommandTest.java
               generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/update
                        CvsUpdateCommandTest.java
  Added:       generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command
                        AbstractCvsCommandTest.java
                        CvsCommandWrapperTest.java
                        TestAbstractCvsCommand.java
  Log:
  Add more svn test. Actually, coverage is 85,1%
  
  Revision  Changes    Path
  1.2       +25 -1     maven-scm/generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.java
  
  Index: CvsCheckoutCommandTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CvsCheckoutCommandTest.java	2 Dec 2003 20:13:32 -0000	1.1
  +++ CvsCheckoutCommandTest.java	10 Dec 2003 21:07:07 -0000	1.2
  @@ -128,4 +128,28 @@
               fail(e.getMessage());
           }
       }
  +    
  +    public void testGetDisplayNameName()
  +    {
  +        try
  +        {
  +            assertEquals("Check out", instance.getDisplayName());
  +        }
  +        catch(Exception e)
  +        {
  +            fail();
  +        }
  +    }
  +    
  +    public void testGetName()
  +    {
  +        try
  +        {
  +            assertEquals("checkout", instance.getName());
  +        }
  +        catch(Exception e)
  +        {
  +            fail();
  +        }
  +    }
   }
  
  
  
  1.2       +25 -1     maven-scm/generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/update/CvsUpdateCommandTest.java
  
  Index: CvsUpdateCommandTest.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/update/CvsUpdateCommandTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CvsUpdateCommandTest.java	2 Dec 2003 20:13:32 -0000	1.1
  +++ CvsUpdateCommandTest.java	10 Dec 2003 21:07:07 -0000	1.2
  @@ -143,4 +143,28 @@
               fail(e.getMessage());
           }
       }
  +    
  +    public void testGetDisplayNameName()
  +    {
  +        try
  +        {
  +            assertEquals("Update", instance.getDisplayName());
  +        }
  +        catch(Exception e)
  +        {
  +            fail();
  +        }
  +    }
  +    
  +    public void testGetName()
  +    {
  +        try
  +        {
  +            assertEquals("update", instance.getName());
  +        }
  +        catch(Exception e)
  +        {
  +            fail();
  +        }
  +    }
   }
  
  
  
  1.1                  maven-scm/generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/AbstractCvsCommandTest.java
  
  Index: AbstractCvsCommandTest.java
  ===================================================================
  package org.apache.maven.genericscm.provider.cvslib.command;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 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-userName documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Maven" 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",
   *    "Apache Maven", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * 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/>.
   *
   * ====================================================================
   */
  
  import junit.framework.TestCase;
  
  import org.apache.maven.genericscm.ScmException;
  import org.apache.maven.genericscm.provider.cvslib.repository.CvsRepository;
  
  /**
   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
   * @version $Id: AbstractCvsCommandTest.java,v 1.1 2003/12/10 21:07:07 evenisse Exp $
   */
  public class AbstractCvsCommandTest extends TestCase
  {
      private TestAbstractCvsCommand cmd;
      
      public AbstractCvsCommandTest(String name)
      {
          super(name);
      }
      
      public void setUp() throws Exception
      {
          cmd = new TestAbstractCvsCommand();
      }
      
      public void testSetValidRepository()
      {
          try
          {
              CvsRepository repo = new CvsRepository();
              repo.setDelimiter(":");
              repo.setConnection("pserver:anonymous@cvs.apache.org:/scm:maven");
              cmd.setRepository(repo);
              assertEquals(repo, cmd.getRepository());
          }
          catch(ScmException e)
          {
              fail();
          }
      }
      
      public void testSetInvalidRepository()
      {
          try
          {
              cmd.setRepository(null);
              fail();
          }
          catch(ScmException e)
          {
              
          }
      }
      
      public void testSetBranch()
      {
          cmd.setBranch("aBranch");
          assertEquals("aBranch", cmd.getBranch());
      }
  
      public void testSetTag()
      {
          cmd.setBranch("aTag");
          assertEquals("aTag", cmd.getTag());
      }
  }
  
  
  1.1                  maven-scm/generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/CvsCommandWrapperTest.java
  
  Index: CvsCommandWrapperTest.java
  ===================================================================
  package org.apache.maven.genericscm.provider.cvslib.command;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 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-userName documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Maven" 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",
   *    "Apache Maven", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * 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/>.
   *
   * ====================================================================
   */
  
  import junit.framework.TestCase;
  
  import org.apache.maven.genericscm.ScmException;
  import org.apache.maven.genericscm.provider.cvslib.repository.CvsRepository;
  
  /**
   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
   * @version $Id: CvsCommandWrapperTest.java,v 1.1 2003/12/10 21:07:07 evenisse Exp $
   */
  public class CvsCommandWrapperTest extends TestCase
  {
      private CvsCommandWrapper wrapper;
      
      public CvsCommandWrapperTest(String testName)
      {
          super(testName);
      }
      
      public void setUp() throws Exception
      {
          wrapper = new CvsCommandWrapper();
      }
      
      public void testSetValidRepository()
      {
          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());
          }
      }
      
      public void testSetInvalidRepository()
      {
          try
          {
              wrapper.setRepository(null);
              fail();
          }
          catch(ScmException e)
          {
          }
      }
  }
  
  
  1.1                  maven-scm/generic-scm-providers/cvslib/src/test/org/apache/maven/genericscm/provider/cvslib/command/TestAbstractCvsCommand.java
  
  Index: TestAbstractCvsCommand.java
  ===================================================================
  package org.apache.maven.genericscm.provider.cvslib.command;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 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-userName documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Maven" 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",
   *    "Apache Maven", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * 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/>.
   *
   * ====================================================================
   */
  
  import junit.framework.TestCase;
  
  import org.apache.maven.genericscm.ScmException;
  import org.apache.maven.genericscm.util.Commandline;
  
  /**
   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
   * @version $Id: TestAbstractCvsCommand.java,v 1.1 2003/12/10 21:07:07 evenisse Exp $
   */
  public class TestAbstractCvsCommand extends AbstractCvsCommand
  {
      public Commandline getCommandLine() throws ScmException
      {
          return null;
      }
      
      public String getName() throws Exception
      {
          return null;
      }
      
      public String getDisplayName()
      {
          return null;
      }
  }