mondrian.test
Class SqlPattern

java.lang.Object
  extended by mondrian.test.SqlPattern

public class SqlPattern
extends Object

Pattern for a SQL statement (or fragment thereof) expected to be produced during the course of running a test.

A pattern contains a dialect. This allows a test to run against different dialects.

Author:
jhyde
See Also:
Dialect

Constructor Summary
SqlPattern(Dialect.DatabaseProduct databaseProduct, String sql, int startsWithLen)
          Creates a pattern which applies to one or more dialects and is triggered by the first N characters of the expected statement.
SqlPattern(Dialect.DatabaseProduct databaseProduct, String sql, String triggerSql)
          Creates a pattern which applies to one or more dialects.
SqlPattern(Set<Dialect.DatabaseProduct> databaseProducts, String sql, int startsWithLen)
          Creates a pattern which applies to a collection of dialects and is triggered by the first N characters of the expected statement.
SqlPattern(Set<Dialect.DatabaseProduct> databaseProducts, String sql, String triggerSql)
          Creates a pattern which applies a collection of dialects.
 
Method Summary
static SqlPattern getPattern(Dialect.DatabaseProduct d, SqlPattern[] patterns)
           
 String getSql()
           
 String getTriggerSql()
           
 boolean hasDatabaseProduct(Dialect.DatabaseProduct databaseProduct)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlPattern

public SqlPattern(Set<Dialect.DatabaseProduct> databaseProducts,
                  String sql,
                  int startsWithLen)
Creates a pattern which applies to a collection of dialects and is triggered by the first N characters of the expected statement.

Parameters:
databaseProducts - Set of dialects
sql - SQL statement
startsWithLen - Length of prefix of statement to consider

SqlPattern

public SqlPattern(Dialect.DatabaseProduct databaseProduct,
                  String sql,
                  int startsWithLen)
Creates a pattern which applies to one or more dialects and is triggered by the first N characters of the expected statement.

Parameters:
databaseProduct - Dialect
sql - SQL statement
startsWithLen - Length of prefix of statement to consider

SqlPattern

public SqlPattern(Dialect.DatabaseProduct databaseProduct,
                  String sql,
                  String triggerSql)
Creates a pattern which applies to one or more dialects.

Parameters:
databaseProduct - Dialect
sql - SQL statement
triggerSql - Prefix of SQL statement which triggers a match; null means whole statement

SqlPattern

public SqlPattern(Set<Dialect.DatabaseProduct> databaseProducts,
                  String sql,
                  String triggerSql)
Creates a pattern which applies a collection of dialects.

Parameters:
databaseProducts - Set of dialects
sql - SQL statement
triggerSql - Prefix of SQL statement which triggers a match; null means whole statement
Method Detail

getPattern

public static SqlPattern getPattern(Dialect.DatabaseProduct d,
                                    SqlPattern[] patterns)

hasDatabaseProduct

public boolean hasDatabaseProduct(Dialect.DatabaseProduct databaseProduct)

getSql

public String getSql()

getTriggerSql

public String getTriggerSql()

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads