@Test public void testRemoveLsaFromBin() throws Exception { lsaBin = EasyMock.createMock(LsaBinImpl.class); lsaWrapper = new LsaWrapperImpl(); lsaWrapper.setBinNumber(-1); lsaBin.addOspfLsa("1", lsaWrapper); lsdbAge.startDbAging(); lsdbAge.addLsaToMaxAgeBin("3600", lsaWrapper); lsdbAge.addLsaBin(-1, lsaBin); lsdbAge.removeLsaFromBin(lsaWrapper); assertThat(lsdbAge, is(notNullValue())); }
public void removeLsaFromBin(LsaWrapper lsaWrapper) { if (ageBins.containsKey(lsaWrapper.binNumber())) { LsaBin lsaBin = ageBins.get(lsaWrapper.binNumber()); lsaBin.removeOspfLsa(((OspfAreaImpl) ospfArea).getLsaKey(((LsaWrapperImpl) lsaWrapper).lsaHeader()), lsaWrapper); } }
LsdbAgeImpl implements LsdbAge { public void removeLsaFromBin(LsaWrapper lsaWrapper) { if (ageBins.containsKey(lsaWrapper.binNumber())) { LsaBin lsaBin = ageBins.get(lsaWrapper.binNumber()); lsaBin.removeOspfLsa(((OspfAreaImpl) ospfArea).getLsaKey(((LsaWrapperImpl) lsaWrapper).lsaHeader()), lsaWrapper); } } }
LsdbAgeImpl implements LsdbAge { public void removeLsaFromBin(LsaWrapper lsaWrapper) { if (ageBins.containsKey(lsaWrapper.binNumber())) { LsaBin lsaBin = ageBins.get(lsaWrapper.binNumber()); lsaBin.removeOspfLsa(((OspfAreaImpl) ospfArea).getLsaKey(((LsaWrapperImpl) lsaWrapper).lsaHeader()), lsaWrapper); } } LsdbAgeImpl(OspfArea ospfArea); }
LsdbAgeImpl implements LsdbAge { public void removeLsaFromBin(LsaWrapper lsaWrapper) { if (ageBins.containsKey(lsaWrapper.binNumber())) { LsaBin lsaBin = ageBins.get(lsaWrapper.binNumber()); lsaBin.removeOspfLsa(((OspfAreaImpl) ospfArea).getLsaKey(((LsaWrapperImpl) lsaWrapper).lsaHeader()), lsaWrapper); } } LsdbAgeImpl(OspfArea ospfArea); @Override boolean equals(Object o); @Override int hashCode(); void addLsaBin(Integer binKey, LsaBin lsaBin); LsaBin getLsaBin(Integer binKey); void addLsaToMaxAgeBin(String key, LsaWrapper wrapper); void removeLsaFromBin(LsaWrapper lsaWrapper); void startDbAging(); void ageLsaAndFlood(); void maxAgeLsa(); void refreshLsa(); void checkAges(); Channel getChannel(); void setChannel(Channel channel); int getAgeCounter(); int getAgeCounterRollOver(); LsaBin getMaxAgeBin(); int age2Bin(int x); }
LsdbAgeImpl implements LsdbAge { public void removeLsaFromBin(LsaWrapper lsaWrapper) { if (ageBins.containsKey(lsaWrapper.binNumber())) { LsaBin lsaBin = ageBins.get(lsaWrapper.binNumber()); lsaBin.removeOspfLsa(((OspfAreaImpl) ospfArea).getLsaKey(((LsaWrapperImpl) lsaWrapper).lsaHeader()), lsaWrapper); } } LsdbAgeImpl(OspfArea ospfArea); @Override boolean equals(Object o); @Override int hashCode(); void addLsaBin(Integer binKey, LsaBin lsaBin); LsaBin getLsaBin(Integer binKey); void addLsaToMaxAgeBin(String key, LsaWrapper wrapper); void removeLsaFromBin(LsaWrapper lsaWrapper); void startDbAging(); void ageLsaAndFlood(); void maxAgeLsa(); void refreshLsa(); void checkAges(); Channel getChannel(); void setChannel(Channel channel); int getAgeCounter(); int getAgeCounterRollOver(); LsaBin getMaxAgeBin(); int age2Bin(int x);  }