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:
junit.framework.Test
Direct Known Subclasses:
EclipseAjdtPluginIT, EclipsePluginIT, EclipsePluginMasterProjectIT, EclipseWorkspaceIT, M2EclipseMojoIT, MyEclipsePluginIT, RadPluginIT, RemoveCacheMojoIT

public abstract class AbstractEclipsePluginIT
extends org.apache.maven.plugin.testing.AbstractMojoTestCase

Version:
$Id: AbstractEclipsePluginIT.java 751904 2009-03-09 23:13:33Z aheritier $
Author:
Trygve Laugstøl, Fabrizio Giustina

Field Summary
protected static java.lang.String ARTIFACT_ID
          Artifact-Id for running test builds.
protected static java.lang.String GROUP_ID
          Group-Id for running test builds.
protected static java.io.File localRepositoryDirectory
          Test repository directory.
protected static java.io.File PomFile
          Pom File
protected static java.lang.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(java.lang.String message, java.lang.String full, java.lang.String substring)
           
protected  void assertDoesNotContain(java.lang.String message, java.lang.String full, java.lang.String substring)
           
protected  void assertFileEquals(java.io.File expectedFile, java.io.File actualFile)
           
protected  void assertNotAvailableMarkerFileDoesNotExist(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String classifier, java.lang.String inClassifier)
          Assert that the not available marker file does not exist for the specified artifact details.
protected  void assertNotAvailableMarkerFileExists(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String classifier, java.lang.String inClassifier)
          Assert that the not available marker file exists for the specified artifact details.
protected  void compareDirectoryContent(java.io.File basedir, java.io.File projectOutputDir)
           
protected  void executeMaven(java.io.File pom, java.util.Properties properties, java.util.List goals)
           
protected  void executeMaven(java.io.File pom, java.util.Properties properties, java.util.List goals, boolean switchLocalRepo)
           
protected  java.io.File getNotAvailableMarkerFile(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String classifier, java.lang.String inClassifier)
          Return the not available marker file for the specified artifact details.
protected  java.io.File getOutputDirectory(java.lang.String projectName)
           
protected  java.lang.String getPluginCLISpecification()
           
protected  java.io.File getTestWorkspaceWorkDirectory(java.lang.String projectName)
           
protected  org.apache.maven.project.MavenProject readProject(java.io.File pom)
           
protected  void setUp()
           
protected  void tearDown()
           
protected  void testProject(java.io.File basedir)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
protected  void testProject(java.io.File basedir, java.util.Properties properties, java.lang.String cleanGoal, java.lang.String genGoal)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
protected  void testProject(java.lang.String projectName)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
protected  void testProject(java.lang.String projectName, java.util.Properties properties, java.lang.String cleanGoal, java.lang.String genGoal)
          Execute the eclipse:eclipse goal on a test project and verify generated files.
protected  void testWorkspace(java.lang.String projectName)
          Execute the eclipse:configure-workspace goal on a test project and verify generated files.
protected  void testWorkspace(java.lang.String projectName, java.util.Properties properties, java.lang.String genGoal)
          Execute the eclipse:configure-workspace goal on a test project and verify generated files.
protected  void testWorkspace(java.lang.String projectName, java.lang.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 java.io.File localRepositoryDirectory
Test repository directory.


PomFile

protected static java.io.File PomFile
Pom File


GROUP_ID

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

See Also:
Constant Field Values

ARTIFACT_ID

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

See Also:
Constant Field Values

VERSION

protected static final java.lang.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 java.lang.Exception
Overrides:
setUp in class org.apache.maven.plugin.testing.AbstractMojoTestCase
Throws:
java.lang.Exception
See Also:
PlexusTestCase.setUp()

tearDown

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

testProject

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

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

testProject

protected void testProject(java.io.File basedir)
                    throws java.lang.Exception
Execute the eclipse:eclipse goal on a test project and verify generated files.

Parameters:
basedir - basedir of mvn execution
Throws:
java.lang.Exception - any exception generated during test

testProject

protected void testProject(java.lang.String projectName,
                           java.util.Properties properties,
                           java.lang.String cleanGoal,
                           java.lang.String genGoal)
                    throws java.lang.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:
java.lang.Exception - any exception generated during test

testProject

protected void testProject(java.io.File basedir,
                           java.util.Properties properties,
                           java.lang.String cleanGoal,
                           java.lang.String genGoal)
                    throws java.lang.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
Throws:
java.lang.Exception - any exception generated during test

testWorkspace

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

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

testWorkspace

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

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

testWorkspace

protected void testWorkspace(java.lang.String projectName,
                             java.util.Properties properties,
                             java.lang.String genGoal)
                      throws java.lang.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:
java.lang.Exception - any exception generated during test

getOutputDirectory

protected java.io.File getOutputDirectory(java.lang.String projectName)

getTestWorkspaceWorkDirectory

protected java.io.File getTestWorkspaceWorkDirectory(java.lang.String projectName)

executeMaven

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

executeMaven

protected void executeMaven(java.io.File pom,
                            java.util.Properties properties,
                            java.util.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(java.io.File pom)
                                                     throws org.apache.maven.shared.test.plugin.TestToolsException
Throws:
org.apache.maven.shared.test.plugin.TestToolsException

getPluginCLISpecification

protected java.lang.String getPluginCLISpecification()

compareDirectoryContent

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

assertFileEquals

protected void assertFileEquals(java.io.File expectedFile,
                                java.io.File actualFile)
                         throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

assertContains

protected void assertContains(java.lang.String message,
                              java.lang.String full,
                              java.lang.String substring)

assertDoesNotContain

protected void assertDoesNotContain(java.lang.String message,
                                    java.lang.String full,
                                    java.lang.String substring)

getNotAvailableMarkerFile

protected java.io.File getNotAvailableMarkerFile(java.lang.String groupId,
                                                 java.lang.String artifactId,
                                                 java.lang.String version,
                                                 java.lang.String classifier,
                                                 java.lang.String inClassifier)
                                          throws java.lang.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:
java.lang.Exception - failures.
See Also:
IdeUtils.createArtifactWithClassifier(String, String, String, String, String, ArtifactFactory)

assertNotAvailableMarkerFileExists

protected void assertNotAvailableMarkerFileExists(java.lang.String groupId,
                                                  java.lang.String artifactId,
                                                  java.lang.String version,
                                                  java.lang.String classifier,
                                                  java.lang.String inClassifier)
                                           throws java.lang.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:
java.lang.Exception - failures

assertNotAvailableMarkerFileDoesNotExist

protected void assertNotAvailableMarkerFileDoesNotExist(java.lang.String groupId,
                                                        java.lang.String artifactId,
                                                        java.lang.String version,
                                                        java.lang.String classifier,
                                                        java.lang.String inClassifier)
                                                 throws java.lang.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:
java.lang.Exception - failures


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