Package org.rhq.modules.plugins.jbossas7.json

Examples of org.rhq.modules.plugins.jbossas7.json.Operation$OperationHeaders


        conf.put(new PropertySimple("port-offset", 0));

        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new Address());

        assert cop.numberOfSteps() == 3 : "#Steps should be 3 but were " + cop.numberOfSteps();
        Operation step1 = cop.step(0);
        Operation step2 = cop.step(1);
        Operation step3 = cop.step(2);

        // As we do not specify a base address when creating the delegate 0 or 1 address element is ok.
        assert step1.getAddress().isEmpty();
        assert step2.getAddress().size() == 1;
        assert step3.getAddress().size() == 1;

        assert step1.getAdditionalProperties().get("name").equals("port-offset");
        assert step1.getAdditionalProperties().get("value").equals("0");

        assert step2.getAdditionalProperties().get("name").equals("port");
        Object value = step2.getAdditionalProperties().get("value");
        assert value != null;
        assert value instanceof Integer;
        assert (Integer) value == 18080;

        assert step3.getAdditionalProperties().get("name").equals("fixed-port");
        Object value1 = step3.getAdditionalProperties().get("value");
        assert value1 != null;
        assert value1 instanceof Boolean;
        assert !(Boolean) value1;

        assert step2.getAddress().get(0).equals("socket-binding=http");
        assert step3.getAddress().get(0).equals("socket-binding=http");
    }
View Full Code Here


        conf.put(new PropertySimple("port-offset", 0));

        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new Address());

        assert cop.numberOfSteps() == 5 : "#Steps should be 5 but were " + cop.numberOfSteps();
        Operation step1 = cop.step(0);
        Operation step2 = cop.step(1);
        Operation step3 = cop.step(2);
        Operation step4 = cop.step(3);
        Operation step5 = cop.step(4);

        // As we do not specify a base address when creating the delegate 0 or 1 address element is ok.
        assert step1.getAddress().isEmpty();
        assert step2.getAddress().size() == 1;
        assert step3.getAddress().size() == 1;

        assert step1.getAdditionalProperties().get("name").equals("port-offset");
        assert step1.getAdditionalProperties().get("value").equals("0");

        assert step2.getAdditionalProperties().get("name").equals("port");
        Object value = step2.getAdditionalProperties().get("value");
        assert value != null;
        assert value instanceof Integer;
        assert (Integer) value == 18080;

        assert step3.getAdditionalProperties().get("name").equals("fixed-port");
        Object value1 = step3.getAdditionalProperties().get("value");
        assert value1 != null;
        assert value1 instanceof Boolean;
        assert !(Boolean) value1;

        assert step2.getAddress().get(0).equals("socket-binding=http");
        assert step3.getAddress().get(0).equals("socket-binding=http");
        assert step4.getAddress().get(0).equals("socket-binding=https");
        assert step5.getAddress().get(0).equals("socket-binding=https");
    }
View Full Code Here

        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new Address());

        assert cop.numberOfSteps() == 5 : "#Steps should be 5 but were " + cop.numberOfSteps();

        Operation step1 = cop.step(0);
        Operation step2 = cop.step(1);
        Operation step3 = cop.step(2);
        Operation step4 = cop.step(3);
        Operation step5 = cop.step(4);

        assert step1.getAddress().isEmpty();
        assert step2.getAddress().size() == 1;
        assert step3.getAddress().size() == 1;
        assert step4.getAddress().size() == 1;
        assert step5.getAddress().size() == 1;
        assert step2.getAddress().get(0).equals("configuration=jsp-configuration");
        assert step3.getAddress().get(0).equals("configuration=jsp-configuration");
        assert step4.getAddress().get(0).equals("configuration=static-resources");
        assert step5.getAddress().get(0).equals("configuration=static-resources");

        assert step1.getAdditionalProperties().get("name").equals("test-prop");
        assert step1.getAdditionalProperties().get("value").equals("Heiko");
        assert step2.getAdditionalProperties().get("name").equals("check-interval");
        assert step2.getAdditionalProperties().get("value").equals(23);
View Full Code Here

        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new Address());

        assert cop.numberOfSteps() == 3 : "#Steps should be 3 but were " + cop.numberOfSteps();

        Operation step1 = cop.step(0);
        Operation step2 = cop.step(1);
        Operation step3 = cop.step(2);

        assert step1.getAddress().size() == 1;
        assert step2.getAddress().size() == 1;
        assert step3.getAddress().size() == 1;
        assert step1.getAddress().get(0).equals("system-property=hulla");
        assert step2.getAddress().get(0).equals("system-property=bar");
        assert step3.getAddress().get(0).equals("system-property=hello");
        assert step1.getOperation().equals("add");
        assert step2.getOperation().equals("write-attribute");
        assert step3.getOperation().equals("remove");

        assert step1.getAdditionalProperties().get("value").equals("hopp");
        assert step2.getAdditionalProperties().get("value").equals("42!");
        assert step3.getAdditionalProperties().isEmpty();

    }
