o adding a test project that i'm going to try and build from the embedder

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@291769 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2005-09-26 22:23:43 +00:00
parent 7abf304382
commit 16199817d4
4 changed files with 95 additions and 6 deletions

View File

@ -0,0 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven</groupId>
<artifactId>embedder-test-project</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Quick Start Archetype</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,13 @@
package org.apache.maven;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@ -0,0 +1,38 @@
package org.apache.maven;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}

View File

@ -22,11 +22,7 @@ public class MavenEmbedderTest
super.setUp();
basedir = System.getProperty( "basedir" );
}
public void testMavenEmbedder()
throws Exception
{
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
maven = new MavenEmbedder();
@ -34,14 +30,38 @@ public class MavenEmbedderTest
maven.setClassLoader( classLoader );
maven.start();
}
protected void tearDown()
throws Exception
{
maven.stop();
}
public void testMavenEmbedder()
throws Exception
{
modelReadingTest();
projectReadingTest();
maven.stop();
}
// ----------------------------------------------------------------------
// Goal/Phase execution tests
// ----------------------------------------------------------------------
public void testPhaseExecution()
throws Exception
{
File pomFile = new File( basedir, "src/test/embedder-test-project/pom.xml" );
MavenProject pom = maven.readProjectWithDependencies( pomFile );
}
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
protected void modelReadingTest()
throws Exception
{