コード例 #1
0
 /** 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()));
 }
コード例 #2
0
 /** 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()));
 }
コード例 #3
0
 /** Tests metric() setter method. */
 @Test
 public void testSetMetric() throws Exception {
   summaryLsa.setMetric(20);
   result1 = summaryLsa.metric();
   assertThat(result1, is(20));
 }
コード例 #4
0
 /** 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")));
 }
コード例 #5
0
  /** Tests hashcode() method. */
  @Test
  public void testHashcode() throws Exception {

    result1 = summaryLsa.hashCode();
    assertThat(result1, is(notNullValue()));
  }
コード例 #6
0
 /** Tests getOspfLsaType() getter method. */
 @Test
 public void testGetOspfLsaType() throws Exception {
   ospflsaType = summaryLsa.getOspfLsaType();
   assertThat(ospflsaType, is(notNullValue()));
   assertThat(ospflsaType, is(OspfLsaType.SUMMARY));
 }
コード例 #7
0
 /** Tests getLsaBodyAsByteArray() method. */
 @Test
 public void testGetLsaBodyAsByteArray() throws Exception {
   result2 = summaryLsa.getLsaBodyAsByteArray();
   assertThat(result2, is(notNullValue()));
 }
コード例 #8
0
 /** Tests asBytes() method. */
 @Test
 public void testAsBytes() throws Exception {
   result2 = summaryLsa.asBytes();
   assertThat(result2, is(notNullValue()));
 }