@Test public void testCancelRunningQuery() throws Exception { ScriptableDataFactory dataFactory = spy( new ScriptableDataFactory() ); dataFactory.setQuery( QUERY_NAME, QUERY_VALUE ); dataFactory.setLanguage( LANGUAGE ); BSFManager interpreter = mock( BSFManager.class ); TableModel tableModel = mock( TableModel.class ); when( dataFactory.createInterpreter() ).thenReturn( interpreter ); doReturn( tableModel ).when( interpreter ).eval( LANGUAGE, "expression", 1, 1, QUERY_VALUE ); dataFactory.queryData( QUERY_NAME, null ); dataFactory.cancelRunningQuery(); verify( interpreter ).terminate(); }
public void cancelRunningQuery() { if ( interpreter != null ) { interpreter.terminate(); } }
ScriptableDataFactory extends AbstractDataFactory { public void cancelRunningQuery() { if ( interpreter != null ) { interpreter.terminate(); } } }
ScriptableDataFactory extends AbstractDataFactory { public void cancelRunningQuery() { if ( interpreter != null ) { interpreter.terminate(); } } ScriptableDataFactory(); }
ScriptableDataFactory extends AbstractDataFactory { public void cancelRunningQuery() { if ( interpreter != null ) { interpreter.terminate(); } } ScriptableDataFactory(); String getLanguage(); void setLanguage( final String language ); void setQuery( final String name, final String value ); String getScript(); void setScript( final String script ); String getShutdownScript(); void setShutdownScript( final String shutdownScript ); String getQuery( final String name ); String[] getQueryNames(); TableModel queryData( final String query, final DataRow parameters ); ScriptableDataFactory clone(); DataFactory derive(); void close(); boolean isQueryExecutable( final String query, final DataRow parameters ); void cancelRunningQuery(); }
ScriptableDataFactory extends AbstractDataFactory { public void cancelRunningQuery() { if ( interpreter != null ) { interpreter.terminate(); } } ScriptableDataFactory(); String getLanguage(); void setLanguage( final String language ); void setQuery( final String name, final String value ); String getScript(); void setScript( final String script ); String getShutdownScript(); void setShutdownScript( final String shutdownScript ); String getQuery( final String name ); String[] getQueryNames(); TableModel queryData( final String query, final DataRow parameters ); ScriptableDataFactory clone(); DataFactory derive(); void close(); boolean isQueryExecutable( final String query, final DataRow parameters ); void cancelRunningQuery();  }