Tests for iovisor.sf
[groupbasedpolicy.git] / renderers / iovisor / src / test / java / org / opendaylight / groupbasedpolicy / renderer / iovisor / sf / AllowActionTest.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 org.junit.Assert.assertEquals;\r
12 import static org.junit.Assert.assertTrue;\r
13 \r
14 import org.junit.Before;\r
15 import org.junit.Test;\r
16 import org.opendaylight.groupbasedpolicy.api.ValidationResult;\r
17 import org.opendaylight.groupbasedpolicy.api.sf.AllowActionDefinition;\r
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ActionInstance;\r
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ActionInstanceBuilder;\r
20 \r
21 public class AllowActionTest {\r
22 \r
23     AllowAction action;\r
24 \r
25     @Before\r
26     public void init() {\r
27         action = new AllowAction();\r
28     }\r
29 \r
30     @Test\r
31     public void testGetId() {\r
32         assertEquals(action.getId(), AllowActionDefinition.ID);\r
33     }\r
34 \r
35     @Test\r
36     public void testGetActionDef() {\r
37         assertEquals(action.getActionDef(), AllowActionDefinition.DEFINITION);\r
38     }\r
39 \r
40     @Test\r
41     public void testGetSupportedParameterValues() {\r
42         assertTrue(action.getSupportedParameterValues().isEmpty());\r
43     }\r
44 \r
45     @Test\r
46     public void testValidate() {\r
47         ActionInstance actionInstance = new ActionInstanceBuilder().build();\r
48         ValidationResult result = action.validate(actionInstance);\r
49         assertTrue(result.isValid());\r
50     }\r
51 \r
52 }\r