cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [2/7] git commit: updated refs/heads/4.8 to 142f07d
Date Tue, 28 Jun 2016 15:20:47 GMT
Added unit test to verify ordering


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4c97a398
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4c97a398
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4c97a398

Branch: refs/heads/4.8
Commit: 4c97a3981dc0d543e02f62f2bb4fc2eb805545c6
Parents: caf4a48
Author: Patrick Dube <pdube@cloudops.com>
Authored: Thu Jun 2 13:44:39 2016 -0400
Committer: Patrick Dube <pdube@cloudops.com>
Committed: Thu Jun 2 13:44:39 2016 -0400

----------------------------------------------------------------------
 .../api/routing/SetNetworkACLCommandTest.java   | 34 ++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c97a398/core/test/com/cloud/agent/api/routing/SetNetworkACLCommandTest.java
----------------------------------------------------------------------
diff --git a/core/test/com/cloud/agent/api/routing/SetNetworkACLCommandTest.java b/core/test/com/cloud/agent/api/routing/SetNetworkACLCommandTest.java
new file mode 100644
index 0000000..4fefc68
--- /dev/null
+++ b/core/test/com/cloud/agent/api/routing/SetNetworkACLCommandTest.java
@@ -0,0 +1,34 @@
+package com.cloud.agent.api.routing;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.junit.Test;
+
+import com.cloud.agent.api.to.NetworkACLTO;
+import com.google.common.collect.Lists;
+
+public class SetNetworkACLCommandTest {
+
+    @Test
+    public void testNetworkAclRuleOrdering(){
+
+        //given
+        List<NetworkACLTO> aclList = Lists.newArrayList();
+
+        aclList.add(new NetworkACLTO(3, null, null, null, null, false, false, null, null,
null, null, false, 3));
+        aclList.add(new NetworkACLTO(1, null, null, null, null, false, false, null, null,
null, null, false, 1));
+        aclList.add(new NetworkACLTO(2, null, null, null, null, false, false, null, null,
null, null, false, 2));
+
+        SetNetworkACLCommand cmd = new SetNetworkACLCommand(aclList, null);
+
+        //when
+        cmd.orderNetworkAclRulesByRuleNumber(aclList);
+
+        //then
+        for(int i=0; i< aclList.size();i++){
+            assertEquals(aclList.get(i).getNumber(), i+1);
+        }
+    }
+}


Mime
View raw message