Skip to content

Commit

Permalink
Merge commit '97bc529bbb06017de0bb069012c016c2949157be' into javavnext
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghaolu committed May 25, 2016
2 parents f116efa + 4736d63 commit faf7508
Show file tree
Hide file tree
Showing 10 changed files with 393 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ android:
- extra-android-m2repository
sudo: false
script:
- mvn clean package
- mvn clean install
- mvn checkstyle:check
- cd ./azure-android-client-authentication && ./gradlew check
7 changes: 4 additions & 3 deletions azure-client-authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ apply plugin: 'checkstyle'
version = '1.0.0-SNAPSHOT'

checkstyle {
configFile = new File("$rootDir/Tools/checkstyle/checkstyle.xml")
configProperties = [samedir: "$rootDir/Tools/checkstyle"]
reportsDir = new File("$rootDir/Tools/checkstyle/reports")
toolVersion = "6.18"
configFile = new File("$rootDir/ClientRuntimes/Java/build-tools/src/main/resources/checkstyle.xml")
configProperties = [samedir: "$rootDir/ClientRuntimes/Java/build-tools/src/main/resources"]
reportsDir = new File("$rootDir/ClientRuntimes/Java/build-tools/reports")
}

dependencies {
Expand Down
8 changes: 4 additions & 4 deletions azure-client-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ apply plugin: 'checkstyle'
version = '1.0.0-SNAPSHOT'

checkstyle {
toolVersion = "6.9"
configFile = new File("$rootDir/Tools/checkstyle/checkstyle.xml")
configProperties = [samedir: "$rootDir/Tools/checkstyle"]
reportsDir = new File("$rootDir/Tools/checkstyle/reports")
toolVersion = "6.18"
configFile = new File("$rootDir/ClientRuntimes/Java/build-tools/src/main/resources/checkstyle.xml")
configProperties = [samedir: "$rootDir/ClientRuntimes/Java/build-tools/src/main/resources"]
reportsDir = new File("$rootDir/ClientRuntimes/Java/build-tools/reports")
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.ServiceResponseCallback;
import com.microsoft.rest.ServiceResponseWithHeaders;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Url;

import java.io.IOException;
import java.lang.reflect.Type;
Expand All @@ -22,13 +28,6 @@
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Url;

/**
* An instance of this class defines a ServiceClient that handles polling and
* retrying for long running operations when accessing Azure resources.
Expand Down Expand Up @@ -288,8 +287,7 @@ public <T> ServiceResponse<T> getPostOrDeleteResult(Response<ResponseBody> respo
}

// Check if operation failed
if (AzureAsyncOperation.getFailedStatuses().contains(pollingState.getStatus()))
{
if (AzureAsyncOperation.getFailedStatuses().contains(pollingState.getStatus())) {
throw new CloudException("Async operation failed");
}

Expand Down Expand Up @@ -778,7 +776,7 @@ class PutPatchPollingTask<T> extends AsyncPollingTask<T> {
* @param serviceCall the ServiceCall object tracking Retrofit calls.
* @param clientCallback the client callback to call when a terminal status is hit.
*/
public PutPatchPollingTask(final PollingState<T> pollingState, final String url, final ServiceCall serviceCall, final ServiceCallback<T> clientCallback) {
PutPatchPollingTask(final PollingState<T> pollingState, final String url, final ServiceCall serviceCall, final ServiceCallback<T> clientCallback) {
this.serviceCall = serviceCall;
this.pollingState = pollingState;
this.url = url;
Expand Down Expand Up @@ -835,7 +833,7 @@ class PostDeletePollingTask<T> extends AsyncPollingTask<T> {
* @param serviceCall the ServiceCall object tracking Retrofit calls.
* @param clientCallback the client callback to call when a terminal status is hit.
*/
public PostDeletePollingTask(final PollingState<T> pollingState, final ServiceCall serviceCall, final ServiceCallback<T> clientCallback) {
PostDeletePollingTask(final PollingState<T> pollingState, final ServiceCall serviceCall, final ServiceCallback<T> clientCallback) {
this.serviceCall = serviceCall;
this.pollingState = pollingState;
this.clientCallback = clientCallback;
Expand Down Expand Up @@ -867,8 +865,7 @@ public void run() {
}
} else {
// Check if operation failed
if (AzureAsyncOperation.getFailedStatuses().contains(pollingState.getStatus()))
{
if (AzureAsyncOperation.getFailedStatuses().contains(pollingState.getStatus())) {
clientCallback.failure(new ServiceException("Async operation failed"));
} else {
clientCallback.success(new ServiceResponse<>(pollingState.getResource(), pollingState.getResponse()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import com.microsoft.rest.RestException;

import javax.xml.bind.DataBindingException;
import javax.xml.ws.WebServiceException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
Expand All @@ -17,9 +19,6 @@
import java.util.ListIterator;
import java.util.NoSuchElementException;

import javax.xml.bind.DataBindingException;
import javax.xml.ws.WebServiceException;

/**
* Defines a list response from a paging operation. The pages are
* lazy initialized when an instance of this class is iterated.
Expand Down Expand Up @@ -128,7 +127,7 @@ private class ListItr implements ListIterator<E> {
*
* @param index the position in the list to start.
*/
public ListItr(int index) {
ListItr(int index) {
itemsListItr = items.listIterator(index);
}

Expand Down
47 changes: 47 additions & 0 deletions build-tools/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>autorest-clientruntime-for-java</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>autorest-build-tools</artifactId>
<packaging>jar</packaging>

<name>Build tools for AutoRest client runtime for Java</name>
<description>This package contains the build tools for AutoRest generated Java clients.</description>
<url>https://github.com/Azure/autorest-clientruntime-for-java</url>

<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>scm:git:https://github.com/Azure/autorest-clientruntime-for-java</url>
<connection>scm:git:[email protected]:Azure/autorest-clientruntime-for-java.git</connection>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>

<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>
</project>
Loading

0 comments on commit faf7508

Please sign in to comment.