|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junit.framework.Assert | +--junit.framework.TestCase | +--com.compoze.collab.test.CollabTestCase
A common superclass for all collab test cases. To write a test case that utilizes the framework:
CollabTestCase
and add constructors that take
(String)
and (String, UtInstance)
.
static
suite
method that calls
CollabTestCase.suite(TestCase.class)
where
TestCase.class
is replaced by the class of your test case class
test
to create your test methods.
Constructor Summary | |
CollabTestCase(java.lang.String sName)
Constructor. |
|
CollabTestCase(java.lang.String sName,
UtInstance test)
Constructor. |
Method Summary | |
protected void |
debug(java.lang.Object o)
Prints a debug message. |
static void |
deleteAllItems(IContainer container)
Deletes all items in a container. |
java.lang.String |
getAccountProperty(int iAccountNumber,
java.lang.String sKey)
Gets a property on an account. |
TestContext |
getContext()
Gets the test context. |
java.lang.String |
getName()
Gets the name of the test case (overridden to add additional configuration information). |
java.lang.String |
getProperty(java.lang.String sKey)
Gets a property from the configuration file. |
ISession |
getSession()
Gets the first session. |
ISession |
getSession(int iSessionNumber)
Gets a session by instantiating it using the properties for the given session number. |
java.util.Map |
getSessionProperties(int iSessionNumber)
Gets a session by instantiating it using the properties for the given session number. |
UtInstance |
getTest()
Gets the unit test instance. |
static boolean |
isIdInContainer(java.lang.String sID,
IContainer cont)
Verifies that an item with the specified ID is in the specified container. |
static void |
safeClose(ISession session)
Closes a possibly null session and ignores any exceptions. |
static void |
safeDelete(IItem item)
Deletes a possibly null item and ignores any exceptions. |
void |
setUp()
Sets up the test case. |
static junit.framework.TestSuite |
suite(java.lang.Class testClass)
Creates a test suite out of the test class that contains only this test class. |
static junit.framework.TestSuite |
suite(java.lang.Class testClass,
TestContext context)
Creates a test suite out of the test class that contains all classes specified by the test context. |
void |
tearDown()
Tears down the test case. |
static IGroupwareItem |
waitForItemWithSubject(IContainer container,
FetchProfile fp,
java.lang.String sSubjectSubstring)
Waits for an item with a subject that contains the specified text to show up in a container. |
protected void |
warn(java.lang.Object o)
Prints a warning message. |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, run, run, runBare, runTest, setName, 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, 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 |
Constructor Detail |
public CollabTestCase(java.lang.String sName)
sName
- the test case name (not null
)public CollabTestCase(java.lang.String sName, UtInstance test)
sName
- the test case name (not null
)test
- the test instance (not null
)Method Detail |
public void setUp() throws TestException
setUp
in class junit.framework.TestCase
TestException
- if the test case could not be set uppublic TestContext getContext()
public UtInstance getTest()
public void tearDown()
tearDown
in class junit.framework.TestCase
public static junit.framework.TestSuite suite(java.lang.Class testClass) throws TestException
testClass
- the class of the JUnit test classTestException
- if the test suite could not be createdpublic static junit.framework.TestSuite suite(java.lang.Class testClass, TestContext context) throws TestException
testClass
- the class of the JUnit test classcontext
- the test contextTestException
- if the test suite could not be createdprotected void debug(java.lang.Object o)
o
- the message (not null
)protected void warn(java.lang.Object o)
o
- the message (not null
)public java.lang.String getProperty(java.lang.String sKey)
sKey
- the key (not null
)null
if not found)public java.lang.String getAccountProperty(int iAccountNumber, java.lang.String sKey)
iAccountNumber
- the account numbersKey
- the property keynull
if not found)public ISession getSession() throws CollaborationException
null
)CollaborationException
- if something went wrong when creating
the sessionpublic ISession getSession(int iSessionNumber) throws CollaborationException
iSessionNumber
- the session numbernull
)CollaborationException
- if something went wrong when creating
the sessionpublic java.util.Map getSessionProperties(int iSessionNumber) throws CollaborationException
iSessionNumber
- the session numbernull
)CollaborationException
- if something went wrong when creating
the sessionpublic static void safeClose(ISession session)
session
- the sessionpublic static void safeDelete(IItem item)
null
item and ignores any exceptions.item
- the itempublic static boolean isIdInContainer(java.lang.String sID, IContainer cont) throws CollaborationException
sID
- the ID (not null
)cont
- the container to check (not null
)true
if the ID is in the specified containerCollaborationException
- if something went wrong when getting the itempublic static IGroupwareItem waitForItemWithSubject(IContainer container, FetchProfile fp, java.lang.String sSubjectSubstring) throws CollaborationException
container
- the containerfp
- the fetch profile to get the item withsSubjectSubstring
- the substring of the subject to look fornull
if the item could not be found
within the timeoutCollaborationException
- if something went wrong when looking for the itempublic static void deleteAllItems(IContainer container) throws CollaborationException
container
- the container to delete items fromCollaborationException
- if something went wrong when deleting the itemspublic java.lang.String getName()
getName
in class junit.framework.TestCase
null
)
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |