|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjp.sf.amateras.mirage.test.MirageTestContext
public class MirageTestContext
MockSqlManager| Constructor Summary | |
|---|---|
MirageTestContext()
|
|
| Method Summary | |
|---|---|
static void |
addResult(Object result)
|
static ExecutedSQLInfo |
getExecutedSQLInfo(int index)
|
static void |
initMirageTestContext()
Initializes the MirageTestContext. |
static void |
setNameConverter(NameConverter nameConverter)
|
static void |
verifyDeleteSql(int indexOfSql,
Object entity)
Verifies the SQL and parameters which is executed by SqlManager.deleteEntity(Object). |
static void |
verifyFindSql(int indexOfSql,
Class<?> entityClass,
Object... id)
Verifies the SQL and parameters which is executed by SqlManager.findEntity(Class, Object...). |
static void |
verifyInsertSql(int indexOfSql,
Object entity)
Verifies the SQL and parameters which is executed by SqlManager.insertEntity(Object). |
static void |
verifySql(int indexOfSql,
String sql)
Verifies the executed SQL. |
static void |
verifySql(int indexOfSql,
String sql,
Object... values)
Verifies the executed SQL and parameters. |
static void |
verifySqlByRegExp(int indexOfSql,
String regexp)
Verifies the executed SQL using the regular expression. |
static void |
verifySqlByRegExp(int indexOfSql,
String regexp,
Object... values)
Verifies the executed SQL and parameters using the regular expression. |
static void |
verifySqlNumber(int expected)
Verifies the number of executed SQLs. |
static void |
verifyUpdatetSql(int indexOfSql,
Object entity)
Verifies the SQL and parameters which is executed by SqlManager.updateEntity(Object). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MirageTestContext()
| Method Detail |
|---|
public static void initMirageTestContext()
This method clears the result list and the executed sql list.
You have to invoke this method at setUp() of your test case.
public static void setNameConverter(NameConverter nameConverter)
public static void addResult(Object result)
public static ExecutedSQLInfo getExecutedSQLInfo(int index)
public static void verifySqlNumber(int expected)
expected - the expected number of executed SQLs
public static void verifySql(int indexOfSql,
String sql)
indexOfSql - the index of executed SQLsql - the expected SQL
public static void verifySql(int indexOfSql,
String sql,
Object... values)
indexOfSql - the index of executed SQLsql - the expected SQLvalues - PreparedStatement parameters
public static void verifySqlByRegExp(int indexOfSql,
String regexp)
indexOfSql - the index of executed SQLregexp - the pattern of expected SQL
public static void verifySqlByRegExp(int indexOfSql,
String regexp,
Object... values)
indexOfSql - the index of executed SQLregexp - the pattern of expected SQLvalues - PreparedStatement parameters
public static void verifyFindSql(int indexOfSql,
Class<?> entityClass,
Object... id)
SqlManager.findEntity(Class, Object...).
indexOfSql - the index of executed SQLid - the values of primary key
public static void verifyInsertSql(int indexOfSql,
Object entity)
SqlManager.insertEntity(Object).
indexOfSql - the index of executed SQLentity - the entity which should be inserted
public static void verifyUpdatetSql(int indexOfSql,
Object entity)
SqlManager.updateEntity(Object).
indexOfSql - the index of executed SQLentity - the entity which should be updated
public static void verifyDeleteSql(int indexOfSql,
Object entity)
SqlManager.deleteEntity(Object).
indexOfSql - the index of executed SQLentity - the entity which should be deleted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||