/** Tests readFrom() method. */ @Test public void testReadFrom() throws Exception { inputByteArray = createByteForNetworkLsa(); lsaHeader = createLsaHeader(); summaryLsa = new SummaryLsa(lsaHeader); channelBuffer = ChannelBuffers.copiedBuffer(inputByteArray); summaryLsa.readFrom(channelBuffer); assertThat(summaryLsa, is(notNullValue())); }
/** Tests readFrom() method. */ @Test(expected = Exception.class) public void testReadFrom1() throws Exception { byte[] temp = {0, 0, 0}; inputByteArray = temp; lsaHeader = createLsaHeader(); summaryLsa = new SummaryLsa(lsaHeader); channelBuffer = ChannelBuffers.copiedBuffer(inputByteArray); summaryLsa.readFrom(channelBuffer); assertThat(summaryLsa, is(notNullValue())); }
/** Tests metric() setter method. */ @Test public void testSetMetric() throws Exception { summaryLsa.setMetric(20); result1 = summaryLsa.metric(); assertThat(result1, is(20)); }
/** Tests networkMask() setter method. */ @Test public void testSetNetworkMask() throws Exception { summaryLsa.setNetworkMask(Ip4Address.valueOf("10.226.165.164")); result = summaryLsa.networkMask(); assertThat(result, is(Ip4Address.valueOf("10.226.165.164"))); }
/** Tests hashcode() method. */ @Test public void testHashcode() throws Exception { result1 = summaryLsa.hashCode(); assertThat(result1, is(notNullValue())); }
/** Tests getOspfLsaType() getter method. */ @Test public void testGetOspfLsaType() throws Exception { ospflsaType = summaryLsa.getOspfLsaType(); assertThat(ospflsaType, is(notNullValue())); assertThat(ospflsaType, is(OspfLsaType.SUMMARY)); }
/** Tests getLsaBodyAsByteArray() method. */ @Test public void testGetLsaBodyAsByteArray() throws Exception { result2 = summaryLsa.getLsaBodyAsByteArray(); assertThat(result2, is(notNullValue())); }
/** Tests asBytes() method. */ @Test public void testAsBytes() throws Exception { result2 = summaryLsa.asBytes(); assertThat(result2, is(notNullValue())); }