List of usage examples for io.netty.util AbstractReferenceCounted AbstractReferenceCounted
AbstractReferenceCounted
From source file:com.linecorp.armeria.common.stream.AbstractStreamMessageAndWriterTest.java
License:Apache License
@Test public void rejectReferenceCounted() { AbstractReferenceCounted item = new AbstractReferenceCounted() { @Override/*from ww w.j a va 2 s. c om*/ protected void deallocate() { } @Override public ReferenceCounted touch(Object hint) { return this; } }; StreamMessageAndWriter<Object> stream = newStreamWriter(ImmutableList.of(item)); assertThatThrownBy(() -> stream.write(item)).isInstanceOf(IllegalArgumentException.class); }
From source file:com.linecorp.armeria.common.stream.DefaultStreamMessageTest.java
License:Apache License
@Test public void rejectReferenceCounted() { final DefaultStreamMessage<Object> m = new DefaultStreamMessage<>(); assertThatThrownBy(() -> m.write(new AbstractReferenceCounted() { @Override// ww w .j av a 2s. c om protected void deallocate() { } @Override public ReferenceCounted touch(Object hint) { return this; } })).isInstanceOf(IllegalArgumentException.class); }