use of beast.evolution.alignment.Taxon in project beast2 by CompEvol.
the class XMLTest method testAnnotatedConstructor2.
@Test
public void testAnnotatedConstructor2() throws Exception {
List<Taxon> taxa = new ArrayList<>();
taxa.add(new Taxon("first one"));
taxa.add(new Taxon("second one"));
AnnotatedRunnableTestClass t = new AnnotatedRunnableTestClass(3, taxa);
XMLProducer producer = new XMLProducer();
String xml = producer.toXML(t);
assertEquals(3, (int) t.getParam1());
FileWriter outfile = new FileWriter(new File("/tmp/XMLTest.xml"));
outfile.write(xml);
outfile.close();
XMLParser parser = new XMLParser();
BEASTInterface b = parser.parseFile(new File("/tmp/XMLTest.xml"));
assertEquals(3, (int) ((AnnotatedRunnableTestClass) b).getParam1());
assertEquals(2, ((AnnotatedRunnableTestClass) b).getTaxon().size());
}
Aggregations