use of com.tvd12.ezyfox.mapping.jaxb.EzyXmlReader in project ezyfox-server by youngmonkeys.
the class EzySimpleXmlReaderTest method test2.
@Test(expectedExceptions = { IllegalArgumentException.class })
public void test2() {
EzyXmlReader reader = EzySimpleXmlMapper.builder().contextPath("com.tvd12.ezyfoxserver.mapping").classLoader(getClass().getClassLoader()).build();
reader.read(new File("pom.xml"), ClassB.class);
}
use of com.tvd12.ezyfox.mapping.jaxb.EzyXmlReader in project ezyfox-server by youngmonkeys.
the class EzySimpleXmlReaderTest method test1.
@Test(expectedExceptions = { IllegalArgumentException.class })
public void test1() {
EzyXmlReader reader = EzySimpleXmlMapper.builder().contextClass(ClassA.class).build();
reader.read(new File("pom.xml"), ClassB.class);
}
use of com.tvd12.ezyfox.mapping.jaxb.EzyXmlReader in project ezyfox-server by youngmonkeys.
the class EzySimpleXmlReaderTest method test3.
@Test
public void test3() {
EzyXmlReader reader = EzySimpleXmlMapper.builder().contextPath("com.tvd12.ezyfoxserver").classLoader(getClass().getClassLoader()).build();
EzySimpleSettings settings = reader.read(new File("src/main/resources/ezy-settings.xml"), EzySimpleSettings.class);
System.out.println(new EzySimpleJsonWriter().writeAsString(settings));
}
use of com.tvd12.ezyfox.mapping.jaxb.EzyXmlReader in project ezyfox-server by youngmonkeys.
the class EzySimpleSettingsReader method readSettings.
protected EzySettings readSettings() {
logger.info("read setting file: {}", getSettingsFilePath());
EzyXmlReader xmlReader = newXmlReader();
EzySimpleSettings settings = readSettingsFile(xmlReader);
EzySimpleZoneFilesSetting zoneFiles = settings.getZoneFiles();
zoneFiles.forEach(zf -> {
if (!zf.isActive()) {
return;
}
EzySimpleZoneSetting zoneSetting = readZoneConfigFile(xmlReader, zf.getConfigFile());
postReadZoneSettings(zoneSetting);
zoneSetting.setName(zf.getName());
zoneSetting.setConfigFile(zf.getConfigFile());
zoneSetting.init();
settings.addZone(zoneSetting);
});
if (settingsDecorator != null) {
settingsDecorator.decorate(homePath, settings);
}
return settings;
}
Aggregations