From eecbb10c6acbd544d87df0697b21f98a44246393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Wed, 17 Aug 2016 16:36:12 -0300 Subject: [PATCH] Prepare project to be closed and released to maven central repo --- pom.xml | 44 ++++++++++++++++--- .../apache-cloudstack-client-examples/pom.xml | 4 +- .../client/ApacheCloudStackClient.java | 4 +- ...oudStackClientRequestRuntimeException.java | 2 +- ...pacheCloudStackClientRuntimeException.java | 2 +- .../client/ApacheCloudStackClientTest.java | 18 +++++++- 6 files changed, 59 insertions(+), 15 deletions(-) rename src/main/java/br/com/autonomiccs/apacheCloudStack/{ => exceptions}/ApacheCloudStackClientRequestRuntimeException.java (97%) rename src/main/java/br/com/autonomiccs/apacheCloudStack/{ => exceptions}/ApacheCloudStackClientRuntimeException.java (95%) diff --git a/pom.xml b/pom.xml index 19e40be..645295b 100644 --- a/pom.xml +++ b/pom.xml @@ -19,18 +19,33 @@ specific language governing permissions and limitations under the License. --> - 4.0.0 + + + org.sonatype.oss + oss-parent + 9 + + br.com.autonomiccs apache-cloudstack-java-client - 0.0.1-SNAPSHOT + 1.0.0-SNAPSHOT apache-cloudstack-java-client - This project facilitates the integration of Java applications with Apache CloudStack through its API. - + https://github.com/Autonomiccs/apache-cloudstack-java-client + + + + Autonomiccs + all@autonomiccs.com.br + Autonomiccs + https://www.autonomiccs.com.br + + + Apache License, Version 2.0 @@ -38,7 +53,13 @@ repo - + + + scm:git:git@github.com/Autonomiccs/apache-cloudstack-java-client.git + scm:git:ssh://github.com:Autonomiccs/apache-cloudstack-java-client.git + https://github.com/Autonomiccs/apache-cloudstack-java-client + + 1.7 2.19.1 @@ -168,6 +189,15 @@ + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + org.apache.rat @@ -225,6 +255,7 @@ + @@ -363,8 +394,7 @@ sonar http://sonar.autonomiccs.com.br - **/br/com/autonomiccs/**/beans/*.java, - **/br/com/autonomiccs/**/enums/*.java + **/br/com/autonomiccs/**/beans/*.java,**/br/com/autonomiccs/**/enums/*.java,**/br/com/autonomiccs/**/exceptions/*.java diff --git a/samples/apache-cloudstack-client-examples/pom.xml b/samples/apache-cloudstack-client-examples/pom.xml index b005039..89db208 100644 --- a/samples/apache-cloudstack-client-examples/pom.xml +++ b/samples/apache-cloudstack-client-examples/pom.xml @@ -25,13 +25,13 @@ 4.0.0 br.com.autonomiccs apache-cloudstack-java-client-examples - 0.0.1-SNAPSHOT + 1.0.0-SNAPSHOT br.com.autonomiccs apache-cloudstack-java-client - 0.0.1-SNAPSHOT + ${project.version}} \ No newline at end of file diff --git a/src/main/java/br/com/autonomiccs/apacheCloudStack/client/ApacheCloudStackClient.java b/src/main/java/br/com/autonomiccs/apacheCloudStack/client/ApacheCloudStackClient.java index 74d420c..a6d219f 100644 --- a/src/main/java/br/com/autonomiccs/apacheCloudStack/client/ApacheCloudStackClient.java +++ b/src/main/java/br/com/autonomiccs/apacheCloudStack/client/ApacheCloudStackClient.java @@ -72,9 +72,9 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import br.com.autonomiccs.apacheCloudStack.ApacheCloudStackClientRequestRuntimeException; -import br.com.autonomiccs.apacheCloudStack.ApacheCloudStackClientRuntimeException; import br.com.autonomiccs.apacheCloudStack.client.beans.ApacheCloudStackUser; +import br.com.autonomiccs.apacheCloudStack.exceptions.ApacheCloudStackClientRequestRuntimeException; +import br.com.autonomiccs.apacheCloudStack.exceptions.ApacheCloudStackClientRuntimeException; /** * Apache CloudStack API client. diff --git a/src/main/java/br/com/autonomiccs/apacheCloudStack/ApacheCloudStackClientRequestRuntimeException.java b/src/main/java/br/com/autonomiccs/apacheCloudStack/exceptions/ApacheCloudStackClientRequestRuntimeException.java similarity index 97% rename from src/main/java/br/com/autonomiccs/apacheCloudStack/ApacheCloudStackClientRequestRuntimeException.java rename to src/main/java/br/com/autonomiccs/apacheCloudStack/exceptions/ApacheCloudStackClientRequestRuntimeException.java index a162dc0..f1cb8cf 100644 --- a/src/main/java/br/com/autonomiccs/apacheCloudStack/ApacheCloudStackClientRequestRuntimeException.java +++ b/src/main/java/br/com/autonomiccs/apacheCloudStack/exceptions/ApacheCloudStackClientRequestRuntimeException.java @@ -19,7 +19,7 @@ * specific language governing permissions and limitations * under the License. */ -package br.com.autonomiccs.apacheCloudStack; +package br.com.autonomiccs.apacheCloudStack.exceptions; import org.apache.http.HttpStatus; diff --git a/src/main/java/br/com/autonomiccs/apacheCloudStack/ApacheCloudStackClientRuntimeException.java b/src/main/java/br/com/autonomiccs/apacheCloudStack/exceptions/ApacheCloudStackClientRuntimeException.java similarity index 95% rename from src/main/java/br/com/autonomiccs/apacheCloudStack/ApacheCloudStackClientRuntimeException.java rename to src/main/java/br/com/autonomiccs/apacheCloudStack/exceptions/ApacheCloudStackClientRuntimeException.java index 4f8a47b..76ea90c 100644 --- a/src/main/java/br/com/autonomiccs/apacheCloudStack/ApacheCloudStackClientRuntimeException.java +++ b/src/main/java/br/com/autonomiccs/apacheCloudStack/exceptions/ApacheCloudStackClientRuntimeException.java @@ -19,7 +19,7 @@ * specific language governing permissions and limitations * under the License. */ -package br.com.autonomiccs.apacheCloudStack; +package br.com.autonomiccs.apacheCloudStack.exceptions; /** * This class is used to throw any of the exception that may happen during runtime diff --git a/src/test/java/br/com/autonomiccs/apacheCloudStack/client/ApacheCloudStackClientTest.java b/src/test/java/br/com/autonomiccs/apacheCloudStack/client/ApacheCloudStackClientTest.java index b9d1005..423a144 100644 --- a/src/test/java/br/com/autonomiccs/apacheCloudStack/client/ApacheCloudStackClientTest.java +++ b/src/test/java/br/com/autonomiccs/apacheCloudStack/client/ApacheCloudStackClientTest.java @@ -59,9 +59,9 @@ import org.mockito.Mockito; import org.mockito.runners.MockitoJUnitRunner; -import br.com.autonomiccs.apacheCloudStack.ApacheCloudStackClientRequestRuntimeException; -import br.com.autonomiccs.apacheCloudStack.ApacheCloudStackClientRuntimeException; import br.com.autonomiccs.apacheCloudStack.client.beans.ApacheCloudStackUser; +import br.com.autonomiccs.apacheCloudStack.exceptions.ApacheCloudStackClientRequestRuntimeException; +import br.com.autonomiccs.apacheCloudStack.exceptions.ApacheCloudStackClientRuntimeException; @RunWith(MockitoJUnitRunner.class) public class ApacheCloudStackClientTest { @@ -538,4 +538,18 @@ public void getParametersForLoginTest() { Assert.assertEquals("domain", parametersForLogin.get(3).getValue()); Assert.assertEquals("domain", parametersForLogin.get(3).getName()); } + + @Test + public void executeUserLogoutTest() { + String urlRequest = "urlRequest"; + + Mockito.doReturn(urlRequest).when(apacheCloudStackClient).createApacheCloudStackApiUrlRequest(Mockito.any(ApacheCloudStackRequest.class), Mockito.eq(false)); + Mockito.doReturn("response").when(apacheCloudStackClient).executeRequestGetResponseAsString(Mockito.eq(urlRequest), Mockito.any(CloseableHttpClient.class), Mockito.any(HttpContext.class)); + + apacheCloudStackClient.executeUserLogout(Mockito.mock(CloseableHttpClient.class), Mockito.mock(HttpContext.class)); + + InOrder inOrder = Mockito.inOrder(apacheCloudStackClient); + inOrder.verify(apacheCloudStackClient).createApacheCloudStackApiUrlRequest(Mockito.any(ApacheCloudStackRequest.class), Mockito.eq(false)); + inOrder.verify(apacheCloudStackClient).executeRequestGetResponseAsString(Mockito.eq(urlRequest), Mockito.any(CloseableHttpClient.class), Mockito.any(HttpContext.class)); + } }