" <property name='port' value='7654' type='Integer' />\n" +
" </service>\n" +
"</service-configuration>\n"
);
s.getArrayProps().add(new ArrayProperty("angles", "Integer"));
s.getArrayProps().get(0).addEntry("90");
s.getArrayProps().get(0).addEntry("45");
xml = toXML(config);
assertEqualsXML(
xml,
"<service-configuration>\n" +
" <service pid='servicePID'>\n" +
" <property name='host' value='localhost' />\n" +
" <property name='port' value='7654' type='Integer' />\n" +
" <array name='angles' type='Integer'>\n" +
" <entry value='90' />\n" +
" <entry value='45' />\n" +
" </array>\n" +
" </service>\n" +
"</service-configuration>\n"
);
config.getServices().clear();
ServiceFactory f = new ServiceFactory();
config.getFactories().add(f);
xml = toXML(config);
assertEqualsXML(xml, "<service-configuration><service-factory/></service-configuration>");
Service s2 = new Service();
s2.setServiceID("servicePID");
s2.getArrayProps().add(new ArrayProperty("colors"));
s2.getArrayProps().get(0).addEntry("blue");
config.getServices().add(s2);
f.setFactoryID("factoryPID");
s.setServiceID(null);