use of org.wildfly.clustering.web.hotrod.session.HotRodSessionManagementProvider in project wildfly by wildfly.
the class DistributableWebDeploymentXMLReaderTestCase method testHotRod.
@Test
public void testHotRod() throws IOException, XMLStreamException {
URL url = this.getClass().getResource(String.format("distributable-web-hotrod-%d.%d.xml", this.schema.major(), this.schema.minor()));
XMLMapper mapper = XMLMapper.Factory.create();
mapper.registerRootElement(this.schema.getRoot(), new DistributableWebDeploymentXMLReader(this.schema));
try (InputStream input = url.openStream()) {
XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(input);
MutableDistributableDeploymentConfiguration config = new MutableDistributableDeploymentConfiguration();
mapper.parseDocument(config, reader);
Assert.assertNull(config.getSessionManagementName());
DistributableSessionManagementProvider result = config.getSessionManagement();
Assert.assertNotNull(result);
Assert.assertTrue(result instanceof HotRodSessionManagementProvider);
HotRodSessionManagementConfiguration configuration = ((HotRodSessionManagementProvider) result).getSessionManagementConfiguration();
Assert.assertEquals("foo", configuration.getContainerName());
Assert.assertSame(SessionAttributePersistenceStrategy.FINE, configuration.getAttributePersistenceStrategy());
} finally {
mapper.unregisterRootAttribute(this.schema.getRoot());
}
}
Aggregations