org.codehaus.modello
Class AbstractModelloJavaGeneratorTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.codehaus.plexus.PlexusTestCase
org.codehaus.modello.AbstractModelloGeneratorTest
org.codehaus.modello.AbstractModelloJavaGeneratorTest
- All Implemented Interfaces:
- junit.framework.Test
public abstract class AbstractModelloJavaGeneratorTest
- extends AbstractModelloGeneratorTest
Base class for unit-tests of Modello plugins that generate java code.
- Version:
- $Id: AbstractModelloJavaGeneratorTest.java 1473 2010-04-24 16:46:13Z bentmann $
- Author:
- Trygve Laugstøl
- See Also:
compileGeneratedSources() method to compile generated sources
,
verifyCompiledGeneratedSources(String) method to run a Verifier
class against compiled generated code
,
Verifier base class for verifiers
Fields inherited from class org.codehaus.plexus.PlexusTestCase |
basedir, container |
Methods inherited from class org.codehaus.plexus.PlexusTestCase |
createContainerInstance, customizeContext, customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getContainer, getCustomConfiguration, getResourceAsStream, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, release, tearDown |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
AbstractModelloJavaGeneratorTest
protected AbstractModelloJavaGeneratorTest(String name)
setUp
protected void setUp()
throws Exception
- Overrides:
setUp
in class AbstractModelloGeneratorTest
- Throws:
Exception
getOutputDirectory
protected File getOutputDirectory()
- Overrides:
getOutputDirectory
in class AbstractModelloGeneratorTest
getOutputClasses
protected File getOutputClasses()
addDependency
protected void addDependency(String groupId,
String artifactId)
getDependencyFile
protected File getDependencyFile(String groupId,
String artifactId)
getClasspath
public List<File> getClasspath()
getModelloVersion
protected String getModelloVersion()
throws IOException
- Throws:
IOException
compileGeneratedSources
protected void compileGeneratedSources()
throws IOException,
org.codehaus.plexus.compiler.CompilerException
- Throws:
IOException
org.codehaus.plexus.compiler.CompilerException
compileGeneratedSources
protected void compileGeneratedSources(boolean useJava5)
throws IOException,
org.codehaus.plexus.compiler.CompilerException
- Throws:
IOException
org.codehaus.plexus.compiler.CompilerException
compileGeneratedSources
protected void compileGeneratedSources(String verifierId)
throws IOException,
org.codehaus.plexus.compiler.CompilerException
- Throws:
IOException
org.codehaus.plexus.compiler.CompilerException
compileGeneratedSources
protected void compileGeneratedSources(String verifierId,
boolean useJava5)
throws IOException,
org.codehaus.plexus.compiler.CompilerException
- Throws:
IOException
org.codehaus.plexus.compiler.CompilerException
verifyCompiledGeneratedSources
protected void verifyCompiledGeneratedSources(String verifierClassName)
throws MalformedURLException
- Run a verifier class in a classloader context where compiled generated sources are available
- Parameters:
verifierClassName
- the class name of the verifier class
- Throws:
MalformedURLException
addClassPathFile
protected void addClassPathFile(File file)
printClasspath
protected void printClasspath(URLClassLoader classLoader)
assertGeneratedFileExists
protected void assertGeneratedFileExists(String filename)
skipJava5FeatureTest
protected boolean skipJava5FeatureTest()
- Check if a Java 5 feature test should be skipped, since it is not supported by current test environment.
- Returns:
true
if Java 5 is not available, then feature test should be skipped by caller
getClassPathElements
protected List<String> getClassPathElements()
Copyright © 2001-2012 Codehaus. All Rights Reserved.