Search in sources :

Example 61 with TestStorageService

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

the class DistributedTelemetryConfigStoreTest method setUp.

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

Example 62 with TestStorageService

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

the class OpenstackVtapManagerTest method setUp.

@Before
public void setUp() {
    store = new DistributedOpenstackVtapStore();
    TestUtils.setField(store, "storageService", new TestStorageService());
    store.activate();
    store.createVtap(VTAP_2);
    target = new OpenstackVtapManager();
    target.coreService = new TestCoreService();
    target.clusterService = new TestClusterService();
    target.leadershipService = new TestLeadershipService();
    target.flowRuleService = new TestFlowRuleService();
    target.groupService = new TestGroupService();
    target.deviceService = new TestDeviceService();
    target.osNodeService = new TestOpenstackNodeService();
    target.hostService = new TestHostService();
    target.componentConfigService = new TestComponentConfigService();
    target.store = store;
    injectEventDispatcher(target, new TestEventDispatcher());
    target.addListener(testListener);
    testListener.events.clear();
    target.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 63 with TestStorageService

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

the class OpenstackVtapStoreTest method setup.

@Before
public void setup() {
    store = new DistributedOpenstackVtapStore();
    TestUtils.setField(store, "storageService", new TestStorageService());
    store.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 64 with TestStorageService

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

the class CfmMdManagerTest method setup.

@Before
public void setup() throws Exception, CfmConfigException {
    mdStore = new DistributedMdStore();
    MaintenanceAssociation maTest11 = DefaultMaintenanceAssociation.builder(MA_ID_1_1, MD_ID_1.getNameLength()).ccmInterval(MaintenanceAssociation.CcmInterval.INTERVAL_10MIN).maNumericId((short) 1).addToRemoteMepIdList(MepId.valueOf((short) 101)).addToRemoteMepIdList(MepId.valueOf((short) 102)).addToComponentList(DefaultComponent.builder(1).tagType(Component.TagType.VLAN_CTAG).build()).build();
    MaintenanceAssociation maTest12 = DefaultMaintenanceAssociation.builder(MA_ID_1_2, MD_ID_1.getNameLength()).ccmInterval(MaintenanceAssociation.CcmInterval.INTERVAL_10MIN).maNumericId((short) 2).addToRemoteMepIdList(MepId.valueOf((short) 201)).addToRemoteMepIdList(MepId.valueOf((short) 202)).addToComponentList(DefaultComponent.builder(2).tagType(Component.TagType.VLAN_CTAG).build()).build();
    MaintenanceDomain mdTest1 = DefaultMaintenanceDomain.builder(MD_ID_1).mdLevel(MaintenanceDomain.MdLevel.LEVEL1).mdNumericId((short) 1).addToMaList(maTest11).addToMaList(maTest12).build();
    TestUtils.setField(mdStore, "storageService", new TestStorageService());
    TestUtils.setField(mdStore, "clusterService", new CfmMdManagerTest.TestClusterService());
    TestUtils.setField(mdStore, "mastershipService", new CfmMdManagerTest.TestMastershipService());
    mdStore.activate();
    mdStore.createUpdateMaintenanceDomain(mdTest1);
    manager = new CfmMdManager();
    manager.store = mdStore;
    service = manager;
    TestUtils.setField(manager, "storageService", new TestStorageService());
    TestUtils.setField(manager, "coreService", new TestCoreService());
    TestUtils.setField(manager, "mepService", mepService);
    injectEventDispatcher(manager, new TestEventDispatcher());
    manager.appId = new CfmMdManagerTest.TestApplicationId(0, "CfmMdManagerTest");
    manager.activate();
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) TestStorageService(org.onosproject.store.service.TestStorageService) DefaultMaintenanceDomain(org.onosproject.incubator.net.l2monitoring.cfm.DefaultMaintenanceDomain) MaintenanceDomain(org.onosproject.incubator.net.l2monitoring.cfm.MaintenanceDomain) DefaultMaintenanceAssociation(org.onosproject.incubator.net.l2monitoring.cfm.DefaultMaintenanceAssociation) MaintenanceAssociation(org.onosproject.incubator.net.l2monitoring.cfm.MaintenanceAssociation) Before(org.junit.Before)

Example 65 with TestStorageService

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

the class AlarmManagerTest method setUp.

@Before
public void setUp() throws Exception {
    alarmStore = new DistributedAlarmStore();
    TestUtils.setField(alarmStore, "storageService", new TestStorageService());
    alarmStore.activate();
    manager = new AlarmManager();
    registry = manager;
    manager.addListener(listener);
    NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
    manager.deviceService = deviceService;
    manager.mastershipService = mastershipService;
    manager.store = alarmStore;
    manager.activate();
    provider = new TestProvider();
    providerService = registry.register(provider);
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) 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