org.apache.maven.plugin.eclipse.it
Class AbstractEclipsePluginIT

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.testing.AbstractMojoTestCase
                  extended by org.apache.maven.plugin.eclipse.it.AbstractEclipsePluginIT
All Implemented Interfaces:
Test
Direct Known Subclasses:
EclipseAjdtPluginIT, EclipsePluginIT, EclipsePluginMasterProjectIT, EclipseWorkspaceIT, MyEclipsePluginIT, RadPluginIT, RemoveCacheMojoIT

public abstract class AbstractEclipsePluginIT
extends AbstractMojoTestCase

Version:
$Id: AbstractEclipsePluginIT.java 1213573 2011-12-13 06:22:43Z baerrach $
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
AbstractEclipsePluginIT()
           
 
Method Summary
protected  void assertContains(String message, String full, String substring)
           
protected  void assertDoesNotContain(String message, String full, String substring)
           
protected  void assertFileEquals(File expectedFile, File actualFile)
           
protected  void assertNotAvailableMarkerFileDoesNotExist(String groupId, String artifactId, String version, String classifier, String inClassifier)
          Assert that the not available marker file does not exist for the specified artifact details.
protected  void assertNotAvailableMarkerFileExists(String groupId, String artifactId, String version, String classifier, String inClassifier)
          Assert that the not available marker file exists for the specified artifact details.
protected  void compareDirectoryContent(File basedir, File projectOutputDir)
           
protected  void executeMaven(File pom, Properties properties, List goals)
           
protected  void executeMaven(File pom, Properties properties, List goals, boolean switchLocalRepo)
           
protected  File getNotAvailableMarkerFile(String groupId, String artifactId, String version, String classifier, String inClassifier)
          Return the not available marker file for the specified artifact details.
protected  File getOutputDirectory(String projectName)
           
protected  String getPluginCLISpecification()
           
protected  File getTestWorkspaceWorkDirectory(String projectName)
           
protected  MavenProject readProject(File pom)
           
protected  void setUp()
           
protected  void tearDown()
           
protected  void testProject(File basedir)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
protected  void testProject(File basedir, Properties properties, String cleanGoal, String genGoal)
           
protected  void testProject(File basedir, Properties properties, String cleanGoal, String genGoal, boolean withInstall)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
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, String cleanGoal, String genGoal)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
protected  void testProject(String projectName, Properties properties, String cleanGoal, String genGoal, boolean withInstall)
          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.apache.maven.plugin.testing.AbstractMojoTestCase
configureMojo, configureMojo, extractPluginConfiguration, extractPluginConfiguration, getVariablesAndValuesFromObject, getVariablesAndValuesFromObject, getVariableValueFromObject, lookupEmptyMojo, lookupEmptyMojo, lookupMojo, lookupMojo, lookupMojo, setVariableValueToObject
 
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

AbstractEclipsePluginIT

public AbstractEclipsePluginIT()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class AbstractMojoTestCase
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(File basedir)
                    throws Exception
Execute the eclipse:eclipse goal on a test project and verify generated files.

Parameters:
basedir - basedir of mvn execution
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

testProject

protected void testProject(String projectName,
                           Properties properties,
                           String cleanGoal,
                           String genGoal,
                           boolean withInstall)
                    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
withInstall - true to include the install goal, false to exclude it.
Throws:
Exception - any exception generated during test

testProject

protected void testProject(File basedir,
                           Properties properties,
                           String cleanGoal,
                           String genGoal)
                    throws Exception
Parameters:
basedir - Execute the eclipse:eclipse goal on a test project and verify generated files.
properties - additional properties
cleanGoal - TODO
genGoal - TODO
Throws:
Exception - any exception generated during test

testProject

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

Parameters:
basedir - basedir of mvn execution
properties - additional properties
cleanGoal - TODO
genGoal - TODO
withInstall - true to include the install goal, false to exclude it.
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 TestToolsException,
                            ExecutionFailedException
Throws:
TestToolsException
ExecutionFailedException

executeMaven

protected void executeMaven(File pom,
                            Properties properties,
                            List goals,
                            boolean switchLocalRepo)
                     throws TestToolsException,
                            ExecutionFailedException
Throws:
TestToolsException
ExecutionFailedException

readProject

protected MavenProject readProject(File pom)
                            throws TestToolsException
Throws:
TestToolsException

getPluginCLISpecification

protected String getPluginCLISpecification()

compareDirectoryContent

protected void compareDirectoryContent(File basedir,
                                       File projectOutputDir)
                                throws MojoExecutionException
Parameters:
basedir - the base directory of the project
projectOutputDir - the directory where the eclipse plugin will write the output files.
Throws:
MojoExecutionException

assertFileEquals

protected void assertFileEquals(File expectedFile,
                                File actualFile)
                         throws MojoExecutionException
Throws:
MojoExecutionException

assertContains

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

assertDoesNotContain

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

getNotAvailableMarkerFile

protected File getNotAvailableMarkerFile(String groupId,
                                         String artifactId,
                                         String version,
                                         String classifier,
                                         String inClassifier)
                                  throws Exception
Return the not available marker file for the specified artifact details.

Parameters:
groupId - group id of artifact
artifactId - artifact id of artifact
version - version of artifact
classifier - the classifier of the artifact
inClassifier - the sources/javadocs to be attached
Returns:
the not available marker file
Throws:
Exception - failures.
See Also:
IdeUtils.createArtifactWithClassifier(String, String, String, String, String, ArtifactFactory)

assertNotAvailableMarkerFileExists

protected void assertNotAvailableMarkerFileExists(String groupId,
                                                  String artifactId,
                                                  String version,
                                                  String classifier,
                                                  String inClassifier)
                                           throws Exception
Assert that the not available marker file exists for the specified artifact details.

Parameters:
groupId - group id of artifact
artifactId - artifact id of artifact
version - version of artifact
classifier - the classifier of the artifact
inClassifier - the sources/javadocs to be attached
Throws:
Exception - failures

assertNotAvailableMarkerFileDoesNotExist

protected void assertNotAvailableMarkerFileDoesNotExist(String groupId,
                                                        String artifactId,
                                                        String version,
                                                        String classifier,
                                                        String inClassifier)
                                                 throws Exception
Assert that the not available marker file does not exist for the specified artifact details.

Parameters:
groupId - group id of artifact
artifactId - artifact id of artifact
version - version of artifact
classifier - the classifier of the artifact
inClassifier - the sources/javadocs to be attached
Throws:
Exception - failures


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