Package org.apache.commons.configuration2.builder.fluent

Examples of org.apache.commons.configuration2.builder.fluent.Parameters


     * @throws ConfigurationException if an error occurs
     */
    private static void checkTestConfiguration(FileHandler handler)
            throws ConfigurationException
    {
        XMLConfiguration config = new XMLConfiguration();
        FileHandler h2 = new FileHandler(config, handler);
        h2.load();
        assertEquals("Wrong content", "value", config.getString("element"));
    }
View Full Code Here


            throws ConfigurationException
    {
        FileBasedConfigurationBuilder<XMLConfiguration> builder =
                new FileBasedConfigurationBuilder<XMLConfiguration>(
                        XMLConfiguration.class);
        builder.configure(new Parameters().fileBased().setFile(testFile));
        config = builder.getConfiguration();

        CountDownLatch startLatch = new CountDownLatch(1);
        Collection<SubNodeAccessThread> threads =
                new ArrayList<SubNodeAccessThread>();
View Full Code Here

    }

    @Before
    public void setUp() throws Exception
    {
        parameters = new Parameters();
        manager = new DefaultParametersManager();
    }
View Full Code Here

     */
    @Test
    public void testCreateConfigurationNonExistingFileAndThenSave()
            throws ConfigurationException {
        File outFile = ConfigurationAssert.getOutFile("save.properties");
        Parameters parameters = new Parameters();
        FileBasedConfigurationBuilder<PropertiesConfiguration> builder = new FileBasedConfigurationBuilder<PropertiesConfiguration>(
                PropertiesConfiguration.class, null, true).configure(parameters
                .properties().setFile(outFile));
        Configuration config = builder.getConfiguration();
        config.setProperty(PROP, 1);
        builder.save();
        checkSavedConfig(outFile, 1);
View Full Code Here

     *
     * @return the parameters object
     */
    public DatabaseBuilderParameters setUpDefaultParameters()
    {
        return new Parameters().database().setDataSource(getDatasource())
                .setTable(TABLE).setKeyColumn(COL_KEY)
                .setValueColumn(COL_VALUE).setAutoCommit(isAutoCommit());
    }
View Full Code Here

    private static Parameters parameters;

    @BeforeClass
    public static void setUpOnce()
    {
        parameters = new Parameters();
    }
View Full Code Here

    private ReloadingCombinedConfigurationBuilder builder;

    @Before
    public void setUp() throws Exception
    {
        parameters = new Parameters();
        builder = new ReloadingCombinedConfigurationBuilder();
    }
View Full Code Here

    {
        System.setProperty("java.naming.factory.initial",
                "org.apache.commons.configuration2.MockInitialContextFactory");
        System.setProperty("test_file_xml", TEST_SUB_XML);
        System.setProperty("test_file_combine", "testcombine1.xml");
        parameters = new Parameters();
        builder = new CombinedConfigurationBuilder();
    }
View Full Code Here

     */
    @Test
    public void testGetDateNoFormatPropertyConversionHandler() throws Exception
    {
        conf.clearProperty(DataConfiguration.DATE_FORMAT_KEY);
        DefaultConversionHandler handler = new DefaultConversionHandler();
        handler.setDateFormat(DATE_PATTERN);
        conf.setConversionHandler(handler);
        assertEquals("Wrong result", expectedDate(), conf.getDate("date.string"));
    }
View Full Code Here

        map.put("key2", "value2");
        map.put("list", "value1, value2");
        map.put("listesc", "value1\\,value2");

        MapConfiguration config = new MapConfiguration(map);
        config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
        return config;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration2.builder.fluent.Parameters

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.