Skip to content

Commit 0471042

Browse files
committed
Add unittest
1 parent 3e8697b commit 0471042

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,22 @@ public void testSelectingReplImplementation() throws IOException {
128128
}
129129

130130
@Test
131+
public void testReloadAndSetInterpreter() throws IOException {
132+
// given a notebook
133+
File srcDir = new File("src/test/resources/2A94M5J1Z");
134+
File destDir = new File(notebookDir.getAbsolutePath() + "/2A94M5J1Z");
135+
FileUtils.copyDirectory(srcDir, destDir);
136+
137+
// when load
138+
notebook.reloadAllNotes(null);
139+
assertEquals(1, notebook.getAllNotes().size());
140+
141+
// then interpreter factory should be injected into all the paragraphs
142+
Note note = notebook.getAllNotes().get(0);
143+
assertNull(note.getParagraphs().get(0).getRepl(null));
144+
}
145+
146+
@Test
131147
public void testReloadAllNotes() throws IOException {
132148
File srcDir = new File("src/test/resources/2A94M5J1Z");
133149
File destDir = new File(notebookDir.getAbsolutePath() + "/2A94M5J1Z");

0 commit comments

Comments
 (0)