1 package org.apache.maven.repository.reporting;
4 * Copyright 2001-2005 The Apache Software Foundation.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 import org.codehaus.plexus.PlexusTestCase;
22 import org.codehaus.plexus.util.FileUtils;
25 * @author <a href="mailto:jtolentino@mergere.com">John Tolentino</a>
27 public abstract class AbstractRepositoryReportsTestCase
28 extends PlexusTestCase
30 private static String JAR = ".jar";
32 private static String basedir;
34 private static String[] directoryStructure;
36 public AbstractRepositoryReportsTestCase( String basedir, String[] directoryStructure )
38 this.basedir = basedir;
39 this.directoryStructure = directoryStructure;
42 protected void setUp()
49 private void buildTestRepoPath()
51 for ( int i = 0; i < directoryStructure.length; i++ )
53 File dir = new File( basedir + directoryStructure[i] );
61 private void deleteTestRepoPath() throws Exception
63 FileUtils.deleteDirectory( basedir );
66 protected boolean writeTestArtifact( String relativePath, String artifactId )
69 File artifact = new File( basedir + relativePath + artifactId + JAR );
70 System.out.println( "" + basedir + relativePath + artifactId );
71 return artifact.createNewFile();
74 protected void tearDown()