Search in sources :

Example 16 with TestStorageService

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

the class DistributedGroupStoreTest method setUp.

@Before
public void setUp() throws Exception {
    groupStoreImpl = new DistributedGroupStore();
    groupStoreImpl.storageService = new TestStorageService();
    groupStoreImpl.clusterCommunicator = new ClusterCommunicationServiceAdapter();
    groupStoreImpl.mastershipService = new MasterOfAll();
    groupStoreImpl.cfgService = new ComponentConfigAdapter();
    groupStoreImpl.deviceService = new InternalDeviceServiceImpl();
    ClusterService mockClusterService = createMock(ClusterService.class);
    NodeId nodeId = new NodeId(NODE_ID);
    MockControllerNode mockControllerNode = new MockControllerNode(nodeId);
    expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
    replay(mockClusterService);
    groupStoreImpl.clusterService = mockClusterService;
    groupStoreImpl.activate(null);
    groupStore = groupStoreImpl;
    auditPendingReqQueue = TestUtils.getField(groupStoreImpl, "auditPendingReqQueue");
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) ClusterService(org.onosproject.cluster.ClusterService) TestStorageService(org.onosproject.store.service.TestStorageService) NodeId(org.onosproject.cluster.NodeId) ClusterCommunicationServiceAdapter(org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter) Before(org.junit.Before)

Example 17 with TestStorageService

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

the class DistributedHostStoreTest method setUp.

@Before
public void setUp() {
    ecXHostStore = new DistributedHostStore();
    delegate = new TestStoreDelegate();
    ecXHostStore.setDelegate(delegate);
    ecXHostStore.storageService = new TestStorageService();
    ecXHostStore.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 18 with TestStorageService

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

the class DistributedPiTranslationStoreTest method setUp.

/**
 * Sets up the store and the storage service test harness.
 */
@Before
public void setUp() {
    store = new AbstractDistributedPiTranslationStore<PiTranslatable, PiEntity>() {

        @Override
        protected String mapSimpleName() {
            return "test";
        }
    };
    store.storageService = new TestStorageService();
    store.setDelegate(event -> {
    });
    store.activate();
}
Also used : PiTranslatable(org.onosproject.net.pi.service.PiTranslatable) PiEntity(org.onosproject.net.pi.runtime.PiEntity) TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 19 with TestStorageService

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

the class DistributedRegionStoreTest method setUp.

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

Example 20 with TestStorageService

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

the class KubevirtPortManagerTest method setUp.

@Before
public void setUp() throws Exception {
    kubevirtPortStore = new DistributedKubevirtPortStore();
    TestUtils.setField(kubevirtPortStore, "coreService", new TestCoreService());
    TestUtils.setField(kubevirtPortStore, "storageService", new TestStorageService());
    TestUtils.setField(kubevirtPortStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    kubevirtPortStore.activate();
    target = new KubevirtPortManager();
    TestUtils.setField(target, "coreService", new TestCoreService());
    target.kubevirtPortStore = kubevirtPortStore;
    target.addListener(testListener);
    target.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) 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