Example #1
0
 /**
  * Tests whether the dijkstra's algorithm code will work for both the data plane and the control
  * plane going from right to left.
  */
 @Test
 public void testRoutingRightToLeft() {
   Assert.assertTrue(lsrG.getDestNICviaIP(1, true).getId().compareTo("lsrGlsrF") == 0);
   Assert.assertTrue(lsrG.getDestNICviaIP(1, false).getId().compareTo("lsrGlsrF") == 0);
   Assert.assertTrue(lsrF.getDestNICviaIP(1, true).getId().compareTo("lsrFlsrEControl") == 0);
   Assert.assertTrue(lsrF.getDestNICviaIP(1, false).getId().compareTo("lsrFlsrEData") == 0);
   Assert.assertTrue(lsrE.getDestNICviaIP(1, true).getId().compareTo("lsrElsrDControl") == 0);
   Assert.assertTrue(lsrE.getDestNICviaIP(1, false).getId().compareTo("lsrElsrDData") == 0);
   Assert.assertTrue(lsrD.getDestNICviaIP(1, true).getId().compareTo("lsrDlsrCControl") == 0);
   Assert.assertTrue(lsrD.getDestNICviaIP(1, false).getId().compareTo("lsrDlsrCData") == 0);
   Assert.assertTrue(lsrC.getDestNICviaIP(1, true).getId().compareTo("lsrClsrBControl") == 0);
   Assert.assertTrue(lsrC.getDestNICviaIP(1, false).getId().compareTo("lsrClsrBData") == 0);
   Assert.assertTrue(lsrB.getDestNICviaIP(1, true).getId().compareTo("lsrBlsrA") == 0);
   Assert.assertTrue(lsrB.getDestNICviaIP(1, false).getId().compareTo("lsrBlsrA") == 0);
 }
Example #2
0
 /**
  * Tests whether the dijkstra's algorithm code will work for both the data plane and the control
  * plane going from left to right.
  */
 @Test
 public void testRoutingLeftToRight() {
   Assert.assertTrue(lsrA.getDestNICviaIP(7, true).getId().compareTo("lsrAlsrB") == 0);
   Assert.assertTrue(lsrA.getDestNICviaIP(7, false).getId().compareTo("lsrAlsrB") == 0);
   Assert.assertTrue(lsrB.getDestNICviaIP(7, true).getId().compareTo("lsrBlsrCControl") == 0);
   Assert.assertTrue(lsrB.getDestNICviaIP(7, false).getId().compareTo("lsrBlsrCData") == 0);
   Assert.assertTrue(lsrC.getDestNICviaIP(7, true).getId().compareTo("lsrClsrDControl") == 0);
   Assert.assertTrue(lsrC.getDestNICviaIP(7, false).getId().compareTo("lsrClsrDData") == 0);
   Assert.assertTrue(lsrD.getDestNICviaIP(7, true).getId().compareTo("lsrDlsrEControl") == 0);
   Assert.assertTrue(lsrD.getDestNICviaIP(7, false).getId().compareTo("lsrDlsrEData") == 0);
   Assert.assertTrue(lsrE.getDestNICviaIP(7, true).getId().compareTo("lsrElsrFControl") == 0);
   Assert.assertTrue(lsrE.getDestNICviaIP(7, false).getId().compareTo("lsrElsrFData") == 0);
   Assert.assertTrue(lsrF.getDestNICviaIP(7, true).getId().compareTo("lsrFlsrG") == 0);
   Assert.assertTrue(lsrF.getDestNICviaIP(7, false).getId().compareTo("lsrFlsrG") == 0);
 }