@Test public void testListenersAreNotNotifiedWhenNoNewVersions() { updateCheckGatewayObserver.addListener(listener); assertTrue("No notification when no new versions", listener.notifiedEvents.size() == 0); }
public void addListener(UpdateCheckListener newListener) { if (newListener == null) { throw new IllegalArgumentException("newListener"); } GatewayVersion latestGatewayVersion = getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } listeners.add(newListener); }
UpdateCheckGatewayObserver implements GatewayObserverFactorySpi { public void addListener(UpdateCheckListener newListener) { if (newListener == null) { throw new IllegalArgumentException("newListener"); } GatewayVersion latestGatewayVersion = getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } listeners.add(newListener); } }
UpdateCheckGatewayObserver implements GatewayObserverFactorySpi { public void addListener(UpdateCheckListener newListener) { if (newListener == null) { throw new IllegalArgumentException("newListener"); } GatewayVersion latestGatewayVersion = getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } listeners.add(newListener); } UpdateCheckGatewayObserver(); }
UpdateCheckGatewayObserver implements GatewayObserverFactorySpi { public void addListener(UpdateCheckListener newListener) { if (newListener == null) { throw new IllegalArgumentException("newListener"); } GatewayVersion latestGatewayVersion = getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } listeners.add(newListener); } UpdateCheckGatewayObserver(); void addListener(UpdateCheckListener newListener); @Override void startingGateway(GatewayContext gatewayContext); }
UpdateCheckGatewayObserver implements GatewayObserverFactorySpi { public void addListener(UpdateCheckListener newListener) { if (newListener == null) { throw new IllegalArgumentException("newListener"); } GatewayVersion latestGatewayVersion = getLatestGatewayVersion(); if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) { newListener.newVersionAvailable(currentVersion, latestGatewayVersion); } listeners.add(newListener); } UpdateCheckGatewayObserver(); void addListener(UpdateCheckListener newListener); @Override void startingGateway(GatewayContext gatewayContext);  }