-
Notifications
You must be signed in to change notification settings - Fork 11
Writing Extensions
Create a maven project with a starting pom with the following template (You can also find an example project here)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.adobe.qe</groupId>
<artifactId>toughday2-tests-parent</artifactId>
<version>0.9.2</version> <!-- Always try to use the latest version -->
</parent>
<groupId>${YourGroupID}</groupId>
<artifactId>${YourArtifactID}</artifactId>
<packaging>jar</packaging>
<version>${YourVersion}</version>
</project><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.adobe.qe</groupId>
<artifactId>aem-td2-tests-parent</artifactId>
<version>0.9.2</version> <!-- Always try to use the latest version -->
</parent>
<groupId>${YourGroupID}</groupId>
<artifactId>${YourArtifactID}</artifactId>
<packaging>jar</packaging>
<version>${YourVersion}</version>
</project><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.adobe.cq</groupId>
<artifactId>cloud-perf-parent</artifactId>
<version>${ReleaseVersion}</version> <!-- Always try to use the latest version -->
</parent>
<groupId>${YourGroupID}</groupId>
<artifactId>${YourArtifactID}</artifactId>
<packaging>jar</packaging>
<version>${YourVersion}</version>
</project>Then you are good to go to create your first ToughDay2 test.
Extensions are added in the same way we add a test or a publisher (using --add option). So, in order to run a test contained in an extension jar file, we have to add both the extension jar file and the test from that extension. In order to do that, we have two options:
Use command line arguments :
java -jar ToughDay.jar --host=localhost --add pathToJarFile/ExtensionFileName.jar --add ExtensionTestNameUse one yaml configuration file and pass this file to ToughDay using the --configfile option:
java -jar ToughDay.jar --configfile=pathToConfigFile/ConfigFileName.yamlAn example of how extensions should be written inside the configuration file can be found below:
globals:
port : 4502
host : localhost
extensions:
- add : /path/to/toughday2-tests-sample-0.1.0-SNAPSHOT.jar
- add : /path/to/toughday2-publisher-sample-0.1.0-SNAPSHOT.jar
tests:
- add : MyDemoTest
properties:
property : demo
publishers:
- add : com.adobe.qe.example.MyDemoPublisherToughDay2 provides a set of API classes which are located in the com.adobe.qe.toughday.api package of the com.adobe.qe:toughday2-api jar. Toughday2 developers will strive to keep these API classes backwards compatible moving forward, but until the 1.0.0 version is released this is not guaranteed. Any other classes (usually located in packages marked as *.internal.*, but not necessarily) are subject to change without prior notice.
Moving forward, most likely more internal classes will move to the API package to allow more OOTB functionality or to provide more extension points.
Currently, the following extension points are provided by the Toughday2 core:
- Creating the Maven Project
- How to load an extension jar
- What's API and what's not?
- What are the existing Extension Points?