|
||||||||||
| 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.apache.shale.test.base.AbstractJsfTestCase
org.ajax4jsf.tests.AbstractAjax4JsfTestCase
org.ajax4jsf.tests.AbstractThreadedAjax4JsfTestCase
public class AbstractThreadedAjax4JsfTestCase
MultiThreadedTestCase
Runnable extend MultiThreadedTestCase.TestCaseRunnable.
runTestCase () to do your test, you may call fail (), assert () etc. and throw
exceptions with impunity.
runTestCaseRunnables ().
public class MTTest extends ThreadedVcpJsfTestCase
{
MTTest (String s) { super (s); }
public class CounterThread extends TestCaseRunnable
{
public void runTestCase (FacesContext context) throws Throwable
{
for (int i = 0; i < 1000; i++)
{
System.out.println ("Counter Thread: " + Thread.currentThread () + " : " + i);
// Do some testing...
if (Thread.currentThread ().isInterrupted ()) {
return;
}
}
}
}
public void test1 ()
{
TestCaseRunnable tct [] = new TestCaseRunnable [5];
for (int i = 0; i < 5; i++)
{
tct[i] = new CounterThread ();
}
runTestCaseRunnables (tct);
}
}
| Nested Class Summary | |
|---|---|
class |
AbstractThreadedAjax4JsfTestCase.TestCaseRunnable
A test case thread. |
| Field Summary |
|---|
| Fields inherited from class org.ajax4jsf.tests.AbstractAjax4JsfTestCase |
|---|
ajaxContext, elContext, expressionFactory, SLASHED_RESOURCE_URI_PREFIX, vcpRenderKit, webClient, webConnection, webXml, writer |
| Fields inherited from class org.apache.shale.test.base.AbstractJsfTestCase |
|---|
application, config, externalContext, facesContext, facesContextFactory, lifecycle, lifecycleFactory, renderKit, request, response, servletContext, session |
| Constructor Summary | |
|---|---|
AbstractThreadedAjax4JsfTestCase(java.lang.String s)
Simple constructor. |
|
| Method Summary | |
|---|---|
protected javax.faces.context.FacesContext |
createFacesContext()
Create instance of faces context for current thread. |
void |
interruptThreads()
Interrupt the running threads. |
void |
run(junit.framework.TestResult result)
Override run so we can squirrel away the test result. |
protected void |
runTestCaseRunnables(AbstractThreadedAjax4JsfTestCase.TestCaseRunnable[] runnables)
Run the test case threads. |
protected void |
runTestCaseThreads(java.lang.Class clazz,
int numThreads)
Create instances of classes and run threads with it. |
| Methods inherited from class org.ajax4jsf.tests.AbstractAjax4JsfTestCase |
|---|
createComponent, createWebClient, evaluate, getCountValidScripts, getImageResource, getImplementationUrls, getResourceIfPresent, getSkinName, processResponse, processResponseWriter, renderChild, renderChildren, renderView, setUp, setupResponseWriter, setupWebClient, tearDown |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, 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, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractThreadedAjax4JsfTestCase(java.lang.String s)
| Method Detail |
|---|
public void interruptThreads()
public void run(junit.framework.TestResult result)
run in interface junit.framework.Testrun in class junit.framework.TestCase
protected void runTestCaseThreads(java.lang.Class clazz,
int numThreads)
clazz - - class of test thread implementation.numThreads - - number of threads to run.
java.lang.InstantiationException
java.lang.IllegalAccessExceptionprotected void runTestCaseRunnables(AbstractThreadedAjax4JsfTestCase.TestCaseRunnable[] runnables)
runnables - - array with instances of AbstractThreadedAjax4JsfTestCase.TestCaseRunnable with concrete testsprotected javax.faces.context.FacesContext createFacesContext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||