View Javadoc
1   package org.apache.maven.wagon.providers.scm;
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 org.apache.maven.scm.provider.ScmProvider;
23  import org.apache.maven.scm.provider.cvslib.cvsexe.CvsExeScmProvider;
24  
25  /**
26   * Test for ScmWagon using CVS Exe as underlying SCM
27   *
28   * @author <a href="carlos@apache.org">Carlos Sanchez</a>
29   *
30   */
31  public class ScmCvsExeWagonTest
32      extends AbstractScmCvsWagonTest
33  {
34  
35      @Override
36      protected void setUp()
37          throws Exception
38      {
39          assumeHaveCvsBinary();
40          if ( !testSkipped )
41          {
42              super.setUp();
43          }
44      }
45  
46      protected ScmProvider getScmProvider()
47      {
48          return new CvsExeScmProvider();
49      }
50  
51      @Override
52      public void testWagonGetFileList()
53          throws Exception
54      {
55          // cvs rls is rare
56      }
57  
58      @Override
59      public void testWagonResourceExists()
60          throws Exception
61      {
62          // cvs rls is rare
63      }
64  
65      @Override
66      public void testWagonResourceNotExists()
67          throws Exception
68      {
69          // cvs rls is rare
70      }
71  
72      @Override
73      protected boolean supportsGetIfNewer()
74      {
75          return false;
76      }
77  
78      /** Optionally set the testSkipped flag */
79      protected void assumeHaveCvsBinary()
80      {
81          if ( !isSystemCmd( CVS_COMMAND_LINE ) )
82          {
83              testSkipped = true;
84              System.err.println( "'" + CVS_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." );
85          }
86      }
87  
88      /** 'cvs' command line */
89      public static final String CVS_COMMAND_LINE = "cvs";
90  }