}
}
private void setupTest(int numServers, int numAgents) throws Exception {
Server server = ServerFactory.newInstance();
Agent agent;
getTransactionManager().begin();
try {
for (int i = 0; (i < numServers); ++i) {
server = ServerFactory.newInstance();
server.setName("Server-flm-" + i);
server.setAddress("" + i);
server.setPort(i);
server.setSecurePort(i);
server.setOperationMode(Server.OperationMode.NORMAL);
em.persist(server);
servers.add(server);
}
for (int i = 0; (i < numAgents); ++i) {
agent = new Agent("Agent-flm-" + i, "" + i, 1, "endpoint", "token" + i);
em.persist(agent);
agents.add(agent);
}
ag = new AffinityGroup("AG-flm-1");