Initial revision

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162710 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2004-05-21 17:25:02 +00:00
parent cde1476131
commit 34b0e98e97
20 changed files with 307 additions and 0 deletions

View File

@ -0,0 +1,9 @@
*~
*.log
target
*.ipr
*.iws
dist
target
.classpath
.project

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="false">
<component name="ModuleRootManager" />
<component name="NewModuleRootManager">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="java version &quot;1.4.2&quot;" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,5 @@
<project>
<groupId>maven</groupId>
<artifactId>maven-core-it-verifier</artifactId>
<version>1.0</version>
</project>

View File

@ -0,0 +1,28 @@
package org.apache.maven.it;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
*/
public class VerificationException
extends Exception
{
public VerificationException()
{
}
public VerificationException( String message )
{
super( message );
}
public VerificationException( Throwable cause )
{
super( cause );
}
public VerificationException( String message, Throwable cause )
{
super( message, cause );
}
}

View File

@ -0,0 +1,91 @@
package org.apache.maven.it;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.net.URL;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
*/
public class Verifier
{
private String basedir;
public Verifier( String basedir )
{
this.basedir = basedir;
}
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
public void verify()
throws VerificationException
{
try
{
BufferedReader reader = new BufferedReader( new FileReader( new File( basedir, "expected-results.txt" ) ) );
String line = "";
while ( ( line = reader.readLine() ) != null )
{
verifyExpectedResult( line );
}
}
catch ( Exception e )
{
throw new VerificationException( e );
}
}
private void verifyExpectedResult( String line )
throws VerificationException
{
if ( line.indexOf( "!/" ) > 0 )
{
String urlString = "jar:file:" + line;
try
{
URL url = new URL( urlString );
InputStream is = url.openStream();
if ( is == null )
{
throw new VerificationException( "Expected JAR resource was not found: " + line );
}
}
catch ( Exception e )
{
throw new VerificationException( "Expected JAR resource was not found: " + line );
}
}
else
{
File expectedFile = new File( basedir, line );
if ( !expectedFile.exists() )
{
throw new VerificationException( "Expected file was not found: " + line );
}
}
}
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
public static void main( String args[] )
throws VerificationException
{
Verifier verifier = new Verifier( args[0] );
verifier.verify();
}
}

21
maven-core-it/README.txt Normal file
View File

@ -0,0 +1,21 @@
it0000: The simplest of builds. We have one application class and one test
class. There are no resources, no source generation, no resource
generation and a the super model is employed to provide the build
information.
it0001: Build upon it0000 we add an application resource that is packaged
up in the resultant JAR.
-------------------------------------------------------------------------------
- generated sources
- generated resources from sources
- generated resources from generated sources
- filtered resources
- build that requires a plugin download
- transitive dependencies
- write a small program to generate a massively nested build
which which use the reactor and inheritence. we need to have
integration tests that go far beyond what the average user
would ever setup.

View File

@ -0,0 +1,2 @@
it0000
it0001

View File

@ -0,0 +1,9 @@
*~
*.log
target
*.ipr
*.iws
dist
target
.classpath
.project

View File

@ -0,0 +1,3 @@
target/classes/org/apache/maven/it0000/Person.class
target/test-classes/org/apache/maven/it0000/PersonTest.class
target/maven-core-it0000-1.0.jar

View File

@ -0,0 +1,13 @@
<project>
<groupId>maven</groupId>
<artifactId>maven-core-it0000</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>test</type>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,16 @@
package org.apache.maven.it0000;
public class Person
{
private String name;
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
}

View File

@ -0,0 +1,16 @@
package org.apache.maven.it0000;
import junit.framework.TestCase;
public class PersonTest
extends TestCase
{
public void testPerson()
{
Person person = new Person();
person.setName( "foo" );
assertEquals( "foo", person.getName() );
}
}

View File

@ -0,0 +1,9 @@
*~
*.log
target
*.ipr
*.iws
dist
target
.classpath
.project

View File

@ -0,0 +1 @@
/home/jvanzyl/maven-repo-local

View File

@ -0,0 +1,4 @@
target/classes/org/apache/maven/it0001/Person.class
target/test-classes/org/apache/maven/it0001/PersonTest.class
target/maven-core-it0001-1.0.jar
target/maven-core-it0001-1.0.jar!/it0001.properties

View File

@ -0,0 +1,13 @@
<project>
<groupId>maven</groupId>
<artifactId>maven-core-it0001</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>test</type>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,16 @@
package org.apache.maven.it0001;
public class Person
{
private String name;
public void setName( String name )
{
this.name = name;
}
public String getName()
{
return name;
}
}

View File

@ -0,0 +1 @@
name = jason

View File

@ -0,0 +1,16 @@
package org.apache.maven.it0001;
import junit.framework.TestCase;
public class PersonTest
extends TestCase
{
public void testPerson()
{
Person person = new Person();
person.setName( "foo" );
assertEquals( "foo", person.getName() );
}
}

21
maven-core-it/maven-core-it.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
home=`pwd`
cp=`pwd`/../maven-core-it-verifier/target/maven-core-it-verifier-1.0.jar
verifier=org.apache.maven.it.Verifier
integration_tests=`cat integration-tests.txt`
for integration_test in $integration_tests
do
echo "Running integration test $integration_test ..."
(
cd $integration_test
m2 clean jar
java -cp $cp $verifier `pwd`
)
done