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


Java NetworkConfigRegistryAdapter类代码示例

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


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

示例1: setup

import org.onosproject.net.config.NetworkConfigRegistryAdapter; //导入依赖的package包/类
@Before
public void setup() {
    vplsConfigManager = new VplsConfigManager();
    vplsConfigManager.configService = new TestConfigService();
    vplsConfigManager.coreService = new TestCoreService();
    vplsConfigManager.interfaceService = new TestInterfaceService();
    vplsConfigManager.registry = new NetworkConfigRegistryAdapter();
    vplsConfigManager.vpls = new TestVpls();
    vplsConfigManager.leadershipService = new TestLeadershipService();

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

示例2: setUp

import org.onosproject.net.config.NetworkConfigRegistryAdapter; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    // Initialize pairDevice and pairLocalPort config
    ObjectMapper mapper = new ObjectMapper();
    ConfigApplyDelegate delegate = config -> { };

    SegmentRoutingDeviceConfig dev3Config = new SegmentRoutingDeviceConfig();
    JsonNode dev3Tree = mapper.createObjectNode();
    dev3Config.init(DEV3, "host-handler-test", dev3Tree, mapper, delegate);
    dev3Config.setPairDeviceId(DEV4).setPairLocalPort(P9);

    SegmentRoutingDeviceConfig dev4Config = new SegmentRoutingDeviceConfig();
    JsonNode dev4Tree = mapper.createObjectNode();
    dev4Config.init(DEV4, "host-handler-test", dev4Tree, mapper, delegate);
    dev4Config.setPairDeviceId(DEV3).setPairLocalPort(P9);

    MockNetworkConfigRegistry mockNetworkConfigRegistry = new MockNetworkConfigRegistry();
    mockNetworkConfigRegistry.applyConfig(dev3Config);
    mockNetworkConfigRegistry.applyConfig(dev4Config);

    // Initialize Segment Routing Manager
    SegmentRoutingManager srManager = new MockSegmentRoutingManager(NEXT_TABLE);
    srManager.cfgService = new NetworkConfigRegistryAdapter();
    srManager.deviceConfiguration = new DeviceConfiguration(srManager);
    srManager.flowObjectiveService = new MockFlowObjectiveService(BRIDGING_TABLE, NEXT_TABLE);
    srManager.routingRulePopulator = new MockRoutingRulePopulator(srManager, ROUTING_TABLE);
    srManager.defaultRoutingHandler = new MockDefaultRoutingHandler(srManager, SUBNET_TABLE);
    srManager.interfaceService = new MockInterfaceService(INTERFACES);
    srManager.mastershipService = new MockMastershipService(LOCAL_DEVICES);
    srManager.hostService = new MockHostService(HOSTS);
    srManager.cfgService = mockNetworkConfigRegistry;
    mockLocationProbingService = new MockLocationProbingService();
    srManager.probingService = mockLocationProbingService;
    srManager.linkHandler = new MockLinkHandler(srManager);

    hostHandler = new HostHandler(srManager);

    ROUTING_TABLE.clear();
    BRIDGING_TABLE.clear();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:41,代码来源:HostHandlerTest.java

示例3: setUp

import org.onosproject.net.config.NetworkConfigRegistryAdapter; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    ObjectMapper mapper = new ObjectMapper();
    ConfigApplyDelegate delegate = config -> { };

    SegmentRoutingDeviceConfig dev1Config = new SegmentRoutingDeviceConfig();
    JsonNode dev1Tree = mapper.createObjectNode();
    dev1Config.init(CP1.deviceId(), "host-handler-test", dev1Tree, mapper, delegate);
    dev1Config.setPairDeviceId(CP2.deviceId()).setPairLocalPort(P9);

    SegmentRoutingDeviceConfig dev2Config = new SegmentRoutingDeviceConfig();
    JsonNode dev2Tree = mapper.createObjectNode();
    dev2Config.init(CP2.deviceId(), "host-handler-test", dev2Tree, mapper, delegate);
    dev2Config.setPairDeviceId(CP1.deviceId()).setPairLocalPort(P9);

    MockNetworkConfigRegistry mockNetworkConfigRegistry = new MockNetworkConfigRegistry();
    mockNetworkConfigRegistry.applyConfig(dev1Config);
    mockNetworkConfigRegistry.applyConfig(dev2Config);

    // Initialize Segment Routing Manager
    SegmentRoutingManager srManager = new MockSegmentRoutingManager(NEXT_TABLE);
    srManager.cfgService = new NetworkConfigRegistryAdapter();
    srManager.deviceConfiguration = new DeviceConfiguration(srManager);
    srManager.flowObjectiveService = new MockFlowObjectiveService(BRIDGING_TABLE, NEXT_TABLE);
    srManager.routingRulePopulator = new MockRoutingRulePopulator(srManager, ROUTING_TABLE);
    srManager.defaultRoutingHandler = new MockDefaultRoutingHandler(srManager, SUBNET_TABLE);
    srManager.interfaceService = new MockInterfaceService(INTERFACES);
    srManager.mastershipService = new MockMastershipService(LOCAL_DEVICES);
    hostService = new MockHostService(HOSTS);
    srManager.hostService = hostService;
    srManager.cfgService = mockNetworkConfigRegistry;
    srManager.routeService = new MockRouteService(ROUTING_TABLE);

    routeHandler = new RouteHandler(srManager) {
        // routeEventCache is not necessary for unit tests
        @Override
        void enqueueRouteEvent(RouteEvent routeEvent) {
            dequeueRouteEvent(routeEvent);
        }
    };

    ROUTING_TABLE.clear();
    BRIDGING_TABLE.clear();
    SUBNET_TABLE.clear();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:46,代码来源:RouteHandlerTest.java


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