Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public void testGetNotebookInfo() throws IOException {

assertTrue(paragraphs.size() > 0);
assertEquals(paragraphText, paragraphs.get(0).get("text"));
//
ZeppelinServer.notebook.removeNote(sourceNoteID, null);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public void testSelectingReplImplementation() throws IOException {
note.run(p2.getId());
while(p2.isTerminated()==false || p2.getResult()==null) Thread.yield();
assertEquals("repl2: hello world", p2.getResult().message());
notebook.removeNote(note.getId(), null);
}

@Test
Expand Down Expand Up @@ -208,6 +209,7 @@ public void testPersist() throws IOException, SchedulerException, RepositoryExce
conf, notebookRepo, schedulerFactory,
new InterpreterFactory(conf, null, null, null, depResolver), this, null, null, null);
assertEquals(1, notebook2.getAllNotes().size());
notebook.removeNote(note.getId(), null);
}

@Test
Expand All @@ -220,6 +222,7 @@ public void testCreateNoteWithSubject() throws IOException, SchedulerException,
Set<String> owners = new HashSet<>();
owners.add("user1");
assertEquals(owners, notebook.getNotebookAuthorization().getOwners(note.getId()));
notebook.removeNote(note.getId(), null);
}

@Test
Expand All @@ -238,6 +241,7 @@ public void testClearParagraphOutput() throws IOException, SchedulerException{
// clear paragraph output/result
note.clearParagraphOutput(p1.getId());
assertNull(p1.getResult());
notebook.removeNote(note.getId(), null);
}

@Test
Expand Down Expand Up @@ -308,6 +312,7 @@ public void testSchedule() throws InterruptedException, IOException {
assertNotNull(dateFinished);
Thread.sleep(1 * 1000);
assertEquals(dateFinished, p.getDateFinished());
notebook.removeNote(note.getId(), null);
}

@Test
Expand Down Expand Up @@ -360,6 +365,7 @@ public void testAutoRestartInterpreterAfterSchedule() throws InterruptedExceptio
// make sure all paragraph has been executed
assertNotNull(p.getDateFinished());
assertNotNull(p2.getDateFinished());
notebook.removeNote(note.getId(), null);
}

@Test
Expand Down Expand Up @@ -396,6 +402,9 @@ public void testExportAndImportNote() throws IOException, CloneNotSupportedExcep
Set<String> owners = new HashSet<>();
owners.add("user1");
assertEquals(owners, notebook.getNotebookAuthorization().getOwners(importedNote2.getId()));
notebook.removeNote(note.getId(), null);
notebook.removeNote(importedNote.getId(), null);
notebook.removeNote(importedNote2.getId(), null);
}

@Test
Expand Down Expand Up @@ -427,6 +436,9 @@ public void testCloneNote() throws IOException, CloneNotSupportedException,
Set<String> owners = new HashSet<>();
owners.add("user1");
assertEquals(owners, notebook.getNotebookAuthorization().getOwners(cloneNote2.getId()));
notebook.removeNote(note.getId(), null);
notebook.removeNote(cloneNote.getId(), null);
notebook.removeNote(cloneNote2.getId(), null);
}

@Test
Expand All @@ -437,6 +449,8 @@ public void testCloneNoteWithNoName() throws IOException, CloneNotSupportedExcep

Note cloneNote = notebook.cloneNote(note.getId(), null, null);
assertEquals(cloneNote.getName(), "Note " + cloneNote.getId());
notebook.removeNote(note.getId(), null);
notebook.removeNote(cloneNote.getId(), null);
}

@Test
Expand All @@ -461,6 +475,8 @@ public void testCloneNoteWithExceptionResult() throws IOException, CloneNotSuppo
assertEquals(cp.getId(), p.getId());
assertEquals(cp.text, p.text);
assertNull(cp.getResult());
notebook.removeNote(note.getId(), null);
notebook.removeNote(cloneNote.getId(), null);
}

@Test
Expand Down Expand Up @@ -554,6 +570,7 @@ public void testAngularObjectRemovalOnParagraphRemove() throws InterruptedExcept
// notebook scope and global object sould be remained
assertNotNull(registry.get("o2", note.getId(), null));
assertNotNull(registry.get("o3", null, null));
notebook.removeNote(note.getId(), null);
}

@Test
Expand Down Expand Up @@ -663,6 +680,7 @@ public void testAbortParagraphStatusOnInterpreterRestart() throws InterruptedExc
}

assertTrue(isAborted);
notebook.removeNote(note.getId(), null);
}

@Test
Expand Down Expand Up @@ -871,6 +889,8 @@ public void testGetAllNotes() throws Exception {
assertEquals(0, notebook.getAllNotes(new AuthenticationInfo("anonymous")).size());
assertEquals(1, notebook.getAllNotes(new AuthenticationInfo("user1")).size());
assertEquals(1, notebook.getAllNotes(new AuthenticationInfo("user2")).size());
notebook.removeNote(note1.getId(), null);
notebook.removeNote(note2.getId(), null);
}

private void delete(File file){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public void testSyncOnCreate() throws IOException {
assertEquals(1, notebookRepoSync.list(0, null).size());
assertEquals(1, notebookRepoSync.list(1, null).size());
assertEquals(notebookRepoSync.list(0, null).get(0).getId(),notebookRepoSync.list(1, null).get(0).getId());


notebookSync.removeNote(notebookRepoSync.list(0, null).get(0).getId(), null);
}

@Test
Expand Down Expand Up @@ -194,6 +195,7 @@ public void testSyncUpdateMain() throws IOException {
notebookRepoSync.list(0, null).get(0).getId(), null).getLastParagraph().getId());
assertEquals(p1.getId(), notebookRepoSync.get(1,
notebookRepoSync.list(1, null).get(0).getId(), null).getLastParagraph().getId());
notebookRepoSync.remove(note.getId(), null);
}

@Test
Expand Down Expand Up @@ -306,6 +308,7 @@ public void testCheckpointOneStorage() throws IOException, SchedulerException {
vRepoSync.save(note, null);
vRepoSync.checkpoint(noteId, "checkpoint message 2", null);
assertThat(gitRepo.revisionHistory(noteId, null).size()).isEqualTo(vCount + 1);
notebookRepoSync.remove(note.getId(), null);
}

static void delete(File file){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public void testSaveNotebook() throws IOException, InterruptedException {
note.setName("SaveTest");
notebookRepo.save(note, null);
assertEquals(note.getName(), "SaveTest");
notebookRepo.remove(note.getId(), null);
}

class NotebookWriter implements Runnable {
Expand Down