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();
}
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);
}
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);
}
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);
}
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();
}
Aggregations