@Test public void testSelectRelease_None() throws Throwable { selectTestRelease(); WaitForEventsListener listener = new WaitForEventsListener(sprintService); sprintService.selectRelease(null); listener.waitForEvents(null, null, null); }
public synchronized void selectRelease(final Entity release) { if((release != null && release.equals(this.releaseSelector.selected)) || (release == null && this.releaseSelector.selected == null)) { return; } this.releaseSelector.selected = release; if(release != null) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { sprintSelector.requestRunning = true; teamSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadSprints(release); loadTeams(release); } }); } } else { selectSprint(null); selectTeam(null); } fireReleaseSelected(); }
SprintService implements PersistentStateComponent<Element>, ServerTypeListener, CachingEntityListener { public synchronized void selectRelease(final Entity release) { if((release != null && release.equals(this.releaseSelector.selected)) || (release == null && this.releaseSelector.selected == null)) { return; } this.releaseSelector.selected = release; if(release != null) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { sprintSelector.requestRunning = true; teamSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadSprints(release); loadTeams(release); } }); } } else { selectSprint(null); selectTeam(null); } fireReleaseSelected(); } }
SprintService implements PersistentStateComponent<Element>, ServerTypeListener, CachingEntityListener { public synchronized void selectRelease(final Entity release) { if((release != null && release.equals(this.releaseSelector.selected)) || (release == null && this.releaseSelector.selected == null)) { return; } this.releaseSelector.selected = release; if(release != null) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { sprintSelector.requestRunning = true; teamSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadSprints(release); loadTeams(release); } }); } } else { selectSprint(null); selectTeam(null); } fireReleaseSelected(); } SprintService(Project project); }
SprintService implements PersistentStateComponent<Element>, ServerTypeListener, CachingEntityListener { public synchronized void selectRelease(final Entity release) { if((release != null && release.equals(this.releaseSelector.selected)) || (release == null && this.releaseSelector.selected == null)) { return; } this.releaseSelector.selected = release; if(release != null) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { sprintSelector.requestRunning = true; teamSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadSprints(release); loadTeams(release); } }); } } else { selectSprint(null); selectTeam(null); } fireReleaseSelected(); } SprintService(Project project); Element getState(); void loadState(Element state); @Override void connectedTo(ServerType serverType); synchronized Entity getRelease(); synchronized Entity getSprint(); synchronized Entity getTeam(); void addListener(Listener listener); void removeListener(Listener listener); synchronized void selectRelease(final Entity release); synchronized void selectSprint(Entity sprint); synchronized void selectTeam(Entity team); synchronized Entity getCurrentSprint(); synchronized EntityList getTeams(); EntityList getSprints(); EntityList getReleases(); static boolean isSameTense(Entity sprint1, Entity sprint2); static boolean isCurrentSprint(Entity sprint); static long distance(long now, Entity entity); @Override Entity lookup(final EntityRef ref); @Override void entityLoaded(Entity entity, Event event); @Override void entityNotFound(EntityRef ref, boolean removed); }
SprintService implements PersistentStateComponent<Element>, ServerTypeListener, CachingEntityListener { public synchronized void selectRelease(final Entity release) { if((release != null && release.equals(this.releaseSelector.selected)) || (release == null && this.releaseSelector.selected == null)) { return; } this.releaseSelector.selected = release; if(release != null) { if(ServerType.AGM.equals(restService.getServerTypeIfAvailable())) { sprintSelector.requestRunning = true; teamSelector.requestRunning = true; ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { @Override public void run() { loadSprints(release); loadTeams(release); } }); } } else { selectSprint(null); selectTeam(null); } fireReleaseSelected(); } SprintService(Project project); Element getState(); void loadState(Element state); @Override void connectedTo(ServerType serverType); synchronized Entity getRelease(); synchronized Entity getSprint(); synchronized Entity getTeam(); void addListener(Listener listener); void removeListener(Listener listener); synchronized void selectRelease(final Entity release); synchronized void selectSprint(Entity sprint); synchronized void selectTeam(Entity team); synchronized Entity getCurrentSprint(); synchronized EntityList getTeams(); EntityList getSprints(); EntityList getReleases(); static boolean isSameTense(Entity sprint1, Entity sprint2); static boolean isCurrentSprint(Entity sprint); static long distance(long now, Entity entity); @Override Entity lookup(final EntityRef ref); @Override void entityLoaded(Entity entity, Event event); @Override void entityNotFound(EntityRef ref, boolean removed);  }