Search in sources :

Example 36 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class DistributedDevicePipeconfMappingStoreTest method setUp.

/**
 * Sets up the device key store and the storage service test harness.
 */
@Before
public void setUp() {
    store = new DistributedDevicePipeconfMappingStore();
    store.storageService = new TestStorageService();
    store.setDelegate(event -> {
    });
    store.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 37 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class DistributedNetworkConfigStoreTest method setUp.

/**
 * Sets up the config store and the storage service test harness.
 */
@Before
public void setUp() {
    configStore = new DistributedNetworkConfigStore();
    configStore.storageService = new TestStorageService();
    configStore.setDelegate(event -> {
    });
    configStore.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 38 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class DistributedApplicationIdStoreTest method setUp.

@Before
public void setUp() throws Exception {
    appIdStore = new DistributedApplicationIdStore();
    appIdStore.storageService = new TestStorageService();
    appIdStore.activate();
    idStore = appIdStore;
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 39 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class ECFlowRuleStoreTest method setUp.

@Before
public void setUp() throws Exception {
    flowStoreImpl = new ECFlowRuleStore();
    flowStoreImpl.storageService = new TestStorageService() {

        @Override
        public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() {
            return new ConsistentMapBuilder<K, V>() {

                @Override
                public AsyncConsistentMap<K, V> buildAsyncMap() {
                    return new AsyncConsistentMapAdapter<K, V>();
                }

                @Override
                public ConsistentMap<K, V> build() {
                    return null;
                }
            };
        }
    };
    ReplicaInfoManager replicaInfoManager = new ReplicaInfoManager();
    replicaInfoManager.mastershipService = new MasterOfAll();
    flowStoreImpl.replicaInfoManager = replicaInfoManager;
    mockClusterService = createMock(ClusterService.class);
    flowStoreImpl.clusterService = mockClusterService;
    nodeId = new NodeId("1");
    mockControllerNode = new MockControllerNode(nodeId);
    expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
    replay(mockClusterService);
    flowStoreImpl.clusterCommunicator = new ClusterCommunicationServiceAdapter();
    flowStoreImpl.mastershipService = new MasterOfAll();
    flowStoreImpl.deviceService = new DeviceServiceAdapter();
    flowStoreImpl.coreService = new CoreServiceAdapter();
    flowStoreImpl.configService = new ComponentConfigAdapter();
    flowStoreImpl.persistenceService = new PersistenceServiceAdapter();
    flowStoreImpl.activate(context);
}
Also used : PersistenceServiceAdapter(org.onosproject.store.persistence.PersistenceServiceAdapter) TestStorageService(org.onosproject.store.service.TestStorageService) ClusterCommunicationServiceAdapter(org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter) ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) ClusterService(org.onosproject.cluster.ClusterService) CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) ConsistentMap(org.onosproject.store.service.ConsistentMap) AsyncConsistentMap(org.onosproject.store.service.AsyncConsistentMap) NodeId(org.onosproject.cluster.NodeId) AsyncConsistentMap(org.onosproject.store.service.AsyncConsistentMap) ConsistentMapBuilder(org.onosproject.store.service.ConsistentMapBuilder) DeviceServiceAdapter(org.onosproject.net.device.DeviceServiceAdapter) Before(org.junit.Before)

Example 40 with TestStorageService

use of org.onosproject.store.service.TestStorageService 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)75 TestStorageService (org.onosproject.store.service.TestStorageService)75 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)18 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)12 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)12 CoreService (org.onosproject.core.CoreService)8 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)6 ClusterCommunicationServiceAdapter (org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter)5 TestApplicationId (org.onosproject.TestApplicationId)3 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)3 ClusterService (org.onosproject.cluster.ClusterService)3 LeadershipServiceAdapter (org.onosproject.cluster.LeadershipServiceAdapter)3 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)3 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)3 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)3 FlowObjectiveServiceAdapter (org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter)3 Semaphore (java.util.concurrent.Semaphore)2 ComponentContextAdapter (org.onlab.osgi.ComponentContextAdapter)2 KryoNamespace (org.onlab.util.KryoNamespace)2 NodeId (org.onosproject.cluster.NodeId)2