Skip to content

Commit

Permalink
Add Base Test Compile using Java 8 when JDK is 9 or Above (Azure#26392)
Browse files Browse the repository at this point in the history
Add Base Test Compile using Java 8 when JDK is 9 or Above
  • Loading branch information
alzimmermsft authored and rickle-msft committed Jan 13, 2022
1 parent 79f45aa commit e16fad9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,19 @@ private Flux<ByteBuffer> getDownloadStream(long offset, Long count) {
});

case DR_TEST_SCENARIO_NO_MULTIPLE_SUBSCRIPTION:
if (this.subscribed) {
return Flux.error(new IllegalStateException("Cannot subscribe to the same flux twice"));
case DR_TEST_SCENARIO_SUCCESSFUL_STREAM_FAILURES:
// Java 8 compiler didn't like the previous fall-through case structure
if (this.scenario == DR_TEST_SCENARIO_NO_MULTIPLE_SUBSCRIPTION) {
if (this.subscribed) {
return Flux.error(new IllegalStateException("Cannot subscribe to the same flux twice"));
}
this.subscribed = true;
}
this.subscribed = true;
// fall through to test data

case DR_TEST_SCENARIO_SUCCESSFUL_STREAM_FAILURES:
if (this.tryNumber <= 3) {
// tryNumber is 1 indexed, so we have to sub 1.
if (offset != (this.tryNumber - 1) * 256
|| count != this.scenarioData.remaining() - (this.tryNumber - 1) * 256) {
if (offset != (this.tryNumber - 1L) * 256
|| count != this.scenarioData.remaining() - (this.tryNumber - 1L) * 256) {
return Flux.error(new IllegalArgumentException("Info values are incorrect."));
}

Expand All @@ -120,8 +122,8 @@ private Flux<ByteBuffer> getDownloadStream(long offset, Long count) {

return dataStream.concatWith(Flux.error(e));
}
if (offset != (this.tryNumber - 1) * 256
|| count != this.scenarioData.remaining() - (this.tryNumber - 1) * 256) {
if (offset != (this.tryNumber - 1L) * 256
|| count != this.scenarioData.remaining() - (this.tryNumber - 1L) * 256) {
return Flux.error(new IllegalArgumentException("Info values are incorrect."));
}
ByteBuffer toSend = this.scenarioData.duplicate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.lang.reflect.InvocationTargetException;

@SuppressWarnings({"rawtypes", "unchecked"})
public class RequiredServiceVersionExtension implements IAnnotationDrivenExtension<RequiredServiceVersion> {

@Override
Expand Down

0 comments on commit e16fad9

Please sign in to comment.