SendAsciiAction extends AsciiAction { @Override public void execute(State state) throws WorkflowExecutionException { TlsContext tlsContext = state.getTlsContext(); if (isExecuted()) { throw new WorkflowExecutionException("Action already executed!"); } try { LOGGER.info("Sending ASCII message: " + getAsciiText()); tlsContext.getTransportHandler().sendData(getAsciiText().getBytes(getEncoding())); setExecuted(true); } catch (IOException E) { LOGGER.debug(E); setExecuted(false); } } private  SendAsciiAction();  SendAsciiAction(String asciiString, String encoding);  SendAsciiAction(String encoding); @Override void execute(State state); @Override void reset(); @Override boolean executedAsPlanned();  }
@Test public void testExecute() throws IOException { action.execute(state); assertTrue(action.isExecuted()); }
@Test(expected = WorkflowExecutionException.class) public void testExecuteWorkflowExecutionException() throws IOException { action.execute(state); action.execute(state); }