Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f6836d2
merge remote-tracking branch 'sourcerepo/migrate-to-central' into bat…
headshot786 Jan 5, 2019
7d56cb6
Adding Record/Playback feature
g2vinay Jan 22, 2019
f9c6e72
Reverting test config in pom
g2vinay Jan 22, 2019
64c78fc
updated gitignore
g2vinay Jan 22, 2019
0485c56
checkstyle config update.
g2vinay Jan 23, 2019
1eaf454
CI integration updates
g2vinay Feb 22, 2019
7c3df71
Merge branch 'master' into record-playback-integration
g2vinay Feb 22, 2019
ee00473
Recorded Tests + Refactor
g2vinay Feb 22, 2019
189cc5d
Playback config updates.
g2vinay Feb 23, 2019
f7807f2
Batch Tests refactor
g2vinay Feb 23, 2019
83ab63b
Test updates.
g2vinay Feb 23, 2019
df02aa9
Merge branch 'master' into record-playback-integration
g2vinay Feb 23, 2019
b6aa7f2
Playback mode credentials update.
g2vinay Feb 23, 2019
ea8e318
Task Tests update.
g2vinay Feb 23, 2019
9a72a2e
Code Refactor
g2vinay Feb 27, 2019
1b4c865
Merge branch 'master' into record-playback-integration
g2vinay Feb 27, 2019
93fd28b
Code Refactor + Pom update + Test Recordings Relocation
g2vinay Mar 5, 2019
713d80d
Code refactor
g2vinay Mar 6, 2019
6c1c2fe
Merge branch 'master' into record-playback-integration
g2vinay Mar 6, 2019
732e53a
test update.
g2vinay Mar 6, 2019
8e15dc7
code refactor
g2vinay Mar 6, 2019
d8c093a
Adding assume check.
g2vinay Mar 6, 2019
54db087
Added null check
g2vinay Mar 6, 2019
0da6a50
code refactor
g2vinay Mar 7, 2019
ef078ad
code refactor
g2vinay Mar 7, 2019
68bd688
Merge branch 'master' into record-playback-integration
g2vinay Mar 7, 2019
dcb3003
whitepace removal
g2vinay Mar 7, 2019
4c9e3e5
test update.
g2vinay Mar 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions batch/data-plane/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-resources</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this redundant?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No,
Both are referencing to different versions of the azure-mgmt-resources in the parent pom.
Both the versions are needed.

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-resources</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
<build>
<plugins>
Expand All @@ -83,6 +96,19 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<outputDirectory>${basedir}/target/test-classes/session-records</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/test/resources/test-recordings</directory>
</resource>
</resources>
</configuration>
</plugin>

</plugins>

</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ public BatchServiceClient protocolLayer() {

private BatchClient(BatchCredentials credentials) {
RestClient restClient = new RestClient.Builder()
.withBaseUrl(credentials.baseUrl())
.withCredentials(credentials)
.withSerializerAdapter(new AzureJacksonAdapter())
.withResponseBuilderFactory(new ResponseBuilder.Factory() {
private final AzureResponseBuilder.Factory baseFactory = new AzureResponseBuilder.Factory();
@Override
public <T, E extends RestException> ResponseBuilder<T, E> newInstance(SerializerAdapter<?> serializerAdapter) {
return baseFactory.<T, E>newInstance(serializerAdapter).withThrowOnGet404(true);
}
})
.build();
.withBaseUrl(credentials.baseUrl())
.withCredentials(credentials)
.withSerializerAdapter(new AzureJacksonAdapter())
.withResponseBuilderFactory(new ResponseBuilder.Factory() {
private final AzureResponseBuilder.Factory baseFactory = new AzureResponseBuilder.Factory();
@Override
public <T, E extends RestException> ResponseBuilder<T, E> newInstance(SerializerAdapter<?> serializerAdapter) {
return baseFactory.<T, E>newInstance(serializerAdapter).withThrowOnGet404(true);
}
})
.build();

this.protocolLayer = new BatchServiceClientImpl(restClient).withBatchUrl(credentials.baseUrl());
this.customBehaviors = new LinkedList<>();
this.customBehaviors.add(new ClientRequestIdInterceptor());
Expand All @@ -70,6 +71,21 @@ public <T, E extends RestException> ResponseBuilder<T, E> newInstance(Serializer
this.computeNodeOperations = new ComputeNodeOperations(this, customBehaviors());
}

private BatchClient(RestClient restClient, String baseUrl) {
this.protocolLayer = new BatchServiceClientImpl(restClient).withBatchUrl(baseUrl);
this.customBehaviors = new LinkedList<>();
this.customBehaviors.add(new ClientRequestIdInterceptor());
this.certificateOperations = new CertificateOperations(this, customBehaviors());
this.jobOperations = new JobOperations(this, customBehaviors());
this.taskOperations = new TaskOperations(this, customBehaviors());
this.jobScheduleOperations = new JobScheduleOperations(this, customBehaviors());
this.poolOperations = new PoolOperations(this, customBehaviors());
this.fileOperations = new FileOperations(this, customBehaviors());
this.applicationOperations = new ApplicationOperations(this, customBehaviors());
this.accountOperations = new AccountOperations(this, customBehaviors());
this.computeNodeOperations = new ComputeNodeOperations(this, customBehaviors());
}

/**
* Creates an instance of {@link BatchClient} associated with the specified credentials.
*
Expand All @@ -80,6 +96,18 @@ public static BatchClient open(BatchCredentials credentials) {
return new BatchClient(credentials);
}

/**
* Creates an instance of {@link BatchClient} associated with the specified restClient and baseurl.
*
* @param restClient A {@link RestClient} object specifying the definition of rest client used to
* interact with batch endpoint.
* @param baseUrl A String object specifying the the batch end point.
* @return The new {@link BatchClient} instance.
*/
static BatchClient open(RestClient restClient, String baseUrl) {
return new BatchClient(restClient, baseUrl);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need new public API? This could probably be package-protected?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyvault has a public client constructor with RestClient as a parameter.
Had this public to keep it consistent.
But changed it to protected and Batch team can choose to expose it later, if needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand why we need this new public API? Can it be package-protected (i.e. with no modifier and therefore not public API)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be github glitch.
I already changed it to protected

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not protected, package-protected (with no modifier)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean package-private (no modifier) ?
https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
Got confused.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to package-private.


/**
* Gets a {@link CertificateOperations} object for performing certificate-related operations on the associated account.
*
Expand Down
Loading