コード例 #1
0
 /** Utility for test method. */
 private OspfInterfaceImpl createOspfInterface1() throws UnknownHostException {
   ospfInterface = new OspfInterfaceImpl();
   OspfAreaImpl ospfArea = new OspfAreaImpl();
   OspfInterfaceChannelHandler ospfInterfaceChannelHandler =
       EasyMock.createMock(OspfInterfaceChannelHandler.class);
   ospfNbr =
       new OspfNbrImpl(
           ospfArea, ospfInterface, ip4Address5, ip4Address6, 2, topologyForDeviceAndLink);
   ospfNbr.setState(OspfNeighborState.FULL);
   ospfNbr.setNeighborId(ip4Address7);
   ospfInterface = new OspfInterfaceImpl();
   ospfInterface.setIpAddress(ip4Address5);
   ospfInterface.setIpNetworkMask(subnetAddress);
   ospfInterface.setBdr(ip4Address4);
   ospfInterface.setDr(ip4Address4);
   ospfInterface.setHelloIntervalTime(20);
   ospfInterface.setInterfaceType(2);
   ospfInterface.setReTransmitInterval(2000);
   ospfInterface.setMtu(6500);
   ospfInterface.setRouterDeadIntervalTime(1000);
   ospfInterface.setRouterPriority(1);
   ospfInterface.setInterfaceType(1);
   ospfInterface.addNeighbouringRouter(ospfNbr);
   return ospfInterface;
 }
コード例 #2
0
 @Before
 public void setUp() throws Exception {
   ospfProcess = new OspfProcessImpl();
   ospfArea = createOspfArea();
   ospfAreas.add(ospfArea);
   ospfProcess.setAreas(ospfAreas);
   ospfProcesses.add(ospfProcess);
   controller = new Controller();
   topologyForDeviceAndLink = new TopologyForDeviceAndLinkImpl();
   ospfNbr =
       new OspfNbrImpl(
           ospfArea, ospfInterface, ip4Address1, ip4Address2, 2, topologyForDeviceAndLink);
   ospfNbr.setNeighborId(ip4Address1);
   ospfNbr.setRouterPriority(0);
   ospfNbr.setNeighborDr(ip4Address3);
   ospfInterface.addNeighbouringRouter(ospfNbr);
   ospfInterfaceChannelHandler = new OspfInterfaceChannelHandler(controller, ospfProcesses);
 }