taverna-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nadeesh Dilanga <nadeesh...@gmail.com>
Subject Re: Issue in reusing ActivityInvoker#invokeAsyncActivity for unit tests
Date Tue, 28 Jun 2016 02:26:14 GMT
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 <nadeesh092@gmail.com>

> 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,
>       System.out.println(outputs.size());

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message