Skip to content

Commit

Permalink
Removes superfluous creation of processors for SubscriberWhiteboxVeri…
Browse files Browse the repository at this point in the history
…fication
  • Loading branch information
viktorklang committed Feb 16, 2015
1 parent 6efc7c6 commit feb1d2e
Showing 1 changed file with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public void untested_spec213_failingOnSignalInvocation() throws Exception {
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.13
@Override @Test
public void required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull() throws Throwable {
subscriberTest(new TestStageTestRun() {
subscriberTestWithoutSetup(new TestStageTestRun() {
@Override
public void run(WhiteboxTestStage stage) throws Throwable {

Expand All @@ -365,13 +365,18 @@ public void run(WhiteboxTestStage stage) throws Throwable {
}// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.13
@Override @Test
public void required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNull() throws Throwable {
subscriberTest(new TestStageTestRun() {
subscriberTestWithoutSetup(new TestStageTestRun() {
@Override
public void run(WhiteboxTestStage stage) throws Throwable {

final Subscription subscription = new Subscription() {
@Override public void request(final long elements) {}
@Override public void cancel() {}
@Override
public void request(final long elements) {
}

@Override
public void cancel() {
}
};

{
Expand All @@ -380,7 +385,7 @@ public void run(WhiteboxTestStage stage) throws Throwable {
sub.onSubscribe(subscription);
try {
sub.onNext(null);
} catch(final NullPointerException expected) {
} catch (final NullPointerException expected) {
gotNPE = true;
}
assertTrue(gotNPE, "onNext(null) did not throw NullPointerException");
Expand All @@ -394,13 +399,18 @@ public void run(WhiteboxTestStage stage) throws Throwable {
// Verifies rule: https://github.com/reactive-streams/reactive-streams#2.13
@Override @Test
public void required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull() throws Throwable {
subscriberTest(new TestStageTestRun() {
subscriberTestWithoutSetup(new TestStageTestRun() {
@Override
public void run(WhiteboxTestStage stage) throws Throwable {

final Subscription subscription = new Subscription() {
@Override public void request(final long elements) {}
@Override public void cancel() {}
@Override
public void request(final long elements) {
}

@Override
public void cancel() {
}
};

{
Expand All @@ -409,7 +419,7 @@ public void run(WhiteboxTestStage stage) throws Throwable {
sub.onSubscribe(subscription);
try {
sub.onError(null);
} catch(final NullPointerException expected) {
} catch (final NullPointerException expected) {
gotNPE = true;
}
assertTrue(gotNPE, "onError(null) did not throw NullPointerException");
Expand Down

1 comment on commit feb1d2e

@smaldini
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't work for me, #222 should tho.

Please sign in to comment.