blob: f786ae57b99a18f9b594b8e50556406a13a4d1d0 [file] [log] [blame]
Claudine Chiucdc4b8c2017-03-30 00:34:39 -04001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Claudine Chiucdc4b8c2017-03-30 00:34:39 -04003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.incubator.net.virtual.impl;
18
19import org.junit.After;
20import org.junit.Before;
21import org.onlab.junit.TestUtils;
22import org.onosproject.incubator.store.virtual.impl.DistributedVirtualFlowObjectiveStore;
23
24/**
25 * Junit tests for VirtualNetworkFlowObjectiveManager using
26 * DistributedVirtualFlowObjectiveStore. This test class extends
27 * VirtualNetworkFlowObjectiveManagerTest - all the tests defined in
28 * VirtualNetworkFlowObjectiveManagerTest will run using
29 * DistributedVirtualFlowObjectiveStore.
30 */
31public class VirtualNetworkFlowObjectiveManagerWithDistStoreTest
32 extends VirtualNetworkFlowObjectiveManagerTest {
33
34 private static final String STORE_FIELDNAME_STORAGESERVICE = "storageService";
35
36 private DistributedVirtualFlowObjectiveStore distStore;
37
38 @Before
39 public void setUp() throws Exception {
40 setupDistFlowObjectiveStore();
41 super.setUp();
42 }
43
44 private void setupDistFlowObjectiveStore() throws TestUtils.TestUtilsException {
45 distStore = new DistributedVirtualFlowObjectiveStore();
46 TestUtils.setField(distStore, STORE_FIELDNAME_STORAGESERVICE, storageService);
47
48 distStore.activate();
49 flowObjectiveStore = distStore; // super.setUp() will cause Distributed store to be used.
50 }
51
52 @After
53 public void tearDown() {
54 distStore.deactivate();
55 }
56}