...
You should see log output that shows a successful translation from "abcd" to "ABCD".
If you have errors building...
You might hit an error about "Failure to find com.beust:klaxon:jar". This jar comes from Spring IO at https://repo.spring.io/plugins-release/com/beust/klaxon/ and this repo is not normally mirrored in most repositories, but ODL does mirror this and you can add the following to your ~/settings.xml
Code Block |
---|
<repository>
<id>opendaylight-public</id>
<name>opendaylight-public</name>
<url>https://nexus.opendaylight.org/content/repositories/public</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository> |
Running the tests
Most of the testing is done using unit tests that are written using Spock (a highly recommended
alternative to JUnit). These tests are run as part of every single build and a failure of
a unit test breaks the build.
...
Code Block |
---|
class MyApp { // throws if this path does shouldnot have the required sub-directory structure above SearchPath root = new SearchPath("/opt/myapp/my-plastic"); CartographerWorker worker = new CartographerWorker(root); // the schemas directory should have these somewhere: // my-input-schema-1.0.json // my-output-schema-1.0.json VersionedSchema inschema = new VersionedSchema("my-input-schema", "1.0", "json") VersionedSchema outschema = new VersionedSchema("my-output-schema", "1.0", "json") void handleIncomingPayload(String payload) { ... String result = worker.translate(inschema, outschema, payload); ... } } |
...