MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / nested

Method nested

test/utils/TestExceptions.java:47–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 }
46
47 @Test
48 public void nested() throws Exception {
49 final RuntimeException ex = new RuntimeException("Boo!");
50 deferreds.add(Deferred.fromError(ex));
51
52 final ArrayList<Deferred<Object>> deferreds2 =
53 new ArrayList<Deferred<Object>>(1);
54 deferreds2.add(Deferred.fromResult(null));
55
56 class LOne implements
57 Callback<Deferred<ArrayList<Object>>, ArrayList<Object>> {
58 @Override
59 public Deferred<ArrayList<Object>> call(final ArrayList<Object> piff)
60 throws Exception {
61 return Deferred.group(deferreds);
62 }
63 }
64
65 try {
66 Deferred.group(deferreds2).addCallbackDeferring(new LOne()).join();
67 fail("Expected a DeferredGroupException");
68 } catch (DeferredGroupException dge) {
69 assertSame(ex, Exceptions.getCause(dge));
70 }
71 }
72
73}

Callers

nothing calls this directly

Calls 3

getCauseMethod · 0.95
addMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected