org.apache.maven.plugin.ejb
Class EjbMojoTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.codehaus.plexus.PlexusTestCase
              extended byorg.apache.maven.plugin.testing.AbstractMojoTestCase
                  extended byorg.apache.maven.plugin.ejb.EjbMojoTest
All Implemented Interfaces:
junit.framework.Test

public class EjbMojoTest
extends org.apache.maven.plugin.testing.AbstractMojoTestCase

EJB plugin Test Case


Field Summary
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
basedir, container
 
Constructor Summary
EjbMojoTest()
           
 
Method Summary
protected  void assertClientJarContent(org.apache.maven.project.MavenProject project, java.lang.String[] expectedFiles, java.lang.String[] unexpectedFiles)
           
protected  void assertJarContent(org.apache.maven.project.MavenProject project, java.lang.String[] expectedFiles, java.lang.String[] unexpectedFiles)
           
protected  void assertJarCreation(org.apache.maven.project.MavenProject project, boolean ejbJarCreated, boolean ejbClientJarCreated)
           
protected  void assertJarCreation(org.apache.maven.project.MavenProject project, boolean ejbJarCreated, boolean ejbClientJarCreated, java.lang.String classifier)
           
protected  MavenProjectResourcesStub createTestProject(java.lang.String testName)
           
protected  EjbMojo lookupMojo()
           
protected  EjbMojo lookupMojoWithDefaultSettings(org.apache.maven.project.MavenProject project)
           
protected  EjbMojo lookupMojoWithSettings(org.apache.maven.project.MavenProject project, java.util.LinkedList clientIncludes, java.util.LinkedList clientExcludes, java.util.LinkedList excludes)
           
 void setUp()
           
protected  void setupDefaultProject(MavenProjectResourcesStub project)
           
 void tearDown()
           
 void testClassifiedJarWithClientJar()
          Classified jar creation test with client jar.
 void testClassifiedJarWithoutClientJar()
          Classified jar creation test.
 void testClientJarDefaultInclusionsExclusions()
          Client jar default inclusion and exclusion test.
 void testClientJarExclusions()
          Client jar exclusions test.
 void testClientJarExclusionsWithEmptyPackage()
          Client jar exclusions test that leaves an empty package.
 void testClientJarInclusions()
          Client jar inclusion test.
 void testClientJarInclusionsWithSubPackage()
          Client jar inclusion test with a sub-package.
 void testDefaultInclusionsExclusions()
          Default ejb jar inclusion and exclusion test.
 void testDefaultWithClientJar()
          Basic jar creation test with client jar.
 void testDefaultWithoutClientJar()
          Basic jar creation test.
 void testEjbCompliance_3_0_WithoutDescriptor()
          Tests if the jar is created under EJB version 3.0 without deployment descriptor present.
 void testEjbComplianceVersionThreeWithDescriptor()
          Tests if the jar is created under EJB version 3.0 with deployment descriptor present.
 void testEjbComplianceVersionTwoDotOneWithoutDescriptor()
          Tests if the mojo throws an exception when the EJB version is < 3.0 and no deployment descriptor is present.
 void testMainJarExclusions()
          Main jar exclusions test.
 void testTestEnvironment()
          check test environment
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EjbMojoTest

public EjbMojoTest()
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Throws:
java.lang.Exception

tearDown

public void tearDown()
              throws java.lang.Exception
Throws:
java.lang.Exception

testTestEnvironment

public void testTestEnvironment()
                         throws java.lang.Exception
check test environment

Throws:
java.lang.Exception - if any exception occurs

testDefaultWithoutClientJar

public void testDefaultWithoutClientJar()
                                 throws java.lang.Exception
Basic jar creation test.

Throws:
java.lang.Exception - if any exception occurs

testClassifiedJarWithoutClientJar

public void testClassifiedJarWithoutClientJar()
                                       throws java.lang.Exception
Classified jar creation test.

Throws:
java.lang.Exception - if any exception occurs

testDefaultWithClientJar

public void testDefaultWithClientJar()
                              throws java.lang.Exception
Basic jar creation test with client jar.

Throws:
java.lang.Exception - if any exception occurs

testClassifiedJarWithClientJar

public void testClassifiedJarWithClientJar()
                                    throws java.lang.Exception
