blob: 4a91efcd64dc1b55d4ead5025a94231f0f28bb92 [file] [log] [blame]
andreaed976a42015-10-05 14:38:25 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
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.driver.ovsdb;
18
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
31/**
32 * Created by Andrea on 10/7/15.
33 */
34public class OvsdbControllerConfigTest {
35
36
37 private static final DeviceId DEVICE_ID = DeviceId.deviceId("foo");
38
39 private DefaultDriver ddc;
40 private DefaultDriverData data;
41 private DefaultDriverHandler handler;
42
43 private TestDeviceService deviceService = new TestDeviceService();
44 private TestOvsdbController controller = new TestOvsdbController();
45 private TestOvsdbClient client = new TestOvsdbClient();
46
47 private OvsdbControllerConfig controllerConfig;
48
49
50 @Before
51 public void setUp() {
52 controllerConfig = new OvsdbControllerConfig();
53
54 ddc = new DefaultDriver("foo.bar", null, "Circus", "lux", "1.2a",
55 ImmutableMap.of(ControllerConfig.class,
56 OvsdbControllerConfig.class),
57 ImmutableMap.of("foo", "bar"));
58 data = new DefaultDriverData(ddc, DEVICE_ID);
59 handler = new DefaultDriverHandler(data);
60 //handler.controllerConfig.setHandler(handler);
61 //TODO setTestService directory on handler
62 //TODO setup ovsdb fake controller with fake ovsdbclient
63 //TODO setup fake device service
64 }
65
66 @Test
67 public void testGetControllers() throws Exception {
68// DriverService driverService = new Driv
69// AbstractBehaviour ab = new AbstractBehaviour();
70// DriverHandler handler = handler();
71// List<ControllerInfo> controllersList =
72// controllerConfig.getControllers(DeviceId.deviceId("0000000000000018"));
73// log.info("controllers " + controllersList);
74
75 }
76
77 @Test
78 public void testSetControllers() throws Exception {
79
80 }
81
82
83 private class TestDeviceService extends DeviceServiceAdapter {
84
85 }
86
87 private class TestOvsdbController extends OvsdbControllerAdapter {
88
89
90 }
91
92 private class TestOvsdbClient extends OvsdbClientServiceAdapter {
93
94 }
95}