diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-11-03 10:52:43 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-11-03 16:42:41 +0000 |
commit | bdb1f8193736c0c63429d049397d4783959c1148 (patch) | |
tree | 48df00eab6d0315a91b67cd81286ae5536f1f81f /plugins/ioam-plugin/ioam/jvpp | |
parent | e7637e701717f24172cdbdbf89ba71bdef5125de (diff) |
Fail to register Java API for plugin that was not loaded (VPP-522)
Change-Id: Idb95888ae6fc7a9df197a919e3d3283f915f4a4c
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'plugins/ioam-plugin/ioam/jvpp')
-rw-r--r-- | plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/IoamTraceApiTest.java (renamed from plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/ioamTraceApiTest.java) | 42 | ||||
-rw-r--r-- | plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/Readme.txt | 2 |
2 files changed, 19 insertions, 25 deletions
diff --git a/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/ioamTraceApiTest.java b/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/IoamTraceApiTest.java index ce8ff612..fa5c7ba4 100644 --- a/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/ioamTraceApiTest.java +++ b/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/IoamTraceApiTest.java @@ -25,13 +25,12 @@ import io.fd.vpp.jvpp.ioamtrace.callback.TraceProfileAddCallback; import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileAdd; import io.fd.vpp.jvpp.ioamtrace.dto.TraceProfileAddReply; -public class ioamTraceApiTest { +public class IoamTraceApiTest { - - static class ioamTraceTestCallback implements TraceProfileAddCallback { + static class IoamTraceTestCallback implements TraceProfileAddCallback { @Override - public void onTraceProfileAddReply(final TraceProfileAddReply reply) { + public void onTraceProfileAddReply(final TraceProfileAddReply reply) { System.out.printf("Received TraceProfileAddReply reply: context=%d%n", reply.context); } @@ -48,29 +47,24 @@ public class ioamTraceApiTest { } private static void ioamTraceTestApi() throws Exception { - System.out.println("Testing Java API for ioam trace plugin"); - final JVppRegistry registry = new JVppRegistryImpl("ioamTraceApiTest"); - final JVpp jvpp = new JVppIoamtraceImpl(); + try (final JVppRegistry registry = new JVppRegistryImpl("ioamTraceApiTest"); + final JVpp jvpp = new JVppIoamtraceImpl()) { + registry.register(jvpp, new IoamTraceTestCallback()); - registry.register(jvpp, new ioamTraceTestCallback()); - try{ - System.out.println("Sending ioam trace profile add request..."); - TraceProfileAdd request = new TraceProfileAdd(); - request.traceType = 0x1f; - request.numElts = 4; - request.nodeId = 1; - request.traceTsp = 2; - request.appData = 1234; - final int result = jvpp.send(request); - System.out.printf("TraceProfileAdd send result = %d%n", result); + System.out.println("Sending ioam trace profile add request..."); + TraceProfileAdd request = new TraceProfileAdd(); + request.traceType = 0x1f; + request.numElts = 4; + request.nodeId = 1; + request.traceTsp = 2; + request.appData = 1234; + final int result = jvpp.send(request); + System.out.printf("TraceProfileAdd send result = %d%n", result); - Thread.sleep(1000); - } - finally { - System.out.println("Disconnecting..."); - registry.close(); Thread.sleep(1000); - } + + System.out.println("Disconnecting..."); + } } } diff --git a/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/Readme.txt b/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/Readme.txt index 0246d76d..1913f098 100644 --- a/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/Readme.txt +++ b/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/Readme.txt @@ -1 +1 @@ -sudo java -cp build-vpp_debug-native/vpp-api/java/jvpp-registry-16.12.jar:build-vpp_debug-native/vpp-api/java/jvpp-core-16.12.jar:build-vpp_debug-native/plugins/ioam-plugin/jvpp-ioam-trace-1.0.jar io.fd.vpp.jvpp.ioamtrace.test.ioamTraceApiTest +sudo java -cp build-vpp_debug-native/vpp-api/java/jvpp-registry-16.12.jar:build-vpp_debug-native/plugins/ioam-plugin/jvpp-ioam-trace-1.0.jar io.fd.vpp.jvpp.ioamtrace.test.IoamTraceApiTest |