当前位置: 首页>>代码示例>>Java>>正文


Java TestEventDispatcher类代码示例

本文整理汇总了Java中org.onosproject.common.event.impl.TestEventDispatcher的典型用法代码示例。如果您正苦于以下问题:Java TestEventDispatcher类的具体用法?Java TestEventDispatcher怎么用?Java TestEventDispatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TestEventDispatcher类属于org.onosproject.common.event.impl包,在下文中一共展示了TestEventDispatcher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    virtualNetworkManagerStore = new DistributedVirtualNetworkStore();

    coreService = new TestCoreService();
    virtualNetworkManagerStore.setCoreService(coreService);
    TestUtils.setField(coreService, "coreService", new TestCoreService());
    TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
    virtualNetworkManagerStore.activate();

    manager = new VirtualNetworkManager();
    manager.store = virtualNetworkManagerStore;
    manager.addListener(listener);
    NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
    manager.activate();
    virtualNetworkManagerService = manager;

}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:VirtualNetworkManagerTest.java

示例2: testCreateFlowClassifier

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
/**
 * Checks the operation of createFlowClassifier() method.
 */
@Test
public void testCreateFlowClassifier() {
    // initialize flow classifier manager
    flowClassifierMgr.storageService = storageService;
    injectEventDispatcher(flowClassifierMgr, new TestEventDispatcher());
    flowClassifierMgr.activate();

    // create flow classifier
    flowClassifier = flowClassifierBuilder.setFlowClassifierId(flowClassifierId).setTenantId(tenantId)
            .setName(name).setDescription(description).setEtherType(ethType).setProtocol(protocol)
            .setMinSrcPortRange(minSrcPortRange).setMaxSrcPortRange(maxSrcPortRange)
            .setMinDstPortRange(minDstPortRange).setMaxDstPortRange(maxDstPortRange).setSrcIpPrefix(srcIpPrefix)
            .setDstIpPrefix(dstIpPrefix).setSrcPort(virtualSrcPort).setDstPort(virtualDstPort).build();
    assertThat(flowClassifierMgr.createFlowClassifier(flowClassifier), is(true));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:FlowClassifierManagerTest.java

示例3: testCreatePortChain

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
/**
 * Checks the operation of createPortChain() method.
 */
@Test
public void testCreatePortChain() {
    // initialize port chain manager
    portChainMgr.storageService = storageService;
    injectEventDispatcher(portChainMgr, new TestEventDispatcher());
    portChainMgr.activate();

    // create list of Port Pair Groups.
    PortPairGroupId portPairGroupId = PortPairGroupId.of("73333333-fc23-aeb6-f44b-56dc5e2fb3ae");
    portPairGroupList.add(portPairGroupId);
    portPairGroupId = PortPairGroupId.of("73333333-fc23-aeb6-f44b-56dc5e2fb3af");
    portPairGroupList.add(portPairGroupId);

    // create list of Flow classifiers.
    FlowClassifierId flowClassifierId = FlowClassifierId.of("74444444-fc23-aeb6-f44b-56dc5e2fb3ae");
    flowClassifierList.add(flowClassifierId);
    flowClassifierId = FlowClassifierId.of("74444444-fc23-aeb6-f44b-56dc5e2fb3af");
    flowClassifierList.add(flowClassifierId);

    // create port chain
    portChain = portChainBuilder.setId(portChainId).setTenantId(tenantId).setName(name).setDescription(description)
            .setPortPairGroups(portPairGroupList).setFlowClassifiers(flowClassifierList).build();
    assertThat(portChainMgr.createPortChain(portChain), is(true));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:PortChainManagerTest.java

示例4: testCreatePortPairGroup

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
/**
 * Checks the operation of createPortPairGroup() method.
 */
@Test
public void testCreatePortPairGroup() {
    // initialize port pair group manager
    portPairGroupMgr.storageService = storageService;
    injectEventDispatcher(portPairGroupMgr, new TestEventDispatcher());
    portPairGroupMgr.activate();

    // create port-pair-id list
    PortPairId portPairId = PortPairId.of("73333333-fc23-aeb6-f44b-56dc5e2fb3ae");
    portPairIdList.add(portPairId);
    portPairId = PortPairId.of("74444444-fc23-aeb6-f44b-56dc5e2fb3ae");
    portPairIdList.add(portPairId);

    // create port pair
    portPairGroup = portPairGroupBuilder.setId(portPairGroupId).setTenantId(tenantId).setName(name)
            .setDescription(description).setPortPairs(portPairIdList).build();
    assertThat(portPairGroupMgr.createPortPairGroup(portPairGroup), is(true));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:PortPairGroupManagerTest.java

示例5: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    mgr = new MastershipManager();
    service = mgr;
    injectEventDispatcher(mgr, new TestEventDispatcher());
    testClusterService = new TestClusterService();
    mgr.clusterService = testClusterService;
    mgr.store = new TestSimpleMastershipStore(mgr.clusterService);
    regionStore = new DistributedRegionStore();
    TestUtils.setField(regionStore, "storageService", new TestStorageService());
    TestUtils.callMethod(regionStore, "activate",
                         new Class<?>[] {});
    regionManager = new TestRegionManager();
    TestUtils.setField(regionManager, "store", regionStore);
    regionManager.activate();
    mgr.regionService = regionManager;
    mgr.activate();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:MastershipManagerTest.java

示例6: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() {
    mgr = new DeviceManager();
    service = mgr;
    admin = mgr;
    registry = mgr;
    mgr.store = new SimpleDeviceStore();
    injectEventDispatcher(mgr, new TestEventDispatcher());
    TestMastershipManager mastershipManager = new TestMastershipManager();
    mgr.mastershipService = mastershipManager;
    mgr.termService = mastershipManager;
    mgr.clusterService = new TestClusterService();
    mgr.networkConfigService = new TestNetworkConfigService();
    mgr.activate();


    service.addListener(listener);

    provider = new TestProvider();
    providerService = registry.register(provider);
    assertTrue("provider should be registered",
               registry.getProviders().contains(provider.id()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:DeviceManagerTest.java

示例7: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() {
    mgr = new LinkManager();
    service = mgr;
    admin = mgr;
    registry = mgr;
    mgr.store = new SimpleLinkStore();
    injectEventDispatcher(mgr, new TestEventDispatcher());
    mgr.deviceService = devmgr;
    mgr.networkConfigService = new TestNetworkConfigService();
    mgr.activate();

    DEVICEIDMAP.put(DID1, DEV1);
    DEVICEIDMAP.put(DID2, DEV2);
    DEVICEIDMAP.put(DID3, DEV3);

    service.addListener(listener);

    provider = new TestProvider();
    providerService = registry.register(provider);
    assertTrue("provider should be registered",
               registry.getProviders().contains(provider.id()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:LinkManagerTest.java

示例8: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() {
    manager = new IntentManager();
    flowRuleService = new MockFlowRuleService();
    manager.store = new SimpleIntentStore();
    injectEventDispatcher(manager, new TestEventDispatcher());
    manager.trackerService = new TestIntentTracker();
    manager.flowRuleService = flowRuleService;
    manager.coreService = new TestCoreManager();
    manager.configService = mock(ComponentConfigService.class);
    service = manager;
    extensionService = manager;

    manager.activate();
    service.addListener(listener);
    extensionService.registerCompiler(MockIntent.class, compiler);

    assertTrue("store should be empty",
               Sets.newHashSet(service.getIntents()).isEmpty());
    assertEquals(0L, flowRuleService.getFlowRuleCount());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:IntentManagerTest.java

示例9: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() {
    mgr = new HostManager();
    mgr.store = new SimpleHostStore();
    injectEventDispatcher(mgr, new TestEventDispatcher());
    registry = mgr;
    mgr.networkConfigService = new TestNetworkConfigService();
    mgr.activate();

    mgr.addListener(listener);

    provider = new TestHostProvider();
    providerService = registry.register(provider);
    assertTrue("provider should be registered",
               registry.getProviders().contains(provider.id()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:HostManagerTest.java

示例10: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() {
    mgr = new PacketManager();
    injectEventDispatcher(mgr, new TestEventDispatcher());
    mgr.store = new SimplePacketStore();
    mgr.clusterService = new ClusterServiceAdapter();
    mgr.deviceService = new TestDeviceService();
    mgr.deviceService = new TestDeviceService();
    mgr.coreService = new TestCoreService();
    providerRegistry = mgr;
    mgr.activate();
    driverService = new TestDriverManager();
    driverService.addDriver(new DefaultDriver("foo", ImmutableList.of(), "", "", "",
                                              ImmutableMap.of(PacketProgrammable.class,
                                                              TestPacketProgrammable.class),
                                              ImmutableMap.of()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:PacketManagerTest.java

示例11: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() {
    mgr = new TopologyManager();
    service = mgr;
    registry = mgr;

    mgr.store = new SimpleTopologyStore();
    injectEventDispatcher(mgr, new TestEventDispatcher());
    mgr.activate();

    service.addListener(listener);

    provider = new TestProvider();
    providerService = registry.register(provider);

    assertTrue("provider should be registered",
               registry.getProviders().contains(provider.id()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:TopologyManagerTest.java

示例12: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    mastershipListenerRegistry = new ListenerRegistry<>();

    mgr = new ReplicaInfoManager();
    service = mgr;

    eventDispatcher = new TestEventDispatcher();
    mgr.eventDispatcher = eventDispatcher;
    mgr.mastershipService = new TestMastershipService();

    // register dummy mastership event source
    mgr.eventDispatcher.addSink(MastershipEvent.class, mastershipListenerRegistry);

    mgr.activate();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:ReplicaInfoManagerTest.java

示例13: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() {
    leadershipService = createMock(LeadershipService.class);

    leadershipService.addListener(anyObject(LeadershipEventListener.class));
    expectLastCall().andDelegateTo(new TestLeadershipService());
    for (int i = 0; i < IntentPartitionManager.NUM_PARTITIONS; i++) {
        expect(leadershipService.runForLeadership(ELECTION_PREFIX + i))
            .andReturn(null)
            .times(1);
    }

    partitionManager = new IntentPartitionManager()
            .withScheduledExecutor(new NullScheduledExecutor());

    partitionManager.clusterService = new TestClusterService();
    partitionManager.localNodeId = MY_NODE_ID;
    partitionManager.leadershipService = leadershipService;
    partitionManager.eventDispatcher = new TestEventDispatcher();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:IntentPartitionManagerTest.java

示例14: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    virtualNetworkManagerStore = new DistributedVirtualNetworkStore();

    CoreService coreService = new TestCoreService();
    TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
    TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
    virtualNetworkManagerStore.activate();

    manager = new VirtualNetworkManager();
    manager.store = virtualNetworkManagerStore;
    manager.coreService = coreService;
    NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());

    testDirectory = new TestServiceDirectory();
    TestUtils.setField(manager, "serviceDirectory", testDirectory);

    manager.activate();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:20,代码来源:VirtualNetworkPathManagerTest.java

示例15: setUp

import org.onosproject.common.event.impl.TestEventDispatcher; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    virtualNetworkManagerStore = new DistributedVirtualNetworkStore();

    coreService = new VirtualNetworkLinkManagerTest.TestCoreService();
    TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
    TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
    virtualNetworkManagerStore.activate();

    manager = new VirtualNetworkManager();
    manager.store = virtualNetworkManagerStore;
    manager.coreService = coreService;
    NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());

    testDirectory = new TestServiceDirectory();
    TestUtils.setField(manager, "serviceDirectory", testDirectory);

    manager.activate();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:20,代码来源:VirtualNetworkLinkManagerTest.java


注:本文中的org.onosproject.common.event.impl.TestEventDispatcher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。