blob: 719654b724f1949a837631cb0f851e34822a8f77 [file] [log] [blame]
andreaed976a42015-10-05 14:38:25 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
andreaed976a42015-10-05 14:38:25 -07003 *
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
Andrea Campanella238d96e2016-01-20 11:52:02 -080017package org.onosproject.drivers.ovsdb;
andreaed976a42015-10-05 14:38:25 -070018
19import com.google.common.collect.ImmutableMap;
20import org.junit.Before;
21import org.junit.Test;
22import org.onosproject.net.DeviceId;
23import org.onosproject.net.behaviour.ControllerConfig;
24import org.onosproject.net.device.DeviceServiceAdapter;
25import org.onosproject.net.driver.DefaultDriver;
26import org.onosproject.net.driver.DefaultDriverData;
27import org.onosproject.net.driver.DefaultDriverHandler;
28import org.onosproject.ovsdb.controller.driver.OvsdbClientServiceAdapter;
29import org.onosproject.ovsdb.controller.driver.OvsdbControllerAdapter;
30
Andrea Campanella80520b82016-01-05 17:55:29 -080031import java.util.ArrayList;
32
andreaed976a42015-10-05 14:38:25 -070033/**
34 * Created by Andrea on 10/7/15.
35 */
36public class OvsdbControllerConfigTest {
37
38
39 private static final DeviceId DEVICE_ID = DeviceId.deviceId("foo");
40
41 private DefaultDriver ddc;
42 private DefaultDriverData data;
43 private DefaultDriverHandler handler;
44
45 private TestDeviceService deviceService = new TestDeviceService();
46 private TestOvsdbController controller = new TestOvsdbController();
47 private TestOvsdbClient client = new TestOvsdbClient();
48
49 private OvsdbControllerConfig controllerConfig;
50
51
52 @Before
53 public void setUp() {
54 controllerConfig = new OvsdbControllerConfig();
55
Andrea Campanella80520b82016-01-05 17:55:29 -080056 ddc = new DefaultDriver("foo.bar", new ArrayList<>(), "Circus", "lux", "1.2a",
andreaed976a42015-10-05 14:38:25 -070057 ImmutableMap.of(ControllerConfig.class,
58 OvsdbControllerConfig.class),
59 ImmutableMap.of("foo", "bar"));
60 data = new DefaultDriverData(ddc, DEVICE_ID);
61 handler = new DefaultDriverHandler(data);
62 //handler.controllerConfig.setHandler(handler);
63 //TODO setTestService directory on handler
64 //TODO setup ovsdb fake controller with fake ovsdbclient
65 //TODO setup fake device service
66 }
67
68 @Test
69 public void testGetControllers() throws Exception {
70// DriverService driverService = new Driv
71// AbstractBehaviour ab = new AbstractBehaviour();
72// DriverHandler handler = handler();
73// List<ControllerInfo> controllersList =
74// controllerConfig.getControllers(DeviceId.deviceId("0000000000000018"));
75// log.info("controllers " + controllersList);
76
77 }
78
79 @Test
80 public void testSetControllers() throws Exception {
81
82 }
83
84
85 private class TestDeviceService extends DeviceServiceAdapter {
86
87 }
88
89 private class TestOvsdbController extends OvsdbControllerAdapter {
90
91
92 }
93
94 private class TestOvsdbClient extends OvsdbClientServiceAdapter {
95
96 }
97}