Classified jar creation test with client jar.

Throws:
java.lang.Exception - if any exception occurs

testDefaultInclusionsExclusions

public void testDefaultInclusionsExclusions()
                                     throws java.lang.Exception
Default ejb jar inclusion and exclusion test.

Throws:
java.lang.Exception - if any exception occurs

testClientJarDefaultInclusionsExclusions

public void testClientJarDefaultInclusionsExclusions()
                                              throws java.lang.Exception
Client jar default inclusion and exclusion test.

Throws:
java.lang.Exception - if any exception occurs

testClientJarInclusions

public void testClientJarInclusions()
                             throws java.lang.Exception
Client jar inclusion test.

Throws:
java.lang.Exception - if any exception occurs

testClientJarExclusions

public void testClientJarExclusions()
                             throws java.lang.Exception
Client jar exclusions test.

Throws:
java.lang.Exception - if any exception occurs

testMainJarExclusions

public void testMainJarExclusions()
                           throws java.lang.Exception
Main jar exclusions test.

Throws:
java.lang.Exception - if any exception occurs

testClientJarInclusionsWithSubPackage

public void testClientJarInclusionsWithSubPackage()
                                           throws java.lang.Exception
Client jar inclusion test with a sub-package.

Throws:
java.lang.Exception - if any exception occurs

testClientJarExclusionsWithEmptyPackage

public void testClientJarExclusionsWithEmptyPackage()
                                             throws java.lang.Exception
Client jar exclusions test that leaves an empty package.

Throws:
java.lang.Exception - if any exception occurs

testEjbComplianceVersionTwoDotOneWithoutDescriptor

public void testEjbComplianceVersionTwoDotOneWithoutDescriptor()
                                                        throws java.lang.Exception
Tests if the mojo throws an exception when the EJB version is < 3.0 and no deployment descriptor is present. The case with deployment descriptor present is covered by previous tests.

Throws:
java.lang.Exception - if any exception occurs

testEjbComplianceVersionThreeWithDescriptor

public void testEjbComplianceVersionThreeWithDescriptor()
                                                 throws java.lang.Exception
Tests if the jar is created under EJB version 3.0 with deployment descriptor present.

Throws:
java.lang.Exception - if any exception occurs

testEjbCompliance_3_0_WithoutDescriptor

public void testEjbCompliance_3_0_WithoutDescriptor()
                                             throws java.lang.Exception
Tests if the jar is created under EJB version 3.0 without deployment descriptor present.

Throws:
java.lang.Exception - if any exception occurs

lookupMojo

protected EjbMojo lookupMojo()
                      throws java.lang.Exception
Throws:
java.lang.Exception

createTestProject

protected MavenProjectResourcesStub createTestProject(java.lang.String testName)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

setupDefaultProject

protected void setupDefaultProject(MavenProjectResourcesStub project)
                            throws java.lang.Exception
Throws:
java.lang.Exception

lookupMojoWithSettings

protected EjbMojo lookupMojoWithSettings(org.apache.maven.project.MavenProject project,
                                         java.util.LinkedList clientIncludes,
                                         java.util.LinkedList clientExcludes,
                                         java.util.LinkedList excludes)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

lookupMojoWithDefaultSettings

protected EjbMojo lookupMojoWithDefaultSettings(org.apache.maven.project.MavenProject project)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

assertJarCreation

protected void assertJarCreation(org.apache.maven.project.MavenProject project,
                                 boolean ejbJarCreated,
                                 boolean ejbClientJarCreated,
                                 java.lang.String classifier)

assertJarCreation

protected void assertJarCreation(org.apache.maven.project.MavenProject project,
                                 boolean ejbJarCreated,
                                 boolean ejbClientJarCreated)

assertJarContent

protected void assertJarContent(org.apache.maven.project.MavenProject project,
                                java.lang.String[] expectedFiles,
                                java.lang.String[] unexpectedFiles)
                         throws java.io.IOException
Throws:
java.io.IOException

assertClientJarContent

protected void assertClientJarContent(org.apache.maven.project.MavenProject project,
                                      java.lang.String[] expectedFiles,
                                      java.lang.String[] unexpectedFiles)
                               throws java.io.IOException
Throws:
java.io.IOException


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