delete metadata files for all versions to ensure intergration test works as expected

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@326389 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-10-19 04:54:57 +00:00
parent 6fe85e1bd0
commit e6b92f1b17
1 changed files with 49 additions and 51 deletions

View File

@ -222,60 +222,31 @@ public class Verifier
newLine += convertArtifact( artifact ); newLine += convertArtifact( artifact );
newLine += line.substring( index + 1 ); newLine += line.substring( index + 1 );
index = newLine.lastIndexOf( "SNAPSHOT" ); List l = new ArrayList();
if ( index >= 0 ) l.add( newLine );
int endIndex = newLine.lastIndexOf( '/' );
String command = null;
String filespec;
if ( hasCommand )
{ {
List l = new ArrayList(); int startIndex = newLine.indexOf( ' ' );
l.add( newLine );
int endIndex = newLine.lastIndexOf( '/' ); command = newLine.substring( 0, startIndex );
String command = null; filespec = newLine.substring( startIndex + 1, endIndex );
String filespec;
if ( hasCommand )
{
int startIndex = newLine.indexOf( ' ' );
command = newLine.substring( 0, startIndex );
filespec = newLine.substring( startIndex + 1, endIndex );
}
else
{
filespec = newLine;
}
File dir = new File( filespec );
if ( dir.exists() && dir.isDirectory() )
{
String[] files = dir.list( new FilenameFilter()
{
public boolean accept( File dir, String name )
{
return name.startsWith( "maven-metadata" ) && name.endsWith( ".xml" );
}
} );
for ( int i = 0; i < files.length; i++ )
{
if ( hasCommand )
{
l.add( command + " " + new File( dir, files[i] ).getPath() );
}
else
{
l.add( new File( dir, files[i] ).getPath() );
}
}
}
return l;
} }
else else
{ {
return Collections.singletonList( newLine ); filespec = newLine;
} }
File dir = new File( filespec );
addMetadataToList( dir, hasCommand, l, command );
addMetadataToList( dir.getParentFile(), hasCommand, l, command );
return l;
} }
else else
{ {
@ -283,6 +254,33 @@ public class Verifier
} }
} }
private static void addMetadataToList( File dir, boolean hasCommand, List l, String command )
{
if ( dir.exists() && dir.isDirectory() )
{
String[] files = dir.list( new FilenameFilter()
{
public boolean accept( File dir, String name )
{
return name.startsWith( "maven-metadata" ) && name.endsWith( ".xml" );
}
} );
for ( int i = 0; i < files.length; i++ )
{
if ( hasCommand )
{
l.add( command + " " + new File( dir, files[i] ).getPath() );
}
else
{
l.add( new File( dir, files[i] ).getPath() );
}
}
}
}
private static String convertArtifact( String artifact ) private static String convertArtifact( String artifact )
{ {
StringTokenizer tok = new StringTokenizer( artifact, ":" ); StringTokenizer tok = new StringTokenizer( artifact, ":" );
@ -636,8 +634,8 @@ public class Verifier
cli.createArgument().setLine( "-D" + key + "=" + properties.getProperty( key ) ); cli.createArgument().setLine( "-D" + key + "=" + properties.getProperty( key ) );
} }
boolean useMavenRepoLocal = boolean useMavenRepoLocal = Boolean.valueOf(
Boolean.valueOf( controlProperties.getProperty( "use.mavenRepoLocal", "true" ) ).booleanValue(); controlProperties.getProperty( "use.mavenRepoLocal", "true" ) ).booleanValue();
if ( useMavenRepoLocal ) if ( useMavenRepoLocal )
{ {
// Note: Make sure that the repo is surrounded by quotes as it can possibly have // Note: Make sure that the repo is surrounded by quotes as it can possibly have
@ -852,8 +850,8 @@ public class Verifier
Properties controlProperties = verifier.loadProperties( "verifier.properties" ); Properties controlProperties = verifier.loadProperties( "verifier.properties" );
boolean chokeOnErrorOutput = boolean chokeOnErrorOutput = Boolean.valueOf(
Boolean.valueOf( controlProperties.getProperty( "failOnErrorOutput", "true" ) ).booleanValue(); controlProperties.getProperty( "failOnErrorOutput", "true" ) ).booleanValue();
verifier.executeGoals( properties, controlProperties, "goals.txt" ); verifier.executeGoals( properties, controlProperties, "goals.txt" );