assertEquals(-1, ab.createInstance("t1", 0, "", "", ""));
}
public void testGetInstances() throws Exception {
Instance i1 = EasyMock.createMock(Instance.class);
EasyMock.expect(i1.getPid()).andReturn(1234);
EasyMock.expect(i1.getPort()).andReturn(8818);
EasyMock.expect(i1.getName()).andReturn("i1");
EasyMock.expect(i1.isRoot()).andReturn(true);
EasyMock.expect(i1.getLocation()).andReturn("somewhere");
EasyMock.expect(i1.getState()).andReturn("Stopped");
EasyMock.replay(i1);
Instance i2 = EasyMock.createNiceMock(Instance.class);
EasyMock.expect(i2.getName()).andReturn("i2");
EasyMock.replay(i2);
AdminService as = EasyMock.createMock(AdminService.class);
EasyMock.expect(as.getInstances()).andReturn(new Instance [] {i1, i2});
EasyMock.replay(as);