/** Utility for test method. */ private OspfInterfaceImpl createOspfInterface() throws Exception { ospfInterface = new OspfInterfaceImpl(); LsaHeader lsaHeader = new LsaHeader(); lsaHeader.setLsType(OspfLsaType.ROUTER.value()); RouterLsa routerLsa = new RouterLsa(); OspfAreaImpl ospfArea = new OspfAreaImpl(); ospfArea.addLsa(routerLsa, true, ospfInterface); ospfNbr = new OspfNbrImpl( ospfArea, ospfInterface, ip4Address5, ip4Address6, 2, topologyForDeviceAndLink); ospfNbr.setState(OspfNeighborState.EXSTART); ospfNbr.setNeighborId(ip4Address7); this.ospfInterface = new OspfInterfaceImpl(); this.ospfInterface.setIpAddress(ip4Address5); this.ospfInterface.setIpNetworkMask(subnetAddress); this.ospfInterface.setBdr(ip4Address4); this.ospfInterface.setDr(ip4Address4); this.ospfInterface.setHelloIntervalTime(20); this.ospfInterface.setInterfaceType(2); this.ospfInterface.setReTransmitInterval(2000); this.ospfInterface.setMtu(6500); this.ospfInterface.setRouterDeadIntervalTime(1000); this.ospfInterface.setRouterPriority(1); this.ospfInterface.setInterfaceType(1); this.ospfInterface.setInterfaceIndex(1); this.ospfInterface.addNeighbouringRouter(ospfNbr); this.ospfInterface.setOspfArea(ospfArea); return this.ospfInterface; }
/** 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; }