當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。