protected void checkStartedServer() { System.out.println(new Gson().toJson(server)); assertNotNull(server.getUuid()); assertNotNull(server.getUser()); assertEquals(server.getName(), prefix); assertEquals(server.isPersistent(), true); assertEquals( server.getDevices(), ImmutableMap.of("ide:0:0", new IDEDevice.Builder(0, 0).uuid(drive.getUuid()).build())); assertEquals(server.getBootDeviceIds(), ImmutableSet.of("ide:0:0")); assertEquals(server.getNics().get(0).getDhcp(), server.getVnc().getIp()); assertEquals(server.getNics().get(0).getModel(), Model.E1000); assertEquals(server.getStatus(), ServerStatus.ACTIVE); }
@Test(dependsOnMethods = "testLifeCycle") public void testSetServerConfiguration() throws Exception { client.stopServer(server.getUuid()); assertEquals(client.getServerInfo(server.getUuid()).getStatus(), ServerStatus.STOPPED); ServerInfo server2 = client.setServerConfiguration( server.getUuid(), Server.Builder.fromServer(server) .name("rediculous") .tags(ImmutableSet.of("networking", "security", "gateway")) .userMetadata(ImmutableMap.of("foo", "bar")) .build()); assertNotNull(server2.getUuid(), server.getUuid()); assertEquals(server2.getName(), "rediculous"); checkTagsAndMetadata(server2); server = server2; }