use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class PreCommitPortManagerTest method setUp.
/**
* Initializes this unit test.
*/
@Before
public void setUp() {
target = new PreCommitPortManager();
TestUtils.setField(target, "coreService", new TestCoreService());
TestUtils.setField(target, "storageService", new TestStorageService());
target.activate();
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class InstancePortManagerTest method setUp.
/**
* Initial setup for this unit test.
*/
@Before
public void setUp() {
store = new DistributedInstancePortStore();
TestUtils.setField(store, "coreService", new TestCoreService());
TestUtils.setField(store, "storageService", new TestStorageService());
TestUtils.setField(store, "eventExecutor", MoreExecutors.newDirectExecutorService());
store.activate();
target = new InstancePortManager();
TestUtils.setField(target, "coreService", new TestCoreService());
TestUtils.setField(target, "hostService", new TestHostService());
TestUtils.setField(target, "leadershipService", new TestLeadershipService());
TestUtils.setField(target, "clusterService", new TestClusterService());
target.instancePortStore = store;
target.addListener(testInstancePortListener);
target.activate();
HostLocation location1 = new HostLocation(DEV_ID_1, PORT_NUM_1, TIME_1);
HostLocation location2 = new HostLocation(DEV_ID_2, PORT_NUM_2, TIME_2);
DefaultAnnotations.Builder annotations1 = DefaultAnnotations.builder().set(ANNOTATION_NETWORK_ID, NETWORK_ID_1).set(ANNOTATION_PORT_ID, PORT_ID_1).set(ANNOTATION_CREATE_TIME, String.valueOf(TIME_1));
DefaultAnnotations.Builder annotations2 = DefaultAnnotations.builder().set(ANNOTATION_NETWORK_ID, NETWORK_ID_2).set(ANNOTATION_PORT_ID, PORT_ID_2).set(ANNOTATION_CREATE_TIME, String.valueOf(TIME_2));
Host host1 = new DefaultHost(PROVIDER_ID, HOST_ID_1, MAC_ADDRESS_1, VLAN_ID, location1, ImmutableSet.of(IP_ADDRESS_1), annotations1.build());
Host host2 = new DefaultHost(PROVIDER_ID, HOST_ID_2, MAC_ADDRESS_2, VLAN_ID, location2, ImmutableSet.of(IP_ADDRESS_2), annotations2.build());
instancePort1 = DefaultInstancePort.from(host1, ACTIVE);
instancePort2 = DefaultInstancePort.from(host2, INACTIVE);
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class OpenstackRouterManagerTest method setUp.
@Before
public void setUp() throws Exception {
osRouterStore = new DistributedOpenstackRouterStore();
TestUtils.setField(osRouterStore, "coreService", new TestCoreService());
TestUtils.setField(osRouterStore, "storageService", new TestStorageService());
TestUtils.setField(osRouterStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
osRouterStore.activate();
target = new OpenstackRouterManager();
target.coreService = new TestCoreService();
target.osRouterStore = osRouterStore;
target.addListener(testListener);
target.activate();
}
use of org.onosproject.store.service.TestStorageService 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.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class DistributedMeterStoreTest method setup.
@Before
public void setup() {
meterStore = new DistributedMeterStore();
TestUtils.setField(meterStore, "storageService", new TestStorageService());
TestUtils.setField(meterStore, "driverService", new TestDriverService());
KryoNamespace.Builder testKryoBuilder = TestUtils.getField(meterStore, "APP_KRYO_BUILDER");
testKryoBuilder.register(TestApplicationId.class);
Serializer testSerializer = Serializer.using(Lists.newArrayList(testKryoBuilder.build()));
TestUtils.setField(meterStore, "serializer", testSerializer);
meterStore.activate();
}
Aggregations