T2FlowParser { public String getName() throws TavernaParserException { log.debug("Extracting workflow name"); XPath xpath = DocumentHelper .createXPath("/t2f:workflow/t2f:dataflow[@role='top']/t2f:annotations*/*/annotationBean[@class='net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle']/text"); xpath.setNamespaceURIs(T2FLOW_NAMESPACE_MAP); Node node = xpath.selectSingleNode(doc); if (node == null) { return null; } return node.getText(); }  static T2FlowParser createParser(InputStream t2flow); String getId(); String getName(); String getDescription(); String getAuthor(); Document getDoc();  }
@Test public void getNameTest() throws Exception { InputStream t2flow = getClass().getResourceAsStream("/taverna/WorkflowAnnotations.t2flow"); assertTrue(t2flow != null); T2FlowParser t2flowParser = T2FlowParser.createParser(t2flow); assertTrue(t2flowParser.getName().equals("Workflow Title")); }