| 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 | } |