StreamSource implements Serializable { public String getSqlQuery ( ) { if (sqlQuery==null || sqlQuery.trim( ).length( ) == 0 ) sqlQuery = DEFAULT_QUERY; return sqlQuery; } StreamSource(); String getRawHistorySize(); StreamSource setRawHistorySize(String rawHistorySize); StreamSource setRawSlideValue(String rawSlideValue); StreamSource setAddressing(AddressBean[] addressing); StreamSource setAlias(String alias); StreamSource setSqlQuery(String sqlQuery); AddressBean [] getAddressing( ); CharSequence getAlias( ); InputStream getInputStream(); int getDisconnectedBufferSize( ); void setDisconnectedBufferSize(int disconnectedBufferSize); float getSamplingRate( ); void setSamplingRate(float newRate ); String getStorageSize( ); String getSlideValue(); String getSqlQuery( ); void setWrapper( AbstractWrapper wrapper  ); AbstractWrapper getWrapper( ); boolean validate( ); boolean isStorageCountBased( ); long getParsedStorageSize( ); WindowType getWindowingType(); long getParsedSlideValue(); boolean windowSlided(); void setQueryRewriter(QueryRewriter rewriter); QueryRewriter getQueryRewriter(); StringBuilder rewrite(String query); StringBuilder getUIDStr(); int hashCode(); StringBuilder toSql(); StreamSource setInputStream(InputStream is); AddressBean getActiveAddressBean(); String toString(); static final String DEFAULT_QUERY; static final AddressBean[] EMPTY_ADDRESS_BEAN; static final long STORAGE_SIZE_NOT_SET; static final long DEFAULT_SLIDE_VALUE; static final WindowType DEFAULT_WINDOW_TYPE; }
@Test public void testGetSQLQuery() { InputStream is = new InputStream(); StreamSource ss = new StreamSource(); ss.setAddressing(addressing); ss.setAlias("my-stream"); ss.setRawHistorySize("10m"); ss.setInputStream(is); assertTrue(ss.getSqlQuery().trim().equals("select * from wrapper")); ss = new StreamSource(); ss.setAddressing(addressing); ss.setAlias("my-stream"); ss.setRawHistorySize("10m"); ss.setSqlQuery(" "); ss.setInputStream(is); assertEquals(ss.getSqlQuery().trim(),"select * from wrapper"); }