use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class PegdownParserTest method testStrikethrough.
@Test
public void testStrikethrough() {
InterpreterResult result = md.interpret("This is ~~deleted~~ text", null);
assertEquals(wrapWithMarkdownClassDiv("<p>This is <del>deleted</del> text</p>"), result.message().get(0).getData());
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class PegdownParserTest method testUnorderedList.
@Test
public void testUnorderedList() {
String input = new StringBuilder().append("* Unordered list can use asterisks\n").append("- Or minuses\n").append("+ Or pluses").toString();
String expected = new StringBuilder().append("<ul>\n").append(" <li>Unordered list can use asterisks</li>\n").append(" <li>Or minuses</li>\n").append(" <li>Or pluses</li>\n").append("</ul>").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 PegdownParserTest method testWebsequencePlugin.
@Test
public void testWebsequencePlugin() {
String input = new StringBuilder().append("\n \n %%% sequence style=modern-blue\n").append("title Authentication Sequence\n").append("Alice->Bob: Authentication Request\n").append("note right of Bob: Bob thinks about it\n").append("Bob->Alice: Authentication Response\n").append(" %%% ").toString();
InterpreterResult result = md.interpret(input, null);
// assert statement below can fail depends on response of websequence service.
// To make unittest independent from websequence service,
// catch exception, log and pass instead of assert.
//
//assertThat(result.message().get(0).getData(), CoreMatchers.containsString("<img src=\"http://www.websequencediagrams.com/?png="));
System.err.println(result.message().get(0).getData());
if (!result.message().get(0).getData().contains("<img src=\"http://www.websequencediagrams.com/?png=")) {
logger.error("Expected {} but found {}", "<img src=\"http://www.websequencediagrams.com/?png=", result.message().get(0).getData());
}
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class PegdownParserTest method testSimpleTable.
@Test
public void testSimpleTable() {
String input = new StringBuilder().append("MarkdownInterpreter | Less | Pretty\n").append("--- | --- | ---\n").append("*Still* | `renders` | **nicely**\n").append("1 | 2 | 3").toString();
String expected = new StringBuilder().append("<table>\n").append(" <thead>\n").append(" <tr>\n").append(" <th>MarkdownInterpreter </th>\n").append(" <th>Less </th>\n").append(" <th>Pretty</th>\n").append(" </tr>\n").append(" </thead>\n").append(" <tbody>\n").append(" <tr>\n").append(" <td><em>Still</em> </td>\n").append(" <td><code>renders</code> </td>\n").append(" <td><strong>nicely</strong></td>\n").append(" </tr>\n").append(" <tr>\n").append(" <td>1 </td>\n").append(" <td>2 </td>\n").append(" <td>3</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 PegdownParserTest method testOrderedList.
@Test
public void testOrderedList() {
String input = new StringBuilder().append("1. First ordered list item\n").append("2. Another item").toString();
String expected = new StringBuilder().append("<ol>\n").append(" <li>First ordered list item</li>\n").append(" <li>Another item</li>\n").append("</ol>").toString();
InterpreterResult result = md.interpret(input, null);
assertEquals(wrapWithMarkdownClassDiv(expected), result.message().get(0).getData());
}
Aggregations