@Test public void testComplexMagicData() { InterpreterResult result = null; result = new InterpreterResult(InterpreterResult.Code.SUCCESS, "some text before\n%table col1\tcol2\naaa\t123\n"); assertEquals("text before %table", "some text before\n", result.message().get(0).getData()); assertEquals("text after %table", "col1\tcol2\naaa\t123\n", result.message().get(1).getData()); result = new InterpreterResult(InterpreterResult.Code.SUCCESS, "%html <h3> This is a hack </h3>\n%table\ncol1\tcol2\naaa\t123\n"); assertEquals(" <h3> This is a hack </h3>\n", result.message().get(0).getData()); assertEquals("col1\tcol2\naaa\t123\n", result.message().get(1).getData()); result = new InterpreterResult(InterpreterResult.Code.SUCCESS, "some text before magic word\n%table col1\tcol2\naaa\t123\n\n%html <h3> This is a hack </h3>"); assertEquals("<h3> This is a hack </h3>", result.message().get(2).getData()); result = new InterpreterResult(InterpreterResult.Code.SUCCESS, "%table col1\tcol2\naaa\t123\n\n%html <h3> This is a hack </h3>\n%table col1\naaa\n123\n"); assertEquals("col1\naaa\n123\n", result.message().get(2).getData()); result = new InterpreterResult(InterpreterResult.Code.SUCCESS, "%table " + "col1\tcol2\naaa\t123\n\n%table col1\naaa\n123\n"); assertEquals("col1\tcol2\naaa\t123\n", result.message().get(0).getData()); assertEquals("col1\naaa\n123\n", result.message().get(1).getData()); }
public List<InterpreterResultMessage> message() { return msg; }
InterpreterResult implements Serializable { public List<InterpreterResultMessage> message() { return msg; } }
InterpreterResult implements Serializable { public List<InterpreterResultMessage> message() { return msg; } InterpreterResult(Code code);  InterpreterResult(Code code, List<InterpreterResultMessage> msgs);  InterpreterResult(Code code, String msg);  InterpreterResult(Code code, Type type, String msg); }
InterpreterResult implements Serializable { public List<InterpreterResultMessage> message() { return msg; } InterpreterResult(Code code);  InterpreterResult(Code code, List<InterpreterResultMessage> msgs);  InterpreterResult(Code code, String msg);  InterpreterResult(Code code, Type type, String msg); void add(String msg); void add(Type type, String data); Code code(); List<InterpreterResultMessage> message(); String toString(); }
InterpreterResult implements Serializable { public List<InterpreterResultMessage> message() { return msg; } InterpreterResult(Code code);  InterpreterResult(Code code, List<InterpreterResultMessage> msgs);  InterpreterResult(Code code, String msg);  InterpreterResult(Code code, Type type, String msg); void add(String msg); void add(Type type, String data); Code code(); List<InterpreterResultMessage> message(); String toString();  }