Package org.apache.commons.configuration2.resolver

Examples of org.apache.commons.configuration2.resolver.CatalogResolver$Catalog


            InterruptedException
    {
        // populate the test combined configuration
        setUpSourceTest();
        XMLConfiguration xmlConf = new XMLConfiguration();
        new FileHandler(xmlConf).load(ConfigurationAssert
                .getTestFile("test.xml"));
        config.addConfiguration(xmlConf);
        PropertiesConfiguration propConf = new PropertiesConfiguration();
        new FileHandler(propConf).load(ConfigurationAssert
                .getTestFile("test.properties"));
        for (int i = 0; i < 8; i++)
        {
            config.addConfiguration(new BaseHierarchicalConfiguration());
        }
View Full Code Here


     * @return the URL of the include file or <b>null</b> if it cannot be
     *         resolved
     */
    private URL locateIncludeFile(String basePath, String fileName)
    {
        FileLocator includeLocator =
                FileLocatorUtils.fileLocator(locator).sourceURL(null)
                        .basePath(basePath).fileName(fileName).create();
        return FileLocatorUtils.locate(includeLocator);
    }
View Full Code Here

    private XMLConfiguration config;

    @Before
    public void setUp() throws Exception
    {
        resolver = new CatalogResolver();
        resolver.setCatalogFiles(CATALOG_FILES);
        // resolver.setDebug(true);
        config = new XMLConfiguration();
        config.setEntityResolver(resolver);
    }
View Full Code Here

     * Tests modifying an XML document and saving it with schema validation enabled.
     */
    @Test
    public void testSaveWithValidation() throws Exception
    {
        CatalogResolver resolver = new CatalogResolver();
        resolver.setCatalogFiles(CATALOG_FILES);
        conf = new XMLConfiguration();
        conf.setEntityResolver(resolver);
        conf.setSchemaValidation(true);
        load(conf, testFile2);
        conf.setProperty("Employee.SSN", "123456789");
View Full Code Here

     * Tests modifying an XML document and validating it against the schema.
     */
    @Test
    public void testSaveWithValidationFailure() throws Exception
    {
        CatalogResolver resolver = new CatalogResolver();
        resolver.setCatalogFiles(CATALOG_FILES);
        conf = new XMLConfiguration();
        conf.setEntityResolver(resolver);
        conf.setSchemaValidation(true);
        load(conf, testFile2);
        conf.setProperty("Employee.Email", "JohnDoe@apache.org");
View Full Code Here

            config.addConfiguration(new BaseHierarchicalConfiguration());
        }
        config.getConfiguration(0).addProperty(KEY_CONCURRENT, TEST_NAME);

        // Set a single synchronizer for all involved configurations
        Synchronizer sync = new ReadWriteSynchronizer();
        config.setSynchronizer(sync);
        for (Configuration c : config.getConfigurations())
        {
            c.setSynchronizer(sync);
        }
View Full Code Here

     * @since 2.0
     */
    @Override
    public final Synchronizer getSynchronizer()
    {
        Synchronizer sync = synchronizer;
        return (sync != null) ? sync : NoOpSynchronizer.INSTANCE;
    }
View Full Code Here

            config.addConfiguration(new BaseHierarchicalConfiguration());
        }
        config.getConfiguration(0).addProperty(KEY_CONCURRENT, TEST_NAME);

        // Set a single synchronizer for all involved configurations
        Synchronizer sync = new ReadWriteSynchronizer();
        config.setSynchronizer(sync);
        for (Configuration c : config.getConfigurations())
        {
            c.setSynchronizer(sync);
        }
View Full Code Here

     *
     * @return the new key object
     */
    private static DefaultConfigurationKey createConfigurationKey()
    {
        return new DefaultConfigurationKey(DefaultExpressionEngine.INSTANCE);
    }
View Full Code Here

        assertTrue(prop instanceof Collection);
        assertEquals(5, ((Collection<?>) prop).size());

        for (int i = 0; i < NodeStructureHelper.fieldsLength(0); i++)
        {
            DefaultConfigurationKey key = createConfigurationKey();
            key.append("fields").append("field").appendIndex(i);
            key.append("name");
            assertEquals(NodeStructureHelper.field(0, i), subset.getProperty(key.toString()));
        }

        // test the subset on the second table
        assertTrue("subset is not empty", config.subset("tables.table(2)").isEmpty());
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration2.resolver.CatalogResolver$Catalog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.