Tests for iovisor.sf
[groupbasedpolicy.git] / renderers / iovisor / src / test / java / org / opendaylight / groupbasedpolicy / renderer / iovisor / sf / SubjectFeaturesTest.java
1 /*\r
2  * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 \r
9 package org.opendaylight.groupbasedpolicy.renderer.iovisor.sf;\r
10 \r
11 import static junit.framework.Assert.assertEquals;\r
12 import static org.junit.Assert.assertNotNull;\r
13 \r
14 import org.junit.Assert;\r
15 import org.junit.Test;\r
16 import org.opendaylight.groupbasedpolicy.api.sf.AllowActionDefinition;\r
17 import org.opendaylight.groupbasedpolicy.api.sf.EtherTypeClassifierDefinition;\r
18 import org.opendaylight.groupbasedpolicy.api.sf.IpProtoClassifierDefinition;\r
19 import org.opendaylight.groupbasedpolicy.api.sf.L4ClassifierDefinition;\r
20 \r
21 public class SubjectFeaturesTest {\r
22 \r
23     @Test\r
24     public void testGetClassifier() {\r
25         assertEquals(Classifier.ETHER_TYPE_CL, SubjectFeatures.getClassifier(EtherTypeClassifierDefinition.ID));\r
26         assertEquals(Classifier.IP_PROTO_CL, SubjectFeatures.getClassifier(IpProtoClassifierDefinition.ID));\r
27         assertEquals(Classifier.L4_CL, SubjectFeatures.getClassifier(L4ClassifierDefinition.ID));\r
28     }\r
29 \r
30     @Test\r
31     public void testGetActions() {\r
32         assertNotNull(SubjectFeatures.getActions());\r
33     }\r
34 \r
35     @Test\r
36     public void testGetAction() {\r
37         Assert.assertEquals(AllowActionDefinition.DEFINITION,\r
38                 SubjectFeatures.getAction(AllowActionDefinition.ID).getActionDef());\r
39     }\r
40 \r
41 }\r