Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 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 | package org.onosproject.drivers.server; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | import org.onosproject.net.behaviour.ControllerInfo; |
| 21 | import org.onosproject.protocol.rest.DefaultRestSBDevice; |
| 22 | import org.onosproject.protocol.rest.RestSBDevice; |
| 23 | import java.util.Arrays; |
| 24 | import java.util.List; |
| 25 | |
| 26 | /** |
| 27 | * Common configuration for testing. |
| 28 | */ |
| 29 | public class TestConfig { |
| 30 | |
| 31 | /** |
| 32 | * No need for a constructor, methods are static. |
| 33 | */ |
| 34 | protected TestConfig() {} |
| 35 | |
| 36 | /** |
| 37 | * Device information used during the tests. |
| 38 | */ |
| 39 | public static final String REST_SCHEME = "rest"; |
| 40 | public static final String REST_DEV_TEST_IP_1 = "10.0.0.1"; |
| 41 | public static final int REST_TEST_PORT = 80; |
| 42 | |
| 43 | public static final DeviceId REST_DEV_ID1 = DeviceId.deviceId( |
| 44 | REST_SCHEME + ":" + REST_DEV_TEST_IP_1 + ":" + REST_TEST_PORT |
| 45 | ); |
| 46 | public static final RestSBDevice REST_DEV1 = new DefaultRestSBDevice( |
| 47 | IpAddress.valueOf(REST_DEV_TEST_IP_1), |
| 48 | REST_TEST_PORT, |
| 49 | "foo", "bar", "http", null, true |
| 50 | ); |
| 51 | |
| 52 | /** |
| 53 | * Controller information used during the tests. |
| 54 | */ |
| 55 | public static final String REST_CTRL_TEST_IP_1 = "10.0.0.253"; |
| 56 | public static final String REST_CTRL_TEST_IP_2 = "10.0.0.254"; |
| 57 | public static final String REST_CTRL_TEST_TYPE = "tcp"; |
| 58 | |
| 59 | public static final List<ControllerInfo> CONTROLLERS = Arrays.asList( |
| 60 | new ControllerInfo( |
| 61 | IpAddress.valueOf(REST_CTRL_TEST_IP_1), |
| 62 | REST_TEST_PORT, |
| 63 | REST_CTRL_TEST_TYPE |
| 64 | ), |
| 65 | new ControllerInfo( |
| 66 | IpAddress.valueOf(REST_CTRL_TEST_IP_2), |
| 67 | REST_TEST_PORT, |
| 68 | REST_CTRL_TEST_TYPE |
| 69 | ) |
| 70 | ); |
| 71 | |
| 72 | } |