Board index » jbuilder » Output from Test Cases written to file

Output from Test Cases written to file


2005-04-28 07:57:36 PM
jbuilder13
Running on JBuiler 2005, Developer.
I have created a number of Test Cases and Test Suites. The results are
nicely viewable in the "Test Hierarchy" pane, the "Test Failures" pane and
the "Test Output" pane at the bottom of the IDE.
However I would like to write these results to a file. Preferrably in the
format of the "Test Hierarchy" in order to list all succeeded and failed
Test Suites, Test Cases and Test Methods in a hierarchy. But any other way
to put these outputs to a file would be acceptable.
Thanks!
/Gil Roitto
 
 

Re:Output from Test Cases written to file

Its been awhile since I tried this, but I believe
in the runtime configuration of the test, there are
a few options to choose the type of runner to exec
JUnit tests.
- JBuilder runner
- JUnit SwingUI runner
- JUnit Console runner
The default is the first one, but if you choose
the last one, you should be able to see the output
of the test in a console/command line mode.
Off the top of my head I think it was something
like:
// set classpath
// ">" is the prompt
Quote
java junit.console.TestRunner <test_case_class | test_suite_class>
-krish
Gil Roitto wrote:
Quote
Running on JBuiler 2005, Developer.

I have created a number of Test Cases and Test Suites. The results are
nicely viewable in the "Test Hierarchy" pane, the "Test Failures" pane and
the "Test Output" pane at the bottom of the IDE.

However I would like to write these results to a file. Preferrably in the
format of the "Test Hierarchy" in order to list all succeeded and failed
Test Suites, Test Cases and Test Methods in a hierarchy. But any other way
to put these outputs to a file would be acceptable.

Thanks!
/Gil Roitto


 

Re:Output from Test Cases written to file

Thanks, this helped.
But I will only get a report what failed. E.g:
---------
C:\Borland\JBuilder2005\jdk1.4\bin\javaw -classpath ...
...F.................
Time: 0
There was 1 failure:
1) testGetStatus(Status)junit.framework.AssertionFailedError: Test Fail
at TestStatus.testGetStatus(TestStatus.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
FAILURES!!!
Tests run: 20, Failures: 1, Errors: 0
---------
Can I get all tests that succeeded too? Maybee som parameter to the TextUI
Runner.
And I would be very happy If I could get the hierarchy of test suites that
can be seen in the JBuilder GUI.
Gil
"Krishnan Subramanian" < XXXX@XXXXX.COM >wrote in message
Quote
Its been awhile since I tried this, but I believe
in the runtime configuration of the test, there are
a few options to choose the type of runner to exec
JUnit tests.

- JBuilder runner
- JUnit SwingUI runner
- JUnit Console runner

The default is the first one, but if you choose
the last one, you should be able to see the output
of the test in a console/command line mode.

Off the top of my head I think it was something
like:

// set classpath
// ">" is the prompt
>java junit.console.TestRunner <test_case_class | test_suite_class>

-krish
 

{smallsort}