@Test public void testMigrateWithHostName() { setUpGetHostByNameExpectations(1); setUriInfo(setUpActionExpectations(ActionType.MigrateVmToServer, MigrateVmToServerParameters.class, new String[] { "VmId", "VdsId", "ForceMigrationForNonMigratableVm" }, new Object[] { GUIDS[0], GUIDS[1], Boolean.FALSE })); Action action = new Action(); action.setHost(new Host()); action.getHost().setName(NAMES[1]); verifyActionResponse(resource.migrate(action)); }
@Test public void testMigrateWithHostId() { setUriInfo(setUpActionExpectations(ActionType.MigrateVmToServer, MigrateVmToServerParameters.class, new String[] { "VmId", "VdsId", "ForceMigrationForNonMigratableVm" }, new Object[] { GUIDS[0], GUIDS[1], Boolean.FALSE })); Action action = new Action(); action.setHost(new Host()); action.getHost().setId(GUIDS[1].toString()); verifyActionResponse(resource.migrate(action)); }
to.setHost(adaptIn(from.getHost()));