Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
|   pom.xml
|
\---src
    \---test
        +---java
        |   \---mypackageorg
        |        \---apache
   MavenITmngXXXXDescriptionOfProblemTest.java
     |   |
        \---resourcesmaven
        |    \---mng-xxxx-descriptionOfProblem
           \---integrationTests
	|     |   pom.xml
                |   readmeMavenITmngXXXXDescriptionOfProblemTest.txtjava
        |
        |\---resources
                +\---mng-checkstylexxxx-assemblydescriptionOfProblem
                |   |   pom.xml
                |   |readme.txt
                |
                +---srccheckstyle-assembly
                |   |   \---mainpom.xml
                |   |
       \---resources
         |   +---src
    |            |      rule_set.xml\---main
                |          \---resources
         stc_checks.xml
       |         |
         rule_set.xml
       |
         |       |
           stc_checks.xml
     \---checkstyle-test
           |
         |   pom.xml
    |
                |
                    \\---checkstyle-srctest
                    |   pom.xml
    \---main
                |
                    \---javasrc
                        \---main
                       Class.java

     \---java
                                    Class.java

    src/test    src/test/java/contains a junit file used to execute the sample project. It is heavily commented to guide you along. Stop here and Take a lookbefore continuing.

...

No Format
>mvn test
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Integration Tests
[INFO]    task-segment: [test]
[INFO] ----------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to E:\svn\Maven\maven-it-tests\test\artifact\target\test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: E:\svn\Maven\maven-it-tests\test\artifact\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running mypackage.MavenITmngXXXXDescriptionOfProblemTest
mngXXXXDescriptionOfProblem(testitMNGxxxx).. Ok
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.802 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25 seconds
[INFO] Finished at: Wed Aug 08 22:47:44 EDT 2007
[INFO] Final Memory: 4M/10M
[INFO] ------------------------------------------------------------------------


...

Integrating your IT into the core-integration-tests

Now that your IT is complete, it's time to integrate it into the core-its and make a patch.

...

First, check out the core-integration-tests 

The sample project maps directly to the core-integration-tests structure. Assuming you have named your test uniquely, you can copy the contents of src/test directly over to core-integration-tests (don't copy from the root or you'll overwrite the pom). 

No Format

/cygdrive/e/svn/Maven/maven-it-tests/core-integration-tests
$ cp ../test/artifact/src . -R -v
`../test/artifact/src/test/java/org/apache/maven/integrationtests/MavenITmngXXXXDescriptionOfProblemTest.java' -> `./src/test/java/org/apache/maven/integrationtests/MavenITmngXXXXDescriptionOfProblemTest.java'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/pom.xml' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/pom.xml'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/src/main/resources/rule_set.xml' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/src/main/resources/rule_set.xml'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/src/main/resources/stc_checks.xml' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/src/main/resources/stc_checks.xml'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/rule_set.xml' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/rule_set.xml'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/stc_checks.xml' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-assembly/target/classes/stc_checks.xml'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/pom.xml' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/pom.xml'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/src/main/java/Class.java' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/checkstyle-test/src/main/java/Class.java'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/pom.xml' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/pom.xml'
`../test/artifact/src/test/resources/mng-xxxx-descriptionOfProblem/readme.txt' -> `./src/test/resources/mng-xxxx-descriptionOfProblem/readme.txt'

Now add your test to the testSuite by adding a new line to "src\test\java\org\apache\maven\integrationtests\IntegrationTestSuite.java"

No Format

 suite.addTestSuite( MavenItmngXXXXDescriptionOfProblemTest.class );

Now run the suite:

Don't panic if some tests fail. That's probably normal. Only Panic if your test doesn't fail and it was supposed to.

Now add all those new files to svn (you can figure this one out on your own by now...you're an expert...and its late here)

Create a patch from the root of core-integration-tests


When you will know your IT has been integrated