PentahoSystemDatabaseDialectProvider implements IDatabaseDialectProvider { @Override public Collection<IDatabaseDialect> getDialects( boolean usableOnly ) { return filterUsableDialects( getDialectStream(), usableOnly ).collect( Collectors.toList() ); } PentahoSystemDatabaseDialectProvider();  PentahoSystemDatabaseDialectProvider( Function<Class<IDatabaseDialect>, List<IDatabaseDialect>> dialectGetter ); @Override Collection<IDatabaseDialect> getDialects( boolean usableOnly ); @Override IDatabaseDialect getDialect( boolean usableOnly, IDatabaseType databaseType );  }
@Test public void testGetDialectsUsableOnly() { Collection<IDatabaseDialect> dialects = pentahoSystemDatabaseDialectProvider.getDialects( true ); assertEquals( 2, dialects.size() ); Iterator<IDatabaseDialect> iterator = dialects.iterator(); assertEquals( usableDatabaseDialect, iterator.next() ); assertEquals( usableIDialect, iterator.next() ); }
@Test public void testGetDialectsAll() { Collection<IDatabaseDialect> dialects = pentahoSystemDatabaseDialectProvider.getDialects( false ); assertEquals( 4, dialects.size() ); Iterator<IDatabaseDialect> iterator = dialects.iterator(); assertEquals( unusableDatabaseDialect, iterator.next() ); assertEquals( unusableIDialect, iterator.next() ); assertEquals( usableDatabaseDialect, iterator.next() ); assertEquals( usableIDialect, iterator.next() ); }