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 java.io.File;
23  
24  import org.codehaus.plexus.util.FileUtils;
25  
26  /**
27   * Test for ScmWagon using SVN as underlying SCM
28   *
29   * @author <a href="brett@apache.org">Brett Porter</a>
30   *
31   */
32  public abstract class AbstractScmSvnWagonTest
33      extends AbstractScmWagonTest
34  {
35      private String repository;
36  
37      protected void setUp()
38          throws Exception
39      {
40          super.setUp();
41  
42          // copy the repo for the test
43  
44          File origRepo = getTestFile( "target/test-classes/test-repo-svn" );
45  
46          File testRepo = getTestFile( "target/test-classes/test-repo-svn-test" );
47  
48          FileUtils.deleteDirectory( testRepo );
49  
50          FileUtils.copyDirectoryStructure( origRepo, testRepo );
51  
52          repository = testRepo.getAbsolutePath();
53  
54          // TODO: this is a hack for windows
55          // Note: why not use File.toURL() ?
56          if ( repository.indexOf( ":" ) >= 0 )
57          {
58              repository = "/" + repository;
59          }
60          repository = repository.replace( '\\', '/' );
61  
62          repository = "scm:svn:file://" + repository;
63      }
64  
65      protected String getScmId()
66      {
67          return "svn";
68      }
69  
70      protected String getTestRepositoryUrl()
71      {
72          return repository;
73      }
74  
75      protected boolean supportsGetIfNewer()
76      {
77          return false;
78      }
79  }