@Test public void testRun1() throws Exception { blockingQueue = new ArrayBlockingQueue(5); channel = EasyMock.createMock(Channel.class); ospfArea = new OspfAreaImpl(); lsaWrapper = new LsaWrapperImpl(); routerLsa = new RouterLsa(); routerLsa.setLsType(1); lsaWrapper.addLsa(OspfLsaType.ROUTER, routerLsa); ospfInterface = new OspfInterfaceImpl(); ospfInterface.setState(OspfInterfaceState.DR); lsaWrapper.setOspfInterface(ospfInterface); lsaWrapper.setIsSelfOriginated(true); lsaHeader = new LsaHeader(); lsaHeader.setLsType(1); lsaWrapper.setLsaHeader(lsaHeader); lsaWrapper.setLsaProcessing("refreshLsa"); lsaWrapper.setLsdbAge(new LsdbAgeImpl(ospfArea)); blockingQueue.add(lsaWrapper); lsaQueueConsumer = new LsaQueueConsumer(blockingQueue, channel, ospfArea); lsaQueueConsumer.run(); assertThat(lsaQueueConsumer, is(notNullValue())); }
public void run() { log.debug("LSAQueueConsumer:run...!!!"); try { while (true) { if (!queue.isEmpty()) { LsaWrapper wrapper = (LsaWrapper) queue.take(); String lsaProcessing = wrapper.lsaProcessing(); switch (lsaProcessing) { case OspfParameters.VERIFYCHECKSUM: log.debug("LSAQueueConsumer: Message - " + OspfParameters.VERIFYCHECKSUM + " consumed."); processVerifyChecksum(wrapper); break; case OspfParameters.REFRESHLSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.REFRESHLSA + " consumed."); processRefreshLsa(wrapper); break; case OspfParameters.MAXAGELSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.MAXAGELSA + " consumed."); processMaxAgeLsa(wrapper); break; default: log.debug("Unknown command to process the LSA in queue ...!!!"); break; } } } } catch (Exception e) { log.debug("Error::LSAQueueConsumer::{}", e.getMessage()); } }
LsaQueueConsumer implements Runnable { public void run() { log.debug("LSAQueueConsumer:run...!!!"); try { while (true) { if (!queue.isEmpty()) { LsaWrapper wrapper = (LsaWrapper) queue.take(); String lsaProcessing = wrapper.lsaProcessing(); switch (lsaProcessing) { case OspfParameters.VERIFYCHECKSUM: log.debug("LSAQueueConsumer: Message - " + OspfParameters.VERIFYCHECKSUM + " consumed."); processVerifyChecksum(wrapper); break; case OspfParameters.REFRESHLSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.REFRESHLSA + " consumed."); processRefreshLsa(wrapper); break; case OspfParameters.MAXAGELSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.MAXAGELSA + " consumed."); processMaxAgeLsa(wrapper); break; default: log.debug("Unknown command to process the LSA in queue ...!!!"); break; } } } } catch (Exception e) { log.debug("Error::LSAQueueConsumer::{}", e.getMessage()); } } }
LsaQueueConsumer implements Runnable { public void run() { log.debug("LSAQueueConsumer:run...!!!"); try { while (true) { if (!queue.isEmpty()) { LsaWrapper wrapper = (LsaWrapper) queue.take(); String lsaProcessing = wrapper.lsaProcessing(); switch (lsaProcessing) { case OspfParameters.VERIFYCHECKSUM: log.debug("LSAQueueConsumer: Message - " + OspfParameters.VERIFYCHECKSUM + " consumed."); processVerifyChecksum(wrapper); break; case OspfParameters.REFRESHLSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.REFRESHLSA + " consumed."); processRefreshLsa(wrapper); break; case OspfParameters.MAXAGELSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.MAXAGELSA + " consumed."); processMaxAgeLsa(wrapper); break; default: log.debug("Unknown command to process the LSA in queue ...!!!"); break; } } } } catch (Exception e) { log.debug("Error::LSAQueueConsumer::{}", e.getMessage()); } } LsaQueueConsumer(BlockingQueue queue, Channel channel, OspfArea ospfArea); }
LsaQueueConsumer implements Runnable { public void run() { log.debug("LSAQueueConsumer:run...!!!"); try { while (true) { if (!queue.isEmpty()) { LsaWrapper wrapper = (LsaWrapper) queue.take(); String lsaProcessing = wrapper.lsaProcessing(); switch (lsaProcessing) { case OspfParameters.VERIFYCHECKSUM: log.debug("LSAQueueConsumer: Message - " + OspfParameters.VERIFYCHECKSUM + " consumed."); processVerifyChecksum(wrapper); break; case OspfParameters.REFRESHLSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.REFRESHLSA + " consumed."); processRefreshLsa(wrapper); break; case OspfParameters.MAXAGELSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.MAXAGELSA + " consumed."); processMaxAgeLsa(wrapper); break; default: log.debug("Unknown command to process the LSA in queue ...!!!"); break; } } } } catch (Exception e) { log.debug("Error::LSAQueueConsumer::{}", e.getMessage()); } } LsaQueueConsumer(BlockingQueue queue, Channel channel, OspfArea ospfArea); void run(); void setChannel(Channel channel); }
LsaQueueConsumer implements Runnable { public void run() { log.debug("LSAQueueConsumer:run...!!!"); try { while (true) { if (!queue.isEmpty()) { LsaWrapper wrapper = (LsaWrapper) queue.take(); String lsaProcessing = wrapper.lsaProcessing(); switch (lsaProcessing) { case OspfParameters.VERIFYCHECKSUM: log.debug("LSAQueueConsumer: Message - " + OspfParameters.VERIFYCHECKSUM + " consumed."); processVerifyChecksum(wrapper); break; case OspfParameters.REFRESHLSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.REFRESHLSA + " consumed."); processRefreshLsa(wrapper); break; case OspfParameters.MAXAGELSA: log.debug("LSAQueueConsumer: Message - " + OspfParameters.MAXAGELSA + " consumed."); processMaxAgeLsa(wrapper); break; default: log.debug("Unknown command to process the LSA in queue ...!!!"); break; } } } } catch (Exception e) { log.debug("Error::LSAQueueConsumer::{}", e.getMessage()); } } LsaQueueConsumer(BlockingQueue queue, Channel channel, OspfArea ospfArea); void run(); void setChannel(Channel channel);  }