Skip to content

Commit

Permalink
Merge commit '4aa3dd4b847e747387475e9249c4aba97b6ef8ac' into paramhos…
Browse files Browse the repository at this point in the history
…tfix

Conflicts:
	runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/DAGNode.java
	runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/DAGraph.java
	runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/Graph.java
	runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/Node.java
	runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroup.java
	runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java
	runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/TaskItem.java
  • Loading branch information
jianghaolu committed Jun 8, 2016
2 parents 24d5c1e + 1ae4191 commit 14b071c
Show file tree
Hide file tree
Showing 18 changed files with 240 additions and 177 deletions.
2 changes: 1 addition & 1 deletion azure-android-client-authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ task javadocJar(type: Jar, dependsOn: [javadoc]) {
artifacts {
archives sourcesJar
archives javadocJar
}
}
2 changes: 1 addition & 1 deletion azure-client-authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ test {
reports.html.destination = file("${projectDir}/../../../TestResults/JavaAzureRuntime")
}

tasks.compileJava.dependsOn 'clean'
tasks.compileJava.dependsOn 'clean'
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public <T> ServiceResponse<T> getPutOrPatchResult(Response<ResponseBody> respons

int statusCode = response.code();
ResponseBody responseBody;
if (response.isSuccess()) {
if (response.isSuccessful()) {
responseBody = response.body();
} else {
responseBody = response.errorBody();
Expand Down Expand Up @@ -164,7 +164,7 @@ public <T> AsyncPollingTask<T> getPutOrPatchResultAsync(Response<ResponseBody> r

int statusCode = response.code();
ResponseBody responseBody;
if (response.isSuccess()) {
if (response.isSuccessful()) {
responseBody = response.body();
} else {
responseBody = response.errorBody();
Expand Down Expand Up @@ -252,7 +252,7 @@ public <T> ServiceResponse<T> getPostOrDeleteResult(Response<ResponseBody> respo

int statusCode = response.code();
ResponseBody responseBody;
if (response.isSuccess()) {
if (response.isSuccessful()) {
responseBody = response.body();
} else {
responseBody = response.errorBody();
Expand Down Expand Up @@ -337,7 +337,7 @@ public <T> AsyncPollingTask<T> getPostOrDeleteResultAsync(Response<ResponseBody>

int statusCode = response.code();
ResponseBody responseBody;
if (response.isSuccess()) {
if (response.isSuccessful()) {
responseBody = response.body();
} else {
responseBody = response.errorBody();
Expand Down Expand Up @@ -730,7 +730,7 @@ public Integer getLongRunningOperationRetryTimeout() {
*
* @param longRunningOperationRetryTimeout the time in milliseconds.
*/
public void setLongRunningOperationRetryTimeout(Integer longRunningOperationRetryTimeout) {
public void withLongRunningOperationRetryTimeout(Integer longRunningOperationRetryTimeout) {
this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
*/

package com.microsoft.azure;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
*/

package com.microsoft.azure;

import java.util.ArrayDeque;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
*/

package com.microsoft.azure;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
*/

package com.microsoft.azure;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
*/

package com.microsoft.azure;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
*/

package com.microsoft.azure;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
*/

package com.microsoft.azure;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/**
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
*/

package com.microsoft.azure;

import org.junit.Assert;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class DAGraphTests {
@Test
public void testDAGraphGetNext() {
/**
* |-------->[D]------>[B]-----------[A]
* | ^ ^
* | | |
* [F]------->[E]-------| |
* | | |
* | |------->[G]----->[C]----
* |
* |-------->[H]-------------------->[I]
*/
List<String> expectedOrder = new ArrayList<>();
expectedOrder.add("A"); expectedOrder.add("I");
expectedOrder.add("B"); expectedOrder.add("C"); expectedOrder.add("H");
expectedOrder.add("D"); expectedOrder.add("G");
expectedOrder.add("E");
expectedOrder.add("F");

DAGNode<String> nodeA = new DAGNode<>("A", "dataA");
DAGNode<String> nodeI = new DAGNode<>("I", "dataI");

DAGNode<String> nodeB = new DAGNode<>("B", "dataB");
nodeB.addDependency(nodeA.key());

DAGNode<String> nodeC = new DAGNode<>("C", "dataC");
nodeC.addDependency(nodeA.key());

DAGNode<String> nodeH = new DAGNode<>("H", "dataH");
nodeH.addDependency(nodeI.key());

DAGNode<String> nodeG = new DAGNode<>("G", "dataG");
nodeG.addDependency(nodeC.key());

DAGNode<String> nodeE = new DAGNode<>("E", "dataE");
nodeE.addDependency(nodeB.key());
nodeE.addDependency(nodeG.key());

DAGNode<String> nodeD = new DAGNode<>("D", "dataD");
nodeD.addDependency(nodeB.key());


DAGNode<String> nodeF = new DAGNode<>("F", "dataF");
nodeF.addDependency(nodeD.key());
nodeF.addDependency(nodeE.key());
nodeF.addDependency(nodeH.key());

DAGraph<String, DAGNode<String>> dag = new DAGraph<>(nodeF);
dag.addNode(nodeA);
dag.addNode(nodeB);
dag.addNode(nodeC);
dag.addNode(nodeD);
dag.addNode(nodeE);
dag.addNode(nodeG);
dag.addNode(nodeH);
dag.addNode(nodeI);

dag.populateDependentKeys();
DAGNode<String> nextNode = dag.getNext();
int i = 0;
while (nextNode != null) {
Assert.assertEquals(nextNode.key(), expectedOrder.get(i));
dag.reportedCompleted(nextNode);
nextNode = dag.getNext();
i++;
}

System.out.println("done");
}

@Test
public void testGraphMerge() {
/**
* |-------->[D]------>[B]-----------[A]
* | ^ ^
* | | |
* [F]------->[E]-------| |
* | | |
* | |------->[G]----->[C]----
* |
* |-------->[H]-------------------->[I]
*/
List<String> expectedOrder = new ArrayList<>();
expectedOrder.add("A"); expectedOrder.add("I");
expectedOrder.add("B"); expectedOrder.add("C"); expectedOrder.add("H");
expectedOrder.add("D"); expectedOrder.add("G");
expectedOrder.add("E");
expectedOrder.add("F");

DAGraph<String, DAGNode<String>> graphA = createGraph("A");
DAGraph<String, DAGNode<String>> graphI = createGraph("I");

DAGraph<String, DAGNode<String>> graphB = createGraph("B");
graphA.merge(graphB);

DAGraph<String, DAGNode<String>> graphC = createGraph("C");
graphA.merge(graphC);

DAGraph<String, DAGNode<String>> graphH = createGraph("H");
graphI.merge(graphH);

DAGraph<String, DAGNode<String>> graphG = createGraph("G");
graphC.merge(graphG);

DAGraph<String, DAGNode<String>> graphE = createGraph("E");
graphB.merge(graphE);
graphG.merge(graphE);

DAGraph<String, DAGNode<String>> graphD = createGraph("D");
graphB.merge(graphD);

DAGraph<String, DAGNode<String>> graphF = createGraph("F");
graphD.merge(graphF);
graphE.merge(graphF);
graphH.merge(graphF);

DAGraph<String, DAGNode<String>> dag = graphF;
dag.prepare();

DAGNode<String> nextNode = dag.getNext();
int i = 0;
while (nextNode != null) {
Assert.assertEquals(expectedOrder.get(i), nextNode.key());
// Process the node
dag.reportedCompleted(nextNode);
nextNode = dag.getNext();
i++;
}
}

private DAGraph<String, DAGNode<String>> createGraph(String resourceName) {
DAGNode<String> node = new DAGNode<>(resourceName, "data" + resourceName);
DAGraph<String, DAGNode<String>> graph = new DAGraph<>(node);
return graph;
}
}
14 changes: 6 additions & 8 deletions client-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ checkstyle {

dependencies {
compile 'com.google.guava:guava:18.0'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okio:okio:1.7.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.1.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.1.1'
compile 'com.squareup.retrofit2:converter-jackson:2.0.0-beta4'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.1'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.7.1'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.3.1'
compile 'com.squareup.retrofit2:converter-jackson:2.0.2'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.7.2'
compile 'org.apache.commons:commons-lang3:3.4'
testCompile 'junit:junit:4.12'
testCompile 'junit:junit-dep:4.11'
Expand Down
8 changes: 0 additions & 8 deletions client-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
Expand All @@ -75,10 +71,6 @@
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
Expand Down

This file was deleted.

Loading

0 comments on commit 14b071c

Please sign in to comment.