@Test public void clearAllParagraphOutputTest() { when(interpreterFactory.getInterpreter(anyString(), anyString(), eq("md"))).thenReturn(interpreter); when(interpreter.getScheduler()).thenReturn(scheduler); Note note = new Note(repo, interpreterFactory, interpreterSettingManager, jobListenerFactory, index, credentials, noteEventListener); Paragraph p1 = note.addParagraph(AuthenticationInfo.ANONYMOUS); InterpreterResult result = new InterpreterResult(InterpreterResult.Code.SUCCESS, InterpreterResult.Type.TEXT, "result"); p1.setResult(result); Paragraph p2 = note.addParagraph(AuthenticationInfo.ANONYMOUS); p2.setReturn(result, new Throwable()); note.clearAllParagraphOutput(); assertNull(p1.getReturn()); assertNull(p2.getReturn()); }
public void clearAllParagraphOutput() { synchronized (paragraphs) { for (Paragraph p : paragraphs) { p.setReturn(null, null); } } }
Note implements Serializable, ParagraphJobListener { public void clearAllParagraphOutput() { synchronized (paragraphs) { for (Paragraph p : paragraphs) { p.setReturn(null, null); } } } }
Note implements Serializable, ParagraphJobListener { public void clearAllParagraphOutput() { synchronized (paragraphs) { for (Paragraph p : paragraphs) { p.setReturn(null, null); } } } Note();  Note(NotebookRepo repo, InterpreterFactory factory,
      InterpreterSettingManager interpreterSettingManager, JobListenerFactory jlFactory,
      SearchService noteIndex, Credentials credentials, NoteEventListener noteEventListener); }
Note implements Serializable, ParagraphJobListener { public void clearAllParagraphOutput() { synchronized (paragraphs) { for (Paragraph p : paragraphs) { p.setReturn(null, null); } } } Note();  Note(NotebookRepo repo, InterpreterFactory factory,
      InterpreterSettingManager interpreterSettingManager, JobListenerFactory jlFactory,
      SearchService noteIndex, Credentials credentials, NoteEventListener noteEventListener); boolean isPersonalizedMode(); void setPersonalizedMode(Boolean value); String getId(); String getName(); String getNameWithoutPath(); String getFolderId(); boolean isNameEmpty(); void setName(String name); void setNoteNameListener(NoteNameListener listener); void initializeJobListenerForParagraph(Paragraph paragraph); void setIndex(SearchService index); Credentials getCredentials(); void setCredentials(Credentials credentials); Paragraph addParagraph(AuthenticationInfo authenticationInfo); Paragraph insertParagraph(int index, AuthenticationInfo authenticationInfo); Paragraph removeParagraph(String user, String paragraphId); Paragraph clearParagraphOutput(String paragraphId, String user); void clearAllParagraphOutput(); void moveParagraph(String paragraphId, int index); void moveParagraph(String paragraphId, int index, boolean throwWhenIndexIsOutOfBound); boolean isLastParagraph(String paragraphId); Paragraph getParagraph(String paragraphId); Paragraph getLastParagraph(); List<Map<String, String>> generateParagraphsInfo(); Map<String, String> generateSingleParagraphInfo(String paragraphId); synchronized void runAll(); void runAll(AuthenticationInfo authenticationInfo); void run(String paragraphId); boolean isTrash(); List<InterpreterCompletion> completion(String paragraphId, String buffer, int cursor); List<Paragraph> getParagraphs(); void persist(AuthenticationInfo subject); void persist(int maxDelaySec, AuthenticationInfo subject); Note getUserNote(String user); Map<String, Object> getConfig(); void setConfig(Map<String, Object> config); Map<String, Object> getInfo(); void setInfo(Map<String, Object> info); @Override void beforeStatusChange(Job job, Status before, Status after); @Override void afterStatusChange(Job job, Status before, Status after); @Override void onProgressUpdate(Job job, int progress); @Override void onOutputAppend(Paragraph paragraph, int idx, String output); @Override void onOutputUpdate(Paragraph paragraph, int idx, InterpreterResultMessage msg); @Override void onOutputUpdateAll(Paragraph paragraph, List<InterpreterResultMessage> msgs); }
Note implements Serializable, ParagraphJobListener { public void clearAllParagraphOutput() { synchronized (paragraphs) { for (Paragraph p : paragraphs) { p.setReturn(null, null); } } } Note();  Note(NotebookRepo repo, InterpreterFactory factory,
      InterpreterSettingManager interpreterSettingManager, JobListenerFactory jlFactory,
      SearchService noteIndex, Credentials credentials, NoteEventListener noteEventListener); boolean isPersonalizedMode(); void setPersonalizedMode(Boolean value); String getId(); String getName(); String getNameWithoutPath(); String getFolderId(); boolean isNameEmpty(); void setName(String name); void setNoteNameListener(NoteNameListener listener); void initializeJobListenerForParagraph(Paragraph paragraph); void setIndex(SearchService index); Credentials getCredentials(); void setCredentials(Credentials credentials); Paragraph addParagraph(AuthenticationInfo authenticationInfo); Paragraph insertParagraph(int index, AuthenticationInfo authenticationInfo); Paragraph removeParagraph(String user, String paragraphId); Paragraph clearParagraphOutput(String paragraphId, String user); void clearAllParagraphOutput(); void moveParagraph(String paragraphId, int index); void moveParagraph(String paragraphId, int index, boolean throwWhenIndexIsOutOfBound); boolean isLastParagraph(String paragraphId); Paragraph getParagraph(String paragraphId); Paragraph getLastParagraph(); List<Map<String, String>> generateParagraphsInfo(); Map<String, String> generateSingleParagraphInfo(String paragraphId); synchronized void runAll(); void runAll(AuthenticationInfo authenticationInfo); void run(String paragraphId); boolean isTrash(); List<InterpreterCompletion> completion(String paragraphId, String buffer, int cursor); List<Paragraph> getParagraphs(); void persist(AuthenticationInfo subject); void persist(int maxDelaySec, AuthenticationInfo subject); Note getUserNote(String user); Map<String, Object> getConfig(); void setConfig(Map<String, Object> config); Map<String, Object> getInfo(); void setInfo(Map<String, Object> info); @Override void beforeStatusChange(Job job, Status before, Status after); @Override void afterStatusChange(Job job, Status before, Status after); @Override void onProgressUpdate(Job job, int progress); @Override void onOutputAppend(Paragraph paragraph, int idx, String output); @Override void onOutputUpdate(Paragraph paragraph, int idx, InterpreterResultMessage msg); @Override void onOutputUpdateAll(Paragraph paragraph, List<InterpreterResultMessage> msgs);  }