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

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


        PropertyMap pm = new PropertyMap("connector:collapsed");
        PropertySimple ps = new PropertySimple("name:0", "in-vm");
        pm.put(ps);
        conf.put(pm);

        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;
View Full Code Here


        }

        Configuration conf = new Configuration();
        conf.put(list);

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

        Assert.assertNotNull(cop);
        Assert.assertEquals(cop.numberOfSteps(), 1);
        Assert.assertEquals(cop.step(0).getOperation(), "write-attribute", "Step name was "
            + cop.step(0).getOperation());

        Map<String, Object> additionalProperties = cop.step(0).getAdditionalProperties();
        Assert.assertEquals(additionalProperties.size(), 2);
        Assert.assertEquals(additionalProperties.get("name"), "properties");

        @SuppressWarnings("unchecked")
        List<Map<String, Object>> value = (List<Map<String, Object>>) additionalProperties.get("value");
View Full Code Here

            PropertySimple tempPropertySimple = new PropertySimple("value", stringValue);
            propertyMap.put(tempPropertySimple);
            conf.put(propertyMap);
        }

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

        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")) {
View Full Code Here

        properties.put("proxy-url", "/rootWebappUrl");
        for (String name : properties.keySet()) {//load all properties for update.
            conf.put(new PropertySimple(name, properties.get(name)));
        }

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

        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
View Full Code Here

        configuration.put(new PropertySimple("test:ignore","Hello world!")); // should not create a step

        FakeConnection connection = new FakeConnection();

        ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition, connection, null);
        CompositeOperation cop = delegate.updateGenerateOperationFromProperties(configuration, new Address());

        assert cop != null;
        assert cop.numberOfSteps() == 1 : "One step was expected, but got " + cop.numberOfSteps();

    }
View Full Code Here

        Configuration conf = new Configuration();
        PropertySimple ps = new PropertySimple("mode",null);
        conf.put(ps);

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

        assert cop.numberOfSteps() == 1;
        Operation step1 = cop.step(0);
        assert step1.getOperation().equals("write-attribute");
        Map<String, Object> props = step1.getAdditionalProperties();
        assert props.size() == 2;
        assert props.get("name").equals("mode");
        assert props.get("value").equals("SYNC"); // the defaultValue
View Full Code Here

        Configuration conf = new Configuration();
        PropertySimple ps = new PropertySimple("mode","ASYNC");
        conf.put(ps);

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

        assert cop.numberOfSteps() == 1;
        Operation step1 = cop.step(0);
        assert step1.getOperation().equals("write-attribute");
        Map<String, Object> props = step1.getAdditionalProperties();
        assert props.size() == 2;
        assert props.get("name").equals("mode");
        assert props.get("value").equals("ASYNC"); // the user provided value
View Full Code Here

        Configuration conf = new Configuration();
        PropertySimple ps = new PropertySimple("mode",null);
        conf.put(ps);

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

        assert cop.numberOfSteps() == 1;
        Operation step1 = cop.step(0);
        assert step1.getOperation().equals("write-attribute");
        Map<String, Object> props = step1.getAdditionalProperties();
        assert props.size() == 2;
        assert props.get("name").equals("mode");
        assert props.get("value")==null; // no value
View Full Code Here

        Operation addToServerGroupStep = new Operation("add", serverGroupDeploymentAddress);
        addToServerGroupStep.addAdditionalProperty("runtime-name", runtimeName);
        addToServerGroupStep.addAdditionalProperty("enabled", true);

        CompositeOperation compositeOperation = new CompositeOperation();
        compositeOperation.addStep(addDeploymentStep);
        compositeOperation.addStep(addToServerGroupStep);

        Result result = getASConnection().execute(compositeOperation, 300);
        if (!result.isSuccess()) {
            return BundleHandoverResponse.failure(EXECUTION, result.getFailureDescription());
        } else {
View Full Code Here

            if (reqName == null) {
               reqName = req.getName();
            }

            ComplexRequest request = null;
            Operation op;
            if (reqName.contains(":")) {
               request = ComplexRequest.create(reqName);
               op = new ReadAttribute(getAddress(), request.getProp());
            } else {
               op = new ReadAttribute(getAddress(), reqName); // TODO batching
View Full Code Here

TOP

Related Classes of org.rhq.modules.plugins.jbossas7.json.CompositeOperation$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.