@Test public void importProjectsMinimalPlanProperties() throws PlatoException { PlanParser parser = new PlanParser(); InputStream in = Thread.currentThread().getContextClassLoader() .getResourceAsStream("plans/PlanParserTest/PlanParserTest-PLAN_VALIDATED-minimal.xml"); List<Plan> plans = parser.importProjects(in); Assert.assertTrue(plans.size() == 1); Plan plan = plans.get(0); PlanProperties pp = plan.getPlanProperties(); Assert.assertTrue("PlanParser Test - minimal".equals(pp.getName())); Assert.assertTrue("Test".equals(pp.getDescription())); Assert.assertTrue("Test1 Test1".equals(pp.getAuthor())); Assert.assertTrue("TUW".equals(pp.getOrganization())); Assert.assertTrue(pp.isPrivateProject()); Assert.assertFalse(pp.isReportPublic()); Assert.assertTrue(pp.getState() == PlanState.PLAN_VALIDATED); Assert.assertTrue("test1".equals(pp.getOwner())); Assert.assertNotNull(pp.getReportUpload()); Assert.assertTrue("".equals(pp.getOpenedByUser())); Assert.assertNotNull(pp.getChangeLog()); Assert.assertTrue("test1".equals(pp.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);  }