ProcessorNames { public List<String> showProcessorNames(WorkflowBundle ro) throws JAXBException, IOException { ArrayList<String> names = new ArrayList<String>(); for (Processor processor : ro.getMainWorkflow().getProcessors()) { names.add(processor.getName()); } Collections.sort(names); return names; }  static void main(String[] args); TreeModel makeProcessorTree(WorkflowBundle workflowBundle); List<String> showProcessorNames(WorkflowBundle ro); String showProcessorTree(WorkflowBundle ro); String treeModelAsString(TreeModel treeModel);  }
@Test public void processorNames() throws JAXBException, IOException, ReaderException { InputStream workflow = getClass().getResourceAsStream( "/workflows/t2flow/defaultActivitiesTaverna2.2.t2flow"); assertNotNull(workflow); WorkflowBundleIO io = new WorkflowBundleIO(); WorkflowBundle ro = io.readBundle(workflow, "application/vnd.taverna.t2flow+xml"); List<String> expected = Arrays.asList("Beanshell", "Nested_workflow", "Rshell", "Send_an_Email", "SpreadsheetImport", "String_constant", "TavernaResearchObject", "biomart", "localWorker", "localWorker_bytearray", "mobyObject", "mobyService", "run", "run_input", "run_output", "setWorkflows", "soaplab", "wsdl_document", "wsdl_rpc", "wsdl_secured", "xmlSplitter"); ProcessorNames processorNames = new ProcessorNames(); assertEquals(expected, processorNames.showProcessorNames(ro)); }
@Test public void nestedWorkflow() throws JAXBException, IOException, ReaderException { InputStream workflow = getClass().getResourceAsStream( "/workflows/t2flow/as.t2flow"); assertNotNull(workflow); WorkflowBundleIO io = new WorkflowBundleIO(); WorkflowBundle ro = io.readBundle(workflow, "application/vnd.taverna.t2flow+xml"); ProcessorNames processorNames = new ProcessorNames(); assertEquals(8, processorNames.showProcessorNames(ro).size()); }
@Test public void nestedWorkflowBundle() throws JAXBException, IOException, ReaderException { InputStream workflow = getClass().getResourceAsStream( "/workflows/wfbundle/as.wfbundle"); assertNotNull(workflow); WorkflowBundleIO io = new WorkflowBundleIO(); WorkflowBundle ro = io.readBundle(workflow, null); ProcessorNames processorNames = new ProcessorNames(); assertEquals(8, processorNames.showProcessorNames(ro).size()); }