@Override public void bye() throws IOException { // Close slimServer thread if (slimServerThread.isAlive()) { SlimStreamReader.sendSlimMessage(clientOutput, SlimVersion.BYEMESSAGE); } }
@Override public void bye() throws IOException { // Close slimServer thread if (slimServerThread.isAlive()) { SlimStreamReader.sendSlimMessage(clientOutput, SlimVersion.BYEMESSAGE); } }
private boolean processOneSetOfInstructions(SlimStreamReader reader, OutputStream writer, ListExecutor executor) throws IOException { String instructions = reader.getSlimMessage(); // Not sure why this is need but we keep it. if (instructions == null) return true; // We are done Bye Bye message received if (instructions.equalsIgnoreCase(SlimVersion.BYEMESSAGE)) { return false; } // Do some real work String resultString = executeInstructions(executor, instructions); SlimStreamReader.sendSlimMessage(writer, resultString); return true; }
private boolean processOneSetOfInstructions(SlimStreamReader reader, OutputStream writer, ListExecutor executor) throws IOException { String instructions = reader.getSlimMessage(); // Not sure why this is need but we keep it. if (instructions == null) return true; // We are done Bye Bye message received if (instructions.equalsIgnoreCase(SlimVersion.BYEMESSAGE)) { return false; } // Do some real work String resultString = executeInstructions(executor, instructions); SlimStreamReader.sendSlimMessage(writer, resultString); return true; }
@Override public void bye() throws IOException { SlimStreamReader.sendSlimMessage(writer, SlimVersion.BYEMESSAGE); slimRunner.join(); kill(); }
@Override public void bye() throws IOException { SlimStreamReader.sendSlimMessage(writer, SlimVersion.BYEMESSAGE); slimRunner.join(); kill(); }
@Override public Map<String, Object> invokeAndGetResponse(List<Instruction> statements) throws SlimCommunicationException { if (statements.isEmpty()) return Collections.emptyMap(); String instructions = SlimSerializer.serialize(new SlimListBuilder(slimServerVersion).toList(statements)); String results; try { SlimStreamReader.sendSlimMessage(clientOutput, instructions); results = reader.getSlimMessage(); } catch (IOException e) { throw new SlimCommunicationException("Could not send/receive data with SUT", e); } List<Object> resultList = SlimDeserializer.deserialize(results); return resultToMap(resultList); }
@Override public Map<String, Object> invokeAndGetResponse(List<Instruction> statements) throws SlimCommunicationException { if (statements.isEmpty()) return Collections.emptyMap(); String instructions = SlimSerializer.serialize(new SlimListBuilder(slimServerVersion).toList(statements)); String results; try { SlimStreamReader.sendSlimMessage(clientOutput, instructions); results = reader.getSlimMessage(); } catch (IOException e) { throw new SlimCommunicationException("Could not send/receive data with SUT", e); } List<Object> resultList = SlimDeserializer.deserialize(results); return resultToMap(resultList); }
@Override public Map<String, Object> invokeAndGetResponse(List<Instruction> statements) throws SlimCommunicationException { if (statements.isEmpty()) return Collections.emptyMap(); String instructions = SlimSerializer.serialize(new SlimListBuilder(slimServerVersion).toList(statements)); String results; try { SlimStreamReader.sendSlimMessage(writer, instructions); results = reader.getSlimMessage(); } catch (IOException e) { throw new SlimCommunicationException("Could not send/receive data with SUT", e); } List<Object> resultList = SlimDeserializer.deserialize(results); return resultToMap(resultList); }
@Override public Map<String, Object> invokeAndGetResponse(List<Instruction> statements) throws SlimCommunicationException { if (statements.isEmpty()) return Collections.emptyMap(); String instructions = SlimSerializer.serialize(new SlimListBuilder(slimServerVersion).toList(statements)); String results; try { SlimStreamReader.sendSlimMessage(writer, instructions); results = reader.getSlimMessage(); } catch (IOException e) { throw new SlimCommunicationException("Could not send/receive data with SUT", e); } List<Object> resultList = SlimDeserializer.deserialize(results); return resultToMap(resultList); }