org.apache.maven.plugin.eclipse
Class AbstractEclipsePluginTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.codehaus.plexus.PlexusTestCase
              extended by org.apache.maven.plugin.eclipse.AbstractEclipsePluginTestCase
All Implemented Interfaces:
Test
Direct Known Subclasses:
EclipsePluginMasterProjectTest, EclipsePluginTest, EclipseWorkspaceTest, MyEclipsePluginTest, RadPluginTest

public abstract class AbstractEclipsePluginTestCase
extends org.codehaus.plexus.PlexusTestCase

Version:
$Id: AbstractEclipsePluginTestCase.java 595639 2007-11-16 12:16:25Z aheritier $
Author:
Trygve Laugstøl, Fabrizio Giustina

Field Summary
protected static String ARTIFACT_ID
          Artifact-Id for running test builds.
protected static String GROUP_ID
          Group-Id for running test builds.
protected static File localRepositoryDirectory
          Test repository directory.
protected static File PomFile
          Pom File
protected static String VERSION
          Version under which the plugin was installed to the test-time local repository for running test builds.
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
basedir, container
 
Constructor Summary
AbstractEclipsePluginTestCase()
           
 
Method Summary
protected  void assertContains(String message, String full, String substring)
           
protected  void assertDoesNotContain(String message, String full, String substring)
           
protected  void assertFileEquals(String mavenRepo, File expectedFile, File actualFile)
           
protected  void compareDirectoryContent(File basedir, File projectOutputDir, String additionalDir)
           
protected  void executeMaven(File pom, Properties properties, List goals)
           
protected  void executeMaven(File pom, Properties properties, List goals, boolean switchLocalRepo)
           
protected  File getOutputDirectory(String projectName)
           
protected  String getPluginCLISpecification()
           
protected  File getTestWorkspaceWorkDirectory(String projectName)
           
protected  org.apache.maven.project.MavenProject readProject(File pom)
           
protected  void setUp()
           
protected  void tearDown()
           
protected  void testProject(String projectName)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
protected  void testProject(String projectName, Properties properties)
          Deprecated. Use testProject(String,Properties,String,String) instead
protected  void testProject(String projectName, Properties properties, String cleanGoal, String genGoal)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
protected  void testWorkspace(String projectName)
          Execute the eclipse:configure-workspace goal on a test project and verify generated files.
protected  void testWorkspace(String projectName, Properties properties, String genGoal)
          Execute the eclipse:configure-workspace goal on a test project and verify generated files.
protected  void testWorkspace(String projectName, String goal)
          Execute the eclipse:configure-workspace goal on a test project and verify generated files.
 
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
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

localRepositoryDirectory

protected static File localRepositoryDirectory
Test repository directory.


PomFile

protected static File PomFile
Pom File


GROUP_ID

protected static final String GROUP_ID
Group-Id for running test builds.

See Also:
Constant Field Values

ARTIFACT_ID

protected static final String ARTIFACT_ID
Artifact-Id for running test builds.

See Also:
Constant Field Values

VERSION

protected static final String VERSION
Version under which the plugin was installed to the test-time local repository for running test builds.

See Also:
Constant Field Values
Constructor Detail

AbstractEclipsePluginTestCase

public AbstractEclipsePluginTestCase()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception
See Also:
PlexusTestCase.setUp()

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception
See Also:
PlexusTestCase.tearDown()

testProject

protected void testProject(String projectName)
                    throws Exception
Execute the eclipse:eclipse goal on a test project and verify generated files.

Parameters:
projectName - project directory
Throws:
Exception - any exception generated during test

testProject

protected void testProject(String projectName,
                           Properties properties)
                    throws Exception
Deprecated. Use testProject(String,Properties,String,String) instead

Execute the eclipse:eclipse goal on a test project and verify generated files.

Parameters:
projectName - project directory
properties - additional properties
Throws:
Exception - any exception generated during test

testProject

protected void testProject(String projectName,
                           Properties properties,
                           String cleanGoal,
                           String genGoal)
                    throws Exception
Execute the eclipse:eclipse goal on a test project and verify generated files.

Parameters:
projectName - project directory
properties - additional properties
cleanGoal - TODO
genGoal - TODO
Throws:
Exception - any exception generated during test

testWorkspace

protected void testWorkspace(String projectName)
                      throws Exception
Execute the eclipse:configure-workspace goal on a test project and verify generated files.

Parameters:
projectName - project directory
Throws:
Exception - any exception generated during test

testWorkspace

protected void testWorkspace(String projectName,
                             String goal)
                      throws Exception
Execute the eclipse:configure-workspace goal on a test project and verify generated files.

Parameters:
projectName - project directory
Throws:
Exception - any exception generated during test

testWorkspace

protected void testWorkspace(String projectName,
                             Properties properties,
                             String genGoal)
                      throws Exception
Execute the eclipse:configure-workspace goal on a test project and verify generated files.

Parameters:
projectName - project directory
properties - additional properties
cleanGoal - TODO
genGoal - TODO
Throws:
Exception - any exception generated during test

getOutputDirectory

protected File getOutputDirectory(String projectName)

getTestWorkspaceWorkDirectory

protected File getTestWorkspaceWorkDirectory(String projectName)

executeMaven

protected void executeMaven(File pom,
                            Properties properties,
                            List goals)
                     throws org.apache.maven.shared.test.plugin.TestToolsException,
                            ExecutionFailedException
Throws:
org.apache.maven.shared.test.plugin.TestToolsException
ExecutionFailedException

executeMaven

protected void executeMaven(File pom,
                            Properties properties,
                            List goals,
                            boolean switchLocalRepo)
                     throws org.apache.maven.shared.test.plugin.TestToolsException,
                            ExecutionFailedException
Throws:
org.apache.maven.shared.test.plugin.TestToolsException
ExecutionFailedException

readProject

protected org.apache.maven.project.MavenProject readProject(File pom)
                                                     throws org.apache.maven.shared.test.plugin.TestToolsException
Throws:
org.apache.maven.shared.test.plugin.TestToolsException

getPluginCLISpecification

protected String getPluginCLISpecification()

compareDirectoryContent

protected void compareDirectoryContent(File basedir,
                                       File projectOutputDir,
                                       String additionalDir)
                                throws IOException
Parameters:
basedir -
projectOutputDir -
Throws:
IOException

assertFileEquals

protected void assertFileEquals(String mavenRepo,
                                File expectedFile,
                                File actualFile)
                         throws IOException
Throws:
IOException

assertContains

protected void assertContains(String message,
                              String full,
                              String substring)

assertDoesNotContain

protected void assertDoesNotContain(String message,
                                    String full,
                                    String substring)


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.