mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Add clearAllParagraphOutput unit test
This commit is contained in:
parent
4adddb49d9
commit
98d7604a0f
1 changed files with 21 additions and 0 deletions
|
|
@ -17,8 +17,10 @@
|
|||
|
||||
package org.apache.zeppelin.notebook;
|
||||
|
||||
import org.apache.zeppelin.helium.HeliumPackage;
|
||||
import org.apache.zeppelin.interpreter.Interpreter;
|
||||
import org.apache.zeppelin.interpreter.InterpreterFactory;
|
||||
import org.apache.zeppelin.interpreter.InterpreterResult;
|
||||
import org.apache.zeppelin.notebook.repo.NotebookRepo;
|
||||
import org.apache.zeppelin.scheduler.Scheduler;
|
||||
import org.apache.zeppelin.search.SearchService;
|
||||
|
|
@ -125,4 +127,23 @@ public class NoteTest {
|
|||
assertNull(p2.getText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clearAllParagraphOutputTest() {
|
||||
when(interpreterFactory.getInterpreter(anyString(), anyString(), eq("md"))).thenReturn(interpreter);
|
||||
when(interpreter.getScheduler()).thenReturn(scheduler);
|
||||
|
||||
Note note = new Note(repo, interpreterFactory, jobListenerFactory, index, credentials, noteEventListener);
|
||||
Paragraph p1 = note.addParagraph();
|
||||
InterpreterResult result = new InterpreterResult(InterpreterResult.Code.SUCCESS, InterpreterResult.Type.TEXT, "result");
|
||||
p1.setResult(result);
|
||||
|
||||
Paragraph p2 = note.addParagraph();
|
||||
p2.setReturn(result, new Throwable());
|
||||
|
||||
note.clearAllParagraphOutput();
|
||||
|
||||
assertNull(p1.getReturn());
|
||||
assertNull(p2.getReturn());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue