Package com.cloud.agent.api

Examples of com.cloud.agent.api.UnsupportedAnswer


        assertTrue(d.equals("details"));
    }

    @Test
    public void testCreateUnsupportedCommandAnswer() {
        UnsupportedAnswer usa = Answer.createUnsupportedCommandAnswer(acc);
        boolean b = usa.executeInSequence();
        assertFalse(b);

        b = usa.getResult();
        assertFalse(b);

        String d = usa.getDetails();
        assertTrue(d.equals("Unsupported command issued:" + acc.toString()
                + ".  Are you sure you got the right type of server?"));

        usa = Answer.createUnsupportedVersionAnswer(acc);
        b = usa.executeInSequence();
        assertFalse(b);

        b = usa.getResult();
        assertFalse(b);

        d = usa.getDetails();
        assertTrue(d.equals("Unsuppored Version."));
    }
View Full Code Here


        assertTrue(d.equals("details"));
    }

    @Test
    public void testCreateUnsupportedCommandAnswer() {
        UnsupportedAnswer usa = Answer.createUnsupportedCommandAnswer(acc);
        boolean b = usa.executeInSequence();
        assertFalse(b);

        b = usa.getResult();
        assertFalse(b);

        String d = usa.getDetails();
        assertTrue(d.equals("Unsupported command issued:" + acc.toString() + ".  Are you sure you got the right type of server?"));

        usa = Answer.createUnsupportedVersionAnswer(acc);
        b = usa.executeInSequence();
        assertFalse(b);

        b = usa.getResult();
        assertFalse(b);

        d = usa.getDetails();
        assertTrue(d.equals("Unsuppored Version."));
    }
View Full Code Here

            // Unsupported commands will not route.
            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_FOUND) {
                String errMsg = "Failed to send : HTTP error code : " + response.getStatusLine().getStatusCode();
                s_logger.error(errMsg);
                String unsupportMsg = "Unsupported command " + agentUri.getPath() + ".  Are you sure you got the right type of" + " server?";
                Answer ans = new UnsupportedAnswer(null, unsupportMsg);
                s_logger.error(ans);
                result = s_gson.toJson(new Answer[] {ans});
            } else if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
                String errMsg = "Failed send to " + agentUri.toString() + " : HTTP error code : " + response.getStatusLine().getStatusCode();
                s_logger.error(errMsg);
View Full Code Here

                String unsupportMsg =
                        "Unsupported command "
                                + agentUri.getPath()
                                + ".  Are you sure you got the right type of"
                                + " server?";
                Answer ans = new UnsupportedAnswer(null, unsupportMsg);
                s_logger.error(ans);
                result = s_gson.toJson(new Answer[] {ans});
            } else if (response.getStatusLine().getStatusCode()
                    != HttpStatus.SC_OK) {
                String errMsg =
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.UnsupportedAnswer

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.