本文整理汇总了Java中org.onosproject.ospf.protocol.lsa.LsaHeader.setLsType方法的典型用法代码示例。如果您正苦于以下问题:Java LsaHeader.setLsType方法的具体用法?Java LsaHeader.setLsType怎么用?Java LsaHeader.setLsType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.ospf.protocol.lsa.LsaHeader
的用法示例。
在下文中一共展示了LsaHeader.setLsType方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRun1
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* Tests run() method.
*/
@Test
public void testRun1() throws Exception {
blockingQueue = new ArrayBlockingQueue(5);
channel = EasyMock.createMock(Channel.class);
ospfArea = new OspfAreaImpl();
lsaWrapper = new LsaWrapperImpl();
routerLsa = new RouterLsa();
routerLsa.setLsType(1);
lsaWrapper.addLsa(OspfLsaType.ROUTER, routerLsa);
ospfInterface = new OspfInterfaceImpl();
ospfInterface.setState(OspfInterfaceState.DR);
lsaWrapper.setOspfInterface(ospfInterface);
lsaWrapper.setIsSelfOriginated(true);
lsaHeader = new LsaHeader();
lsaHeader.setLsType(1);
lsaWrapper.setLsaHeader(lsaHeader);
lsaWrapper.setLsaProcessing("refreshLsa");
lsaWrapper.setLsdbAge(new LsdbAgeImpl(ospfArea));
blockingQueue.add(lsaWrapper);
lsaQueueConsumer = new LsaQueueConsumer(blockingQueue, channel, ospfArea);
lsaQueueConsumer.run();
assertThat(lsaQueueConsumer, is(notNullValue()));
}
示例2: testRun3
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
@Test
public void testRun3() throws Exception {
blockingQueue = new ArrayBlockingQueue(5);
channel = EasyMock.createMock(Channel.class);
ospfArea = new OspfAreaImpl();
lsaWrapper = new LsaWrapperImpl();
routerLsa = new RouterLsa();
routerLsa.setLsType(2);
lsaWrapper.addLsa(OspfLsaType.NETWORK, routerLsa);
ospfInterface = new OspfInterfaceImpl();
ospfInterface.setState(OspfInterfaceState.BDR);
lsaWrapper.setOspfInterface(ospfInterface);
lsaWrapper.setIsSelfOriginated(true);
lsaHeader = new LsaHeader();
lsaHeader.setLsType(2);
lsaWrapper.setLsaHeader(lsaHeader);
lsaWrapper.setLsaProcessing("refreshLsa");
lsaWrapper.setLsdbAge(new LsdbAgeImpl(ospfArea));
blockingQueue.add(lsaWrapper);
lsaQueueConsumer = new LsaQueueConsumer(blockingQueue, channel, ospfArea);
lsaQueueConsumer.run();
assertThat(lsaQueueConsumer, is(notNullValue()));
}
示例3: testRun5
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* Tests run() method.
*/
@Test
public void testRun5() throws Exception {
blockingQueue = new ArrayBlockingQueue(5);
channel = EasyMock.createMock(Channel.class);
ospfArea = new OspfAreaImpl();
lsaWrapper = new LsaWrapperImpl();
routerLsa = new RouterLsa();
routerLsa.setLsType(2);
lsaWrapper.addLsa(OspfLsaType.NETWORK, routerLsa);
ospfInterface = new OspfInterfaceImpl();
ospfInterface.setState(OspfInterfaceState.DR);
lsaWrapper.setOspfInterface(ospfInterface);
lsaWrapper.setIsSelfOriginated(true);
lsaHeader = new LsaHeader();
lsaHeader.setLsType(2);
lsaWrapper.setLsaHeader(lsaHeader);
lsaWrapper.setLsaProcessing("maxAgeLsa");
lsaWrapper.setLsdbAge(new LsdbAgeImpl(ospfArea));
blockingQueue.add(lsaWrapper);
lsaQueueConsumer = new LsaQueueConsumer(blockingQueue, channel, ospfArea);
lsaQueueConsumer.run();
assertThat(lsaQueueConsumer, is(notNullValue()));
}
示例4: createLsaHeader
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* Utility method used by junit methods.
*/
private LsaHeader createLsaHeader() {
lsaHeader = new LsaHeader();
lsaHeader.setAge(10);
lsaHeader.setLinkStateId("10.226.165.164");
lsaHeader.setLsCheckSum(222);
lsaHeader.setLsPacketLen(48);
lsaHeader.setLsSequenceNo(2020);
lsaHeader.setLsType(5);
lsaHeader.setOptions(2);
lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("10.226.165.165"));
return lsaHeader;
}
示例5: createLsaHeader
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* Utility method used by junit methods.
*/
private LsaHeader createLsaHeader() {
lsaHeader = new LsaHeader();
lsaHeader.setAge(10);
lsaHeader.setLinkStateId("10.226.165.164");
lsaHeader.setLsCheckSum(222);
lsaHeader.setLsPacketLen(48);
lsaHeader.setLsSequenceNo(2020);
lsaHeader.setLsType(2);
lsaHeader.setOptions(2);
lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("10.226.165.165"));
return lsaHeader;
}
示例6: createLsaHeader
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* Utility method used by junit methods.
*/
private LsaHeader createLsaHeader() {
lsaHeader = new LsaHeader();
lsaHeader.setLsType(1);
lsaHeader.setLsPacketLen(48);
lsaHeader.setLsCheckSum(10);
lsaHeader.setAge(4);
lsaHeader.setLinkStateId("10.226.165.164");
lsaHeader.setLsSequenceNo(250);
lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("100.226.165.165"));
lsaHeader.setOptions(2);
return lsaHeader;
}
示例7: createLsaHeader
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* Utility method used by junit methods.
*/
private LsaHeader createLsaHeader() {
lsaHeader = new LsaHeader();
lsaHeader.setLsType(3);
lsaHeader.setLsPacketLen(48);
lsaHeader.setLsCheckSum(10);
lsaHeader.setAge(4);
lsaHeader.setLinkStateId("10.226.165.164");
lsaHeader.setLsSequenceNo(250);
lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("100.226.165.165"));
lsaHeader.setOptions(2);
return lsaHeader;
}
示例8: createLsaHeader
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* Utility method used by junit methods.
*/
private LsaHeader createLsaHeader() {
lsaHeader = new LsaHeader();
lsaHeader.setLsType(2);
lsaHeader.setLsPacketLen(48);
lsaHeader.setLsCheckSum(10);
lsaHeader.setAge(4);
lsaHeader.setLinkStateId("10.226.165.164");
lsaHeader.setLsSequenceNo(250);
lsaHeader.setAdvertisingRouter(Ip4Address.valueOf("100.226.165.165"));
lsaHeader.setOptions(2);
return lsaHeader;
}
示例9: testLoadingDone
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* Tests loadingDone() method.
*/
@Test
public void testLoadingDone() throws Exception {
LsaHeader lsaHeader = new LsaHeader();
lsaHeader.setLsType(OspfLsaType.ROUTER.value());
RouterLsa routerLsa = new RouterLsa(lsaHeader);
ospfArea.addLsa(routerLsa, false, ospfInterface);
ospfArea.addLsa(routerLsa, ospfInterface);
ospfArea.addLsaToMaxAgeBin("lsa", new LsaWrapperImpl());
ospfNbr.loadingDone();
assertThat(ospfNbr, is(notNullValue()));
}
示例10: createOspfInterface
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
/**
* 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;
}
示例11: setUp
import org.onosproject.ospf.protocol.lsa.LsaHeader; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
lsaHeader = new LsaHeader();
lsaHeader.setLsType(OspfLsaType.ROUTER.value());
RouterLsa routerLsa = new RouterLsa(lsaHeader);
routerLsa.setLsType(OspfLsaType.ROUTER.value());
ospfInterface = new OspfInterfaceImpl();
ospfInterface.setInterfaceType(2);
ospfInterface.setInterfaceIndex(1);
ospfInterface.setRouterDeadIntervalTime(30);
ospfInterface.setReTransmitInterval(30);
ospfInterface.setDr(Ip4Address.valueOf("1.1.1.1"));
ospfInterface.setIpAddress(Ip4Address.valueOf("1.1.1.1"));
ospfInterface.setState(OspfInterfaceState.POINT2POINT);
ospfArea = createOspfArea();
ospfArea.addLsa(routerLsa, true, ospfInterface);
ospfInterface.setOspfArea(ospfArea);
ospfInterface1 = new OspfInterfaceImpl();
ospfInterface1.setInterfaceType(2);
ospfInterface1.setInterfaceIndex(1);
ospfInterface1.setRouterDeadIntervalTime(30);
ospfInterface1.setReTransmitInterval(30);
ospfInterface1.setDr(Ip4Address.valueOf("7.7.7.7"));
ospfInterface1.setIpAddress(Ip4Address.valueOf("7.7.7.7"));
ospfInterface1.setState(OspfInterfaceState.DOWN);
ospfInterface1.setOspfArea(ospfArea);
ospfInterface2 = new OspfInterfaceImpl();
ospfInterface2.setInterfaceType(2);
ospfInterface2.setInterfaceIndex(1);
ospfInterface2.setRouterDeadIntervalTime(30);
ospfInterface2.setReTransmitInterval(30);
ospfInterface2.setDr(Ip4Address.valueOf("6.6.6.6"));
ospfInterface2.setIpAddress(Ip4Address.valueOf("6.6.6.6"));
ospfInterface2.setOspfArea(ospfArea);
ospfInterface1.setState(OspfInterfaceState.DR);
ospfInterfaces = new ArrayList();
ospfInterfaces.add(ospfInterface);
ospfInterfaces.add(ospfInterface1);
ospfInterfaces.add(ospfInterface2);
ospfArea.setOspfInterfaceList(ospfInterfaces);
ospfInterface.setState(OspfInterfaceState.POINT2POINT);
ospfArea.setRouterId(Ip4Address.valueOf("111.111.111.111"));
topologyForDeviceAndLink = new TopologyForDeviceAndLinkImpl();
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, Ip4Address.valueOf("1.1.1.1"),
Ip4Address.valueOf("2.2.2.2"), 2,
topologyForDeviceAndLink);
}