Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » cactus suite of plain tests not junit-runnable ?
cactus suite of plain tests not junit-runnable ? [message #242963] Wed, 18 April 2007 09:38
Edoardo Comar is currently offline Edoardo ComarFriend
Messages: 102
Registered: July 2009
Senior Member
Hi

I am trying to reuse a set of PLAIN junit tests as a cactus suite -
following the Option B: reuse a JUnit TestCase
doc at http://jakarta.apache.org/cactus/1.7.2/writing/howto_testcas e.html

<quote>
Cactus is able to run pure JUnit TestCase on the server side. This is
done by using the ServletTestSuite Test Suite that wraps your existing
Test Cases. For example:

public class TestJUnitTestCaseWrapper extends TestCase
{
public static Test suite()
{
ServletTestSuite suite = new ServletTestSuite();
suite.addTestSuite(TestJUnitTestCaseWrapper.class);
return suite;
}

public void testXXX()
{
}
}
</quote>


with a bit of tracing it's easy to see that the tests do get run on the
server but the eclipse junit runner does NOT get any results.
it terminates showing no tests have been run (e.g. showing a label like
"Runs: 0/3").

if the ServletTestSuite is run with the text junit runner (!) the
results do come back as expected

i noticed an error in the eclipse error log ....

java.lang.Exception: Unexpected TestElement type for testId '3': null
org.eclipse.jdt.internal.junit.model.TestRunSession$TestSess ionNotifier.logUnexpectedTest(Unknown
org.eclipse.jdt.internal.junit.model.TestRunSession$TestSess ionNotifier.testEnded(Unknown
org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient$ 4.run(Unknown
at org.eclipse.core.runtime.SafeRunner.run(Unknown Source)
org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient. notifyTestEnded(Unknown
org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient. access$7(Unknown
org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient$ DefaultProcessingState.readMessage(Unknown
org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient. receiveMessage(Unknown
org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient. access$26(Unknown
org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient$ ServerConnection.run(Unknown
Source)

at
org.eclipse.jdt.internal.junit.model.TestRunSession$TestSess ionNotifier.testEnded(Unknown
Source) there is this code :

....
if (! (testElement instanceof TestCaseElement)) {
logUnexpectedTest(testId, testElement);
return;
}

I am using cactus 1.7.2 with java5 and rational software architect
7.0.0.2 (eclipse 3.2.2 based)
Previous Topic:Java Debug View not receiving events?
Next Topic:ITestRunListener vs. TestRunListener
Goto Forum:
  


Current Time: Wed Jul 17 14:40:11 GMT 2024

Powered by FUDForum. Page generated in 0.03636 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top