@Test public void testActivate_uninitialized() { RestInvocations.loadMetadata(handler, "defect"); RestInvocations.loadMetadata(handler, "release-backlog-item"); handler.addRequest("GET", "/qcbin/rest/domains/domain/projects/project/defects?fields=actual-fix-time,attachment,in-bucket,changeset,build-closed,closing-version,closing-date,dev-comments,id,status,description,detected-by,build-detected,detected-in-rcyc,detected-in-rel,detection-version,creation-time,estimated-fix-time,extended-reference,fixed-on-date,has-change,has-linkage,has-others-linkage,last-modified,planned-closing-ver,priority,user-04,user-03,reproducible,severity,subject,name,user-02,user-01,watch-id,release-backlog-item.product-id,release-backlog-item.owner,release-backlog-item.blocked,release-backlog-item.entity-name,release-backlog-item.entity-type,release-backlog-item.feature-id,release-backlog-item.invested,release-backlog-item.kanban-status-id,release-backlog-item.linked-entities-info,release-backlog-item.no-of-sons,release-backlog-item.kanban-parent-status-id,release-backlog-item.rank,release-backlog-item.release-id,release-backlog-item.entity-id,release-backlog-item.remaining,release-backlog-item.sprint-id,release-backlog-item.status,release-backlog-item.kan-parent-duration,release-backlog-item.story-points,release-backlog-item.kan-status-duration,release-backlog-item.team-id,release-backlog-item.theme-id,release-backlog-item.estimated,release-backlog-item.watch-id,release-backlog-item.id,product-group-id&query={id[86]}&order-by={}", 200) .content("entityServiceTest_entity.xml"); Entity defect = new Entity("defect", 86); handler.async(); taskManager.addTaskListener(new TaskListenerAdapter() { @Override public void taskActivated(final LocalTask localTask) { taskManager.removeTaskListener(this); handler.done(new Runnable() { @Override public void run() { Assert.assertEquals("defect #86: somewhat", localTask.getPresentableName()); } }); } }); taskManagerIntegration.activate(defect); }
public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } }
TaskManagerIntegration { public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } } }
TaskManagerIntegration { public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } } TaskManagerIntegration(Project project, EntityService entityService); }
TaskManagerIntegration { public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } } TaskManagerIntegration(Project project, EntityService entityService); void activate(Entity entity); void addListener(Listener listener); void removeListener(Listener listener); }
TaskManagerIntegration { public void activate(Entity entity) { if(entity == null) { activateDefaultTask(); } else { HpAlmTask task = new HpAlmTask(project, entity); if(!task.isInitialized()) { entityService.getEntityAsync(new EntityRef(entity), new EntityAdapter() { @Override public void entityLoaded(final Entity entity, Event event) { ApplicationUtil.invokeLaterIfNeeded(new Runnable() { public void run() { activateTask(new HpAlmTask(project, entity)); } }); } }); } else { activateTask(task); } } } TaskManagerIntegration(Project project, EntityService entityService); void activate(Entity entity); void addListener(Listener listener); void removeListener(Listener listener);  }