Search in sources :

Example 1 with WorkPartitionServiceAdapter

use of org.onosproject.net.intent.WorkPartitionServiceAdapter 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)

Example 2 with WorkPartitionServiceAdapter

use of org.onosproject.net.intent.WorkPartitionServiceAdapter in project onos by opennetworkinglab.

the class GossipIntentStoreTest method setUp.

@Override
@Before
public void setUp() {
    intentStore = new GossipIntentStore();
    intentStore.storageService = new TestStorageService();
    intentStore.partitionService = new WorkPartitionServiceAdapter();
    intentStore.clusterService = new ClusterServiceAdapter();
    super.setUp();
    builder1 = HostToHostIntent.builder().one(hid("12:34:56:78:91:ab/1")).two(hid("12:34:56:78:91:ac/1")).appId(APP_ID);
    intentStore.configService = new MockComponentConfigService();
    intentStore.activate(null);
}
Also used : WorkPartitionServiceAdapter(org.onosproject.net.intent.WorkPartitionServiceAdapter) TestStorageService(org.onosproject.store.service.TestStorageService) ClusterServiceAdapter(org.onosproject.cluster.ClusterServiceAdapter) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 WorkPartitionServiceAdapter (org.onosproject.net.intent.WorkPartitionServiceAdapter)2 TestStorageService (org.onosproject.store.service.TestStorageService)2 Semaphore (java.util.concurrent.Semaphore)1 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)1 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)1 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)1 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)1 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)1 SimpleVirtualIntentStore (org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualIntentStore)1 WorkPartitionService (org.onosproject.net.intent.WorkPartitionService)1