@Override protected ConfigurationBuilderHolder createConfiguration(String configFile) throws FileNotFoundException { ClassLoader classLoader = getClass().getClassLoader(); InputStream input = FileLookupFactory.newInstance().lookupFileStrict(configFile, classLoader); return new ParserRegistry(classLoader).parse(input); }
@Test public void testSchema() throws Exception { FileLookup lookup = FileLookupFactory.newInstance(); URL schemaFile = lookup.lookupFileLocation( "schema/infinispan-config-6.0.xsd", Thread.currentThread().getContextClassLoader()); Source xmlFile = new StreamSource( lookup.lookupFile("configs/all.xml", Thread.currentThread().getContextClassLoader())); SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI) .newSchema(schemaFile) .newValidator() .validate(xmlFile); }
@Override public void before() throws Throwable { InputStream inputStream = FileLookupFactory.newInstance() .lookupFileStrict(configurationFile, InfinispanNode.class.getClassLoader()); ConfigurationBuilderHolder cfgBuilder = new ParserRegistry().parse(inputStream); cfgBuilder .getGlobalConfigurationBuilder() .globalJmxStatistics() .cacheManagerName(cacheManagerName); manager = new DefaultCacheManager(cfgBuilder, true); System.out.println("Started CacheManager"); // Now *Actually* start it: manager.getCache(); started = true; }