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


Java DataBrokerTestModule类代码示例

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


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

示例1: configure

import org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule; //导入依赖的package包/类
@Override
protected void configure() {
    bind(DataBroker.class).toInstance(DataBrokerTestModule.dataBroker());
    bind(AclserviceConfig.class).toInstance(aclServiceConfig());

    bind(AclClusterUtil.class).toInstance(() -> true);

    TestIMdsalApiManager singleton = TestIMdsalApiManager.newInstance();
    bind(IMdsalApiManager.class).toInstance(singleton);
    bind(TestIMdsalApiManager.class).toInstance(singleton);

    bind(IdManagerService.class).toInstance(Mockito.mock(TestIdManagerService.class, realOrException()));
    bind(OpendaylightDirectStatisticsService.class)
            .toInstance(Mockito.mock(TestOdlDirectStatisticsService.class, realOrException()));

    bind(JobCoordinatorEventsWaiter.class).to(TestableJobCoordinatorEventsWaiter.class);

    bind(AclInterfaceCache.class).toInstance(new AclInterfaceCacheImpl());
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:AclServiceTestModule.java

示例2: VMs

import org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule; //导入依赖的package包/类
@Test
@Ignore // This test is flaky on build server VMs (although fine locally)
public void slowYangLoadingShouldOnlyHappenOnceAndNotDelayEachDataBroker() {
    // TODO Write a lil' Timer utility class to make this kind of timing test code more readable
    long startAtMs = System.currentTimeMillis();
    DataBrokerTestModule.dataBroker();
    long firstDataBrokerAtMs = System.currentTimeMillis();
    long firstDataBrokerDurationMs = firstDataBrokerAtMs - startAtMs;
    DataBrokerTestModule.dataBroker();
    long secondDataBrokerDurationMs = System.currentTimeMillis() - firstDataBrokerAtMs;
    assertThat(Math.abs(secondDataBrokerDurationMs - firstDataBrokerDurationMs))
            .isLessThan(firstDataBrokerDurationMs / 4);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:DataBrokerTestModuleTest.java

示例3: ensureDataBrokerTestModuleWorksWithoutException

import org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule; //导入依赖的package包/类
@Test
public void ensureDataBrokerTestModuleWorksWithoutException() {
    assertThat(DataBrokerTestModule.dataBroker()).isNotNull();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:DataBrokerTestModuleTest.java

示例4: configureBindings

import org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule; //导入依赖的package包/类
@Override
protected void configureBindings() {
    DataBroker dataBroker = DataBrokerTestModule.dataBroker();
    bind(EntityOwnershipService.class).toInstance(Mockito.mock(EntityOwnershipService.class));
    bind(ElanStatusMonitor.class).toInstance(Mockito.mock(ElanStatusMonitor.class));
    bind(INeutronVpnManager.class).toInstance(Mockito.mock(NeutronvpnManagerImpl.class));
    IVpnManager ivpnManager = Mockito.mock(VpnManagerTestImpl.class, CALLS_REAL_METHODS);
    bind(IMdsalApiManager.class).toInstance(new MDSALManager(dataBroker,
            Mockito.mock(PacketProcessingService.class)));

    // Bindings for external services to "real" implementations
    bind(LockManagerService.class).to(LockManagerServiceImpl.class);
    bind(ElanConfig.class).toInstance(new ElanConfigBuilder().setIntBridgeGenMac(true)
                    .setTempSmacLearnTimeout(10).build());

    // Bindings of all listeners (which are not directly referenced in the code)
    // This is required to be explicit here, because these are referenced neither from src/main nor src/test
    // and we, intentionally, don't use "classpath scanning for auto-discovery"
    // so this list must kept, manually, in line with the rc/main/resources/org/opendaylight/blueprint/*.xml
    // and target/generated-resources/org/opendaylight/blueprint/autowire.xml
    // bind(ElanGroupListener.class);
    // TODO complete this list!!! after Gerrit which adds @Inject to all listeners

    // Bindings to test infra (fakes & mocks)

    TestInterfaceManager obj = TestInterfaceManager.newInstance(dataBroker);
    ItmRpcService itmRpcService = new ItmRpcTestImpl();

    bind(DataBroker.class).toInstance(dataBroker);
    bind(DataBroker.class).annotatedWith(OsgiService.class).toInstance(dataBroker);
    bind(IdManagerService.class).toInstance(Mockito.mock(IdHelper.class,  CALLS_REAL_METHODS));
    bind(IInterfaceManager.class).toInstance(obj);
    bind(TestInterfaceManager.class).toInstance(obj);
    InterfaceMetaUtils interfaceMetaUtils = new InterfaceMetaUtils(dataBroker,
            Mockito.mock(IdHelper.class,  CALLS_REAL_METHODS),
            Mockito.mock(BatchingUtils.class));

    InterfaceManagerCommonUtils interfaceManagerCommonUtils = new InterfaceManagerCommonUtils(
            dataBroker,
            new MDSALManager(dataBroker, Mockito.mock(PacketProcessingService.class)),
            Mockito.mock(IdHelper.class,  CALLS_REAL_METHODS),
            interfaceMetaUtils,
            Mockito.mock(BatchingUtils.class));

    bind(OdlInterfaceRpcService.class).toInstance(ElanEgressActionsHelper.newInstance(interfaceManagerCommonUtils));
    SingleTransactionDataBroker singleTransactionDataBroker = new SingleTransactionDataBroker(dataBroker);
    bind(SingleTransactionDataBroker.class).toInstance(singleTransactionDataBroker);
    IBgpManager ibgpManager = BgpManagerTestImpl.newInstance(singleTransactionDataBroker);
    bind(ItmRpcService.class).toInstance(itmRpcService);
    bind(ItmRpcTestImpl.class).toInstance((ItmRpcTestImpl)itmRpcService);
    bind(DataImportBootReady.class).annotatedWith(OsgiService.class).toInstance(new DataImportBootReady() {});
    bind(DiagStatusService.class).toInstance(Mockito.mock(DiagStatusService.class));
    bind(IVpnManager.class).toInstance(ivpnManager);
    bind(IBgpManager.class).toInstance(ibgpManager);
    bind(DataImportBootReady.class).toInstance(new DataImportBootReady() {});
    bind(IElanService.class).to(ElanServiceProvider.class);

    MdsalUtils mdsalUtils = new MdsalUtils(dataBroker);
    bind(MdsalUtils.class).toInstance(mdsalUtils);
    bind(SouthboundUtils.class).toInstance(new SouthboundUtils(mdsalUtils));
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:62,代码来源:ElanServiceTestModule.java


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