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";
}