Brian O'Connor | f3d0616 | 2014-10-02 15:54:12 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.intent; |
| 2 | |
| 3 | import static org.junit.Assert.assertEquals; |
| 4 | |
| 5 | import org.junit.Test; |
| 6 | import org.onlab.onos.net.NetTestTools; |
| 7 | import org.onlab.onos.net.Path; |
| 8 | |
| 9 | public class PathIntentTest extends ConnectivityIntentTest { |
| 10 | // 111:11 --> 222:22 |
| 11 | private static final Path PATH1 = NetTestTools.createPath("111", "222"); |
| 12 | |
| 13 | // 111:11 --> 333:33 |
| 14 | private static final Path PATH2 = NetTestTools.createPath("222", "333"); |
| 15 | |
| 16 | @Test |
| 17 | public void basics() { |
| 18 | PathIntent intent = createOne(); |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 19 | assertEquals("incorrect id", APPID, intent.appId()); |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 20 | assertEquals("incorrect match", MATCH, intent.selector()); |
| 21 | assertEquals("incorrect action", NOP, intent.treatment()); |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 22 | assertEquals("incorrect path", PATH1, intent.path()); |
Brian O'Connor | f3d0616 | 2014-10-02 15:54:12 -0700 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | @Override |
| 26 | protected PathIntent createOne() { |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 27 | return new PathIntent(APPID, MATCH, NOP, PATH1); |
Brian O'Connor | f3d0616 | 2014-10-02 15:54:12 -0700 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | @Override |
| 31 | protected PathIntent createAnother() { |
Thomas Vachuska | c96058a | 2014-10-20 23:00:16 -0700 | [diff] [blame] | 32 | return new PathIntent(APPID, MATCH, NOP, PATH2); |
Brian O'Connor | f3d0616 | 2014-10-02 15:54:12 -0700 | [diff] [blame] | 33 | } |
| 34 | } |