|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.melati.poem.test.PoemTestCase
public class PoemTestCase
A TestCase that runs in a Database session.
| Field Summary | |
|---|---|
protected static int |
maxTrans
|
protected static junit.framework.TestResult |
result
|
| Constructor Summary | |
|---|---|
PoemTestCase()
Constructor. |
|
PoemTestCase(String name)
Constructor. |
|
| Method Summary | |
|---|---|
static void |
assertEquals(File expected,
File actual)
Asserts that two files are equal. |
static void |
assertEquals(String message,
File expected,
File actual)
Taken from junit-addons.sourceforge.net. |
static void |
assertEquals(String message,
int expected,
int actual)
|
protected void |
checkColumns(int columnCount)
|
protected void |
checkDbUnchanged()
|
protected void |
checkTables(int tableCount)
|
protected void |
checkTablesAndColumns(int tableCount,
int columnCount)
|
protected void |
databaseUnchanged()
|
protected void |
dropTable(String tableName)
|
protected void |
dumpTable(org.melati.poem.Table t)
|
org.melati.poem.Database |
getDatabase(String name)
|
String |
getDatabaseName()
|
org.melati.poem.Database |
getDb()
|
org.melati.poem.Database |
getDb(String dbNameP)
|
String |
getName()
Gets the name of a TestCase. |
static String |
getOrDie(Properties properties,
String propertyName)
Return a property. |
Properties |
getProperties()
|
String |
getPropertiesFileName()
|
org.melati.poem.AccessToken |
getUserToRunAs()
|
void |
run(junit.framework.TestResult resultIn)
Runs the test case and collects the results in TestResult. |
protected void |
runTest()
Run the test in a session. |
void |
setDatabaseName(String databaseName)
|
void |
setName(String name)
Sets the name of a TestCase. |
void |
setPropertiesFileName(String propertiesFileNameIn)
|
protected void |
setUp()
|
void |
setUserToRunAs(org.melati.poem.AccessToken userToRunAs)
|
protected void |
tearDown()
|
void |
testNothing()
Some test runners seem to think there should be a test in this file. |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, run, runBare, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface junit.framework.Test |
|---|
countTestCases |
| Field Detail |
|---|
protected static int maxTrans
protected static junit.framework.TestResult result
| Constructor Detail |
|---|
public PoemTestCase()
public PoemTestCase(String name)
name - | Method Detail |
|---|
protected void setUp()
throws Exception
setUp in class junit.framework.TestCaseExceptionTestCase.setUp()
protected void tearDown()
throws Exception
tearDown in class junit.framework.TestCaseExceptionTestCase.tearDown()public void run(junit.framework.TestResult resultIn)
run in interface junit.framework.Testrun in class junit.framework.TestCase
public static void assertEquals(String message,
int expected,
int actual)
protected void runTest()
throws Throwable
runTest in class junit.framework.TestCaseThrowableTestCase.runTest()protected void checkDbUnchanged()
protected void databaseUnchanged()
protected void dropTable(String tableName)
protected void checkTablesAndColumns(int tableCount,
int columnCount)
protected void checkTables(int tableCount)
protected void checkColumns(int columnCount)
protected void dumpTable(org.melati.poem.Table t)
public String getName()
getName in class junit.framework.TestCasepublic void setName(String name)
setName in class junit.framework.TestCasename - The name to setpublic org.melati.poem.Database getDb()
public org.melati.poem.Database getDb(String dbNameP)
dbNameP - the name of the logical db
public org.melati.poem.Database getDatabase(String name)
name - the name of the logical db
public org.melati.poem.AccessToken getUserToRunAs()
public void setUserToRunAs(org.melati.poem.AccessToken userToRunAs)
userToRunAs - the userpublic Properties getProperties()
public static String getOrDie(Properties properties,
String propertyName)
properties - the Properties object to look inpropertyName - the property to get
RuntimeException - if the property is not setpublic String getPropertiesFileName()
public void setPropertiesFileName(String propertiesFileNameIn)
propertiesFileName - the name to setpublic String getDatabaseName()
public void setDatabaseName(String databaseName)
databaseName - the db name
public static void assertEquals(String message,
File expected,
File actual)
Note: This assertion method rely on the standard junit.framework.Assert(String expected, String actual) method to compare the lines of the files. JUnit > 3.8 provides a nicer way to display differences between two strings but since only lines are compared (and not entire paragraphs) you can still use JUnit 3.7.
public static void assertEquals(File expected,
File actual)
public void testNothing()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||