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(); |
tom | 85258ee | 2014-10-07 00:10:02 -0700 | [diff] [blame] | 19 | assertEquals("incorrect id", IID, intent.id()); |
| 20 | assertEquals("incorrect match", MATCH, intent.selector()); |
| 21 | assertEquals("incorrect action", NOP, intent.treatment()); |
| 22 | assertEquals("incorrect ingress", P1, intent.ingressPoint()); |
| 23 | assertEquals("incorrect egress", P2, intent.egressPoint()); |
| 24 | assertEquals("incorrect path", PATH1, intent.path()); |
Brian O'Connor | f3d0616 | 2014-10-02 15:54:12 -0700 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | @Override |
| 28 | protected PathIntent createOne() { |
| 29 | return new PathIntent(IID, MATCH, NOP, P1, P2, PATH1); |
| 30 | } |
| 31 | |
| 32 | @Override |
| 33 | protected PathIntent createAnother() { |
| 34 | return new PathIntent(IID, MATCH, NOP, P1, P3, PATH2); |
| 35 | } |
| 36 | } |