Hi, If reusing ActivityInvoker not fits in here, I can avoid it and directly invoke the Docker activity async execution and come up with a similar thread wait/notify mechanism to write the test case.
I am waiting for a conclusion for this, so that I can send the pull request on the test case with the README on how to execute.(actually it will be a JUnit test case eventually). On Sat, Jun 25, 2016 at 2:11 AM, Nadeesh Dilanga <[email protected]> wrote: > Hi, > I am trying to reuse the ActivityInvoker#invokeAsyncActivity to my > activity plugin unit test. And my code is as follows where I am passing > String inputs to inspect an image. But the ActivityInvoker not passing same > inouts to my DockerActivity. > Ex: In ActivityInvoker > referenceService.register(getNameForObject) > returns "t2:error//testNS?test0/0" after converting my input > "hello-world". I debug the code, it identifies my input as a > ExternalReferenceSPI and that seems to be what converting my value to > "t2:error//testNS?test0/0"". > > Any idea why ? If this is not good to reuse for my case, shall I directly > invoke the activity class ? > > DockerActivity activity = new DockerActivity(containerConfiguration); > activity.configure(activityConfiguration); > > Map<String,Object> inputs = new HashMap<String,Object>(); > inputs.put(DockerActivity.ACTION, DockerActivity.INSPECT); > inputs.put(DockerActivity.IN_IMAGE_NAME, IMAGE_NAME); > > Map<String, Class<?>> expectedOutputs = new HashMap<String, Class<?>>(); > expectedOutputs.put("response_body", T2Reference.class); > > Map<String,Object> outputs = ActivityInvoker.invokeAsyncActivity(activity, > inputs, expectedOutputs); > System.out.println(outputs.size()); > > > >
