@Test public void testAfterAddingNicksManually() { testChannel.addNick(testNick1); assertTrue(peakPlugin.updatePeakForChannel(network, testChannel)); assertFalse(peakPlugin.updatePeakForChannel(network, testChannel)); testChannel.addNick(testNick2); assertTrue(peakPlugin.updatePeakForChannel(network, testChannel)); assertFalse(peakPlugin.updatePeakForChannel(network, testChannel)); }
protected boolean updatePeakForChannel(Network network, Channel channel) { try { int storedCount = getCount(network, channel); int numberCurrentlyOnChannel = channel.getNicks().size(); if (storedCount < numberCurrentlyOnChannel) { peaks.put(channelIdentifier(network, channel), "" + numberCurrentlyOnChannel); return true; } } catch (NumberFormatException nfe) { logger.error("Malformed data for Peak plugin stored in peaks. Deactivating plugin.", nfe.getCause()); this.enabled = false; } return false; }
PeakPlugin implements PluginWithDependencies { protected boolean updatePeakForChannel(Network network, Channel channel) { try { int storedCount = getCount(network, channel); int numberCurrentlyOnChannel = channel.getNicks().size(); if (storedCount < numberCurrentlyOnChannel) { peaks.put(channelIdentifier(network, channel), "" + numberCurrentlyOnChannel); return true; } } catch (NumberFormatException nfe) { logger.error("Malformed data for Peak plugin stored in peaks. Deactivating plugin.", nfe.getCause()); this.enabled = false; } return false; } }
PeakPlugin implements PluginWithDependencies { protected boolean updatePeakForChannel(Network network, Channel channel) { try { int storedCount = getCount(network, channel); int numberCurrentlyOnChannel = channel.getNicks().size(); if (storedCount < numberCurrentlyOnChannel) { peaks.put(channelIdentifier(network, channel), "" + numberCurrentlyOnChannel); return true; } } catch (NumberFormatException nfe) { logger.error("Malformed data for Peak plugin stored in peaks. Deactivating plugin.", nfe.getCause()); this.enabled = false; } return false; } PeakPlugin(); }
PeakPlugin implements PluginWithDependencies { protected boolean updatePeakForChannel(Network network, Channel channel) { try { int storedCount = getCount(network, channel); int numberCurrentlyOnChannel = channel.getNicks().size(); if (storedCount < numberCurrentlyOnChannel) { peaks.put(channelIdentifier(network, channel), "" + numberCurrentlyOnChannel); return true; } } catch (NumberFormatException nfe) { logger.error("Malformed data for Peak plugin stored in peaks. Deactivating plugin.", nfe.getCause()); this.enabled = false; } return false; } PeakPlugin(); String[] getDependencies(); void loadDependency(Plugin plugin); String getDescription(); void incomingEvent(Event e); void addEventDistributor(EventDistributor eventDistributor); void addWand(Wand wand); }
PeakPlugin implements PluginWithDependencies { protected boolean updatePeakForChannel(Network network, Channel channel) { try { int storedCount = getCount(network, channel); int numberCurrentlyOnChannel = channel.getNicks().size(); if (storedCount < numberCurrentlyOnChannel) { peaks.put(channelIdentifier(network, channel), "" + numberCurrentlyOnChannel); return true; } } catch (NumberFormatException nfe) { logger.error("Malformed data for Peak plugin stored in peaks. Deactivating plugin.", nfe.getCause()); this.enabled = false; } return false; } PeakPlugin(); String[] getDependencies(); void loadDependency(Plugin plugin); String getDescription(); void incomingEvent(Event e); void addEventDistributor(EventDistributor eventDistributor); void addWand(Wand wand);  }