This is an example of a web action adapter plugin.
Plugins are used to extend the agent test execution vocabulary and SUT (System Under Test) driving capabilities.
<dependency>
<groupId>io.toast-tk</groupId>
<artifactId>toast-tk-adapters-api</artifactId>
<version>0.1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.toast-tk</groupId>
<artifactId>toast-tk-agent-api</artifactId>
<version>0.1.5-SNAPSHOT</version>
</dependency> @Override
public Collection<? extends Module> getModules() {
Module module = new AbstractActionAdapterModule() {
@Override
protected void configure() {
bindActionAdapter(WebActionAdapter.class);
}
};
return Arrays.asList(module);
} src/main/resources
|__ META-INF
|____ services
|______ io.toast.tk.plugin.IAgentPlugin
my.first.plugin.MyAgentPlugin
- Use maven-assembly plugin (the plugin must include it's runtime dependencies)
- assembly.xml example:
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>plugin</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>runtime</scope>
<excludes>
</excludes>
</dependencySet>
</dependencySets>
</assembly>- Maven assemble plugin example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<executions>
<execution>
<goals>
<goal>attached</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>toast-tk-example</finalName>
<descriptor>src/assembly/bin.xml</descriptor>
</configuration>
</execution>
</executions>
</plugin>Enjoy, you're done !
The assembled jar (here: /target/toast-tk-example-plugin.jar) can be copied to your agent plugin directory.
For contribution rules and guidelines, See CONTRIBUTING.md
If you'd like to help, get in touch and let us know how you'd like to help. We love contributors!!