Merge "Fixed Group and meter id bugs"
[controller.git] / opendaylight / forwardingrulesmanager / api / src / test / java / org / opendaylight / controller / forwardingrulesmanager / frmTest.java
index 176d8e9ebdfea8a2f0bb341eed68177d69a235ed..48e1f07716ec267ddb52340e3ea21ef64ac8cebd 100644 (file)
@@ -19,8 +19,6 @@ import java.util.concurrent.ConcurrentMap;
 
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
-import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
 import org.opendaylight.controller.sal.action.Action;
 import org.opendaylight.controller.sal.action.ActionType;
 import org.opendaylight.controller.sal.action.Controller;
@@ -471,13 +469,14 @@ public class frmTest {
 
     @Test
     public void testStatusToggle() throws UnknownHostException {
+        // default is install in Hw
         FlowConfig fc = new FlowConfig();
         fc.toggleInstallation();
-        Assert.assertTrue(fc.installInHw());
-        fc.toggleInstallation();
         Assert.assertFalse(fc.installInHw());
         fc.toggleInstallation();
         Assert.assertTrue(fc.installInHw());
+        fc.toggleInstallation();
+        Assert.assertFalse(fc.installInHw());
 
     }
 
@@ -523,6 +522,12 @@ public class frmTest {
         Assert.assertTrue(status.getDescription().contains("Node is null"));
 
         fc.setNode(Node.fromString(Node.NodeIDType.OPENFLOW, "1"));
+        Assert.assertFalse(fc.validate(null).isSuccess());
+        List<String> actions = new ArrayList<String>();
+        fc.setActions(actions);
+        Assert.assertFalse(fc.validate(null).isSuccess());
+        actions.add("OUTPUT=2");
+        fc.setActions(actions);
         Assert.assertTrue(fc.validate(null).isSuccess());
 
         fc.setPriority("-1");
@@ -541,11 +546,6 @@ public class frmTest {
         fc.setCookie("100");
         Assert.assertTrue(fc.validate(null).isSuccess());
 
-        fc.setIngressPort("-1");
-        status = fc.validate(null);
-        Assert.assertFalse(status.isSuccess());
-        Assert.assertTrue(status.getDescription().contains("is not valid for the Switch"));
-
         fc.setIngressPort("100");
         Assert.assertTrue(fc.validate(null).isSuccess());