Coverage Report - org.apache.maven.scm.provider.cvslib.CvsScmTestUtils
 
Classes in this File Line Coverage Branch Coverage Complexity
CvsScmTestUtils
0 %
0/16
N/A
1
 
 1  
 package org.apache.maven.scm.provider.cvslib;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  * http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import junit.framework.Assert;
 23  
 import org.apache.maven.scm.ScmTestCase;
 24  
 import org.codehaus.plexus.PlexusTestCase;
 25  
 import org.codehaus.plexus.util.FileUtils;
 26  
 
 27  
 import java.io.File;
 28  
 import java.io.IOException;
 29  
 
 30  
 /**
 31  
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
 32  
  * @version $Id: CvsScmTestUtils.java 687713 2008-08-21 11:12:33Z vsiveton $
 33  
  */
 34  
 public final class CvsScmTestUtils
 35  
 {
 36  
     /** 'cvs' command line */
 37  
     public static final String CVS_COMMAND_LINE = "cvs";
 38  
 
 39  
     private CvsScmTestUtils()
 40  0
     {
 41  0
     }
 42  
 
 43  
     public static String getScmUrl( File repository, String module )
 44  
     {
 45  0
         return "scm:cvs|local|" + repository + "|" + module;
 46  
     }
 47  
 
 48  
     public static void executeCVS( File workingDirectory, String arguments )
 49  
         throws Exception
 50  
     {
 51  0
         ScmTestCase.execute( workingDirectory, CVS_COMMAND_LINE, arguments );
 52  0
     }
 53  
 
 54  
     public static void initRepo( File repository, File workingDirectory, File assertionDirectory )
 55  
         throws IOException
 56  
     {
 57  0
         initRepo( "src/test/repository/", repository, workingDirectory );
 58  
 
 59  0
         FileUtils.deleteDirectory( assertionDirectory );
 60  
 
 61  0
         Assert.assertTrue( assertionDirectory.mkdirs() );
 62  0
     }
 63  
 
 64  
     public static void initRepo( String source, File repository, File workingDirectory )
 65  
         throws IOException
 66  
     {
 67  
         // Copy the repository to target
 68  0
         File src = PlexusTestCase.getTestFile( source );
 69  
 
 70  0
         FileUtils.deleteDirectory( repository );
 71  
 
 72  0
         Assert.assertTrue( repository.mkdirs() );
 73  
 
 74  0
         FileUtils.copyDirectoryStructure( src, repository );
 75  
 
 76  0
         FileUtils.deleteDirectory( workingDirectory );
 77  
 
 78  0
         Assert.assertTrue( workingDirectory.mkdirs() );
 79  0
     }
 80  
 }