T2FlowParser { public String getId() throws TavernaParserException { log.debug("Extracting profile ID"); XPath xpath = DocumentHelper.createXPath("/t2f:workflow/t2f:dataflow[@role='top']/@id"); 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 getIdTest() throws Exception { InputStream t2flow = getClass().getResourceAsStream("/taverna/WorkflowAnnotations.t2flow"); assertTrue(t2flow != null); T2FlowParser t2flowParser = T2FlowParser.createParser(t2flow); assertTrue(t2flowParser.getId().equals("e0089782-e811-48c7-b72d-2b84ddfdeb11")); }