Versions Compared

Key

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

...

Panel

<?xml version="1.0" encoding="UTF-8"?><archetype-registry>
  <ArchetypeGroups>
    <ArchetypeGroup>org.apache.maven.archetypes</ArchetypeGroup>
    <ArchetypeGroup>org.codehaus.mojo.archetypes</ArchetypeGroup>
    <ArchetypeGroup>org.apache.maven.it.sample</ArchetypeGroup>
  </ArchetypeGroups>
  <ArchetypeRepositories>
    <ArchetypeRepository id="central">
      <url>http://repo1.maven.org/maven2Image Removed</url>
    </ArchetypeRepository>
  </ArchetypeRepositories>
  <Languages>
    <Language>java</Language>
    <Language>groovy</Language>
    <Language>csharp</Language>
    <Language>aspectj</Language>
  </Languages>
  <FilteredExtensions>
    <FilteredExtension>java</FilteredExtension>
    <FilteredExtension>xml</FilteredExtension>
    <FilteredExtension>txt</FilteredExtension>
    <FilteredExtension>groovy</FilteredExtension>
    <FilteredExtension>cs</FilteredExtension>
    <FilteredExtension>mdo</FilteredExtension>
    <FilteredExtension>aj</FilteredExtension>
    <FilteredExtension>jsp</FilteredExtension>
    <FilteredExtension>gsp</FilteredExtension>
    <FilteredExtension>vm</FilteredExtension>
    <FilteredExtension>html</FilteredExtension>
    <FilteredExtension>xhtml</FilteredExtension>
    <FilteredExtension>properties</FilteredExtension>
    <FilteredExtension>.classpath</FilteredExtension>
    <FilteredExtension>.project</FilteredExtension>
  </FilteredExtensions>
</archetype-registry>

No Format

mvn archetypeng:add-groups -Dgroups=org.apache.maven.its

...

Now you can create the archetype project:

No Format
mvn archetype:create create

ARCHETYPE-83: prevents us from continuing with this story...

Tour of the Sample Project

The sample IT project contains the following files: 

No Format

|   pom.xml
|
\---src
    \---test
        +---java
        |   \---mypackage
        |           MavenITmngXXXXDescriptionOfProblemTest.java
        |
        \---resources
            \---mng-xxxx-descriptionOfProblem
                |   pom.xml
                |   readme.txt
                |
                +---checkstyle-assembly
                |   |   pom.xml
                |   |
                |   +---src
                |      \---main
                |          \---resources
                |                  rule_set.xml
                |                  stc_checks.xml
                |  
                |  
                |
                \---checkstyle-test
                    |   pom.xml
                    |
                    \---src
                        \---main
                            \---java
                                    Class.java
 

    src/test/java/contains a junit file used to execute the sample project. It is heavily commented to guide you along. Take a look

    src/test/resources contains a sample project tree that will be invoked to test our condition. The sample consists of a few modules, first an extension (checkstyle-assembly) that is jarred up and installed into the repository. Then a second invocation is made on a project that uses the extension (checkstyle-test)

The sample IT project uses the simplest method of using the verifier, that is the sample build fails if the test should fail. More complicated ITs can be created with beanshell scripts to check complex conditions. (Example Needed) (Link to verifier docs)

Once your IT is complete, you should be able to execute it:

No Format

>mvn test
Using maven.home=c:\Program Files\maven2\bin\\..
[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] ------------------------------------------------------------------------

 


How you should execute for integration test to validate

How to submit your integration test

...