You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/03/02 12:06:52 UTC
[1/2] git commit: updated refs/heads/master to db443c1
Repository: cloudstack
Updated Branches:
refs/heads/master 541c23ed0 -> db443c173
CLOUDSTACK-8294: fix for java 1.8 build
The test testFindSecurityProfileByUuid built an assumptio on the order of the arguments after transforming through a HashMap.
Signed-off-by: Laszlo Hornyak <la...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/873649eb
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/873649eb
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/873649eb
Branch: refs/heads/master
Commit: 873649eb3b52f2ec25c0e60d2a2465f95c97e428
Parents: ed099c3
Author: Laszlo Hornyak <la...@gmail.com>
Authored: Sun Mar 1 13:20:51 2015 +0100
Committer: Laszlo Hornyak <la...@gmail.com>
Committed: Sun Mar 1 13:20:51 2015 +0100
----------------------------------------------------------------------
.../cloud/network/nicira/NiciraNvpApiTest.java | 21 ++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/873649eb/plugins/network-elements/nicira-nvp/test/com/cloud/network/nicira/NiciraNvpApiTest.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nicira-nvp/test/com/cloud/network/nicira/NiciraNvpApiTest.java b/plugins/network-elements/nicira-nvp/test/com/cloud/network/nicira/NiciraNvpApiTest.java
index 51964bf..1435cc5 100644
--- a/plugins/network-elements/nicira-nvp/test/com/cloud/network/nicira/NiciraNvpApiTest.java
+++ b/plugins/network-elements/nicira-nvp/test/com/cloud/network/nicira/NiciraNvpApiTest.java
@@ -20,12 +20,18 @@
package com.cloud.network.nicira;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Matchers.any;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
@@ -38,10 +44,11 @@ import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.params.HttpClientParams;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
import com.google.gson.Gson;
import com.google.gson.JsonParseException;
-
import com.cloud.utils.rest.RESTServiceConnector;
import com.cloud.utils.rest.RESTValidationStrategy;
@@ -144,13 +151,23 @@ public class NiciraNvpApiTest {
new NameValuePair("uuid", UUID),
new NameValuePair("fields","*")
};
+ final List<NameValuePair> queryStringNvps = new ArrayList<>();
+ doAnswer(new Answer<Void>() {
+
+ @Override
+ public Void answer(InvocationOnMock invocation) throws Throwable {
+ final NameValuePair[] arguments = (NameValuePair[]) invocation.getArguments()[0];
+ queryStringNvps.addAll(Arrays.asList(arguments));
+ return null;
+ }}).when(method).setQueryString(any(NameValuePair[].class));
// Execute
final NiciraNvpList<SecurityProfile> actualProfiles = api.findSecurityProfile(UUID);
// Assert
verify(method, times(1)).releaseConnection();
- verify(method, times(1)).setQueryString(queryString);
+ assertTrue(queryStringNvps.containsAll(Arrays.asList(queryString)));
+ assertEquals(queryString.length, queryStringNvps.size());
assertEquals("Wrong Uuid in the newly created SecurityProfile",
UUID, actualProfiles.getResults().get(0).getUuid());
assertEquals("Wrong Uuid in the newly created SecurityProfile",
[2/2] git commit: updated refs/heads/master to db443c1
Posted by bh...@apache.org.
Merge remote-tracking branch 'laszlo/CLOUDSTACK-8294'
This closes #92
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/db443c17
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/db443c17
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/db443c17
Branch: refs/heads/master
Commit: db443c1734c738ebd265259264ed7be5502fb246
Parents: 541c23e 873649e
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Mon Mar 2 16:36:27 2015 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Mon Mar 2 16:36:39 2015 +0530
----------------------------------------------------------------------
.../cloud/network/nicira/NiciraNvpApiTest.java | 21 ++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------