summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/org/openvpp/jvpp/test/CallbackApiTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-api/java/jvpp/org/openvpp/jvpp/test/CallbackApiTest.java')
-rw-r--r--vpp-api/java/jvpp/org/openvpp/jvpp/test/CallbackApiTest.java27
1 files changed, 14 insertions, 13 deletions
diff --git a/vpp-api/java/jvpp/org/openvpp/jvpp/test/CallbackApiTest.java b/vpp-api/java/jvpp/org/openvpp/jvpp/test/CallbackApiTest.java
index c3bb272368c..8c976db2397 100644
--- a/vpp-api/java/jvpp/org/openvpp/jvpp/test/CallbackApiTest.java
+++ b/vpp-api/java/jvpp/org/openvpp/jvpp/test/CallbackApiTest.java
@@ -18,16 +18,12 @@ package org.openvpp.jvpp.test;
import org.openvpp.jvpp.JVpp;
import org.openvpp.jvpp.JVppImpl;
+import org.openvpp.jvpp.VppCallbackException;
import org.openvpp.jvpp.VppJNIConnection;
import org.openvpp.jvpp.callback.GetNodeIndexCallback;
import org.openvpp.jvpp.callback.ShowVersionCallback;
import org.openvpp.jvpp.callback.SwInterfaceCallback;
-import org.openvpp.jvpp.dto.GetNodeIndex;
-import org.openvpp.jvpp.dto.GetNodeIndexReply;
-import org.openvpp.jvpp.dto.ShowVersion;
-import org.openvpp.jvpp.dto.ShowVersionReply;
-import org.openvpp.jvpp.dto.SwInterfaceDetails;
-import org.openvpp.jvpp.dto.SwInterfaceDump;
+import org.openvpp.jvpp.dto.*;
public class CallbackApiTest {
@@ -35,14 +31,14 @@ public class CallbackApiTest {
@Override
public void onGetNodeIndexReply(final GetNodeIndexReply msg) {
- System.out.printf("Received GetNodeIndexReply: context=%d, retval=%d, nodeIndex=%d\n",
- msg.context, msg.retval, msg.nodeIndex);
+ System.out.printf("Received GetNodeIndexReply: context=%d, nodeIndex=%d\n",
+ msg.context, msg.nodeIndex);
}
@Override
- public void onShowVersionReply(final ShowVersionReply msg) {
- System.out.printf("Received ShowVersionReply: context=%d, retval=%d, program=%s, version=%s, " +
+ public void onShowVersionReply(final ShowVersionReply msg) {
+ System.out.printf("Received ShowVersionReply: context=%d, program=%s, version=%s, " +
"buildDate=%s, buildDirectory=%s\n",
- msg.context, msg.retval, new String(msg.program), new String(msg.version),
+ msg.context, new String(msg.program), new String(msg.version),
new String(msg.buildDate), new String(msg.buildDirectory));
}
@@ -53,12 +49,17 @@ public class CallbackApiTest {
new String(msg.interfaceName), msg.l2AddressLength, msg.adminUpDown,
msg.linkUpDown, msg.linkSpeed, (int)msg.linkMtu);
}
+
+ @Override
+ public void onError(VppCallbackException ex) {
+ System.out.printf("Received onError exception: call=%s, context=%d, retval=%d\n", ex.getMethodName(), ex.getCtxId(), ex.getErrorCode());
+ }
}
private static void testCallbackApi() throws Exception {
System.out.println("Testing Java callback API");
- JVpp jvpp = new JVppImpl( new VppJNIConnection("CallbackApiTest"));
- jvpp.connect( new TestCallback());
+ JVpp jvpp = new JVppImpl(new VppJNIConnection("CallbackApiTest"));
+ jvpp.connect(new TestCallback());
System.out.println("Successfully connected to VPP");
System.out.println("Sending ShowVersion request...");