use of beast.app.beauti.BeautiSubTemplate in project beast2 by CompEvol.
the class BeautiSubTemplateTest method testBeautiSubTemplateCombined.
@Test
public void testBeautiSubTemplateCombined() throws Exception {
BeautiSubTemplate t = new BeautiSubTemplate();
// minimal template + connector + name + condition for 2 entries
t.initByName("class", RealParameter.class.getName(), "mainid", "kappa", "value", "<state idref='thestate'>" + " <if cond='kappa/estimate=true'>" + " <parameter id='kappa' name='stateNode' value='1.0'/>" + " <parameter id='gamma' value='3.0'/>" + " </if>" + "</state>" + "<logger idref='tracer'>" + " <if cond='gamma/estimate=true'>" + " <log idref='kappa'/>" + " <log idref='gamma'/>" + " </if>" + "</logger>");
assertEquals(4, t.connectorsInput.get().size());
BeautiConnector c = t.connectorsInput.get().get(0);
assertEquals("kappa", c.sourceIDInput.get());
assertEquals("thestate", c.targetIDInput.get());
assertEquals("stateNode", c.inputNameInput.get());
assertEquals("kappa/estimate=true", c.conditionInput.get());
c = t.connectorsInput.get().get(1);
assertEquals("gamma", c.sourceIDInput.get());
assertEquals("thestate", c.targetIDInput.get());
assertEquals("parameter", c.inputNameInput.get());
assertEquals("kappa/estimate=true", c.conditionInput.get());
c = t.connectorsInput.get().get(2);
assertEquals("kappa", c.sourceIDInput.get());
assertEquals("tracer", c.targetIDInput.get());
assertEquals("log", c.inputNameInput.get());
assertEquals("gamma/estimate=true", c.conditionInput.get());
c = t.connectorsInput.get().get(3);
assertEquals("gamma", c.sourceIDInput.get());
assertEquals("tracer", c.targetIDInput.get());
assertEquals("log", c.inputNameInput.get());
assertEquals("gamma/estimate=true", c.conditionInput.get());
String xml = t.xMLInput.get();
assertEquals("<![CDATA[ <parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/> <parameter id=\"gamma\" value=\"3.0\"/> ]]>", xml);
}
Aggregations