Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.XMLConfiguration


    public void setUp() throws Exception
    {
        // Test does not directly use the AppRegistry but the configured broker
        // is required for the correct ConfigurationPlugin processing
        super.setUp();
        XMLConfiguration xmlconfig = new XMLConfiguration();
        xmlconfig.addProperty("base.element[@property]", "property");
        xmlconfig.addProperty("base.element.name", "name");
        // We make these strings as that is how they will be read from the file.
        xmlconfig.addProperty("base.element.positiveLong", String.valueOf(POSITIVE_LONG));
        xmlconfig.addProperty("base.element.negativeLong", String.valueOf(NEGATIVE_LONG));
        xmlconfig.addProperty("base.element.boolean", String.valueOf(true));
        xmlconfig.addProperty("base.element.double", String.valueOf(DOUBLE));
        for (int i = 0; i < LIST_SIZE; i++)
        {
            xmlconfig.addProperty("base.element.list", i);
        }

        //Use a composite configuration as this is what our broker code uses.
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);
View Full Code Here


     */
    public void testConfigLoadingValidConfig()
    {
        SlowConsumerDetectionQueueConfiguration config = new SlowConsumerDetectionQueueConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();

        xmlconfig.addProperty("messageAge", "60000");
        xmlconfig.addProperty("depth", "1024");
        xmlconfig.addProperty("messageCount", "10");

        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);

View Full Code Here

     */
    public void testConfigLoadingMissingConfig()
    {
        SlowConsumerDetectionQueueConfiguration config = new SlowConsumerDetectionQueueConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();

        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);

View Full Code Here

     */
    public void testConfigLoadingMessageAgeOk()
    {
        SlowConsumerDetectionQueueConfiguration config = new SlowConsumerDetectionQueueConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();
        xmlconfig.addProperty("messageAge", "60000");

        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);

View Full Code Here

     */
    public void testConfigLoadingDepthOk()
    {
        SlowConsumerDetectionQueueConfiguration config = new SlowConsumerDetectionQueueConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();
        xmlconfig.addProperty("depth", "1024");

        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);

View Full Code Here

     */
    public void testConfigLoadingMessageCountOk()
    {
        SlowConsumerDetectionQueueConfiguration config = new SlowConsumerDetectionQueueConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();
        xmlconfig.addProperty("messageCount", "10");

        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);

View Full Code Here

     */
    public void testConfigLoadingValidConfig()
    {
        SlowConsumerDetectionPolicyConfiguration config = new SlowConsumerDetectionPolicyConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();

        String policyName = "TestPolicy";
        xmlconfig.addProperty("name", policyName);

        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);

View Full Code Here

     */
    public void testConfigLoadingInValidConfig()
    {
        SlowConsumerDetectionPolicyConfiguration config = new SlowConsumerDetectionPolicyConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();


        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);
View Full Code Here

    protected void setUp() throws Exception
    {
        super.setUp();

        //the factory needs a registry instance
        ApplicationRegistry.initialise(new TestApplicationRegistry(new ServerConfiguration(new XMLConfiguration())));
    }
View Full Code Here

     */
    public void testConfigDeletePersistent()
    {
        TopicDeletePolicyConfiguration config = new TopicDeletePolicyConfiguration();

        XMLConfiguration xmlconfig = new XMLConfiguration();

        xmlconfig.addProperty("delete-persistent","");

        // Create a CompositeConfiguration as this is what the broker uses
        CompositeConfiguration composite = new CompositeConfiguration();
        composite.addConfiguration(xmlconfig);

View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.XMLConfiguration

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.