o adding IT it0048

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465822 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2006-10-19 20:45:10 +00:00
parent edcc85396e
commit 2e8fc5e48a
4 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<model>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core-it0048</artifactId>
<description>Verify that default values for mojo parameters are working (indirectly,
by verifying that the Surefire mojo is functioning correctly).</description>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</model>

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,40 @@
package org.apache.maven.it0001;
import junit.framework.TestCase;
import java.net.URL;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class PersonTest
extends TestCase
{
public void testPerson() throws IOException
{
ClassLoader cloader = getClass().getClassLoader();
String path = getClass().getName().replace( '.', '/' ) + ".class";
URL resource = cloader.getResource( path );
File resourceFile = new File( resource.getPath() );
String dirPath = resourceFile.getAbsolutePath();
dirPath = dirPath.substring( 0, dirPath.length() - path.length() );
File dir = new File( dirPath );
dir = dir.getParentFile();
File testFile = new File( dir, "testFileOutput.txt" );
FileWriter writer = new FileWriter( testFile );
writer.write( "Test" );
writer.flush();
writer.close();
}
}