2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
\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
9 package org.opendaylight.groupbasedpolicy.renderer.iovisor.sf;
\r
11 import static org.junit.Assert.assertEquals;
\r
12 import static org.junit.Assert.assertTrue;
\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
21 public class AllowActionTest {
\r
26 public void init() {
\r
27 action = new AllowAction();
\r
31 public void testGetId() {
\r
32 assertEquals(action.getId(), AllowActionDefinition.ID);
\r
36 public void testGetActionDef() {
\r
37 assertEquals(action.getActionDef(), AllowActionDefinition.DEFINITION);
\r
41 public void testGetSupportedParameterValues() {
\r
42 assertTrue(action.getSupportedParameterValues().isEmpty());
\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