Examples of FileBasedBuilderParametersImpl


Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

            InterruptedException
    {
        FileBasedConfigurationBuilder<XMLConfiguration> builder =
                new FileBasedConfigurationBuilder<XMLConfiguration>(
                        XMLConfiguration.class);
        builder.configure(new FileBasedBuilderParametersImpl()
                .setFileName(testProperties));
        XMLConfiguration config = builder.getConfiguration();
        assertTrue("Property not found",
                config.getProperty("test.short") != null);
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

    public void testDetermineConfigurationClassNoExtension()
            throws ConfigurationException
    {
        ConfigurationDeclaration decl = setUpDecl();
        BuilderParameters params =
                new FileBasedBuilderParametersImpl()
                        .setPath("C:\\Test\\someTestConfiguration");
        FileExtensionConfigurationBuilderProvider provider = setUpProvider();
        assertEquals(
                "Wrong class",
                DEF_CLASS,
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

    public void testDetermineConfigurationClassExtensionNoMatch()
            throws ConfigurationException
    {
        ConfigurationDeclaration decl = setUpDecl();
        BuilderParameters params =
                new FileBasedBuilderParametersImpl()
                        .setPath("C:\\Test\\someTestConfiguration.properties");
        FileExtensionConfigurationBuilderProvider provider = setUpProvider();
        assertEquals(
                "Wrong class",
                DEF_CLASS,
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

    @Test
    public void testDeterminieConfigurationClassNoFileName()
            throws ConfigurationException
    {
        ConfigurationDeclaration decl = setUpDecl();
        BuilderParameters params = new FileBasedBuilderParametersImpl();
        FileExtensionConfigurationBuilderProvider provider = setUpProvider();
        assertEquals(
                "Wrong class",
                DEF_CLASS,
                provider.determineConfigurationClass(decl,
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

    public void testDetermineConfigurationClassExtensionMatch()
            throws ConfigurationException
    {
        ConfigurationDeclaration decl = setUpDecl();
        BuilderParameters params =
                new FileBasedBuilderParametersImpl()
                        .setPath("C:\\Test\\someTestConfiguration." + EXT);
        FileExtensionConfigurationBuilderProvider provider = setUpProvider();
        assertEquals(
                "Wrong class",
                MATCH_CLASS,
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

    public void testDetermineConfigurationClassMatchCase()
            throws ConfigurationException
    {
        ConfigurationDeclaration decl = setUpDecl();
        BuilderParameters params =
                new FileBasedBuilderParametersImpl()
                        .setPath("C:\\Test\\someTestConfiguration."
                                + EXT.toUpperCase(Locale.ENGLISH));
        FileExtensionConfigurationBuilderProvider provider = setUpProvider();
        assertEquals(
                "Wrong class",
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

                .combined()
                .setDefinitionBuilder(new ConstantConfigurationBuilder(defConf))
                .registerChildDefaultsHandler(
                        FileBasedBuilderProperties.class,
                        new CopyObjectDefaultHandler(
                                new FileBasedBuilderParametersImpl()
                                        .setReloadingDetectorFactory(detectorFactory))));
        CombinedConfiguration config = builder.getConfiguration();
        assertEquals("Wrong initial value (1)", 0,
                config.getInt(testProperty(1)));
        assertEquals("Wrong initial value (2)", 0,
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

                                new BasicBuilderParameters()
                                        .setSynchronizer(sync)))
                .registerChildDefaultsHandler(
                        FileBasedBuilderProperties.class,
                        new CopyObjectDefaultHandler(
                                new FileBasedBuilderParametersImpl()
                                        .setReloadingDetectorFactory(detectorFactory))));

        assertEquals("Wrong initial value", "100", builder.getConfiguration()
                .getString("/property[@name='config']/@value"));
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

     * Tests extended cloning functionality.
     */
    @Test
    public void testClone()
    {
        FileBasedBuilderParametersImpl managedParams =
                new FileBasedBuilderParametersImpl();
        managedParams.setFileName("test.xml");
        params.setManagedBuilderParameters(managedParams);
        params.setFilePattern("somePattern");
        MultiFileBuilderParametersImpl clone = params.clone();
        assertEquals("Wrong pattern", params.getFilePattern(),
                clone.getFilePattern());
        assertNotSame("Managed parameters not cloned",
                params.getManagedBuilderParameters(),
                clone.getManagedBuilderParameters());
        assertEquals("Wrong file name", managedParams.getFileHandler()
                .getFileName(),
                ((FileBasedBuilderParametersImpl) clone
                        .getManagedBuilderParameters()).getFileHandler()
                        .getFileName());
    }
View Full Code Here

Examples of org.apache.commons.configuration2.builder.FileBasedBuilderParametersImpl

        builder.configure(new CombinedBuilderParametersImpl()
                .setDefinitionBuilder(
                        new FileBasedConfigurationBuilder<XMLConfiguration>(
                                XMLConfiguration.class))
                .setDefinitionBuilderParameters(
                        new FileBasedBuilderParametersImpl().setFile(testFile)));
        builder.getConfiguration();
        CombinedReloadingController rc =
                (CombinedReloadingController) builder.getReloadingController();
        assertTrue("Got sub reloading controllers", rc.getSubControllers()
                .isEmpty());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.