use of com.tvd12.ezyfoxserver.command.impl.EzyStreamBytesImpl in project ezyfox-server by youngmonkeys.
the class EzyStreamBytesImplTest method exceptionCaseTest.
@Test
public void exceptionCaseTest() throws Exception {
EzySimpleSettings settings = new EzySimpleSettings();
settings.setDebug(true);
EzyStreamingApi streamingApi = spy(EzyStreamingApi.class);
doThrow(new IllegalArgumentException()).when(streamingApi).response(any(EzyBytesPackage.class));
EzySimpleServer server = new EzySimpleServer();
server.setStreamingApi(streamingApi);
server.setSettings(settings);
EzyStreamBytesImpl cmd = new EzyStreamBytesImpl(server);
EzySession recipient = spy(EzyAbstractSession.class);
cmd.execute(new byte[] { 1, 2, 3 }, recipient);
cmd.execute(new byte[] { 1, 2, 3 }, Lists.newArrayList(recipient));
}
use of com.tvd12.ezyfoxserver.command.impl.EzyStreamBytesImpl in project ezyfox-server by youngmonkeys.
the class EzyStreamBytesImplTest method normalCaseTest.
@Test
public void normalCaseTest() {
EzySimpleSettings settings = new EzySimpleSettings();
settings.setDebug(true);
EzyStreamingApi streamingApi = spy(EzyAbstractStreamingApi.class);
EzySimpleServer server = new EzySimpleServer();
server.setStreamingApi(streamingApi);
server.setSettings(settings);
EzyStreamBytesImpl cmd = new EzyStreamBytesImpl(server);
EzySession recipient = spy(EzyAbstractSession.class);
cmd.execute(new byte[] { 1, 2, 3 }, recipient);
cmd.execute(new byte[] { 1, 2, 3 }, Lists.newArrayList(recipient));
}
Aggregations