use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class PegdownParserTest method testInlineCode.
@Test
public void testInlineCode() {
InterpreterResult result = md.interpret("Inline `code` has `back-ticks around` it.", null);
assertEquals(wrapWithMarkdownClassDiv("<p>Inline <code>code</code> has <code>back-ticks around</code> it.</p>"), result.message().get(0).getData());
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class PegdownParserTest method testYumlPlugin.
@Test
public void testYumlPlugin() {
String input = new StringBuilder().append("\n \n %%% yuml style=nofunky scale=120 format=svg\n").append("[Customer]<>-orders>[Order]\n").append("[Order]++-0..>[LineItem]\n").append("[Order]-[note:Aggregate root.]\n").append(" %%% ").toString();
InterpreterResult result = md.interpret(input, null);
assertThat(result.message().get(0).getData(), CoreMatchers.containsString("<img src=\"http://yuml.me/diagram/"));
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class PegdownParserTest method testAlignedTable.
@Test
public void testAlignedTable() {
String input = new StringBuilder().append("| First Header | Second Header | Third Header |\n").append("| :----------- | :-----------: | -------------------: |\n").append("| First row | Data | Very long data entry |\n").append("| Second row | **Cell** | *Cell* |").toString();
String expected = new StringBuilder().append("<table>\n").append(" <thead>\n").append(" <tr>\n").append(" <th align=\"left\">First Header </th>\n").append(" <th align=\"center\">Second Header </th>\n").append(" <th align=\"right\">Third Header </th>\n").append(" </tr>\n").append(" </thead>\n").append(" <tbody>\n").append(" <tr>\n").append(" <td align=\"left\">First row </td>\n").append(" <td align=\"center\">Data </td>\n").append(" <td align=\"right\">Very long data entry </td>\n").append(" </tr>\n").append(" <tr>\n").append(" <td align=\"left\">Second row </td>\n").append(" <td align=\"center\"><strong>Cell</strong> </td>\n").append(" <td align=\"right\"><em>Cell</em> </td>\n").append(" </tr>\n").append(" </tbody>\n").append("</table>").toString();
InterpreterResult result = md.interpret(input, null);
assertEquals(wrapWithMarkdownClassDiv(expected), result.message().get(0).getData());
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class IgniteSqlInterpreterTest method testInvalidSql.
@Test
public void testInvalidSql() throws Exception {
InterpreterResult result = intp.interpret("select * hrom person", INTP_CONTEXT);
assertEquals(Code.ERROR, result.code());
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class IgniteSqlInterpreterTest method testSql.
@Test
public void testSql() {
InterpreterResult result = intp.interpret("select name, age from person where age > 10", INTP_CONTEXT);
assertEquals(Code.SUCCESS, result.code());
assertEquals(Type.TABLE, result.message().get(0).getType());
assertEquals("NAME\tAGE\nsun\t100\nmoon\t50\n", result.message().get(0).getData());
}
Aggregations