blob: 21efe49bf2850e78d120ec18ab538fab1b1ce84c [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 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 */
Brian O'Connorf3d06162014-10-02 15:54:12 -070016package org.onlab.onos.net.intent;
17
18import static org.junit.Assert.assertEquals;
19
20import org.junit.Test;
21import org.onlab.onos.net.NetTestTools;
22import org.onlab.onos.net.Path;
23
24public class PathIntentTest extends ConnectivityIntentTest {
25 // 111:11 --> 222:22
26 private static final Path PATH1 = NetTestTools.createPath("111", "222");
27
28 // 111:11 --> 333:33
29 private static final Path PATH2 = NetTestTools.createPath("222", "333");
30
31 @Test
32 public void basics() {
33 PathIntent intent = createOne();
Thomas Vachuskac96058a2014-10-20 23:00:16 -070034 assertEquals("incorrect id", APPID, intent.appId());
tom85258ee2014-10-07 00:10:02 -070035 assertEquals("incorrect match", MATCH, intent.selector());
36 assertEquals("incorrect action", NOP, intent.treatment());
tom85258ee2014-10-07 00:10:02 -070037 assertEquals("incorrect path", PATH1, intent.path());
Brian O'Connorf3d06162014-10-02 15:54:12 -070038 }
39
40 @Override
41 protected PathIntent createOne() {
Thomas Vachuskac96058a2014-10-20 23:00:16 -070042 return new PathIntent(APPID, MATCH, NOP, PATH1);
Brian O'Connorf3d06162014-10-02 15:54:12 -070043 }
44
45 @Override
46 protected PathIntent createAnother() {
Thomas Vachuskac96058a2014-10-20 23:00:16 -070047 return new PathIntent(APPID, MATCH, NOP, PATH2);
Brian O'Connorf3d06162014-10-02 15:54:12 -070048 }
49}