/** Ensures that updating a ad_group works as expected. */ @Test public void testUpdate() { existingAsyncTask.setstatus(AsyncTaskStatusEnum.aborting); existingAsyncTask.setresult(AsyncTaskResultEnum.failure); existingAsyncTask.setaction_type(VdcActionType.AddDisk); AddDiskParameters addDiskToVmParams = new AddDiskParameters(); addDiskToVmParams.setSessionId("SESSION_ID"); existingAsyncTask.setaction_parameters(addDiskToVmParams); dao.update(existingAsyncTask); async_tasks result = dao.get(existingAsyncTask.gettask_id()); assertEquals(existingAsyncTask, result); }
@Override @Before public void setUp() throws Exception { super.setUp(); dao = prepareDAO(dbFacade.getAsyncTaskDAO()); params = new VdcActionParametersBase(); params.setSessionId("ASESSIONID"); params.setTransactionScopeOption(TransactionScopeOption.RequiresNew); // create some test data newAsyncTask = new async_tasks(); newAsyncTask.settask_id(Guid.NewGuid()); newAsyncTask.setaction_type(VdcActionType.AddDisk); newAsyncTask.setstatus(AsyncTaskStatusEnum.running); newAsyncTask.setresult(AsyncTaskResultEnum.success); newAsyncTask.setaction_parameters(params); newAsyncTask.setCommandId(Guid.NewGuid()); existingAsyncTask = dao.get(new Guid("340fd52b-3400-4cdd-8d3f-C9d03704b0aa")); }