Ruslan Diachenko created SUREFIRE-835:
-----------------------------------------

             Summary: Tests for maven plugins are incompatible with maven 3.0.4
                 Key: SUREFIRE-835
                 URL: https://jira.codehaus.org/browse/SUREFIRE-835
             Project: Maven Surefire
          Issue Type: Bug
            Reporter: Ruslan Diachenko
         Attachments: simple-test.zip

Steps will reproduce the problem:
1. Write test for maven plugin by extending test class from 
AbstractMojoTestCase (package org.apache.maven.plugin.testing)

public class SimpleMavenTest extends AbstractMojoTestCase {

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        // code
    }

    public void test() throws Exception {
        // test case
    }

    @Override
    protected void tearDown() throws Exception {
        // code
        super.tearDown();
    }
}

2. Configure maven-surefire-plugin as follows:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
        <forkMode>never</forkMode>
      </configuration>
    </plugin>
  </plugins>
</build>

3. Run "mvn test" on maven 3.0.4

Detected:
java.lang.IllegalStateException: The internal default plexus-bootstrap.xml is 
missing. This is highly irregular, your plexus JAR is most likely corrupt.
    at 
org.codehaus.plexus.DefaultPlexusContainer.initializeConfiguration(DefaultPlexusContainer.java:1052)
    at 
org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:627)
    at org.codehaus.plexus.PlexusTestCase.setUp(PlexusTestCase.java:119)
    at 
org.apache.maven.plugin.testing.AbstractMojoTestCase.setUp(AbstractMojoTestCase.java:69)
    at org.maven.test.MyMojoTest.setUp(MyMojoTest.java:12)
    at junit.framework.TestCase.runBare(TestCase.java:128)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at junit.framework.TestSuite.runTest(TestSuite.java:230)
    at junit.framework.TestSuite.run(TestSuite.java:225)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Error occurred only when <forkMode>never</forkMode>. If we change forkMode 
value to "once" or another one, test will run succesfully. On maven 3.0.3 and 
previous maven versions the test was run without any errors.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to