@@ -93,6 +93,13 @@ public void testConnectionInvalidInName() throws DMLException {
9393 conn .gatherMemStats (false );
9494 Assert .assertTrue (DMLScript .STATISTICS );
9595
96+ conn .gatherMemStats (true );
97+ Assert .assertTrue (DMLScript .STATISTICS );
98+
99+ DMLScript .STATISTICS = false ;
100+ conn .gatherMemStats (false );
101+ Assert .assertFalse (DMLScript .STATISTICS );
102+
96103 try (conn ) {
97104 conn .prepareScript ("printx('hello')" , new String []{"$inScalar1" , null }, new String []{null });
98105 throw new AssertionError ("Test should have thrown a LanguageException" );
@@ -106,22 +113,13 @@ public void testConnectionInvalidInName() throws DMLException {
106113
107114 @ Test
108115 public void testConnectionParseLanguageException () {
109- boolean oldStat = DMLScript .STATISTICS ;
110- boolean oldJMLCStat = DMLScript .JMLC_MEM_STATISTICS ;
111116 try (Connection conn = new Connection ()) {
112- DMLScript .STATISTICS = true ;
113- conn .gatherMemStats (true );
114- Assert .assertTrue (DMLScript .STATISTICS );
115-
116117 conn .prepareScript ("printx('hello')" , new String []{}, new String []{});
117118 throw new AssertionError ("Test should have thrown a DMLException" );
118119 } catch (DMLException e ) {
119120 Throwable cause = e .getCause ();
120121 Assert .assertTrue (cause .getMessage ().startsWith ("ERROR: [line 1:0] -> printx('hello') -- function printx is undefined in namespace .builtinNS" ));
121- } finally {
122- DMLScript .STATISTICS = oldStat ;
123- DMLScript .JMLC_MEM_STATISTICS = oldJMLCStat ;
124- }
122+ }
125123 }
126124
127125 @ Test
@@ -378,4 +376,14 @@ public void testConvertToStringFrameException2() {
378376 Assert .assertTrue (e .getMessage ().startsWith ("Invalid input format" ));
379377 }
380378 }
379+
380+ @ Test
381+ public void testConvertToFrame () {
382+ try (Connection conn = new Connection ()) {
383+ FrameBlock frame = conn .convertToFrame ("1 1 Hello" , 1 , 1 );
384+ Assert .assertEquals ("Hello" , frame .get (0 ,0 ));
385+ } catch (IOException e ) {
386+ throw new AssertionError (e );
387+ }
388+ }
381389}
0 commit comments