mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
add test case for extends z.run and z.runNote
This commit is contained in:
parent
10c2a47047
commit
292319a8eb
1 changed files with 28 additions and 0 deletions
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.zeppelin.rest;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -346,6 +347,33 @@ public class ZeppelinSparkClusterTest extends AbstractTestRestApi {
|
|||
assertEquals(Status.FINISHED, p2.getStatus());
|
||||
assertEquals("10", p2.getResult().message());
|
||||
|
||||
Paragraph p3 = note.addParagraph();
|
||||
Map config3 = p3.getConfig();
|
||||
config3.put("enabled", true);
|
||||
p3.setConfig(config3);
|
||||
p3.setText("%spark println(new java.util.Date())");
|
||||
p3.setAuthenticationInfo(anonymous);
|
||||
|
||||
p0.setText(String.format("%%spark z.runNote(\"%s\")", note.getId()));
|
||||
note.run(p0.getId());
|
||||
waitForFinish(p0);
|
||||
waitForFinish(p1);
|
||||
waitForFinish(p2);
|
||||
waitForFinish(p3);
|
||||
|
||||
assertEquals(Status.FINISHED, p3.getStatus());
|
||||
String p3result = p3.getResult().message();
|
||||
assertNotEquals(null, p3result);
|
||||
assertNotEquals("", p3result);
|
||||
|
||||
p0.setText(String.format("%%spark z.run(\"%s\", \"%s\")", note.getId(), p3.getId()));
|
||||
|
||||
note.run(p0.getId());
|
||||
waitForFinish(p0);
|
||||
waitForFinish(p3);
|
||||
|
||||
assertNotEquals(p3result, p3.getResult().message());
|
||||
|
||||
ZeppelinServer.notebook.removeNote(note.getId(), anonymous);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue