...
A sample project has been created to aid in IT test creation. It can be retrieved using svn hereor viewed with your browser here.
Sample IT Archetype Archetype
This project has also been converted into an archetype to make it even easier to use. (NOTE: This is currently not deployed and bugs prevent this from being usable right now. Use the Sample IT project for now and skip this section -Brianf 8/8/07)
...
ARCHETYPE-82: You must manually create archetype.xml in your $HOME/.m2 folder and it must minimally contain the following:
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<?xml version="1.0" encoding="UTF-8"?><archetype-registry> |
No Format |
---|
mvn archetypeng:add-groups -Dgroups=org.apache.maven.its
|
Successful output:
No Format |
---|
E:\svn\Maven\atest>mvn archetypeng:add-groups -Dgroups=org.apache.maven.its
Using maven.home=c:\Program Files\maven2\bin\\..
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetypeng'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetypeng:add-groups] (aggregator-style)
[INFO] ----------------------------------------------------------------------------
[INFO] [archetypeng:add-groups]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Aug 08 21:58:57 EDT 2007
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------
|
Now you can create the archetype project:
No Format |
---|
mvn archetype:create |
ARCHETYPE-83: prevents us from continuing with this story...
Tour of the Sample Project
...
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] ------------------------------------------------------------------------ |
Submitting your IT Test
Now that your IT is complete, create a zip, tgz or some other *normal* archive of your test and attach it to your Jira issue.
...
Now run the suite:
No Format |
---|
brianf@sonoma /cygdrive/e/svn/Maven/maven-it-tests/core-integration-test
$ 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 124 source files to e:\svn\Maven\maven-it-tests\core-integration-tests\target\test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: e:\svn\Maven\maven-it-tests\core-integration-tests\target\surefire-reports
Running integration tests for Maven 2.0.7
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.apache.maven.integrationtests.IntegrationTestSuite
Running integration tests for Maven 2.0.7
0000(testit0000).. Ok
....
got get some coffee, it's gonna be a while
....
MavenItmngXXXXDescriptionOfProblemTest...Ok <-- our test...yeah!
Tests run: 115, Failures: 22, Errors: 3, Skipped: 0, Time elapsed: 534.241 sec <<< FAILURE!
Results :
Failed tests:
testit0002(org.apache.maven.integrationtests.MavenIT0002Test)
Tests in error:
testit0086(org.apache.maven.integrationtests.MavenIT0086Test)
testit0087(org.apache.maven.integrationtests.MavenIT0087Test)
testit0104(org.apache.maven.integrationtests.MavenIT0104Test)
Tests run: 115, Failures: 22, Errors: 3, Skipped: 0
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 minutes 12 seconds
[INFO] Finished at: Wed Aug 08 23:39:48 EDT 2007
[INFO] Final Memory: 4M/12M
[INFO] ------------------------------------------------------------------------
|
...