Create an Encoder/Decoder using a Maven archetype

This tutorial describes how to create a new Encoder/Decoder from an archetype. Using a Maven archetype allows you to easily and quickly develop Encoder/Decoders since Encoder, Decoder and Binder classes are automatically created.

For more information about how to implement the Data Format Extension API in NeoLoad, see Data Format Extension requests.

Use case environment

The use case presented in this tutorial was performed in the following environment:

  • Computer on Windows 7 with an Administrator account

  • Java Development Kit version 7

  • Eclipse for Java developers launched with Administrator privileges

  • NeoLoad 5.0 and above

Prerequisites

In order to create a Maven project, you need to add a connector to your Eclipse environment.

  1. In the Help Menu, select Install New Software...

  2. In the Work with: field, enter http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-jdt-compiler/.

  3. Select M2E connector for the Eclipse JDT Compiler.

  4. Click Next> twice, accept the terms of the license and click Finish.

Create a Maven project

This section describes how to create a Maven project with Eclipse. To do so, follow these steps:

  1. Create a workspace in Eclipse or use an existing one.

  2. In the Java perspective, select File -> New -> Project….

  3. In the New Project dialog, select Maven -> Maven Project and select Next.

  4. Make sure Create a simple project is not selected in the first screen of the New Maven Project wizard and select Next.

  5. In the Select an Archetype step, select Configure….

  6. Select Add Remote Catalog... and add the neotys archetype catalog.

  7. Enter "https://maven.neotys.com/content/groups/public/archetype-catalog.xml" in the Catalog File field.

  8. Enter neotys in the Description.

  9. Select Verify... and then OK to add the catalog.

  10. Select OK in the Preferences dialog.

    Now you should be able to find neotys in the Catalog list.

  11. Select neotys-custom-action-archetype from the archetypes list and select Next.

  12. Fill out the details for Group Id, Artifact Id, Version number, Package name, binderName, decoderName, encoderName, namerName, and outputFolder.

  13. Before selecting Finish make sure to uncheck the Run archetype generation interactively box. Select Finish so that Maven downloads the necessary dependencies.

The encoder, decoder and namer can now be implemented.

Generate the JAR of the Encoder/Decoder

To use the Encoder/Decoder in NeoLoad, you need to generate a JAR file.

To generate the JAR of your Encoder/Decoder into the output directory of your user directory: Right-click on your Java project and select Run As > Maven install.