Search in sources :

Example 36 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.

the class VirtualNetworkDeviceManagerTest method setUp.

@Before
public void setUp() throws Exception {
    virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
    coreService = new VirtualNetworkDeviceManagerTest.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, dispatcher);
    testDirectory = new TestServiceDirectory();
    TestUtils.setField(manager, "serviceDirectory", testDirectory);
    manager.activate();
}
Also used : DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) TestStorageService(org.onosproject.store.service.TestStorageService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) Before(org.junit.Before)

Example 37 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.

the class PortAnnotationConfigTest method setUpClass.

// TODO consolidate code-clone in ProtectionConfigTest, and define constants for field name
@BeforeClass
public static void setUpClass() throws TestUtilsException {
    directory = new TestServiceDirectory();
    CodecManager codecService = new CodecManager();
    codecService.activate();
    directory.add(CodecService.class, codecService);
    // replace service directory used by BaseConfig
    original = TestUtils.getField(BaseConfig.class, "services");
    TestUtils.setField(BaseConfig.class, "services", directory);
}
Also used : TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) BaseConfig(org.onosproject.net.config.BaseConfig) BeforeClass(org.junit.BeforeClass)

Example 38 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.

the class DeviceAnnotationConfigTest method setUpClass.

// TODO consolidate code-clone in ProtectionConfigTest, and define constants for field name
@BeforeClass
public static void setUpClass() throws TestUtilsException {
    directory = new TestServiceDirectory();
    CodecManager codecService = new CodecManager();
    codecService.activate();
    directory.add(CodecService.class, codecService);
    // replace service directory used by BaseConfig
    original = TestUtils.getField(BaseConfig.class, "services");
    TestUtils.setField(BaseConfig.class, "services", directory);
}
Also used : TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) BaseConfig(org.onosproject.net.config.BaseConfig) BeforeClass(org.junit.BeforeClass)

Example 39 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.

the class ProtectionEndpointIntentInstallerTest method setUpClass.

@BeforeClass
public static void setUpClass() throws TestUtils.TestUtilsException {
    directory = new TestServiceDirectory();
    CodecManager codecService = new CodecManager();
    codecService.activate();
    directory.add(CodecService.class, codecService);
    // replace service directory used by BaseConfig
    original = TestUtils.getField(BaseConfig.class, "services");
    TestUtils.setField(BaseConfig.class, "services", directory);
}
Also used : TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) BaseConfig(org.onosproject.net.config.BaseConfig) BeforeClass(org.junit.BeforeClass)

Example 40 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.

the class VirtualNetworkIntentManagerTest method setUp.

@Before
public void setUp() throws Exception {
    virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
    intentStore = new SimpleVirtualIntentStore();
    coreService = new VirtualNetworkIntentManagerTest.TestCoreService();
    MockIdGenerator.cleanBind();
    TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
    TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
    virtualNetworkManagerStore.activate();
    manager = new VirtualNetworkManager();
    manager.store = virtualNetworkManagerStore;
    NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
    intentService.addListener(listener);
    // Register a compiler and an installer both setup for success.
    intentExtensionService = intentService;
    intentExtensionService.registerCompiler(VirtualNetworkIntent.class, compiler);
    created = new Semaphore(0, true);
    withdrawn = new Semaphore(0, true);
    purged = new Semaphore(0, true);
    workPartitionService = new WorkPartitionServiceAdapter();
    testDirectory = new TestServiceDirectory().add(VirtualNetworkStore.class, virtualNetworkManagerStore).add(IntentService.class, intentService).add(WorkPartitionService.class, workPartitionService);
    TestUtils.setField(manager, "serviceDirectory", testDirectory);
    manager.activate();
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) SimpleVirtualIntentStore(org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualIntentStore) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) WorkPartitionServiceAdapter(org.onosproject.net.intent.WorkPartitionServiceAdapter) WorkPartitionService(org.onosproject.net.intent.WorkPartitionService) TestStorageService(org.onosproject.store.service.TestStorageService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) Semaphore(java.util.concurrent.Semaphore) VirtualNetworkStore(org.onosproject.incubator.net.virtual.VirtualNetworkStore) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) Before(org.junit.Before)

Aggregations

TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)71 Before (org.junit.Before)66 ServiceDirectory (org.onlab.osgi.ServiceDirectory)53 CodecManager (org.onosproject.codec.impl.CodecManager)37 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)14 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)13 TestStorageService (org.onosproject.store.service.TestStorageService)12 CoreService (org.onosproject.core.CoreService)10 BeforeClass (org.junit.BeforeClass)5 CfmCodecContext (org.onosproject.cfm.CfmCodecContext)5 CodecService (org.onosproject.codec.CodecService)5 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)5 BaseConfig (org.onosproject.net.config.BaseConfig)5 DeviceService (org.onosproject.net.device.DeviceService)5 TestApplicationId (org.onosproject.TestApplicationId)4 CfmMdService (org.onosproject.incubator.net.l2monitoring.cfm.service.CfmMdService)3 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)3 VirtualProviderRegistryService (org.onosproject.incubator.net.virtual.provider.VirtualProviderRegistryService)3 SimpleVirtualFlowRuleStore (org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualFlowRuleStore)3 Semaphore (java.util.concurrent.Semaphore)2