Search in sources :

Example 16 with InterpreterSettingManager

use of org.apache.zeppelin.interpreter.InterpreterSettingManager in project SSM by Intel-bigdata.

the class NoteInterpreterLoaderTest method setUp.

@Before
public void setUp() throws Exception {
    tmpDir = new File(System.getProperty("java.io.tmpdir") + "/ZeppelinLTest_" + System.currentTimeMillis());
    tmpDir.mkdirs();
    new File(tmpDir, "conf").mkdirs();
    System.setProperty(ConfVars.ZEPPELIN_HOME.getVarName(), tmpDir.getAbsolutePath());
    conf = ZeppelinConfiguration.create();
    depResolver = new DependencyResolver(tmpDir.getAbsolutePath() + "/local-repo");
    interpreterSettingManager = new InterpreterSettingManager(conf, depResolver, new InterpreterOption(false));
    factory = new InterpreterFactory(conf, null, null, null, depResolver, false, interpreterSettingManager);
    ArrayList<InterpreterInfo> interpreterInfos = new ArrayList<>();
    interpreterInfos.add(new InterpreterInfo(MockInterpreter1.class.getName(), "mock1", true, Maps.<String, Object>newHashMap()));
    interpreterInfos.add(new InterpreterInfo(MockInterpreter11.class.getName(), "mock11", false, Maps.<String, Object>newHashMap()));
    ArrayList<InterpreterInfo> interpreterInfos2 = new ArrayList<>();
    interpreterInfos2.add(new InterpreterInfo(MockInterpreter2.class.getName(), "mock2", true, Maps.<String, Object>newHashMap()));
    interpreterSettingManager.add("group1", interpreterInfos, Lists.<Dependency>newArrayList(), new InterpreterOption(), Maps.<String, InterpreterProperty>newHashMap(), "mock", null);
    interpreterSettingManager.add("group2", interpreterInfos2, Lists.<Dependency>newArrayList(), new InterpreterOption(), Maps.<String, InterpreterProperty>newHashMap(), "mock", null);
    interpreterSettingManager.createNewSetting("group1", "group1", Lists.<Dependency>newArrayList(), new InterpreterOption(), new Properties());
    interpreterSettingManager.createNewSetting("group2", "group2", Lists.<Dependency>newArrayList(), new InterpreterOption(), new Properties());
}
Also used : InterpreterOption(org.apache.zeppelin.interpreter.InterpreterOption) ArrayList(java.util.ArrayList) InterpreterInfo(org.apache.zeppelin.interpreter.InterpreterInfo) InterpreterSettingManager(org.apache.zeppelin.interpreter.InterpreterSettingManager) Properties(java.util.Properties) File(java.io.File) InterpreterFactory(org.apache.zeppelin.interpreter.InterpreterFactory) DependencyResolver(org.apache.zeppelin.dep.DependencyResolver) Before(org.junit.Before)

Aggregations

InterpreterSettingManager (org.apache.zeppelin.interpreter.InterpreterSettingManager)16 InterpreterSetting (org.apache.zeppelin.interpreter.InterpreterSetting)8 Notebook (org.apache.zeppelin.notebook.Notebook)8 InterpreterFactory (org.apache.zeppelin.interpreter.InterpreterFactory)7 File (java.io.File)6 Before (org.junit.Before)6 InterpreterOption (org.apache.zeppelin.interpreter.InterpreterOption)5 Credentials (org.apache.zeppelin.user.Credentials)5 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)4 ZeppelinConfiguration (org.apache.zeppelin.conf.ZeppelinConfiguration)4 DependencyResolver (org.apache.zeppelin.dep.DependencyResolver)4 Paragraph (org.apache.zeppelin.notebook.Paragraph)4 Properties (java.util.Properties)3 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)3 Interpreter (org.apache.zeppelin.interpreter.Interpreter)3 NoteManager (org.apache.zeppelin.notebook.NoteManager)3 AuthenticationInfo (org.apache.zeppelin.user.AuthenticationInfo)3 TypeToken (com.google.gson.reflect.TypeToken)2 IOException (java.io.IOException)2