db51958d9e9832ec7b4531e6672478017dfb15b9
[netvirt.git] / vpnservice / aclservice / impl / src / test / java / org / opendaylight / netvirt / aclservice / tests / AclServiceStatefulTest.java
1 /*
2  * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netvirt.aclservice.tests;
9
10 import org.junit.Rule;
11 import org.junit.rules.MethodRule;
12 import org.opendaylight.genius.datastoreutils.testutils.TestableDataTreeChangeListenerModule;
13 import org.opendaylight.infrautils.inject.guice.testutils.GuiceRule;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.config.rev160806.AclserviceConfig.SecurityGroupMode;
15
16
17 public class AclServiceStatefulTest extends AclServiceTestBase {
18
19     public @Rule MethodRule guice = new GuiceRule(new AclServiceModule(),
20             new AclServiceTestModule(SecurityGroupMode.Stateful),
21             new TestableDataTreeChangeListenerModule());
22
23     @Override
24     void newInterfaceCheck() {
25         assertFlowsInAnyOrder(FlowEntryObjectsStateful.expectedFlows(PORT_MAC_1));
26     }
27
28     @Override
29     void newInterfaceWithEtherTypeAclCheck() {
30         assertFlowsInAnyOrder(FlowEntryObjectsStateful.etherFlows());
31     }
32
33     @Override
34     public void newInterfaceWithTcpDstAclCheck() {
35         assertFlowsInAnyOrder(FlowEntryObjectsStateful.tcpFlows());
36     }
37
38     @Override
39     public void newInterfaceWithUdpDstAclCheck() {
40         assertFlowsInAnyOrder(FlowEntryObjectsStateful.udpFlows());
41     }
42
43     @Override
44     public void newInterfaceWithIcmpAclCheck() {
45         assertFlowsInAnyOrder(FlowEntryObjectsStateful.icmpFlows());
46     }
47
48     @Override
49     public void newInterfaceWithDstPortRangeCheck() {
50         assertFlowsInAnyOrder(FlowEntryObjectsStateful.dstRangeFlows());
51     }
52
53     @Override
54     public void newInterfaceWithDstAllPortsCheck() {
55         assertFlowsInAnyOrder(FlowEntryObjectsStateful.dstAllFlows());
56     }
57
58     @Override
59     void newInterfaceWithTwoAclsHavingSameRulesCheck() {
60         assertFlowsInAnyOrder(FlowEntryObjectsStateful.icmpFlowsForTwoAclsHavingSameRules());
61     }
62 }