Versions Compared

Key

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

...

1. find the test case you wish to copy.

copy recursively recursively resources/testdata/<you_want_to_copy>-war to a new folder (ex. resources/testdata/NEW-war)
edit edit resources/testdata/new-war/pom.xml (change change artifact-id to NEW-war, and name to something descriptive )
edit edit resources/testdata/pom.xml and add module MEW NEW-war

edit core/samples/pom.xml
under Test data artifacts, add

Code Block

    <dependency>
 
    <groupId>org.codehaus.cargo</groupId>
 
    <artifactId>NEW-war</artifactId>

     <version>${cargoproject.resources.version}</version>
      <type>war</type>
 
  </dependency>

under Location of testdata dependencies..., add

Code Block

              <property>
                <name>cargo.testdata.NEW-war</name>
   
            <value>org/codehaus/cargo/NEW-war/${cargoproject.resources.version}/simple-NEW-${cargo.resourcesproject.version}.war</value>
      
       </property>

this will create a property that an implementation of of AbstractDataSourceWarCapabilityContainerTestCase can understand

add a new test class that does what you want, extending extending AbstractDataSourceWarCapabilityContainerTestCase or a subclass of it. Make sure you use an appropriate appropriate Validator for the configuration type you are concerned with. Otherwise you may end up testing invalid containers.

finally, execute execute mvn -P<container_to_test> install from the root of Cargo.