View Full Code Here

        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new Address());

        assert cop.numberOfSteps() == 2 : "#Steps should be 2 but were " + cop.numberOfSteps();

        Operation step1 = cop.step(0);
        Operation step2 = cop.step(1);

        assert step1.getAddress().size() == 1;
        assert step2.getAddress().size() == 1;
        assert step1.getAddress().get(0).equals("system-property=hulla");
        assert step2.getAddress().get(0).equals("system-property=hello");
        assert step1.getOperation().equals("add");
        assert step2.getOperation().equals("remove");

        assert step1.getAdditionalProperties().get("value").equals("hopp");
        assert step2.getAdditionalProperties().isEmpty();

    }
View Full Code Here

        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new Address());

        assert cop.numberOfSteps() == 4 : "#Steps should be 4 but were " + cop.numberOfSteps();

        Operation step1 = cop.step(0);
        Operation step2 = cop.step(1);
        Operation step3 = cop.step(2);
        Operation step4 = cop.step(3);

        assert step1.getAddress().size() == 1;
        assert step2.getAddress().size() == 1;
        assert step3.getAddress().size() == 1;
        assert step4.getAddress().size() == 1;
        assert step1.getAddress().get(0).equals("system-property=hulla");
        assert step2.getAddress().get(0).equals("system-property=bar");
        assert step3.getAddress().get(0).equals("system-property=bar");
        assert step4.getAddress().get(0).equals("system-property=hello");
        assert step1.getOperation().equals("add");
        assert step2.getOperation().equals("remove");
        assert step3.getOperation().equals("add");
        assert step4.getOperation().equals("remove");

        assert step1.getAdditionalProperties().get("value").equals("hopp");
        assert step2.getAdditionalProperties().isEmpty();
        assert step3.getAdditionalProperties().get("value").equals("42!");
        assert step4.getAdditionalProperties().isEmpty();

    }
View Full Code Here

        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new Address());

        assert cop != null;
        assert cop.numberOfSteps() == 1;
        Operation step = cop.step(0);
        assert step != null;
        assert step.getOperation().equals("write-attribute") : "Step name was " + step.getOperation();
        Map<String, Object> additionalProperties = step.getAdditionalProperties();
        assert additionalProperties != null;
        assert additionalProperties.size() == 2;
        assert additionalProperties.get("name").equals("connector");
        Object value = additionalProperties.get("value");
        assert value instanceof Map;
View Full Code Here

        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new Address());

        assert cop != null;
        assert cop.numberOfSteps() == 1;
        Operation step = cop.step(0);
        assert step != null;
        assert step.getOperation().equals("write-attribute") : "Step name was " + step.getOperation();
        Map<String, Object> additionalProperties = step.getAdditionalProperties();
        assert additionalProperties != null;
        assert additionalProperties.size() == 2;
        assert additionalProperties.get("name").equals("connector");
        Object value = additionalProperties.get("value");
        assert value instanceof Map;
View Full Code Here

        Assert.assertNotNull(cop);
        Assert.assertEquals(cop.numberOfSteps(), 6);

        for (int index = 0; index < 6; index++) {
            Operation step = cop.step(index);
            Assert.assertEquals(step.getOperation(), "write-attribute", "Step name was " + step.getOperation());
            Map<String, Object> additionalProperties = step.getAdditionalProperties();
            Assert.assertEquals(additionalProperties.size(), 2);

            if (additionalProperties.get("name").equals("firstprop")) {
                String expectedValue = (index + 1) + "" + (index + 2) + "" + (index + 3);
                Assert.assertEquals(additionalProperties.get("value"), expectedValue);
View Full Code Here

        assert cop.numberOfSteps() == properties.size() : "Composite operation steps incorrect. Expected '"
            + properties.size() + "' but was '" + cop.numberOfSteps() + "'.";
        //check property values
        for (int i = 0; i < cop.numberOfSteps(); i++) {
            //each property maps to a separate operation.
            Operation step = cop.step(i);
            assert step.getOperation().equals("write-attribute") : "Write attribute not set correctly.";
            Map<String, Object> props = step.getAdditionalProperties();
            assert props.size() == 2 : "Property list not correct. Expected '2' property but there were '"
                + props.size() + "'.";
            //check that property was returned
            String[] keys = new String[2];
            props.keySet().toArray(keys);
View Full Code Here

TOP

Related Classes of org.rhq.modules.plugins.jbossas7.json.Operation$OperationHeaders

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.