Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 84A0A200B3C for ; Tue, 28 Jun 2016 17:20:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 83741160A28; Tue, 28 Jun 2016 15:20:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D1A24160A56 for ; Tue, 28 Jun 2016 17:20:47 +0200 (CEST) Received: (qmail 18788 invoked by uid 500); 28 Jun 2016 15:20:46 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 18758 invoked by uid 99); 28 Jun 2016 15:20:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2016 15:20:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CA3ABE094C; Tue, 28 Jun 2016 15:20:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: swill@apache.org To: commits@cloudstack.apache.org Date: Tue, 28 Jun 2016 15:20:47 -0000 Message-Id: <14951940df04417fa93d1260d4a1b6b7@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/7] git commit: updated refs/heads/4.8 to 142f07d archived-at: Tue, 28 Jun 2016 15:20:48 -0000 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 Authored: Thu Jun 2 13:44:39 2016 -0400 Committer: Patrick Dube 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 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); + } + } +}