Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.PropertiesConfiguration$PropertiesWriter


    private VirtualHost createVirtualHostUsingStoreType(String virtualHostName) throws ConfigurationException, Exception
    {
        Broker broker = BrokerTestHelper.createBrokerMock();
        _virtualHostRegistry = broker.getVirtualHostRegistry();

        Configuration config = new PropertiesConfiguration();
        VirtualHostConfiguration configuration = new  VirtualHostConfiguration(virtualHostName, config, broker);
        final org.apache.qpid.server.model.VirtualHost virtualHost = mock(org.apache.qpid.server.model.VirtualHost.class);
        when(virtualHost.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.STORE_TYPE))).thenReturn(TestMemoryMessageStore.TYPE);
        VirtualHost host = new StandardVirtualHostFactory().createVirtualHost(_virtualHostRegistry, mock(StatisticsGatherer.class), new SecurityManager(mock(Broker.class), false), configuration,
                virtualHost);
View Full Code Here


    public void setUp() throws Exception
    {
        super.setUp();
        BrokerTestHelper.setUp();
        _broker = BrokerTestHelper.createBrokerMock();
        _env = new PropertiesConfiguration();
        _emptyConf = new VirtualHostConfiguration("test", _env, _broker);

        PropertiesConfiguration fullEnv = new PropertiesConfiguration();
        fullEnv.setProperty("queues.maximumMessageAge", 1);
        fullEnv.setProperty("queues.maximumQueueDepth", 1);
        fullEnv.setProperty("queues.maximumMessageSize", 1);
        fullEnv.setProperty("queues.maximumMessageCount", 1);
        fullEnv.setProperty("queues.minimumAlertRepeatGap", 1);
        fullEnv.setProperty("queues.deadLetterQueues", true);
        fullEnv.setProperty("queues.maximumDeliveryCount", 5);

        _fullHostConf = new VirtualHostConfiguration("test", fullEnv, _broker);

    }
View Full Code Here

        //Check default value
        QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
        assertTrue(qConf.getArguments().isEmpty());


        PropertiesConfiguration queueConfig = new PropertiesConfiguration();
        queueConfig.addProperty("queues.queue.test.argument", QueueArgumentsConverter.QPID_GROUP_HEADER_KEY + "=mykey");
        queueConfig.addProperty("queues.queue.test.argument", QueueArgumentsConverter.QPID_SHARED_MSG_GROUP + "=1");

        CompositeConfiguration config = new CompositeConfiguration();
        config.addConfiguration(_fullHostConf.getConfig());
        config.addConfiguration(queueConfig);
View Full Code Here


    private VirtualHostConfiguration overrideConfiguration(String property, Object value)
            throws ConfigurationException
    {
        PropertiesConfiguration queueConfig = new PropertiesConfiguration();
        queueConfig.setProperty("queues.queue.test." + property, value);

        CompositeConfiguration config = new CompositeConfiguration();
        config.addConfiguration(_fullHostConf.getConfig());
        config.addConfiguration(queueConfig);
View Full Code Here

        return createVirtualHost(configuration);
    }

    private static VirtualHostConfiguration createVirtualHostConfiguration(String name) throws ConfigurationException
    {
        VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration(name, new PropertiesConfiguration(), createBrokerMock());
        vhostConfig.setMessageStoreClass(TestableMemoryMessageStore.class.getName());
        return vhostConfig;
    }
View Full Code Here

   
    if (configFile != null) {
   
      try {
       
        PropertiesConfiguration fileConfig = new PropertiesConfiguration();
        fileConfig.setListDelimiter(';');
        fileConfig.load(configFile);
        data.setConfig(fileConfig);
       
      } catch (ConfigurationException e) {
       
        JOptionPane.showMessageDialog(viewerFrame,
View Full Code Here

    CLIArguments representativeArgs = argumentsGroup.getRepresentative();
   
    if (representativeArgs.isConfig()) {
      try {
        configFile = representativeArgs.getConfig();
        PropertiesConfiguration fileConfig = new PropertiesConfiguration();
        fileConfig.setListDelimiter(';');
        fileConfig.load(configFile);
        config = fileConfig;
      } catch (ConfigurationException e) {
        System.err.println("could not read config, ignoring it: ");
        System.err.println(e);
      }
View Full Code Here

    public static void main(String args[])
    {
        String configLocation = "./WebContent/WEB-INF/mfa.properties";
        String ttsLocation = "./WebContent/WEB-INF/tts.properties";
       
        PropertiesConfiguration config = new PropertiesConfiguration();
        PropertiesConfiguration tconfig = new PropertiesConfiguration();
        Properties x = new Properties();
        try
        {
            InputStream is = new FileInputStream(configLocation);
            config.load(is);
            is.close();
            InputStream tis = new FileInputStream(ttsLocation);
            tconfig.load(tis);
            tis.close();           
            MultiFacetedAuthentication mfa = new MultiFacetedAuthenticationImpl(config, tconfig);
            MFA.setInstance(mfa);
        }
        catch (Exception e)
View Full Code Here

        String ttsConfigLocation = "/WEB-INF/tts.properties";
       
        try
        {
            InputStream is = event.getServletContext().getResourceAsStream(configLocation);
            PropertiesConfiguration config = new PropertiesConfiguration();
            config.load(is);
            is.close();

            InputStream tis = event.getServletContext().getResourceAsStream(ttsConfigLocation);           
            PropertiesConfiguration ttsConfig = new PropertiesConfiguration();
            ttsConfig.load(tis);
            tis.close();
           
            String rootPath = event.getServletContext().getRealPath("/");
            MultiFacetedAuthentication mfa = new MultiFacetedAuthenticationImpl(config, ttsConfig, rootPath);
            MFA.setInstance(mfa);
        }
        catch (Throwable e)
        {
            logger.error("Unexpected error during loading configuration.", e);
            PropertiesConfiguration config = new PropertiesConfiguration();
            PropertiesConfiguration ttsConfig = new PropertiesConfiguration();
            MultiFacetedAuthentication mfa = new MultiFacetedAuthenticationImpl(config, ttsConfig);
            MFA.setInstance(mfa);           
        }
    }
View Full Code Here

    private File tempCaptchaFile;
   
    @Override
    public void setUp() throws Exception
    {
        PropertiesConfiguration config = new PropertiesConfiguration();
       
        InputStream input = null;
       
        try
        {
            input = Thread.currentThread().getContextClassLoader().getResourceAsStream("mfa.properties");
            config.load(input);
        }
        finally
        {
            IOUtils.closeQuietly(input);
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.PropertiesConfiguration$PropertiesWriter

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.