Examples of AgentRegistrationRequest


Examples of org.rhq.core.clientapi.server.core.AgentRegistrationRequest

    }

    @Test(dependsOnMethods = "testNormalAgentRegistration")
    public void testAttemptToChangeAgentName() throws Exception {
        CoreServerServiceImpl service = new CoreServerServiceImpl();
        AgentRegistrationRequest request;

        List<Object> objs = readObjects("b.obj", 2);
        AgentRegistrationRequest zReq = (AgentRegistrationRequest) objs.get(0);
        AgentRegistrationResults zResults = (AgentRegistrationResults) objs.get(1);

        request = createRequest(prefixName("newName"), zReq.getAddress(), zReq.getPort(), zResults.getAgentToken());
        try {
            service.registerAgent(request);
            assert false : "An agent should not be able to change its name";
        } catch (AgentRegistrationException ok) {
            debugPrintThrowable(ok);
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentRegistrationRequest

        assert agentInstall.getId() > 0 : "didn't persist properly - ID should be non-zero";
        assert agentInstall.getAgentName() == null : "there should be no agent name yet";
        assert agentInstall.getInstallLocation() == null : "there should be no install location yet";

        CoreServerServiceImpl service = new CoreServerServiceImpl();
        AgentRegistrationRequest aReq = createRequest(prefixName(".AgentInstall"), A_HOST, A_PORT, null,
            String.valueOf(agentInstall.getId()), "/tmp/CoreServerServiceImplTest/rhq-agent");
        AgentRegistrationResults aResults = service.registerAgent(aReq);
        assert aResults != null : "got null results";

        persistedAgentInstall = agentManager.getAgentInstallByAgentName(sm.getOverlord(), aReq.getName());
        assert persistedAgentInstall != null : "the new agent info is missing";
        assert persistedAgentInstall.getAgentName().equals(aReq.getName());
        assert persistedAgentInstall.getInstallLocation().equals("/tmp/CoreServerServiceImplTest/rhq-agent");
        assert persistedAgentInstall.getSshHost().equals("CoreServerServiceImpl-SshHost");
        assert persistedAgentInstall.getSshPort().equals(44);
        assert persistedAgentInstall.getSshUsername().equals("CoreServerServiceImpl-SshUsername");
        assert persistedAgentInstall.getSshPassword().equals("CoreServerServiceImpl-SshPassword");

        Agent doomed = agentManager.getAgentByName(aReq.getName());
        agentManager.deleteAgent(doomed);
        persistedAgentInstall = agentManager.getAgentInstallByAgentName(sm.getOverlord(), aReq.getName());
        assert persistedAgentInstall == null : "the agent info should have been deleted";
    }
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentRegistrationRequest

        return createRequest(name, address, port, token, "12345", "/tmp/CoreServerServiceImplTest/rhq-agent");
    }

    private AgentRegistrationRequest createRequest(String name, String address, int port, String token,
        String installId, String installLocation) {
        return new AgentRegistrationRequest(name, address, port, "socket://" + address + ":" + port
            + "/?rhq.communications.connector.rhqtype=agent", true, token, agentVersion, installId, installLocation);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.