Fwd: TestCase : how to access the test result ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: TestCase : how to access the test result ?

JUnit - User mailing list
Hello,


I am doing aspect programming for my thesis. There I have access to the
TestCase class. There when a test case method is executed. I want to get
its result whether test has passed or failed. So that I can use that
information. How can I get the test result programmatically ?


Here is sample code :


        pointcut allMethodsRun() : execution(* *.*(..));
        pointcut testClasses() : within(junit.framework.TestCase+);




     after() :  testClasses() && allMethodsRun() {
         System.out.println(((TestCase) thisJoinPoint.getThis()).run()  );








Here I can access the TestCase class but how can I get the test result
after test method executes. Any Idea or question ?


ilke
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: TestCase : how to access the test result ?

JUnit - User mailing list
This should help:

http://junit.sourceforge.net/doc/cookstour/cookstour.htm

Good luck!

- Kevin
On Nov 4, 2015 11:06 PM, "ilke Muhtaroglu [hidden email]
[junit]" <[hidden email]> wrote:

>
>
>
>
>
> Hello,
>
> I am doing aspect programming for my thesis. There I have access to the
> TestCase class. There when a test case method is executed. I want to get
> its result whether test has passed or failed. So that I can use that
> information. How can I get the test result programmatically ?
>
> Here is sample code :
>
>         pointcut allMethodsRun() : execution(* *.*(..));
>         pointcut testClasses() : within(junit.framework.TestCase+);
>
>
>      after() :  testClasses() && allMethodsRun() {
>          System.out.println(((TestCase) thisJoinPoint.getThis()).run()  );
>
>
>
>
> Here I can access the TestCase class but how can I get the test result
> after test method executes. Any Idea or question ?
>
> ilke
>
>
>
>