@Test public void testXmlToWmeAllString() throws URISyntaxException, TagAlreadyAddedException { File testMsg = new File(this.getClass().getResource("testMessage.xml") .toURI()); assertTrue(testMsg.canRead()); ManualTypeXmlToWme pat = new ManualTypeXmlToWme(agent.getInputOutput()); pat.xmlToWme(testMsg, agent.getInputOutput()); agent.runFor(1, RunType.DECISIONS); final MatcherBuilder m = Wmes.matcher(agent); final Identifier il = agent.getInputOutput().getInputLink(); final Identifier msg = m.attr("Message").find(il).getValue() .asIdentifier(); assertNotNull(msg); assertEquals("", m.attr("TestEmpty").find(msg).getValue().asString() .getValue()); assertEquals("", m.attr("TestEmpty1").find(msg).getValue().asString() .getValue()); assertEquals("", m.attr("TestEmpty2").find(msg).getValue().asString() .getValue()); assertEquals("", m.attr("TestEmpty3").find(msg).getValue().asString() .getValue()); assertEquals("", m.attr("TestEmpty4").find(msg).getValue().asString() .getValue()); assertEquals("0.0", m.attr("TestFloat").find(msg).getValue().asString() .getValue()); assertTrue(m.attr("TestFloat").find(msg).getValue().asInteger() == null); assertTrue(m.attr("TestFloat").find(msg).getValue().asDouble() == null); assertEquals("0", m.attr("TestInt").find(msg).getValue().asString() .getValue()); assertTrue(m.attr("TestInt").find(msg).getValue().asInteger() == null); assertTrue(m.attr("TestInt").find(msg).getValue().asDouble() == null); assertTrue(m.attr("Attribute").find(msg).getValue().asString() == null); final Identifier att = m.attr("Attribute").find(msg).getValue() .asIdentifier(); assertEquals("test", m.attr("myString").find(att).getValue().asString() .getValue()); assertEquals("1", m.attr("myInt").find(att).getValue().asString() .getValue()); assertEquals("1.0", m.attr("myFloat").find(att).getValue().asString() .getValue()); }
@Override public void xmlToWme(File file, InputOutput io) { final Element root = getRootElement(file); final Identifier ret = fromXml(root); final SymbolFactory sf = io.getSymbols(); io.addInputWme(io.getInputLink(), Symbols.create(sf, root.getNodeName()), ret); }
ManualTypeXmlToWme extends AbstractXmlFileToWme { @Override public void xmlToWme(File file, InputOutput io) { final Element root = getRootElement(file); final Identifier ret = fromXml(root); final SymbolFactory sf = io.getSymbols(); io.addInputWme(io.getInputLink(), Symbols.create(sf, root.getNodeName()), ret); } }
ManualTypeXmlToWme extends AbstractXmlFileToWme { @Override public void xmlToWme(File file, InputOutput io) { final Element root = getRootElement(file); final Identifier ret = fromXml(root); final SymbolFactory sf = io.getSymbols(); io.addInputWme(io.getInputLink(), Symbols.create(sf, root.getNodeName()), ret); } ManualTypeXmlToWme(InputOutput io);  ManualTypeXmlToWme(WmeFactory<?> wmeFactory); }
ManualTypeXmlToWme extends AbstractXmlFileToWme { @Override public void xmlToWme(File file, InputOutput io) { final Element root = getRootElement(file); final Identifier ret = fromXml(root); final SymbolFactory sf = io.getSymbols(); io.addInputWme(io.getInputLink(), Symbols.create(sf, root.getNodeName()), ret); } ManualTypeXmlToWme(InputOutput io);  ManualTypeXmlToWme(WmeFactory<?> wmeFactory); @Override void xmlToWme(File file, InputOutput io); @Override Identifier fromXml(Element element); void addFloatTag(String path); void addIntTag(String path); }
ManualTypeXmlToWme extends AbstractXmlFileToWme { @Override public void xmlToWme(File file, InputOutput io) { final Element root = getRootElement(file); final Identifier ret = fromXml(root); final SymbolFactory sf = io.getSymbols(); io.addInputWme(io.getInputLink(), Symbols.create(sf, root.getNodeName()), ret); } ManualTypeXmlToWme(InputOutput io);  ManualTypeXmlToWme(WmeFactory<?> wmeFactory); @Override void xmlToWme(File file, InputOutput io); @Override Identifier fromXml(Element element); void addFloatTag(String path); void addIntTag(String path);  }