mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Update unittest
This commit is contained in:
parent
e1b0e79f11
commit
83b529c12f
2 changed files with 13 additions and 29 deletions
|
|
@ -106,7 +106,6 @@ public class ZeppelinSparkClusterTest extends AbstractTestRestApi {
|
|||
);
|
||||
note.run(p.getId());
|
||||
waitForFinish(p);
|
||||
ps();
|
||||
System.err.println("sparkRTest=" + p.getResult().message());
|
||||
assertEquals(Status.FINISHED, p.getStatus());
|
||||
assertEquals("[1] 3", p.getResult().message());
|
||||
|
|
@ -114,27 +113,6 @@ public class ZeppelinSparkClusterTest extends AbstractTestRestApi {
|
|||
ZeppelinServer.notebook.removeNote(note.id(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPs() {
|
||||
ps();
|
||||
}
|
||||
|
||||
private void ps() {
|
||||
CommandLine cmdLine = CommandLine.parse("ps aux");
|
||||
DefaultExecutor executor = new DefaultExecutor();
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
executor.setStreamHandler(new PumpStreamHandler(out, out));
|
||||
|
||||
try {
|
||||
executor.execute(cmdLine);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.err.println("ps>>>>>>>>>>>>>>>>>\n" + new String(out.toByteArray()) +
|
||||
"\n<<<<<<<<<<<<<<<<<<");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pySparkTest() throws IOException {
|
||||
// create new note
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ public class InterpreterFactoryTest {
|
|||
depResolver = new DependencyResolver(tmpDir.getAbsolutePath() + "/local-repo");
|
||||
factory = new InterpreterFactory(conf, new InterpreterOption(false), null, null, null, depResolver);
|
||||
context = new InterpreterContext("note", "id", "title", "text", null, null, null, null, null, null, null);
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
@ -70,10 +69,17 @@ public class InterpreterFactoryTest {
|
|||
|
||||
@Test
|
||||
public void testBasic() {
|
||||
List<String> all = factory.getDefaultInterpreterSettingList();
|
||||
InterpreterSetting setting = factory.get(all.get(0));
|
||||
InterpreterGroup interpreterGroup = setting.getInterpreterGroup("sharedProcess");
|
||||
factory.createInterpretersForNote(setting, "sharedProcess", "session");
|
||||
List<InterpreterSetting> all = factory.get();
|
||||
InterpreterSetting mock1Setting = null;
|
||||
for (InterpreterSetting setting : all) {
|
||||
if (setting.getName().equals("mock1")) {
|
||||
mock1Setting = setting;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
InterpreterGroup interpreterGroup = mock1Setting.getInterpreterGroup("sharedProcess");
|
||||
factory.createInterpretersForNote(mock1Setting, "sharedProcess", "session");
|
||||
|
||||
// get interpreter
|
||||
assertNotNull("get Interpreter", interpreterGroup.get("session").get(0));
|
||||
|
|
@ -82,8 +88,8 @@ public class InterpreterFactoryTest {
|
|||
assertNull(factory.get("unknown"));
|
||||
|
||||
// restart interpreter
|
||||
factory.restart(all.get(0));
|
||||
assertNull(setting.getInterpreterGroup("sharedProcess").get("session"));
|
||||
factory.restart(mock1Setting.id());
|
||||
assertNull(mock1Setting.getInterpreterGroup("sharedProcess").get("session"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in a new issue