Fork me on GitHub

Usage

This page describes how to use this plugin in your project. If you need more details, or if you want to easily try this plugin, you can have a look to the sample project which closely follows this documentation.

Note that attester-maven-plugin is not yet included in the Maven central repository. Therefore, before being able to use it, you have to build and install it from sources. Please check the build section for more information.

Directory layout

Here is the recommended directory layout, which allows most configuration parameters to keep their default values:

.
|-- pom.xml
|-- src
|   |-- main
|   |   `-- webapp
|   |       |-- MyMainFiles.js        // Put here the main .js files
|   |       `-- MyOtherMainFile.js    // of your application
|   `-- test
|       `-- webapp
|           |-- MainTestSuite.js      // Put here the test-related .js files
|           `-- MyTestCase.js
`-- target                            // The target directory is created during the build.
    `-- MyProject-1.0-SNAPSHOT        // This directory corresponds to the ${project.build.finalName} variable
        |-- aria
        |   |-- bootstrap.js          // The correct Aria Templates version should be deployed
        |   `-- ...                   // here (by some configuration in the pom.xml)
        |-- other
        |   `-- MyOtherLib.js         // Any other library used by the project should be deployed
        |                             // somewhere in the ${project.build.finalName} directory
        |
        |-- MyMainFiles.js            // The main .js files of your application are also
        `-- MyOtherMainFile.js        // usually deployed here, but, by default, they will
                                      // not be used from here for the tests
                                      // (but from the src/main/webapp directory)

Simple configuration

To run Aria Templates tests automatically during the test phase of the build, add the following lines in the pom.xml file:

    <project>
        ...
        <build>
            <plugins>
                <plugin>
                    <groupId>com.ariatemplates.attester</groupId>
                    <artifactId>attester-maven-plugin</artifactId>
                    <version>2.6.2</version>
                    <configuration>
                        <!-- In the following line, replace /aria/bootstrap.js with the name of the Aria Templates main .js file -->
                        <ariaTemplatesBootstrap>/aria/bootstrap.js</ariaTemplatesBootstrap>
                        <ariaTemplatesClasspathsIncludes>
                            <!-- Specify below the classpaths of the set of test suites or test cases to run -->
                            <item>MainTestSuite</item>
                            <!-- If all the tests you want to run are included in a single test suite
                                called MainTestSuite, you can remove the whole ariaTemplatesClasspathsIncludes configuration
                                as it is the default value -->
                        </ariaTemplatesClasspathsIncludes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>test</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                ...
            </plugins>
        </build>
        ...
    </project>

To run the tests, you can now execute:

mvn test

To run tests manually, or check code coverage results, you can run:

mvn attester:run

This starts a web server and displays the URL to access it. You can use this URL to display code coverage results from the previous test campaign (launched with mvn test). You can also use it to run some tests manually with the Aria Templates test runner (by appending /aria/tester/index.html to the url).