use of com.cloud.vm.VirtualMachineManagerImpl.JobHelper in project cosmic by MissionCriticalCloud.
the class JobHelperTest method test_jobIsForSameNetwork_whenJobCmdInfoIsNull.
@Test
public void test_jobIsForSameNetwork_whenJobCmdInfoIsNull() throws Exception {
final long networkId = 1L;
final VmWorkJobVO vmWorkJobVO = new VmWorkJobVO("someContext");
final NetworkVO networkVO = new NetworkVO();
networkVO.setId(networkId);
assertThat(new JobHelper().jobIsForSameNetwork(vmWorkJobVO, networkVO), is(false));
}
use of com.cloud.vm.VirtualMachineManagerImpl.JobHelper in project cosmic by MissionCriticalCloud.
the class JobHelperTest method test_jobIsForSameNetwork_whenJobIsForNetwork.
@Test
public void test_jobIsForSameNetwork_whenJobIsForNetwork() throws Exception {
final long networkId = 1L;
final VmWorkAddVmToNetwork vmWorkAddVmToNetwork = new VmWorkAddVmToNetwork(0, 0, 0, "someHandler", networkId, null);
final VmWorkJobVO vmWorkJobVO = new VmWorkJobVO("someContext");
vmWorkJobVO.setCmdInfo(VmWorkSerializer.serialize(vmWorkAddVmToNetwork));
final NetworkVO networkVO = new NetworkVO();
networkVO.setId(networkId);
assertThat(new JobHelper().jobIsForSameNetwork(vmWorkJobVO, networkVO), is(true));
}
use of com.cloud.vm.VirtualMachineManagerImpl.JobHelper in project cosmic by MissionCriticalCloud.
the class JobHelperTest method test_jobIsForSameNetwork_whenJobCmdInfoNetworkIdIsNull.
@Test
public void test_jobIsForSameNetwork_whenJobCmdInfoNetworkIdIsNull() throws Exception {
final long networkId = 1L;
final VmWorkAddVmToNetwork vmWorkAddVmToNetwork = new VmWorkAddVmToNetwork(0, 0, 0, "someHandler", null, null);
final VmWorkJobVO vmWorkJobVO = new VmWorkJobVO("someContext");
vmWorkJobVO.setCmdInfo(VmWorkSerializer.serialize(vmWorkAddVmToNetwork));
final NetworkVO networkVO = new NetworkVO();
networkVO.setId(networkId);
assertThat(new JobHelper().jobIsForSameNetwork(vmWorkJobVO, networkVO), is(false));
}
use of com.cloud.vm.VirtualMachineManagerImpl.JobHelper in project cosmic by MissionCriticalCloud.
the class JobHelperTest method test_jobIsForSameNetwork_whenJobIsNotForNetwork.
@Test
public void test_jobIsForSameNetwork_whenJobIsNotForNetwork() throws Exception {
final long someNetworkId = 1L;
final long anotherNetworkId = 2L;
final VmWorkAddVmToNetwork vmWorkAddVmToNetwork = new VmWorkAddVmToNetwork(0, 0, 0, "someHandler", someNetworkId, null);
final VmWorkJobVO vmWorkJobVO = new VmWorkJobVO("someContext");
vmWorkJobVO.setCmdInfo(VmWorkSerializer.serialize(vmWorkAddVmToNetwork));
final NetworkVO networkVO = new NetworkVO();
networkVO.setId(anotherNetworkId);
assertThat(new JobHelper().jobIsForSameNetwork(vmWorkJobVO, networkVO), is(false));
}
Aggregations