Channel { @Override public String toString() { return "Channel{" + "queue=" + queue + ", readers=" + readers + ", exec=" + exec + ", closed=" + closed + '}'; } Channel(final VMExecutor exec); @SuppressFBWarnings("URV_UNRELATED_RETURN_VALUES") Object read(); void write(final Object obj); void close(); @Override String toString(); static final Object EOF; }
@Test public void test() throws CompileException, ExecutionException, InterruptedException, IOException { String ctest = Resources.toString(Resources.getResource(ChannelTest.class, "channel.zel"), StandardCharsets.US_ASCII); Program p = Program.compile(ctest); Integer result = (Integer) p.execute(); Assert.assertEquals(4950, result.intValue()); }