Skip to content

Commit 08ccad9

Browse files
committed
Fix test
1 parent 0874522 commit 08ccad9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public void setUp() throws Exception {
8383
"org.apache.zeppelin.interpreter.mock.MockInterpreter1," +
8484
"org.apache.zeppelin.interpreter.mock.MockInterpreter2," +
8585
"org.apache.zeppelin.interpreter.mock.MockInterpreter11");
86+
System.setProperty(ConfVars.ZEPPELIN_INTERPRETER_GROUP_ORDER.getVarName(),
87+
"mock1,mock2,mock11,dev");
8688

8789
conf = ZeppelinConfiguration.create();
8890

@@ -92,7 +94,7 @@ public void setUp() throws Exception {
9294
MockInterpreter2.register("mock2", "org.apache.zeppelin.interpreter.mock.MockInterpreter2");
9395

9496
depResolver = new DependencyResolver(tmpDir.getAbsolutePath() + "/local-repo");
95-
factory = new InterpreterFactory(conf, new InterpreterOption(true), null, null, null, depResolver);
97+
factory = new InterpreterFactory(conf, new InterpreterOption(false), null, null, null, depResolver);
9698

9799
SearchService search = mock(SearchService.class);
98100
notebookRepo = new VFSNotebookRepo(conf);
@@ -113,7 +115,7 @@ public void testSelectingReplImplementation() throws IOException {
113115
Note note = notebook.createNote(null);
114116
factory.setInterpreters(note.getId(), factory.getDefaultInterpreterSettingList());
115117

116-
// run with defatul repl
118+
// run with default repl
117119
Paragraph p1 = note.addParagraph();
118120
Map config = p1.getConfig();
119121
config.put("enabled", true);
@@ -301,7 +303,7 @@ public void testSchedule() throws InterruptedException, IOException{
301303
config.put("cron", "* * * * * ?");
302304
note.setConfig(config);
303305
notebook.refreshCron(note.getId());
304-
Thread.sleep(1*1000);
306+
Thread.sleep(1 * 1000);
305307

306308
// remove cron scheduler.
307309
config.put("cron", null);
@@ -310,7 +312,7 @@ public void testSchedule() throws InterruptedException, IOException{
310312
Thread.sleep(1000);
311313
dateFinished = p.getDateFinished();
312314
assertNotNull(dateFinished);
313-
Thread.sleep(1*1000);
315+
Thread.sleep(1 * 1000);
314316
assertEquals(dateFinished, p.getDateFinished());
315317
}
316318

@@ -608,26 +610,26 @@ public void testPermissions() throws IOException {
608610
new HashSet<String>(Arrays.asList("user1")));
609611

610612
assertEquals(notebookAuthorization.isOwner(note.getId(),
611-
new HashSet<String>(Arrays.asList("user2"))), false);
613+
new HashSet<String>(Arrays.asList("user2"))), false);
612614
assertEquals(notebookAuthorization.isOwner(note.getId(),
613615
new HashSet<String>(Arrays.asList("user1"))), true);
614616

615617
assertEquals(notebookAuthorization.isReader(note.getId(),
616-
new HashSet<String>(Arrays.asList("user3"))), false);
618+
new HashSet<String>(Arrays.asList("user3"))), false);
617619
assertEquals(notebookAuthorization.isReader(note.getId(),
618-
new HashSet<String>(Arrays.asList("user2"))), true);
620+
new HashSet<String>(Arrays.asList("user2"))), true);
619621

620622
assertEquals(notebookAuthorization.isWriter(note.getId(),
621-
new HashSet<String>(Arrays.asList("user2"))), false);
623+
new HashSet<String>(Arrays.asList("user2"))), false);
622624
assertEquals(notebookAuthorization.isWriter(note.getId(),
623625
new HashSet<String>(Arrays.asList("user1"))), true);
624626

625627
// Test clearing of permssions
626628
notebookAuthorization.setReaders(note.getId(), Sets.<String>newHashSet());
627629
assertEquals(notebookAuthorization.isReader(note.getId(),
628-
new HashSet<String>(Arrays.asList("user2"))), true);
630+
new HashSet<String>(Arrays.asList("user2"))), true);
629631
assertEquals(notebookAuthorization.isReader(note.getId(),
630-
new HashSet<String>(Arrays.asList("user3"))), true);
632+
new HashSet<String>(Arrays.asList("user3"))), true);
631633

632634
notebook.removeNote(note.getId(), null);
633635
}

0 commit comments

Comments
 (0)