cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject [41/93] [abbrv] [partial] merge master
Date Mon, 13 May 2013 15:54:01 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerContainer.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerContainer.java b/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerContainer.java
new file mode 100644
index 0000000..df94d3d
--- /dev/null
+++ b/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerContainer.java
@@ -0,0 +1,28 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.lb;
+
+import com.cloud.network.rules.LoadBalancerContainer;
+import com.cloud.utils.net.Ip;
+
+public interface ApplicationLoadBalancerContainer extends LoadBalancerContainer{
+    
+    public Long getSourceIpNetworkId();
+    
+    public Ip getSourceIp();
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerRule.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerRule.java b/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerRule.java
new file mode 100644
index 0000000..f4acb73
--- /dev/null
+++ b/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerRule.java
@@ -0,0 +1,24 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.network.lb;
+
+import com.cloud.network.rules.LoadBalancer;
+
+public interface ApplicationLoadBalancerRule extends ApplicationLoadBalancerContainer, LoadBalancer{
+    int getInstancePort();
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerService.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerService.java b/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerService.java
new file mode 100644
index 0000000..b2ac358
--- /dev/null
+++ b/api/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerService.java
@@ -0,0 +1,42 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.network.lb;
+
+import java.util.List;
+
+import org.apache.cloudstack.api.command.user.loadbalancer.ListApplicationLoadBalancersCmd;
+
+import com.cloud.exception.InsufficientAddressCapacityException;
+import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.network.rules.LoadBalancerContainer.Scheme;
+import com.cloud.utils.Pair;
+
+public interface ApplicationLoadBalancerService {
+    
+    ApplicationLoadBalancerRule createApplicationLoadBalancer(String name, String description, Scheme scheme, long sourceIpNetworkId, String sourceIp,
+            int sourcePort, int instancePort, String algorithm, long networkId, long lbOwnerId) throws InsufficientAddressCapacityException,
+            NetworkRuleConflictException, InsufficientVirtualNetworkCapcityException;
+    
+    boolean deleteApplicationLoadBalancer(long id);
+    
+    Pair<List<? extends ApplicationLoadBalancerRule>, Integer> listApplicationLoadBalancers(ListApplicationLoadBalancersCmd cmd);
+    
+    ApplicationLoadBalancerRule getApplicationLoadBalancer(long ruleId);
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMService.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMService.java b/api/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMService.java
new file mode 100644
index 0000000..91cd88d
--- /dev/null
+++ b/api/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMService.java
@@ -0,0 +1,34 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.network.lb;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.exception.StorageUnavailableException;
+import com.cloud.network.router.VirtualRouter;
+import com.cloud.user.Account;
+
+public interface InternalLoadBalancerVMService {
+
+    VirtualRouter startInternalLbVm(long internalLbVmId, Account caller, long callerUserId) 
+            throws StorageUnavailableException, InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException;
+
+    VirtualRouter stopInternalLbVm(long vmId, boolean forced, Account caller, long callerUserId)
+            throws ConcurrentOperationException, ResourceUnavailableException;
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/src/org/apache/cloudstack/query/QueryService.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/query/QueryService.java b/api/src/org/apache/cloudstack/query/QueryService.java
index 2b82fec..9eada21 100644
--- a/api/src/org/apache/cloudstack/query/QueryService.java
+++ b/api/src/org/apache/cloudstack/query/QueryService.java
@@ -18,6 +18,7 @@ package org.apache.cloudstack.query;
 
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.command.admin.host.ListHostsCmd;
+import org.apache.cloudstack.api.command.admin.internallb.ListInternalLBVMsCmd;
 import org.apache.cloudstack.api.command.admin.router.ListRoutersCmd;
 import org.apache.cloudstack.api.command.admin.storage.ListStoragePoolsCmd;
 import org.apache.cloudstack.api.command.admin.user.ListUsersCmd;
@@ -95,4 +96,6 @@ public interface QueryService {
 
     public List<ResourceDetailResponse> listResource(ListResourceDetailsCmd cmd);
 
+    ListResponse<DomainRouterResponse> searchForInternalLbVms(ListInternalLBVMsCmd cmd);
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/AgentControlAnswerTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/AgentControlAnswerTest.java b/api/test/org/apache/cloudstack/api/agent/test/AgentControlAnswerTest.java
deleted file mode 100644
index d0e8b4c..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/AgentControlAnswerTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.AgentControlAnswer;
-import com.cloud.agent.api.AgentControlCommand;
-
-public class AgentControlAnswerTest {
-    AgentControlCommand acc = new AgentControlCommand();
-    AgentControlAnswer aca = new AgentControlAnswer(acc);
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = acc.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/AgentControlCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/AgentControlCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/AgentControlCommandTest.java
deleted file mode 100644
index 24d0fe5..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/AgentControlCommandTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.AgentControlCommand;
-
-public class AgentControlCommandTest {
-    AgentControlCommand acc = new AgentControlCommand();
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = acc.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/AnswerTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/AnswerTest.java b/api/test/org/apache/cloudstack/api/agent/test/AnswerTest.java
deleted file mode 100644
index 343a3ce..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/AnswerTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.AgentControlCommand;
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.UnsupportedAnswer;
-
-public class AnswerTest {
-    AgentControlCommand acc = new AgentControlCommand();
-    Answer a = new Answer(acc, true, "details");
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = a.executeInSequence();
-        assertFalse(b);
-    }
-
-    @Test
-    public void testGetResult() {
-        boolean b = a.getResult();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testGetDetails() {
-        String d = a.getDetails();
-        assertTrue(d.equals("details"));
-    }
-
-    @Test
-    public void testCreateUnsupportedCommandAnswer() {
-        UnsupportedAnswer usa = Answer.createUnsupportedCommandAnswer(acc);
-        boolean b = usa.executeInSequence();
-        assertFalse(b);
-
-        b = usa.getResult();
-        assertFalse(b);
-
-        String d = usa.getDetails();
-        assertTrue(d.equals("Unsupported command issued:" + acc.toString()
-                + ".  Are you sure you got the right type of server?"));
-
-        usa = Answer.createUnsupportedVersionAnswer(acc);
-        b = usa.executeInSequence();
-        assertFalse(b);
-
-        b = usa.getResult();
-        assertFalse(b);
-
-        d = usa.getDetails();
-        assertTrue(d.equals("Unsuppored Version."));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/AttachIsoCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/AttachIsoCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/AttachIsoCommandTest.java
deleted file mode 100644
index d189d9c..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/AttachIsoCommandTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.AttachIsoCommand;
-
-public class AttachIsoCommandTest {
-    AttachIsoCommand aic = new AttachIsoCommand("vmname", "isopath", false);
-
-    @Test
-    public void testGetVmName() {
-        String vmName = aic.getVmName();
-        assertTrue(vmName.equals("vmname"));
-    }
-
-    @Test
-    public void testGetIsoPath() {
-        String isoPath = aic.getIsoPath();
-        assertTrue(isoPath.equals("isopath"));
-    }
-
-    @Test
-    public void testIsAttach() {
-        boolean b = aic.isAttach();
-        assertFalse(b);
-    }
-
-    @Test
-    public void testGetStoreUrl() {
-        aic.setStoreUrl("http://incubator.apache.org/cloudstack/");
-        String url = aic.getStoreUrl();
-        assertTrue(url.equals("http://incubator.apache.org/cloudstack/"));
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = aic.executeInSequence();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testAllowCaching() {
-        boolean b = aic.allowCaching();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testGetWait() {
-        int b;
-        aic.setWait(5);
-        b = aic.getWait();
-        assertEquals(b, 5);
-        aic.setWait(-3);
-        b = aic.getWait();
-        assertEquals(b, -3);
-        aic.setWait(0);
-        b = aic.getWait();
-        assertEquals(b, 0);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/AttachVolumeAnswerTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/AttachVolumeAnswerTest.java b/api/test/org/apache/cloudstack/api/agent/test/AttachVolumeAnswerTest.java
deleted file mode 100644
index 251a6cb..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/AttachVolumeAnswerTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.AttachVolumeAnswer;
-import com.cloud.agent.api.AttachVolumeCommand;
-import com.cloud.storage.Storage.StoragePoolType;
-
-public class AttachVolumeAnswerTest {
-    AttachVolumeCommand avc = new AttachVolumeCommand(true, "vmname",
-            StoragePoolType.Filesystem, "vFolder", "vPath", "vName",
-            123456789L, "chainInfo");
-    AttachVolumeAnswer ava1 = new AttachVolumeAnswer(avc);
-    String results = "";
-    AttachVolumeAnswer ava2 = new AttachVolumeAnswer(avc, results);
-    Long deviceId = 10L;
-    AttachVolumeAnswer ava3 = new AttachVolumeAnswer(avc, deviceId);
-
-    @Test
-    public void testGetDeviceId() {
-        Long dId = ava1.getDeviceId();
-        assertTrue(dId == null);
-
-        dId = ava2.getDeviceId();
-        assertTrue(dId == null);
-
-        dId = ava3.getDeviceId();
-        Long expected = 10L;
-        assertEquals(expected, dId);
-    }
-
-    @Test
-    public void testGetChainInfo() {
-        ava1.setChainInfo("chainInfo");
-        String chainInfo = ava1.getChainInfo();
-        assertTrue(chainInfo.equals("chainInfo"));
-
-        ava2.setChainInfo("chainInfo");
-        chainInfo = ava2.getChainInfo();
-        assertTrue(chainInfo.equals("chainInfo"));
-
-        ava3.setChainInfo("chainInfo");
-        chainInfo = ava3.getChainInfo();
-        assertTrue(chainInfo.equals("chainInfo"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/AttachVolumeCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/AttachVolumeCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/AttachVolumeCommandTest.java
deleted file mode 100644
index 1ec416a..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/AttachVolumeCommandTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.AttachVolumeCommand;
-import com.cloud.storage.Storage.StoragePoolType;
-
-public class AttachVolumeCommandTest {
-    AttachVolumeCommand avc = new AttachVolumeCommand(true, "vmname",
-            StoragePoolType.Filesystem, "vFolder", "vPath", "vName",
-            123456789L, "chainInfo");
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = avc.executeInSequence();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testGetAttach() {
-        boolean b = avc.getAttach();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testGetVmName() {
-        String vmName = avc.getVmName();
-        assertTrue(vmName.equals("vmname"));
-    }
-
-    @Test
-    public void testGetPooltype() {
-        StoragePoolType pt = avc.getPooltype();
-        assertTrue(pt.equals(StoragePoolType.Filesystem));
-
-        avc.setPooltype(StoragePoolType.NetworkFilesystem);
-        pt = avc.getPooltype();
-        assertTrue(pt.equals(StoragePoolType.NetworkFilesystem));
-
-        avc.setPooltype(StoragePoolType.IscsiLUN);
-        pt = avc.getPooltype();
-        assertTrue(pt.equals(StoragePoolType.IscsiLUN));
-
-        avc.setPooltype(StoragePoolType.Iscsi);
-        pt = avc.getPooltype();
-        assertTrue(pt.equals(StoragePoolType.Iscsi));
-    }
-
-    @Test
-    public void testGetVolumeFolder() {
-        String vFolder = avc.getVolumeFolder();
-        assertTrue(vFolder.equals("vFolder"));
-    }
-
-    @Test
-    public void testGetVolumePath() {
-        String vPath = avc.getVolumePath();
-        assertTrue(vPath.equals("vPath"));
-    }
-
-    @Test
-    public void testGetVolumeName() {
-        String vName = avc.getVolumeName();
-        assertTrue(vName.equals("vName"));
-    }
-
-    @Test
-    public void testGetDeviceId() {
-        Long dId = avc.getDeviceId();
-        Long expected = 123456789L;
-        assertEquals(expected, dId);
-
-        avc.setDeviceId(5L);
-        dId = avc.getDeviceId();
-        expected = 5L;
-        assertEquals(expected, dId);
-
-        avc.setDeviceId(0L);
-        dId = avc.getDeviceId();
-        expected = 0L;
-        assertEquals(expected, dId);
-
-        avc.setDeviceId(-5L);
-        dId = avc.getDeviceId();
-        expected = -5L;
-        assertEquals(expected, dId);
-    }
-
-    @Test
-    public void testGetPoolUuid() {
-        avc.setPoolUuid("420fa39c-4ef1-a83c-fd93-46dc1ff515ae");
-        String pUuid = avc.getPoolUuid();
-        assertTrue(pUuid.equals("420fa39c-4ef1-a83c-fd93-46dc1ff515ae"));
-    }
-
-    @Test
-    public void testGetWait() {
-        String cInfo = avc.getChainInfo();
-        assertTrue(cInfo.equals("chainInfo"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/BackupSnapshotAnswerTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/BackupSnapshotAnswerTest.java b/api/test/org/apache/cloudstack/api/agent/test/BackupSnapshotAnswerTest.java
deleted file mode 100644
index 7fd6e0b..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/BackupSnapshotAnswerTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-import com.cloud.agent.api.BackupSnapshotAnswer;
-import com.cloud.agent.api.BackupSnapshotCommand;
-import com.cloud.storage.StoragePool;
-
-public class BackupSnapshotAnswerTest {
-    private BackupSnapshotCommand bsc;
-    private BackupSnapshotAnswer bsa;
-
-    @Before
-    public void setUp() {
-
-        StoragePool pool = Mockito.mock(StoragePool.class);
-
-        bsc = new BackupSnapshotCommand(
-                "secondaryStoragePoolURL", 101L, 102L, 103L, 104L, 105L,
-                "volumePath", pool, "snapshotUuid", "snapshotName",
-                "prevSnapshotUuid", "prevBackupUuid", false, "vmName", 5);
-        bsa = new BackupSnapshotAnswer(bsc, true, "results", "bussname", false);
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = bsa.executeInSequence();
-        assertFalse(b);
-    }
-
-    @Test
-    public void testIsFull() {
-        boolean b = bsa.isFull();
-        assertFalse(b);
-    }
-
-    @Test
-    public void testGetBackupSnapshotName() {
-        String name = bsa.getBackupSnapshotName();
-        assertTrue(name.equals("bussname"));
-    }
-
-    @Test
-    public void testGetResult() {
-        boolean b = bsa.getResult();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testDetails() {
-        String details = bsa.getDetails();
-        assertTrue(details.equals("results"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java
deleted file mode 100644
index 44d53aa..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/BackupSnapshotCommandTest.java
+++ /dev/null
@@ -1,301 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.BackupSnapshotCommand;
-import com.cloud.agent.api.to.StorageFilerTO;
-import com.cloud.agent.api.to.SwiftTO;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.StoragePoolStatus;
-
-public class BackupSnapshotCommandTest {
-    public StoragePool pool = new StoragePool() {
-        @Override
-        public long getId() {
-            return 1L;
-        };
-
-        @Override
-        public String getName() {
-            return "name";
-        };
-
-        @Override
-        public String getUuid() {
-            return "bed9f83e-cac3-11e1-ac8a-0050568b007e";
-        };
-
-        @Override
-        public StoragePoolType getPoolType() {
-            return StoragePoolType.Filesystem;
-        };
-
-        @Override
-        public Date getCreated() {
-            Date date = null;
-            try {
-                date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                .parse("01/01/1970 12:12:12");
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
-            return date;
-        }
-
-        @Override
-        public Date getUpdateTime() {
-            return new Date();
-        };
-
-        @Override
-        public long getDataCenterId() {
-            return 0L;
-        };
-
-        @Override
-        public long getCapacityBytes() {
-            return 0L;
-        };
-
-        @Override
-        public long getAvailableBytes() {
-            return 0L;
-        };
-
-        @Override
-        public Long getClusterId() {
-            return 0L;
-        };
-
-        @Override
-        public String getHostAddress() {
-            return "hostAddress";
-        };
-
-        @Override
-        public String getPath() {
-            return "path";
-        };
-
-        @Override
-        public String getUserInfo() {
-            return "userInfo";
-        };
-
-        @Override
-        public boolean isShared() {
-            return false;
-        };
-
-        @Override
-        public boolean isLocal() {
-            return false;
-        };
-
-        @Override
-        public StoragePoolStatus getStatus() {
-            return StoragePoolStatus.Up;
-        };
-
-        @Override
-        public int getPort() {
-            return 25;
-        };
-
-        @Override
-        public Long getPodId() {
-            return 0L;
-        }
-
-        @Override
-        public String getStorageProviderName() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public boolean isInMaintenance() {
-            // TODO Auto-generated method stub
-            return false;
-        };
-    };
-
-    BackupSnapshotCommand bsc = new BackupSnapshotCommand(
-            "http://secondary.Storage.Url",
-            101L, 102L, 103L, 104L, 105L, "vPath", pool,
-            "420fa39c-4ef1-a83c-fd93-46dc1ff515ae", "sName",
-            "9012793e-0657-11e2-bebc-0050568b0057",
-            "7167e0b2-f5b0-11e1-8414-0050568b0057", false, "vmName", 5);
-
-    BackupSnapshotCommand bsc1 = new BackupSnapshotCommand(
-            "http://secondary.Storage.Url",
-            101L, 102L, 103L, 104L, 105L,"vPath", pool,
-            "420fa39c-4ef1-a83c-fd93-46dc1ff515ae", "sName",
-            "9012793e-0657-11e2-bebc-0050568b0057",
-            "7167e0b2-f5b0-11e1-8414-0050568b0057", false, "vmName", 5);
-
-    @Test
-    public void testGetPrimaryStoragePoolNameLabel() {
-        String label = bsc.getPrimaryStoragePoolNameLabel();
-        assertTrue(label.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
-    }
-
-    @Test
-    public void testGetSecondaryStorageUrl() {
-        String url = bsc.getSecondaryStorageUrl();
-        assertTrue(url.equals("http://secondary.Storage.Url"));
-    }
-
-    @Test
-    public void testGetDataCenterId() {
-        Long dcId = bsc.getDataCenterId();
-        Long expected = 101L;
-        assertEquals(expected, dcId);
-    }
-
-    @Test
-    public void testGetAccountId() {
-        Long aId = bsc.getAccountId();
-        Long expected = 102L;
-        assertEquals(expected, aId);
-    }
-
-    @Test
-    public void testGetVolumeId() {
-        Long vId = bsc.getVolumeId();
-        Long expected = 103L;
-        assertEquals(expected, vId);
-    }
-
-    @Test
-    public void testGetSnapshotId() {
-        Long ssId = bsc.getSnapshotId();
-        Long expected = 104L;
-        assertEquals(expected, ssId);
-    }
-
-    @Test
-    public void testGetPool() {
-        StorageFilerTO pool = bsc.getPool();
-
-        Long id = pool.getId();
-        Long expectedL = 1L;
-        assertEquals(expectedL, id);
-
-        String uuid = pool.getUuid();
-        assertTrue(uuid.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
-
-        String host = pool.getHost();
-        assertTrue(host.equals("hostAddress"));
-
-        String path = pool.getPath();
-        assertTrue(path.equals("path"));
-
-        String userInfo = pool.getUserInfo();
-        assertTrue(userInfo.equals("userInfo"));
-
-        Integer port = pool.getPort();
-        Integer expectedI = 25;
-        assertEquals(expectedI, port);
-
-        StoragePoolType type = pool.getType();
-        assertEquals(StoragePoolType.Filesystem, type);
-
-        String str = pool.toString();
-        assertTrue(str.equals("Pool[" + id.toString() + "|" + host + ":"
-                + port.toString() + "|" + path + "]"));
-    }
-
-    @Test
-    public void testGetCreated() {
-        try {
-            Date date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-            .parse("01/01/1970 12:12:12");
-            Date d = pool.getCreated();
-            assertTrue(d.compareTo(date) == 0);
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void testGetSwift() {
-        SwiftTO s1 = new SwiftTO();
-        bsc.setSwift(s1);
-        SwiftTO s2 = bsc.getSwift();
-        assertEquals(s1, s2);
-    }
-
-    @Test
-    public void testGetSnapshotName() {
-        String ssName = bsc.getSnapshotName();
-        assertTrue(ssName.equals("sName"));
-    }
-
-    @Test
-    public void testGetSnapshotUuid() {
-        String uuid = bsc.getSnapshotUuid();
-        assertTrue(uuid.equals("420fa39c-4ef1-a83c-fd93-46dc1ff515ae"));
-    }
-
-    @Test
-    public void testGetPrevSnapshotUuid() {
-        String uuid = bsc.getPrevSnapshotUuid();
-        assertTrue(uuid.equals("9012793e-0657-11e2-bebc-0050568b0057"));
-    }
-
-    @Test
-    public void testGetPrevBackupUuid() {
-        String uuid = bsc.getPrevBackupUuid();
-        assertTrue(uuid.equals("7167e0b2-f5b0-11e1-8414-0050568b0057"));
-    }
-
-    @Test
-    public void testGetVolumePath() {
-        String path = bsc.getVolumePath();
-        assertTrue(path.equals("vPath"));
-
-        bsc.setVolumePath("vPath1");
-        path = bsc.getVolumePath();
-        assertTrue(path.equals("vPath1"));
-
-        bsc1.setVolumePath("vPath2");
-        path = bsc1.getVolumePath();
-        assertTrue(path.equals("vPath2"));
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = bsc.executeInSequence();
-        assertFalse(b);
-
-        b = bsc1.executeInSequence();
-        assertFalse(b);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/BumpUpPriorityCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/BumpUpPriorityCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/BumpUpPriorityCommandTest.java
deleted file mode 100644
index f5f5985..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/BumpUpPriorityCommandTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.BumpUpPriorityCommand;
-import com.cloud.agent.api.routing.NetworkElementCommand;
-
-public class BumpUpPriorityCommandTest {
-
-    BumpUpPriorityCommand bupc = new BumpUpPriorityCommand();
-
-    // test super class
-    @Test
-    public void testSuperGetAccessDetail() {
-        String value;
-        bupc.setAccessDetail(NetworkElementCommand.ACCOUNT_ID, "accountID");
-        value = bupc.getAccessDetail(NetworkElementCommand.ACCOUNT_ID);
-        assertTrue(value.equals("accountID"));
-
-        bupc.setAccessDetail(NetworkElementCommand.GUEST_NETWORK_CIDR,
-                "GuestNetworkCIDR");
-        value = bupc.getAccessDetail(NetworkElementCommand.GUEST_NETWORK_CIDR);
-        assertTrue(value.equals("GuestNetworkCIDR"));
-
-        bupc.setAccessDetail(NetworkElementCommand.GUEST_NETWORK_GATEWAY,
-                "GuestNetworkGateway");
-        value = bupc
-                .getAccessDetail(NetworkElementCommand.GUEST_NETWORK_GATEWAY);
-        assertTrue(value.equals("GuestNetworkGateway"));
-
-        bupc.setAccessDetail(NetworkElementCommand.GUEST_VLAN_TAG,
-                "GuestVlanTag");
-        value = bupc.getAccessDetail(NetworkElementCommand.GUEST_VLAN_TAG);
-        assertTrue(value.equals("GuestVlanTag"));
-
-        bupc.setAccessDetail(NetworkElementCommand.ROUTER_NAME, "RouterName");
-        value = bupc.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
-        assertTrue(value.equals("RouterName"));
-
-        bupc.setAccessDetail(NetworkElementCommand.ROUTER_IP, "RouterIP");
-        value = bupc.getAccessDetail(NetworkElementCommand.ROUTER_IP);
-        assertTrue(value.equals("RouterIP"));
-
-        bupc.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP,
-                "RouterGuestIP");
-        value = bupc.getAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP);
-        assertTrue(value.equals("RouterGuestIP"));
-
-        bupc.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE,
-                "ZoneNetworkType");
-        value = bupc.getAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE);
-        assertTrue(value.equals("ZoneNetworkType"));
-
-        bupc.setAccessDetail(NetworkElementCommand.GUEST_BRIDGE, "GuestBridge");
-        value = bupc.getAccessDetail(NetworkElementCommand.GUEST_BRIDGE);
-        assertTrue(value.equals("GuestBridge"));
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = bupc.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/CancelCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/CancelCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/CancelCommandTest.java
deleted file mode 100644
index 19827fd..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/CancelCommandTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.CancelCommand;
-
-public class CancelCommandTest {
-    CancelCommand cc = new CancelCommand(123456789L, "goodreason");
-
-    @Test
-    public void testGetSequence() {
-        Long s = cc.getSequence();
-        assertTrue(123456789L == s);
-    }
-
-    @Test
-    public void testGetReason() {
-        String r = cc.getReason();
-        assertTrue(r.equals("goodreason"));
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = cc.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/ChangeAgentAnswerTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/ChangeAgentAnswerTest.java b/api/test/org/apache/cloudstack/api/agent/test/ChangeAgentAnswerTest.java
deleted file mode 100644
index 8933e6e..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/ChangeAgentAnswerTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.ChangeAgentAnswer;
-import com.cloud.agent.api.ChangeAgentCommand;
-import com.cloud.host.Status.Event;
-
-public class ChangeAgentAnswerTest {
-    ChangeAgentCommand cac = new ChangeAgentCommand(123456789L,
-            Event.AgentConnected);
-    ChangeAgentAnswer caa = new ChangeAgentAnswer(cac, true);
-
-    @Test
-    public void testGetResult() {
-        boolean b = caa.getResult();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = caa.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/ChangeAgentCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/ChangeAgentCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/ChangeAgentCommandTest.java
deleted file mode 100644
index d0c2bf8..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/ChangeAgentCommandTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.ChangeAgentCommand;
-import com.cloud.host.Status.Event;
-
-public class ChangeAgentCommandTest {
-
-    ChangeAgentCommand cac = new ChangeAgentCommand(123456789L,
-            Event.AgentConnected);
-
-    @Test
-    public void testGetAgentId() {
-        Long aid = cac.getAgentId();
-        assertTrue(123456789L == aid);
-    }
-
-    @Test
-    public void testGetEvent() {
-        Event e = cac.getEvent();
-        assertEquals(Event.AgentConnected, e);
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = cac.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/CheckHealthAnswerTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/CheckHealthAnswerTest.java b/api/test/org/apache/cloudstack/api/agent/test/CheckHealthAnswerTest.java
deleted file mode 100644
index 6fa94f9..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/CheckHealthAnswerTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.CheckHealthAnswer;
-import com.cloud.agent.api.CheckHealthCommand;
-
-public class CheckHealthAnswerTest {
-    CheckHealthCommand chc = new CheckHealthCommand();
-    CheckHealthAnswer cha = new CheckHealthAnswer(chc, true);
-
-    @Test
-    public void testGetResult() {
-        boolean r = cha.getResult();
-        assertTrue(r);
-    }
-
-    @Test
-    public void testGetDetails() {
-        String d = cha.getDetails();
-        boolean r = cha.getResult();
-        assertTrue(d.equals("resource is " + (r ? "alive" : "not alive")));
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = cha.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/CheckHealthCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/CheckHealthCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/CheckHealthCommandTest.java
deleted file mode 100644
index 1b565a5..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/CheckHealthCommandTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.CheckHealthCommand;
-
-public class CheckHealthCommandTest {
-    CheckHealthCommand chc = new CheckHealthCommand();
-
-    @Test
-    public void testGetWait() {
-        int wait = chc.getWait();
-        assertTrue(wait == 50);
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = chc.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java b/api/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java
deleted file mode 100644
index 1853d39..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/CheckNetworkAnswerTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-import com.cloud.agent.api.CheckNetworkAnswer;
-import com.cloud.agent.api.CheckNetworkCommand;
-
-public class CheckNetworkAnswerTest {
-    CheckNetworkCommand cnc;
-    CheckNetworkAnswer cna;
-
-    @Before
-    public void setUp() {
-        cnc = Mockito.mock(CheckNetworkCommand.class);
-        cna = new CheckNetworkAnswer(cnc, true, "details", true);
-    }
-
-    @Test
-    public void testGetResult() {
-        boolean b = cna.getResult();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testGetDetails() {
-        String d = cna.getDetails();
-        assertTrue(d.equals("details"));
-    }
-
-    @Test
-    public void testNeedReconnect() {
-        boolean b = cna.needReconnect();
-        assertTrue(b);
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = cna.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/CheckNetworkCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/CheckNetworkCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/CheckNetworkCommandTest.java
deleted file mode 100644
index 0b87b58..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/CheckNetworkCommandTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.List;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-import com.cloud.agent.api.CheckNetworkCommand;
-import com.cloud.network.PhysicalNetworkSetupInfo;
-
-public class CheckNetworkCommandTest {
-    CheckNetworkCommand cnc;
-
-    @Before
-    public void setUp() {
-        @SuppressWarnings("unchecked")
-        List<PhysicalNetworkSetupInfo> net = Mockito.mock(List.class);
-        cnc = new CheckNetworkCommand(net);
-    }
-
-    @Test
-    public void testGetPhysicalNetworkInfoList() {
-        List<PhysicalNetworkSetupInfo> networkInfoList = cnc
-                .getPhysicalNetworkInfoList();
-        assertEquals(0, networkInfoList.size());
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = cnc.executeInSequence();
-        assertTrue(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/CheckOnHostCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/CheckOnHostCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/CheckOnHostCommandTest.java
deleted file mode 100644
index 1b68276..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/CheckOnHostCommandTest.java
+++ /dev/null
@@ -1,483 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.CheckOnHostCommand;
-import com.cloud.agent.api.to.HostTO;
-import com.cloud.host.Host;
-import com.cloud.host.Status;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.resource.ResourceState;
-
-public class CheckOnHostCommandTest {
-    public Host host = new Host() {
-        public Status getState() {
-            return Status.Up;
-        };
-
-        public long getId() {
-            return 101L;
-        };
-
-
-        @Override
-        public String getUuid() {
-            return "101";
-        }
-
-        public String getName() {
-            return "hostName";
-        };
-
-        public Type getType() {
-            return Host.Type.Storage;
-        };
-
-        public Date getCreated() {
-            Date date = null;
-            try {
-                date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                        .parse("01/01/1970 12:12:12");
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
-            return date;
-        }
-
-        public Status getStatus() {
-            return Status.Up;
-        };
-
-        public String getPrivateIpAddress() {
-            return "10.1.1.1";
-        };
-
-        public String getStorageIpAddress() {
-            return "10.1.1.2";
-        };
-
-        public String getGuid() {
-            return "bed9f83e-cac3-11e1-ac8a-0050568b007e";
-        };
-
-        public Long getTotalMemory() {
-            return 100000000000L;
-        };
-
-        public Integer getCpus() {
-            return 16;
-        };
-
-        public Long getSpeed() {
-            return 2000000000L;
-        };
-
-        public Integer getProxyPort() {
-            return 22;
-        };
-
-        public Long getPodId() {
-            return 16L;
-        };
-
-        public long getDataCenterId() {
-            return 17L;
-        };
-
-        public String getParent() {
-            return "parent";
-        };
-
-        public String getStorageIpAddressDeux() {
-            return "10.1.1.3";
-        };
-
-        public HypervisorType getHypervisorType() {
-            return HypervisorType.XenServer;
-        };
-
-        public Date getDisconnectedOn() {
-            Date date = null;
-            try {
-                date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                        .parse("01/01/2012 12:12:12");
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
-            return date;
-        }
-
-        public String getVersion() {
-            return "4.0.1";
-        };
-
-        public long getTotalSize() {
-            return 100000000000L;
-        };
-
-        public String getCapabilities() {
-            return "capabilities";
-        };
-
-        public long getLastPinged() {
-            return 1L;
-        };
-
-        public Long getManagementServerId() {
-            return 2L;
-        };
-
-        public Date getRemoved() {
-            Date date = null;
-            try {
-                date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                        .parse("02/01/2012 12:12:12");
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
-            return date;
-        };
-
-        public Long getClusterId() {
-            return 3L;
-        };
-
-        public String getPublicIpAddress() {
-            return "10.1.1.4";
-        };
-
-        public String getPublicNetmask() {
-            return "255.255.255.8";
-        };
-
-        public String getPrivateNetmask() {
-            return "255.255.255.16";
-        };
-
-        public String getStorageNetmask() {
-            return "255.255.255.24";
-        };
-
-        public String getStorageMacAddress() {
-            return "01:f4:17:38:0e:26";
-        };
-
-        public String getPublicMacAddress() {
-            return "02:f4:17:38:0e:26";
-        };
-
-        public String getPrivateMacAddress() {
-            return "03:f4:17:38:0e:26";
-        };
-
-        public String getStorageNetmaskDeux() {
-            return "255.255.255.25";
-        };
-
-        public String getStorageMacAddressDeux() {
-            return "01:f4:17:38:0e:27";
-        };
-
-        public String getHypervisorVersion() {
-            return "1.2.3.0";
-        };
-
-        public boolean isInMaintenanceStates() {
-            return false;
-        };
-
-        public ResourceState getResourceState() {
-            return ResourceState.Enabled;
-        };
-    };
-
-    CheckOnHostCommand cohc = new CheckOnHostCommand(host);
-
-    @Test
-    public void testGetHost() {
-        HostTO h = cohc.getHost();
-        assertNotNull(h);
-    }
-
-    @Test
-    public void testGetState() {
-        Status s = host.getState();
-        assertTrue(s == Status.Up);
-    }
-
-    @Test
-    public void testGetId() {
-        Long id = host.getId();
-        assertTrue(101L == id);
-    }
-
-    @Test
-    public void testGetName() {
-        String name = host.getName();
-        assertTrue(name.equals("hostName"));
-    }
-
-    @Test
-    public void testGetType() {
-        Host.Type t = host.getType();
-        assertTrue(t == Host.Type.Storage);
-    }
-
-    @Test
-    public void testGetCreated() {
-        try {
-            Date date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                    .parse("01/01/1970 12:12:12");
-            Date d = host.getCreated();
-            assertTrue(d.compareTo(date) == 0);
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void testGetStatus() {
-        Status s = host.getStatus();
-        assertTrue(s == Status.Up);
-    }
-
-    @Test
-    public void testGetPrivateIpAddress() {
-        String addr = host.getPrivateIpAddress();
-        assertTrue(addr.equals("10.1.1.1"));
-    }
-
-    @Test
-    public void testGetStorageIpAddress() {
-        String addr = host.getStorageIpAddress();
-        assertTrue(addr.equals("10.1.1.2"));
-    }
-
-    @Test
-    public void testGetGuid() {
-        String guid = host.getGuid();
-        assertTrue(guid.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
-    }
-
-    @Test
-    public void testGetTotalMemory() {
-        Long m = host.getTotalMemory();
-        assertTrue(m == 100000000000L);
-    }
-
-    @Test
-    public void testGetCpus() {
-        int cpus = host.getCpus();
-        assertTrue(cpus == 16);
-    }
-
-    @Test
-    public void testGetSpeed() {
-        Long spped = host.getSpeed();
-        assertTrue(spped == 2000000000L);
-    }
-
-    @Test
-    public void testGetProxyPort() {
-        Integer port = host.getProxyPort();
-        assertTrue(port == 22);
-    }
-
-    @Test
-    public void testGetPodId() {
-        Long pID = host.getPodId();
-        assertTrue(pID == 16L);
-    }
-
-    @Test
-    public void testGetDataCenterId() {
-        long dcID = host.getDataCenterId();
-        assertTrue(dcID == 17L);
-    }
-
-    @Test
-    public void testGetParent() {
-        String p = host.getParent();
-        assertTrue(p.equals("parent"));
-    }
-
-    @Test
-    public void testGetStorageIpAddressDeux() {
-        String addr = host.getStorageIpAddressDeux();
-        assertTrue(addr.equals("10.1.1.3"));
-    }
-
-    @Test
-    public void testGetHypervisorType() {
-        HypervisorType type = host.getHypervisorType();
-        assertTrue(type == HypervisorType.XenServer);
-    }
-
-    @Test
-    public void testGetDisconnectedOn() {
-        try {
-            Date date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                    .parse("01/01/2012 12:12:12");
-            Date d = host.getDisconnectedOn();
-            assertTrue(d.compareTo(date) == 0);
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void testGetVersion() {
-        String v = host.getVersion();
-        assertTrue(v.equals("4.0.1"));
-    }
-
-    @Test
-    public void testGetTotalSize() {
-        long size = host.getTotalSize();
-        assertTrue(size == 100000000000L);
-    }
-
-    @Test
-    public void testGetCapabilities() {
-        String c = host.getCapabilities();
-        assertTrue(c.equals("capabilities"));
-    }
-
-    @Test
-    public void testGetLastPinged() {
-        long lp = host.getLastPinged();
-        assertTrue(lp == 1L);
-    }
-
-    @Test
-    public void testGetManagementServerId() {
-        Long msID = host.getManagementServerId();
-        assertTrue(msID == 2L);
-    }
-
-    @Test
-    public void testGetRemoved() {
-        try {
-            Date date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                    .parse("02/01/2012 12:12:12");
-            Date d = host.getRemoved();
-            assertTrue(d.compareTo(date) == 0);
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Test
-    public void testGetClusterId() {
-        Long cID = host.getClusterId();
-        assertTrue(cID == 3L);
-    }
-
-    @Test
-    public void testGetPublicIpAddress() {
-        String pipAddr = host.getPublicIpAddress();
-        assertTrue(pipAddr.equals("10.1.1.4"));
-    }
-
-    @Test
-    public void testGetPublicNetmask() {
-        String pMask = host.getPublicNetmask();
-        assertTrue(pMask.equals("255.255.255.8"));
-    }
-
-    @Test
-    public void testGetPrivateNetmask() {
-        String pMask = host.getPrivateNetmask();
-        assertTrue(pMask.equals("255.255.255.16"));
-    }
-
-    @Test
-    public void testGetStorageNetmask() {
-        String sMask = host.getStorageNetmask();
-        assertTrue(sMask.equals("255.255.255.24"));
-    }
-
-    @Test
-    public void testGetStorageMacAddress() {
-        String sMac = host.getStorageMacAddress();
-        assertTrue(sMac.equals("01:f4:17:38:0e:26"));
-    }
-
-    @Test
-    public void testGetPublicMacAddress() {
-        String pMac = host.getPublicMacAddress();
-        assertTrue(pMac.equals("02:f4:17:38:0e:26"));
-    }
-
-    @Test
-    public void testGetPrivateMacAddress() {
-        String pMac = host.getPrivateMacAddress();
-        assertTrue(pMac.equals("03:f4:17:38:0e:26"));
-    }
-
-    @Test
-    public void testGetStorageNetmaskDeux() {
-        String sMask = host.getStorageNetmaskDeux();
-        assertTrue(sMask.equals("255.255.255.25"));
-    }
-
-    @Test
-    public void testGetStorageMacAddressDeux() {
-        String sMac = host.getStorageMacAddressDeux();
-        assertTrue(sMac.equals("01:f4:17:38:0e:27"));
-    }
-
-    @Test
-    public void testGetHypervisorVersion() {
-        String v = host.getHypervisorVersion();
-        assertTrue(v.equals("1.2.3.0"));
-    }
-
-    @Test
-    public void testIsInMaintenanceStates() {
-        boolean b = host.isInMaintenanceStates();
-        assertFalse(b);
-    }
-
-    @Test
-    public void testGetResourceState() {
-        ResourceState r = host.getResourceState();
-        assertTrue(r == ResourceState.Enabled);
-    }
-
-    @Test
-    public void testGetWait() {
-        int wait = cohc.getWait();
-        assertTrue(20 == wait);
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = cohc.executeInSequence();
-        assertFalse(b);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java b/api/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java
deleted file mode 100644
index c2d69c0..0000000
--- a/api/test/org/apache/cloudstack/api/agent/test/SnapshotCommandTest.java
+++ /dev/null
@@ -1,209 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.api.agent.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.cloud.agent.api.SnapshotCommand;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.StoragePoolStatus;
-
-public class SnapshotCommandTest {
-
-    public StoragePool pool = new StoragePool() {
-        public long getId() {
-            return 1L;
-        };
-
-        public String getName() {
-            return "name";
-        };
-
-        public String getUuid() {
-            return "bed9f83e-cac3-11e1-ac8a-0050568b007e";
-        };
-
-        public StoragePoolType getPoolType() {
-            return StoragePoolType.Filesystem;
-        };
-
-        public Date getCreated() {
-            Date date = null;
-            try {
-                date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                        .parse("01/01/1970 12:12:12");
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
-            return date;
-        }
-
-        public Date getUpdateTime() {
-            return new Date();
-        };
-
-        public long getDataCenterId() {
-            return 0L;
-        };
-
-        public long getCapacityBytes() {
-            return 0L;
-        };
-
-        public long getAvailableBytes() {
-            return 0L;
-        };
-
-        public Long getClusterId() {
-            return 0L;
-        };
-
-        public String getHostAddress() {
-            return "hostAddress";
-        };
-
-        public String getPath() {
-            return "path";
-        };
-
-        public String getUserInfo() {
-            return "userInfo";
-        };
-
-        public boolean isShared() {
-            return false;
-        };
-
-        public boolean isLocal() {
-            return false;
-        };
-
-        public StoragePoolStatus getStatus() {
-            return StoragePoolStatus.Up;
-        };
-
-        public int getPort() {
-            return 25;
-        };
-
-        public Long getPodId() {
-            return 0L;
-        }
-
-		@Override
-		public String getStorageProviderName() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-        @Override
-        public boolean isInMaintenance() {
-            // TODO Auto-generated method stub
-            return false;
-        };
-    };
-
-    SnapshotCommand ssc = new SnapshotCommand(pool,
-            "http://secondary.Storage.Url",
-            "420fa39c-4ef1-a83c-fd93-46dc1ff515ae", "snapshotName", 101L, 102L,
-            103L);
-
-    SnapshotCommand ssc1;
-
-
-    @Before
-    public void setUp() {
-        ssc1 = new SnapshotCommand(pool,
-                "secondaryStorageUrl", "snapshotUuid", "snapshotName", 101L,
-                102L, 103L);
-    }
-
-    @Test
-    public void testGetPrimaryStoragePoolNameLabel() {
-        String label = ssc.getPrimaryStoragePoolNameLabel();
-        assertTrue(label.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
-    }
-
-    @Test
-    public void testGetSecondaryStorageUrl() {
-        String url = ssc.getSecondaryStorageUrl();
-        assertTrue(url.equals("http://secondary.Storage.Url"));
-    }
-
-    @Test
-    public void testGetSnapshotUuid() {
-        String uuid = ssc.getSnapshotUuid();
-        assertTrue(uuid.equals("420fa39c-4ef1-a83c-fd93-46dc1ff515ae"));
-    }
-
-    @Test
-    public void testGetSnapshotName() {
-        String name = ssc.getSnapshotName();
-        assertTrue(name.equals("snapshotName"));
-    }
-
-    @Test
-    public void testGetVolumePath() {
-        ssc.setVolumePath("vPath");
-        String path = ssc.getVolumePath();
-        assertTrue(path.equals("vPath"));
-
-        ssc1.setVolumePath("vPath1");
-        path = ssc1.getVolumePath();
-        assertTrue(path.equals("vPath1"));
-    }
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = ssc.executeInSequence();
-        assertFalse(b);
-
-        b = ssc1.executeInSequence();
-        assertFalse(b);
-    }
-
-    @Test
-    public void testGetDataCenterId() {
-        Long dcId = ssc.getDataCenterId();
-        Long expected = 101L;
-        assertEquals(expected, dcId);
-    }
-
-    @Test
-    public void testGetAccountId() {
-        Long aId = ssc.getAccountId();
-        Long expected = 102L;
-        assertEquals(expected, aId);
-    }
-
-    @Test
-    public void testGetVolumeId() {
-        Long vId = ssc.getVolumeId();
-        Long expected = 103L;
-        assertEquals(expected, vId);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/command/test/AddIpToVmNicTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/command/test/AddIpToVmNicTest.java b/api/test/org/apache/cloudstack/api/command/test/AddIpToVmNicTest.java
index 106589d..e5015cb 100644
--- a/api/test/org/apache/cloudstack/api/command/test/AddIpToVmNicTest.java
+++ b/api/test/org/apache/cloudstack/api/command/test/AddIpToVmNicTest.java
@@ -16,6 +16,7 @@
 // under the License.
 package org.apache.cloudstack.api.command.test;
 
+import com.cloud.vm.NicSecondaryIp;
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
@@ -64,15 +65,16 @@ public class AddIpToVmNicTest extends TestCase {
 
         NetworkService networkService = Mockito.mock(NetworkService.class);
         AddIpToVmNicCmd ipTonicCmd = Mockito.mock(AddIpToVmNicCmd.class);
+        NicSecondaryIp secIp = Mockito.mock(NicSecondaryIp.class);
 
         Mockito.when(
-                networkService.allocateSecondaryGuestIP(Mockito.any(Account.class), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyString())).thenReturn("10.1.1.2");
+                networkService.allocateSecondaryGuestIP(Mockito.any(Account.class), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyString())).thenReturn(secIp);
 
         ipTonicCmd._networkService = networkService;
         responseGenerator = Mockito.mock(ResponseGenerator.class);
 
         NicSecondaryIpResponse ipres = Mockito.mock(NicSecondaryIpResponse.class);
-        Mockito.when(responseGenerator.createSecondaryIPToNicResponse(Mockito.anyString(), Mockito.anyLong(), Mockito.anyLong())).thenReturn(ipres);
+        Mockito.when(responseGenerator.createSecondaryIPToNicResponse(secIp)).thenReturn(ipres);
 
         ipTonicCmd._responseGenerator = responseGenerator;
         ipTonicCmd.execute();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/org/apache/cloudstack/api/command/test/ScaleVMCmdTest.java
----------------------------------------------------------------------
diff --git a/api/test/org/apache/cloudstack/api/command/test/ScaleVMCmdTest.java b/api/test/org/apache/cloudstack/api/command/test/ScaleVMCmdTest.java
index 301fa02..8a28290 100644
--- a/api/test/org/apache/cloudstack/api/command/test/ScaleVMCmdTest.java
+++ b/api/test/org/apache/cloudstack/api/command/test/ScaleVMCmdTest.java
@@ -16,31 +16,20 @@
 // under the License.
 package org.apache.cloudstack.api.command.test;
 
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
 import com.cloud.uservm.UserVm;
 import com.cloud.vm.UserVmService;
 import junit.framework.Assert;
 import junit.framework.TestCase;
 import org.apache.cloudstack.api.ResponseGenerator;
 import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.command.admin.region.AddRegionCmd;
 import org.apache.cloudstack.api.command.user.vm.ScaleVMCmd;
-import org.apache.cloudstack.api.response.RegionResponse;
-import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.cloudstack.region.Region;
-import org.apache.cloudstack.region.RegionService;
+
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.mockito.Mockito;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
-
 public class ScaleVMCmdTest extends TestCase{
 
     private ScaleVMCmd scaleVMCmd;
@@ -57,12 +46,11 @@ public class ScaleVMCmdTest extends TestCase{
             public Long getId() {
                 return 2L;
             }
+            @Override
+            public String getCommandName() {
+                return "scalevirtualmachineresponse";
+            }
         };
-
-       //Account account = new AccountVO("testaccount", 1L, "networkdomain", (short) 0, "uuid");
-       //UserContext.registerContext(1, account, null, true);
-
-
     }
 
 
@@ -71,11 +59,10 @@ public class ScaleVMCmdTest extends TestCase{
 
         UserVmService userVmService = Mockito.mock(UserVmService.class);
 
-        UserVm uservm = Mockito.mock(UserVm.class);
         try {
             Mockito.when(
                     userVmService.upgradeVirtualMachine(scaleVMCmd))
-                    .thenReturn(uservm);
+                    .thenReturn(true);
         }catch (Exception e){
             Assert.fail("Received exception when success expected " +e.getMessage());
         }
@@ -83,13 +70,6 @@ public class ScaleVMCmdTest extends TestCase{
         scaleVMCmd._userVmService = userVmService;
         responseGenerator = Mockito.mock(ResponseGenerator.class);
 
-        UserVmResponse userVmResponse = Mockito.mock(UserVmResponse.class);
-        List<UserVmResponse> responseList = new ArrayList<UserVmResponse>();
-        responseList.add(userVmResponse);
-
-        Mockito.when(responseGenerator.createUserVmResponse("virtualmachine",uservm))
-                .thenReturn(responseList);
-
         scaleVMCmd._responseGenerator = responseGenerator;
         scaleVMCmd.execute();
 
@@ -101,10 +81,9 @@ public class ScaleVMCmdTest extends TestCase{
         UserVmService userVmService = Mockito.mock(UserVmService.class);
 
         try {
-            UserVm uservm = Mockito.mock(UserVm.class);
             Mockito.when(
                     userVmService.upgradeVirtualMachine(scaleVMCmd))
-                    .thenReturn(null);
+                    .thenReturn(false);
         }catch (Exception e){
             Assert.fail("Received exception when success expected " +e.getMessage());
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c11dbad9/api/test/src/com/cloud/agent/api/test/ResizeVolumeCommandTest.java
----------------------------------------------------------------------
diff --git a/api/test/src/com/cloud/agent/api/test/ResizeVolumeCommandTest.java b/api/test/src/com/cloud/agent/api/test/ResizeVolumeCommandTest.java
deleted file mode 100644
index 02085f5..0000000
--- a/api/test/src/com/cloud/agent/api/test/ResizeVolumeCommandTest.java
+++ /dev/null
@@ -1,229 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package src.com.cloud.agent.api.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.junit.Test;
-
-import com.cloud.agent.api.storage.ResizeVolumeCommand;
-import com.cloud.agent.api.to.StorageFilerTO;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.StoragePoolStatus;
-
-
-public class ResizeVolumeCommandTest {
-
-    public StoragePool dummypool = new StoragePool() {
-        @Override
-        public long getId() {
-            return 1L;
-        };
-
-        @Override
-        public String getName() {
-            return "name";
-        };
-
-        @Override
-        public String getUuid() {
-            return "bed9f83e-cac3-11e1-ac8a-0050568b007e";
-        };
-
-        @Override
-        public StoragePoolType getPoolType() {
-            return StoragePoolType.Filesystem;
-        };
-
-        @Override
-        public Date getCreated() {
-            Date date = null;
-            try {
-                date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
-                .parse("01/01/1970 12:12:12");
-            } catch (ParseException e) {
-                e.printStackTrace();
-            }
-            return date;
-        }
-
-        @Override
-        public Date getUpdateTime() {
-            return new Date();
-        };
-
-        @Override
-        public long getDataCenterId() {
-            return 0L;
-        };
-
-        @Override
-        public long getCapacityBytes() {
-            return 0L;
-        };
-
-        @Override
-        public long getAvailableBytes() {
-            return 0L;
-        };
-
-        @Override
-        public Long getClusterId() {
-            return 0L;
-        };
-
-        @Override
-        public String getHostAddress() {
-            return "hostAddress";
-        };
-
-        @Override
-        public String getPath() {
-            return "path";
-        };
-
-        @Override
-        public String getUserInfo() {
-            return "userInfo";
-        };
-
-        @Override
-        public boolean isShared() {
-            return false;
-        };
-
-        @Override
-        public boolean isLocal() {
-            return false;
-        };
-
-        @Override
-        public StoragePoolStatus getStatus() {
-            return StoragePoolStatus.Up;
-        };
-
-        @Override
-        public int getPort() {
-            return 25;
-        };
-
-        @Override
-        public Long getPodId() {
-            return 0L;
-        }
-
-        @Override
-        public String getStorageProviderName() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public boolean isInMaintenance() {
-            // TODO Auto-generated method stub
-            return false;
-        };
-    };
-
-    Long newSize = 4194304L;
-    Long currentSize = 1048576L;
-
-    ResizeVolumeCommand rv = new ResizeVolumeCommand("dummydiskpath", 
-            new StorageFilerTO(dummypool), currentSize, newSize, false, 
-            "vmName");
-
-    @Test
-    public void testExecuteInSequence() {
-        boolean b = rv.executeInSequence();
-        assertFalse(b);
-    }
-
-    @Test
-    public void testGetPath() {
-        String path = rv.getPath();
-        assertTrue(path.equals("dummydiskpath"));
-    }
-
-    @Test
-    public void testGetPoolUuid() {
-        String poolUuid = rv.getPoolUuid();
-        assertTrue(poolUuid.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
-    }
-
-    @Test
-    public void testGetPool() {
-        StorageFilerTO pool = rv.getPool();
-
-        Long id = pool.getId();
-        Long expectedL = 1L;
-        assertEquals(expectedL, id);
-
-        String uuid = pool.getUuid();
-        assertTrue(uuid.equals("bed9f83e-cac3-11e1-ac8a-0050568b007e"));
-
-        String host = pool.getHost();
-        assertTrue(host.equals("hostAddress"));
-
-        String path = pool.getPath();
-        assertTrue(path.equals("path"));
-
-        String userInfo = pool.getUserInfo();
-        assertTrue(userInfo.equals("userInfo"));
-
-        Integer port = pool.getPort();
-        Integer expectedI = 25;
-        assertEquals(expectedI, port);
-
-        StoragePoolType type = pool.getType();
-        assertEquals(StoragePoolType.Filesystem, type);
-
-        String str = pool.toString();
-        assertTrue(str.equals("Pool[" + id.toString() + "|" + host + ":"
-                + port.toString() + "|" + path + "]"));
-    }
-
-    @Test
-    public void testGetNewSize() {
-        long newSize = rv.getNewSize();
-        assertTrue(newSize == 4194304L);
-    }
-
-    @Test
-    public void testGetCurrentSize() {
-        long currentSize = rv.getCurrentSize();
-        assertTrue(currentSize == 1048576L);
-    }
-
-    @Test
-    public void testGetShrinkOk() {
-        assertFalse(rv.getShrinkOk());
-    }
-
-    @Test
-    public void testGetInstanceName() {
-        String vmName = rv.getInstanceName();
-        assertTrue(vmName.equals("vmName"));
-    }
-
-}


Mime
View raw message