blob: c9da728df68ee8333b56d9d49a1465d16922b3b1 [file] [log] [blame]
Sho SHIMIZU7226e012014-08-14 14:21:30 -07001package net.onrc.onos.core.newintent;
2
3import net.onrc.onos.api.flowmanager.FlowId;
4import net.onrc.onos.api.flowmanager.PacketPathFlow;
5import net.onrc.onos.api.flowmanager.Path;
6import net.onrc.onos.api.newintent.IntentId;
7import net.onrc.onos.api.newintent.IntentTest;
8import net.onrc.onos.core.matchaction.action.Action;
9import net.onrc.onos.core.matchaction.match.PacketMatch;
10import net.onrc.onos.core.matchaction.match.PacketMatchBuilder;
11import net.onrc.onos.core.util.PortNumber;
12
13import java.util.Collections;
14
15/**
16 * Suite of tests of {@link PathFlowIntent}.
17 */
18public class PathFlowIntentTest extends IntentTest {
19
20 private final IntentId intentId1 = new IntentId(123);
21 private final IntentId intentId2 = new IntentId(456);
Toshio Koide515ba842014-08-20 11:53:37 -070022 private final FlowId flowId1 = new FlowId(1L);
Sho SHIMIZU7226e012014-08-14 14:21:30 -070023 private final PacketMatch match = new PacketMatchBuilder().build();
24 private final PortNumber port = new PortNumber((short) 1);
25
26 /**
27 * Creates a PathFlowIntent.
28 *
29 * @return PathFlowIntent
30 */
31 @Override
32 protected PathFlowIntent createOne() {
33 return new PathFlowIntent(
34 intentId1,
35 new PacketPathFlow(flowId1, match, port,
36 new Path(), Collections.<Action>emptyList(), 0, 0)
37 );
38 }
39
40 /**
41 * Creates another PathFlowIntent, which is different from the intent created by {@link #createOne()}.
42 *
43 * @return another PathFlowIntent
44 */
45 @Override
46 protected PathFlowIntent createAnother() {
47 return new PathFlowIntent(
48 intentId2,
49 new PacketPathFlow(flowId1, match, port,
50 new Path(), Collections.<Action>emptyList(), 0, 0)
51 );
52 }
53}