Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.DefaultConfigurationBuilder$ConfigurationDeclaration


        };
        MockMailStore mockStore = new MockMailStore();
        FilePersistentObjectRepository filePersistentObjectRepository = new FilePersistentObjectRepository();
        filePersistentObjectRepository.setFileSystem(fs);
        filePersistentObjectRepository.setLog(new SimpleLog("MockLog"));
        DefaultConfigurationBuilder defaultConfiguration22 = new DefaultConfigurationBuilder();
        defaultConfiguration22.addProperty("[@destinationURL]", "file://target/var/users");
        filePersistentObjectRepository.configure(defaultConfiguration22);
        filePersistentObjectRepository.init();
       
        mockStore.add("OBJECT.users", filePersistentObjectRepository);
        res.setStore(mockStore);
        DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder("test");
        configuration.addProperty("destination.[@URL]", "file://target/var/users");
        res.setLog(new SimpleLog("MockLog"));
        res.configure(configuration);
        res.init();
        return res;
    }
View Full Code Here


   
    protected MailRepository getMailRepository() throws  Exception {
        MBoxMailRepository mr = new MBoxMailRepository();

        DefaultConfigurationBuilder defaultConfiguration = new DefaultConfigurationBuilder();
       
        File fInbox = new MockFileSystem().getFile("file://conf/org/apache/james/mailrepository/testdata/Inbox");
        String mboxPath = "mbox://"+fInbox.toURI().toString().substring(new File("").toURI().toString().length());
       
        defaultConfiguration.addProperty("[@destinationURL]",mboxPath);
        defaultConfiguration.addProperty("[@type]","MAIL");
        mr.setLog(new SimpleLog("MockLog"));;
        mr.configure(defaultConfiguration);

        return mr;
    }
View Full Code Here

    public void init()
        throws Exception {
        try {
            //TODO Check how to remove this!
            //prepare Configurations for object and stream repositories
            final DefaultConfigurationBuilder objectConfiguration
                = new DefaultConfigurationBuilder();

            objectConfiguration.addProperty( "[@destinationURL]", destination );
            objectConfiguration.addProperty( "[@type]", "OBJECT" );
            objectConfiguration.addProperty( "[@model]", "SYNCHRONOUS" );

            objectRepository = (ObjectRepository)store.select( objectConfiguration );
            if (getLogger().isDebugEnabled()) {
                StringBuffer logBuffer =
                    new StringBuffer(192)
View Full Code Here

    protected AbstractVirtualUserTable getVirtualUserTable() throws Exception {
        JDBCVirtualUserTable virtualUserTable = new JDBCVirtualUserTable();
        virtualUserTable.setLog(new SimpleLog("MockLog"));
        virtualUserTable.setDataSource(TestUtil.getDataSource());
        virtualUserTable.setFileSystem(new MockFileSystem());
        DefaultConfigurationBuilder defaultConfiguration = new DefaultConfigurationBuilder();
        defaultConfiguration.addProperty("[@destinationURL]","db://maildb/VirtualUserTable");
        defaultConfiguration.addProperty("sqlFile","file://conf/sqlResources.xml");
        virtualUserTable.configure(defaultConfiguration);
        virtualUserTable.init();
        return virtualUserTable;
    }   
View Full Code Here

     */
    protected void configureAbstractJdbcUsersRepository(AbstractJdbcUsersRepository res, String tableString) throws Exception, ConfigurationException {
        res.setFileSystem(new MockFileSystem());
        DataSource dataSource = TestUtil.getDataSource()
        res.setDatasource(dataSource );     
        DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
        configuration.addProperty("[@destinationURL]", "db://maildb/"+tableString);
        configuration.addProperty("sqlFile","file://conf/sqlResources.xml");
        res.setLog(new SimpleLog("MockLog"));
        res.configure(configuration);
        res.init();
    }
View Full Code Here

     */
    protected void configureAbstractJdbcUsersRepository(AbstractJdbcUsersRepository res, String tableString) throws Exception, ConfigurationException {
        res.setFileSystem(new MockFileSystem());
        DataSource dataSource = TestUtil.getDataSource()
        res.setDatasource(dataSource );       
        DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
        configuration.addProperty("[@destinationURL]", "db://maildb/"+tableString);
        configuration.addProperty("sqlFile","file://conf/sqlResources.xml");
        res.setLog(new SimpleLog("MockLog"));
        res.configure(configuration);
       
        res.init();
    }
View Full Code Here

        res.setFileSystem(new MockFileSystem());
        DataSource dataSource = TestUtil.getDataSource()
       
        res.setDatasource(dataSource );
       
        DefaultConfigurationBuilder configuration = new DefaultConfigurationBuilder();
        configuration.addProperty("[@destinationURL]", "db://maildb/"+tableString);
        configuration.addProperty("sqlFile","file://conf/sqlResources.xml");
        res.setLog(new SimpleLog("MockLog"));
        res.configure(configuration);
        res.init();
    }
View Full Code Here

        HandlersPackage handlersPackage = (HandlersPackage) loader.load(coreHandlersPackage, addHandler(coreHandlersPackage));
        registerHandlersPackage(handlersPackage, null, children);

        if (handlerchainConfig.getBoolean("[@enableJmx]", true)) {
            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
            builder.addProperty("jmxName", jmxName);
            HandlersPackage jmxPackage = (HandlersPackage) loader.load(jmxHandlersPackage, addHandler(jmxHandlersPackage));

            registerHandlersPackage(jmxPackage, builder, children);
        }
View Full Code Here

     * @param className The class name
     * @return DefaultConfiguration
     * @throws ConfigurationException
     */
    private HierarchicalConfiguration addHandler(String className) throws ConfigurationException {
        HierarchicalConfiguration hConf = new DefaultConfigurationBuilder();
        hConf.addProperty("[@class]", className);
        return hConf;
    }
View Full Code Here

    protected AbstractRecipientRewriteTable getRecipientRewriteTable() throws Exception {
        JDBCRecipientRewriteTable localVirtualUserTable = new JDBCRecipientRewriteTable();
        localVirtualUserTable.setLog(LoggerFactory.getLogger("MockLog"));
        localVirtualUserTable.setDataSource(getDataSource());
        localVirtualUserTable.setFileSystem(new MockFileSystem());
        DefaultConfigurationBuilder defaultConfiguration = new DefaultConfigurationBuilder();
        defaultConfiguration.addProperty("[@destinationURL]", "db://maildb/RecipientRewriteTable");
        defaultConfiguration.addProperty("sqlFile", "file://conf/sqlResources.xml");
        localVirtualUserTable.configure(defaultConfiguration);
        localVirtualUserTable.init();
        return localVirtualUserTable;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.DefaultConfigurationBuilder$ConfigurationDeclaration

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.