@Test public void importProjectsProfileSamplesPAPPreservationActionPlan() 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); DigitalObject pap = plan.getPreservationActionPlan(); Assert.assertNull(pap.getPid()); Assert.assertTrue("PreservationActionPlan.xml".equals(pap.getFullname())); Assert.assertTrue("application/xml".equals(pap.getContentType())); Assert.assertNull(pap.getJhoveXMLString()); Assert.assertNull(pap.getFitsXMLString()); Assert.assertNull(pap.getXcdlDescription()); Assert.assertNotNull(pap.getFormatInfo()); Assert.assertNotNull(pap.getData()); Assert.assertNotNull(pap.getData().getData()); Assert.assertTrue(pap.getData().getData().length > 0); Assert.assertTrue(pap.getData().getSize() > 0); Assert.assertNotNull(pap.getChangeLog()); Assert.assertNull(pap.getChangeLog().getCreatedBy()); }
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);  }