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

Examples of org.rhq.modules.plugins.jbossas7.json.Result


        assertTrue(response.isSuccess(), getFailureMessage(response));

        Address deploymentAddress = new Address();
        deploymentAddress.add("deployment", "javaee6-test-app.war");
        Result readAttributeResult = getStandaloneASConnection().execute(new ReadResource(deploymentAddress));

        assertTrue(readAttributeResult.isSuccess(), readAttributeResult.getFailureDescription());

        @SuppressWarnings("unchecked")
        Map<String, ?> attributes = (Map<String, ?>) readAttributeResult.getResult();

        assertEquals(attributes.get("enabled"), TRUE);
        assertEquals(attributes.get("runtime-name"), "javaee6-test-app.war");

        Result removeDeploymentResult = getStandaloneASConnection().execute(new Operation("remove", deploymentAddress));

        assertTrue(removeDeploymentResult.isSuccess(), "Could not clean standalone deployment: "
            + removeDeploymentResult.getFailureDescription());
    }
View Full Code Here


        if (path.startsWith(","))
            path = path.substring(1);
        PropertySimple ps = new PropertySimple("path", path);

        //discover the node if it's available.
        Result result = connection.execute(new ReadResource(new Address(path)));
        if (result.isSuccess()) {

            String resKey = path;
            //strip off subsystem
            String name = resKey.substring(resKey.lastIndexOf("=") + 1);
            Configuration config2 = context.getDefaultPluginConfiguration();
View Full Code Here

    public void simpleResult() throws Exception {

        String resultString = "{\"outcome\" : \"success\", \"result\" : \"no metrics available\"}";

        ObjectMapper mapper = new ObjectMapper();
        Result result = mapper.readValue(resultString, Result.class);

        assertNotSame(result, null);
        assertEquals(result.getOutcome(), "success");
        assertTrue(result.isSuccess());
    }
View Full Code Here

    public void simpleResult2() throws Exception {

        String resultString = "{\"outcome\" : \"success\", \"result\" : \"DISABLED\"}";

        ObjectMapper mapper = new ObjectMapper();
        Result result = mapper.readValue(resultString, Result.class);

        assertNotSame(result, null);
        assertEquals(result.getOutcome(), "success");
        assertTrue(result.isSuccess());
    }
View Full Code Here

    public void simpleResultWithFailure() throws Exception {

        String resultString = "{\"outcome\" : \"failed\", \"failure-description\" : [{ \"java.util.NoSuchElementException\" : \"No child 'profile' exists\" }]}";

        ObjectMapper mapper = new ObjectMapper();
        Result result = mapper.readValue(resultString, Result.class);

        assertNotSame(result, null);
        assertEquals(result.getOutcome(), "failed");
        assertFalse(result.isSuccess());

        assertSame(result.getResult(), null);
        assertNotSame(result.getFailureDescription(), null);
        //        assertSame(result.getFailureDescription().size(), 1);
    }
View Full Code Here

    public void arrayResult1() throws Exception {

        String resultString = "{\"outcome\":\"success\",\"result\":[\"standard-sockets\",\"messaging-sockets\"],\"response-headers\":null, \"rolled-back\" : false}";

        ObjectMapper mapper = new ObjectMapper();
        Result result = mapper.readValue(resultString, Result.class);

        assertNotSame(result, null);
        assertEquals(result.getOutcome(), "success");
        assertTrue(result.isSuccess());
        @SuppressWarnings("unchecked")
        List<String> stringList = (List<String>) result.getResult();
        assertSame(stringList.size(), 2);
        assertEquals(stringList.get(0), "standard-sockets");
        assertEquals(stringList.get(1), "messaging-sockets");
        assertFalse(result.isRolledBack());

    }
View Full Code Here

    public void rolledBack() throws Exception {

        String resultString = "{\"outcome\":\"failed\", \"rolled-back\" : true}";

        ObjectMapper mapper = new ObjectMapper();
        Result result = mapper.readValue(resultString, Result.class);

        assertNotSame(result, null);
        assertEquals(result.getOutcome(), "failed");
        assertFalse(result.isSuccess());
        assertTrue(result.isRolledBack());

    }
View Full Code Here

    public void needsNoReload() throws Exception {

        String resultString = "{\"outcome\":\"failed\", \"rolled-back\" : true}";

        ObjectMapper mapper = new ObjectMapper();
        Result result = mapper.readValue(resultString, Result.class);

        assertNotSame(result, null);
        assertFalse(result.isReloadRequired());
    }
View Full Code Here

        String resultString = "{\n" + "    \"outcome\":\"success\",\n" + "    \"result\":{\n"
            + "        \"enabled\":\"true\"\n" + "    },\n" + "    \"response-headers\":{\n"
            + "        \"process-state\":\"reload-required\"\n" + "    }\n" + "}\n";

        ObjectMapper mapper = new ObjectMapper();
        Result result = mapper.readValue(resultString, Result.class);

        assertNotSame(result, null);
        assertTrue(result.isReloadRequired());
    }
View Full Code Here

            if (isEntryEligible) {
                op.addAdditionalProperty(entry.getKey(), entry.getValue());
            }
        }

        Result result = this.connection.execute(op);
        if (result.isSuccess()) {
            report.setStatus(CreateResourceStatus.SUCCESS);
            report.setResourceKey(createAddress.getPath());
            report.setResourceName(report.getUserSpecifiedResourceName());
        } else {
            report.setStatus(CreateResourceStatus.FAILURE);
            report.setErrorMessage(result.getFailureDescription());
        }

        return report;
    }
View Full Code Here

TOP

Related Classes of org.rhq.modules.plugins.jbossas7.json.Result

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.