@Test public void importProjectsProfileSamplesPAPExecutablePlanDefinition() throws PlatoException { PlanParser parser = new PlanParser(); InputStream in = Thread.currentThread().getContextClassLoader() .getResourceAsStream("plans/PlanParserTest/PlanParserTest-PLAN_VALIDATED-ProfileSamplesPAP.xml"); List<Plan> plans = parser.importProjects(in); Assert.assertTrue(plans.size() == 1); Plan plan = plans.get(0); ExecutablePlanDefinition ex = plan.getExecutablePlanDefinition(); Assert.assertNull(ex.getObjectPath()); Assert.assertTrue("".equals(ex.getToolParameters())); Assert.assertTrue("".equals(ex.getTriggersConditions())); Assert.assertTrue("".equals(ex.getValidateQA())); Assert.assertNull(ex.getExecutablePlan()); DigitalObject t2flow = ex.getT2flowExecutablePlan(); Assert.assertNull(t2flow.getPid()); Assert.assertTrue("Create_tmp_file_and_convert_by_target_extension.t2flow".equals(t2flow.getFullname())); Assert.assertTrue("application/vnd.taverna.t2flow+xml".equals(t2flow.getContentType())); Assert.assertNull(t2flow.getJhoveXMLString()); Assert.assertNull(t2flow.getFitsXMLString()); Assert.assertNull(t2flow.getXcdlDescription()); Assert.assertNotNull(t2flow.getFormatInfo()); Assert.assertNotNull(t2flow.getData()); Assert.assertNotNull(t2flow.getData().getData()); Assert.assertTrue(t2flow.getData().getData().length > 0); Assert.assertTrue(t2flow.getData().getSize() > 0); Assert.assertNotNull(t2flow.getChangeLog()); Assert.assertNull(t2flow.getChangeLog().getCreatedBy()); Assert.assertNotNull(ex.getChangeLog()); Assert.assertTrue(ex.getChangeLog().getCreatedBy().equals("test1")); }
public List<Plan> importProjects(final String file) throws PlatoException { try { FileInputStream in = new FileInputStream(file); return importProjects(in); } catch (FileNotFoundException e) { throw new PlatoException("IMPORT FAILED: could not find file " + file, e); } }
PlanParser { public List<Plan> importProjects(final String file) throws PlatoException { try { FileInputStream in = new FileInputStream(file); return importProjects(in); } catch (FileNotFoundException e) { throw new PlatoException("IMPORT FAILED: could not find file " + file, e); } } }
PlanParser { public List<Plan> importProjects(final String file) throws PlatoException { try { FileInputStream in = new FileInputStream(file); return importProjects(in); } catch (FileNotFoundException e) { throw new PlatoException("IMPORT FAILED: could not find file " + file, e); } }  }
PlanParser { public List<Plan> importProjects(final String file) throws PlatoException { try { FileInputStream in = new FileInputStream(file); return importProjects(in); } catch (FileNotFoundException e) { throw new PlatoException("IMPORT FAILED: could not find file " + file, e); } }  List<Plan> importProjects(final String file); void setProject(final Plan p); void setTemplate(final TemplateTree t); List<TemplateTree> importTemplates(final InputStream in); List<Plan> importProjects(final InputStream in); }
PlanParser { public List<Plan> importProjects(final String file) throws PlatoException { try { FileInputStream in = new FileInputStream(file); return importProjects(in); } catch (FileNotFoundException e) { throw new PlatoException("IMPORT FAILED: could not find file " + file, e); } }  List<Plan> importProjects(final String file); void setProject(final Plan p); void setTemplate(final TemplateTree t); List<TemplateTree> importTemplates(final InputStream in); List<Plan> importProjects(final InputStream in);  }