Search in sources :

Example 1 with InMemoryNotebookRepo

use of org.apache.zeppelin.notebook.repo.InMemoryNotebookRepo in project zeppelin by apache.

the class LuceneSearchTest method startUp.

@Before
public void startUp() throws IOException {
    indexDir = Files.createTempDirectory("lucene").toFile();
    System.setProperty(ZeppelinConfiguration.ConfVars.ZEPPELIN_SEARCH_INDEX_PATH.getVarName(), indexDir.getAbsolutePath());
    ZeppelinConfiguration conf = ZeppelinConfiguration.create();
    noteManager = new NoteManager(new InMemoryNotebookRepo(), conf);
    interpreterSettingManager = mock(InterpreterSettingManager.class);
    InterpreterSetting defaultInterpreterSetting = mock(InterpreterSetting.class);
    when(defaultInterpreterSetting.getName()).thenReturn("test");
    when(interpreterSettingManager.getDefaultInterpreterSetting()).thenReturn(defaultInterpreterSetting);
    notebook = new Notebook(conf, mock(AuthorizationService.class), mock(NotebookRepo.class), noteManager, mock(InterpreterFactory.class), interpreterSettingManager, mock(Credentials.class), null);
    noteSearchService = new LuceneSearch(ZeppelinConfiguration.create(), notebook);
}
Also used : Notebook(org.apache.zeppelin.notebook.Notebook) ZeppelinConfiguration(org.apache.zeppelin.conf.ZeppelinConfiguration) InterpreterSetting(org.apache.zeppelin.interpreter.InterpreterSetting) NoteManager(org.apache.zeppelin.notebook.NoteManager) InterpreterSettingManager(org.apache.zeppelin.interpreter.InterpreterSettingManager) InMemoryNotebookRepo(org.apache.zeppelin.notebook.repo.InMemoryNotebookRepo) Before(org.junit.Before)

Example 2 with InMemoryNotebookRepo

use of org.apache.zeppelin.notebook.repo.InMemoryNotebookRepo in project zeppelin by apache.

the class AbstractInterpreterTest method setUp.

@Before
public void setUp() throws Exception {
    // copy the resources files to a temp folder
    zeppelinHome = new File("..");
    LOGGER.info("ZEPPELIN_HOME: " + zeppelinHome.getAbsolutePath());
    interpreterDir = new File(zeppelinHome, "interpreter_" + getClass().getSimpleName());
    confDir = new File(zeppelinHome, "conf_" + getClass().getSimpleName());
    notebookDir = new File(zeppelinHome, "notebook_" + getClass().getSimpleName());
    FileUtils.deleteDirectory(notebookDir);
    interpreterDir.mkdirs();
    confDir.mkdirs();
    notebookDir.mkdirs();
    FileUtils.copyDirectory(new File("src/test/resources/interpreter"), interpreterDir);
    FileUtils.copyDirectory(new File("src/test/resources/conf"), confDir);
    System.setProperty(ZeppelinConfiguration.ConfVars.ZEPPELIN_HOME.getVarName(), zeppelinHome.getAbsolutePath());
    System.setProperty(ZeppelinConfiguration.ConfVars.ZEPPELIN_CONF_DIR.getVarName(), confDir.getAbsolutePath());
    System.setProperty(ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_DIR.getVarName(), interpreterDir.getAbsolutePath());
    System.setProperty(ZeppelinConfiguration.ConfVars.ZEPPELIN_NOTEBOOK_DIR.getVarName(), notebookDir.getAbsolutePath());
    System.setProperty(ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_GROUP_DEFAULT.getVarName(), "test");
    conf = ZeppelinConfiguration.create();
    NotebookRepo notebookRepo = new InMemoryNotebookRepo();
    NoteManager noteManager = new NoteManager(notebookRepo, conf);
    AuthorizationService authorizationService = new AuthorizationService(noteManager, conf);
    interpreterSettingManager = new InterpreterSettingManager(conf, mock(AngularObjectRegistryListener.class), mock(RemoteInterpreterProcessListener.class), mock(ApplicationEventListener.class));
    interpreterFactory = new InterpreterFactory(interpreterSettingManager);
    Credentials credentials = new Credentials(conf);
    notebook = new Notebook(conf, authorizationService, notebookRepo, noteManager, interpreterFactory, interpreterSettingManager, credentials);
    interpreterSettingManager.setNotebook(notebook);
}
Also used : NotebookRepo(org.apache.zeppelin.notebook.repo.NotebookRepo) InMemoryNotebookRepo(org.apache.zeppelin.notebook.repo.InMemoryNotebookRepo) Notebook(org.apache.zeppelin.notebook.Notebook) AuthorizationService(org.apache.zeppelin.notebook.AuthorizationService) NoteManager(org.apache.zeppelin.notebook.NoteManager) File(java.io.File) InMemoryNotebookRepo(org.apache.zeppelin.notebook.repo.InMemoryNotebookRepo) Credentials(org.apache.zeppelin.user.Credentials) Before(org.junit.Before)

Aggregations

NoteManager (org.apache.zeppelin.notebook.NoteManager)2 Notebook (org.apache.zeppelin.notebook.Notebook)2 InMemoryNotebookRepo (org.apache.zeppelin.notebook.repo.InMemoryNotebookRepo)2 Before (org.junit.Before)2 File (java.io.File)1 ZeppelinConfiguration (org.apache.zeppelin.conf.ZeppelinConfiguration)1 InterpreterSetting (org.apache.zeppelin.interpreter.InterpreterSetting)1 InterpreterSettingManager (org.apache.zeppelin.interpreter.InterpreterSettingManager)1 AuthorizationService (org.apache.zeppelin.notebook.AuthorizationService)1 NotebookRepo (org.apache.zeppelin.notebook.repo.NotebookRepo)1 Credentials (org.apache.zeppelin.user.Credentials)1