use of java.lang.Override in project wire by square.
the class RedactedRepeated method newBuilder.
@Override
public Builder newBuilder() {
Builder builder = new Builder();
builder.a = Internal.copyOf("a", a);
builder.b = Internal.copyOf("b", b);
builder.addUnknownFields(unknownFields());
return builder;
}
use of java.lang.Override in project wire by square.
the class RedactedRequired method newBuilder.
@Override
public Builder newBuilder() {
Builder builder = new Builder();
builder.a = a;
builder.addUnknownFields(unknownFields());
return builder;
}
use of java.lang.Override in project wire by square.
the class C method newBuilder.
@Override
public Builder newBuilder() {
Builder builder = new Builder();
builder.i = i;
builder.addUnknownFields(unknownFields());
return builder;
}
use of java.lang.Override in project facebook-android-sdk by facebook.
the class BatchRequestTests method testBatchOnProgressCallbackIsCalled.
@LargeTest
public void testBatchOnProgressCallbackIsCalled() {
final AtomicInteger count = new AtomicInteger();
final AccessToken accessToken = getAccessTokenForSharedUser();
String appId = getApplicationId();
GraphRequest.setDefaultBatchApplicationId(appId);
GraphRequest request1 = GraphRequest.newGraphPathRequest(accessToken, "4", null);
assertNotNull(request1);
GraphRequest request2 = GraphRequest.newGraphPathRequest(accessToken, "4", null);
assertNotNull(request2);
GraphRequestBatch batch = new GraphRequestBatch(request1, request2);
batch.addCallback(new GraphRequestBatch.OnProgressCallback() {
@Override
public void onBatchCompleted(GraphRequestBatch batch) {
}
@Override
public void onBatchProgress(GraphRequestBatch batch, long current, long max) {
count.incrementAndGet();
}
});
batch.executeAndWait();
assertEquals(1, count.get());
}
use of java.lang.Override in project reactive-streams-jvm by reactive-streams.
the class PublisherVerification method optional_spec104_mustSignalOnErrorWhenFails.
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.4
@Override
@Test
public void optional_spec104_mustSignalOnErrorWhenFails() throws Throwable {
try {
whenHasErrorPublisherTest(new PublisherTestRun<T>() {
@Override
public void run(final Publisher<T> pub) throws InterruptedException {
final Latch onErrorlatch = new Latch(env);
final Latch onSubscribeLatch = new Latch(env);
pub.subscribe(new TestEnvironment.TestSubscriber<T>(env) {
@Override
public void onSubscribe(Subscription subs) {
onSubscribeLatch.assertOpen("Only one onSubscribe call expected");
onSubscribeLatch.close();
}
@Override
public void onError(Throwable cause) {
onSubscribeLatch.assertClosed("onSubscribe should be called prior to onError always");
onErrorlatch.assertOpen(String.format("Error-state Publisher %s called `onError` twice on new Subscriber", pub));
onErrorlatch.close();
}
});
onSubscribeLatch.expectClose("Should have received onSubscribe");
onErrorlatch.expectClose(String.format("Error-state Publisher %s did not call `onError` on new Subscriber", pub));
env.verifyNoAsyncErrors();
}
});
} catch (SkipException se) {
throw se;
} catch (Throwable ex) {
// which was wrong of him - he should have signalled on error using onError
throw new RuntimeException(String.format("Publisher threw exception (%s) instead of signalling error via onError!", ex.getMessage()), ex);
}
}
Aggregations