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.

Version:
$Id: //open/mondrian-release/3.0/testsrc/main/mondrian/test/SqlPattern.java#4 $
Author:
jhyde
See Also:
SqlQuery.Dialect

Nested Class Summary
static class SqlPattern.Dialect
          SQL dialect definition.
 
Constructor Summary
SqlPattern(Set<SqlPattern.Dialect> dialects, 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<SqlPattern.Dialect> dialects, String sql, String triggerSql)
          Creates a pattern which applies a collection of dialects.
SqlPattern(SqlPattern.Dialect dialect, 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(SqlPattern.Dialect dialect, String sql, String triggerSql)
          Creates a pattern which applies to one or more dialects.
 
Method Summary
static SqlPattern getPattern(SqlPattern.Dialect d, SqlPattern[] patterns)
           
 String getSql()
           
 String getTriggerSql()
           
 boolean hasDialect(SqlPattern.Dialect d)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlPattern

public SqlPattern(Set<SqlPattern.Dialect> dialects,
                  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:
dialects - Set of dialects
sql - SQL statement
startsWithLen - Length of prefix of statement to consider

SqlPattern

public SqlPattern(SqlPattern.Dialect dialect,
                  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:
dialect - Dialect
sql - SQL statement
startsWithLen - Length of prefix of statement to consider

SqlPattern

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

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

SqlPattern

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

Parameters:
dialects - 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(SqlPattern.Dialect d,
                                    SqlPattern[] patterns)

hasDialect

public boolean hasDialect(SqlPattern.Dialect d)

getSql

public String getSql()

getTriggerSql

public String getTriggerSql()

SourceForge.net_Logo