TestCase : how to access the test result ?

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

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: TestCase : how to access the test result ?

JUnit - User mailing list
See the TestResult class
On Oct 28, 2015 1:13 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
>
>
>