@Test public void testIdAndBmlId() { StubBehaviour b = new StubBehaviour("bml1"); b.readXML("<stubbehaviour " + TestUtil.getDefNS() + "id=\"bml2:beh1\"/>"); assertEquals("bml2", b.bmlId); assertEquals("beh1", b.id); }
@Test public void testDescription() { BMLInfo.addDescriptionExtension(StubDescription.xmlTag(), StubDescription.class); BMLInfo.supportedExtensions.add(StubDescription.class); StubBehaviour b = new StubBehaviour("bml1"); b.readXML( "<stubbehaviour " + TestUtil.getDefNS() + "id=\"bml2:beh1\"><description priority=\"1\" type=\"" + StubDescription.xmlTag() + "\"><stubdescription/></description></stubbehaviour>"); assertNotNull(b.descBehaviour); Behaviour bdesc = b.descBehaviour; assertEquals("beh1", bdesc.id); assertEquals("bml2", bdesc.bmlId); }
@Test public void testGetFloatThroughString() { StubBehaviour b = new StubBehaviour("bml1"); b.readXML("<stubbehaviour " + TestUtil.getDefNS() + "id=\"beh1\"/>"); assertEquals(1, Float.parseFloat(b.getStringParameterValue("test")), PRECISION); }