@Test public void testQueryData() throws ReportDataFactoryException { DataRow parameters = mock( DataRow.class ); TableModel model = mock( TableModel.class ); doReturn( model ).when( parameters ).get( QUERY ); TableModel result = factory.queryData( QUERY, parameters ); assertThat( result, is( equalTo( model ) ) ); }
public TableModel queryData( final String query, final DataRow parameters ) throws ReportDataFactoryException { final Object o = parameters.get( query ); if ( o instanceof TableModel ) { return (TableModel) o; } throw new ReportDataFactoryException( "The parameter given was no valid datasource: " + query ); }
ExternalDataFactory extends AbstractDataFactory { public TableModel queryData( final String query, final DataRow parameters ) throws ReportDataFactoryException { final Object o = parameters.get( query ); if ( o instanceof TableModel ) { return (TableModel) o; } throw new ReportDataFactoryException( "The parameter given was no valid datasource: " + query ); } }
ExternalDataFactory extends AbstractDataFactory { public TableModel queryData( final String query, final DataRow parameters ) throws ReportDataFactoryException { final Object o = parameters.get( query ); if ( o instanceof TableModel ) { return (TableModel) o; } throw new ReportDataFactoryException( "The parameter given was no valid datasource: " + query ); } ExternalDataFactory(); }
ExternalDataFactory extends AbstractDataFactory { public TableModel queryData( final String query, final DataRow parameters ) throws ReportDataFactoryException { final Object o = parameters.get( query ); if ( o instanceof TableModel ) { return (TableModel) o; } throw new ReportDataFactoryException( "The parameter given was no valid datasource: " + query ); } ExternalDataFactory(); TableModel queryData( final String query, final DataRow parameters ); DataFactory derive(); void close(); boolean isQueryExecutable( final String query, final DataRow parameters ); String[] getQueryNames(); }
ExternalDataFactory extends AbstractDataFactory { public TableModel queryData( final String query, final DataRow parameters ) throws ReportDataFactoryException { final Object o = parameters.get( query ); if ( o instanceof TableModel ) { return (TableModel) o; } throw new ReportDataFactoryException( "The parameter given was no valid datasource: " + query ); } ExternalDataFactory(); TableModel queryData( final String query, final DataRow parameters ); DataFactory derive(); void close(); boolean isQueryExecutable( final String query, final DataRow parameters ); String[] getQueryNames();  }