MCPcopy Index your code
hub / github.com/cschanck/single-file-java / testException

Method testException

src/test/java/org/sfj/ProxyMeTest.java:120–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

118 }
119
120 @Test
121 public void testException() {
122 AtomicReference<ProxyMe.Client<Closeable>> cRef = new AtomicReference<>(null);
123
124 ProxyMe.Client<Closeable>
125 client =
126 new ProxyMe.Client<>(Executors.newScheduledThreadPool(1), Closeable.class,
127 (i) -> cRef.get().complete(new ProxyMe.InvocationReturn<>(i.getIId(), null, new IOException())), 10,
128 TimeUnit.MILLISECONDS);
129
130 cRef.set(client);
131
132 Closeable closeProxy = client.clientProxy(Thread.currentThread().getContextClassLoader());
133
134 try {
135 closeProxy.close();
136 Assert.fail();
137 } catch (IOException e) {
138 }
139 }
140}

Callers

nothing calls this directly

Calls 6

clientProxyMethod · 0.95
completeMethod · 0.80
getIIdMethod · 0.80
getMethod · 0.65
closeMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected