@@ -643,6 +643,42 @@ public void run() {
643
643
}
644
644
}
645
645
646
+ @ Test
647
+ public void testLivyParams () throws InterpreterException {
648
+ if (!checkPreCondition ()) {
649
+ return ;
650
+ }
651
+ InterpreterGroup interpreterGroup = new InterpreterGroup ("group_1" );
652
+ interpreterGroup .put ("session_1" , new ArrayList <Interpreter >());
653
+ Properties props = new Properties (properties );
654
+ props .setProperty ("livy.spark.executor.cores" , "4" );
655
+ props .setProperty ("livy.name" , "zeppelin-livy" );
656
+ LivySparkInterpreter sparkInterpreter = new LivySparkInterpreter (props );
657
+ sparkInterpreter .setInterpreterGroup (interpreterGroup );
658
+ interpreterGroup .get ("session_1" ).add (sparkInterpreter );
659
+ AuthenticationInfo authInfo = new AuthenticationInfo ("user1" );
660
+ MyInterpreterOutputListener outputListener = new MyInterpreterOutputListener ();
661
+ InterpreterOutput output = new InterpreterOutput (outputListener );
662
+ InterpreterContext context = InterpreterContext .builder ()
663
+ .setNoteId ("noteId" )
664
+ .setParagraphId ("paragraphId" )
665
+ .setAuthenticationInfo (authInfo )
666
+ .setInterpreterOut (output )
667
+ .build ();
668
+ sparkInterpreter .open ();
669
+
670
+ try {
671
+ InterpreterResult result = sparkInterpreter .interpret ("sc.version\n " +
672
+ "assert(sc.getConf.get(\" spark.executor.cores\" ) == \" 4\" && " +
673
+ "sc.getConf.get(\" spark.app.name\" ) == \" zeppelin-livy\" )"
674
+ , context );
675
+ assertEquals (result .toString (), InterpreterResult .Code .SUCCESS , result .code ());
676
+ assertEquals (1 , result .message ().size ());
677
+ } finally {
678
+ sparkInterpreter .close ();
679
+ }
680
+ }
681
+
646
682
@ Test
647
683
public void testLivyTutorialNote () throws IOException , InterpreterException {
648
684
if (!checkPreCondition ()) {
0 commit comments