Rerunning failed test method at runtime.

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

Rerunning failed test method at runtime.

mikkin
Hi

I was wondering if there is any way to re-run a failed test method at
runtime. I tried using IRetryAnalyzer, but it does not work well with
multi-threaded code(Since I would like to retry maximum twice and then
fail or if success, then exit).

Any help would be appreciated.

Thanks
Mikkin

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Rerunning failed test method at runtime.

Cédric Beust ♔
Hi Mikkin,

I'm not sure I understand why IRetryAnalyzer doesn't mix well with parallel, can you elaborate?

--
Cedric


On Thu, Feb 18, 2010 at 9:00 PM, mikkin <[hidden email]> wrote:
Hi

I was wondering if there is any way to re-run a failed test method at
runtime. I tried using IRetryAnalyzer, but it does not work well with
multi-threaded code(Since I would like to retry maximum twice and then
fail or if success, then exit).

Any help would be appreciated.

Thanks
Mikkin

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Rerunning failed test method at runtime.

mikkin
Hi Cedric,

I made a really silly mistake in my code and hence it was not working.
I initially thought that in multi-threaded mode, it shares the same
instance of RetryAnalyzer class, but was not the case.

However, I cannot seem to get the retryanalyzer test annotation to
work at class level. I did see Francois' reply on one of the prior
post about using IAnnotationTransformer, but would be great if it
worked out of the box :)

Below is my code that I am trying to run with retryanalyzer at class
level.

@Test(retryAnalyzer=Analyzer.class)
public class TestClassA {

        @Test
        public void test1() {
                assertTrue("a".equals("a"), "Success in test1");
        }

        @Test
        public void test2() {
                assertTrue("a".equals("b"), "Error in test2");
        }

        @Test
        public void test3() {
                assertTrue("a".equals("b"), "Error in test3");
        }
}
________________________________________________________________

@Test(retryAnalyzer=Analyzer.class)
public class TestClassB {

        @Test
        public void test11() {
                assertTrue("a".equals("a"), "Success in test11");
        }

        @Test
        public void test22() {
                assertTrue("a".equals("b"), "Error in test22");
        }

        @Test
        public void test33() {
                assertTrue("a".equals("b"), "Error in test33");
        }
}
_____________________________________________________

public class Analyzer implements IRetryAnalyzer {

        private int count = 0;
        private int maxCount = 3;
        @Override
        public boolean retry(ITestResult result) {
                if(count < maxCount) {
                        System.out.println("Error in " + result.getName() + " with status "
+ result.getStatus()+ " Retrying " + count + " times");
                        count += 1;
                        return true;
                }
                return false;
        }
}
______________________________________________________________________________________________



On Feb 18, 9:08 pm, Cédric Beust ♔ <[hidden email]> wrote:

> Hi Mikkin,
>
> I'm not sure I understand why IRetryAnalyzer doesn't mix well with parallel,
> can you elaborate?
>
> --
> Cedric
>
>
>
>
>
> On Thu, Feb 18, 2010 at 9:00 PM, mikkin <[hidden email]> wrote:
> > Hi
>
> > I was wondering if there is any way to re-run a failed test method at
> > runtime. I tried using IRetryAnalyzer, but it does not work well with
> > multi-threaded code(Since I would like to retry maximum twice and then
> > fail or if success, then exit).
>
> > Any help would be appreciated.
>
> > Thanks
> > Mikkin
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to [hidden email].
> > To unsubscribe from this group, send email to
> > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.
>
> --
> ***Cédric
> *

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Rerunning failed test method at runtime.

mikkin
Hi,

Now that I am running my multi-threaded tests using the approach
suggested by Francois in another thread, I am able to get by the
problem of not having to annotate each and every test method.

But I have one concern. The problem is that the testNG report displays
the test method that passed on retry in both failed as well as passed
test.
I understand it is important to have the test names mentioned in both
the places, but is there any way that I can get it to go away from the
failed tests list "if" they have passed on retry.

-Mikkin

On Feb 19, 10:45 am, mikkin <[hidden email]> wrote:

> Hi Cedric,
>
> I made a really silly mistake in my code and hence it was not working.
> I initially thought that in multi-threaded mode, it shares the same
> instance of RetryAnalyzer class, but was not the case.
>
> However, I cannot seem to get the retryanalyzer test annotation to
> work at class level. I did see Francois' reply on one of the prior
> post about using IAnnotationTransformer, but would be great if it
> worked out of the box :)
>
> Below is my code that I am trying to run with retryanalyzer at class
> level.
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassA {
>
>         @Test
>         public void test1() {
>                 assertTrue("a".equals("a"), "Success in test1");
>         }
>
>         @Test
>         public void test2() {
>                 assertTrue("a".equals("b"), "Error in test2");
>         }
>
>         @Test
>         public void test3() {
>                 assertTrue("a".equals("b"), "Error in test3");
>         }}
>
> ________________________________________________________________
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassB {
>
>         @Test
>         public void test11() {
>                 assertTrue("a".equals("a"), "Success in test11");
>         }
>
>         @Test
>         public void test22() {
>                 assertTrue("a".equals("b"), "Error in test22");
>         }
>
>         @Test
>         public void test33() {
>                 assertTrue("a".equals("b"), "Error in test33");
>         }}
>
> _____________________________________________________
>
> public class Analyzer implements IRetryAnalyzer {
>
>         private int count = 0;
>         private int maxCount = 3;
>         @Override
>         public boolean retry(ITestResult result) {
>                 if(count < maxCount) {
>                         System.out.println("Error in " + result.getName() + " with status "
> + result.getStatus()+ " Retrying " + count + " times");
>                         count += 1;
>                         return true;
>                 }
>                 return false;
>         }}
>
> ______________________________________________________________________________________________
>
> On Feb 18, 9:08 pm, Cédric Beust ♔ <[hidden email]> wrote:
>
> > Hi Mikkin,
>
> > I'm not sure I understand why IRetryAnalyzer doesn't mix well with parallel,
> > can you elaborate?
>
> > --
> > Cedric
>
> > On Thu, Feb 18, 2010 at 9:00 PM, mikkin <[hidden email]> wrote:
> > > Hi
>
> > > I was wondering if there is any way to re-run a failed test method at
> > > runtime. I tried using IRetryAnalyzer, but it does not work well with
> > > multi-threaded code(Since I would like to retry maximum twice and then
> > > fail or if success, then exit).
>
> > > Any help would be appreciated.
>
> > > Thanks
> > > Mikkin
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "testng-users" group.
> > > To post to this group, send email to [hidden email].
> > > To unsubscribe from this group, send email to
> > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > ***Cédric
> > *

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Re: Rerunning failed test method at runtime.

Cédric Beust ♔
Hi Mikkin,

The easiest way to do this is to patch SuiteReporter, which is probably a very small change...

--
Cedric


On Fri, Feb 19, 2010 at 4:38 PM, mikkin <[hidden email]> wrote:
Hi,

Now that I am running my multi-threaded tests using the approach
suggested by Francois in another thread, I am able to get by the
problem of not having to annotate each and every test method.

But I have one concern. The problem is that the testNG report displays
the test method that passed on retry in both failed as well as passed
test.
I understand it is important to have the test names mentioned in both
the places, but is there any way that I can get it to go away from the
failed tests list "if" they have passed on retry.

-Mikkin

On Feb 19, 10:45 am, mikkin <[hidden email]> wrote:
> Hi Cedric,
>
> I made a really silly mistake in my code and hence it was not working.
> I initially thought that in multi-threaded mode, it shares the same
> instance of RetryAnalyzer class, but was not the case.
>
> However, I cannot seem to get the retryanalyzer test annotation to
> work at class level. I did see Francois' reply on one of the prior
> post about using IAnnotationTransformer, but would be great if it
> worked out of the box :)
>
> Below is my code that I am trying to run with retryanalyzer at class
> level.
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassA {
>
>         @Test
>         public void test1() {
>                 assertTrue("a".equals("a"), "Success in test1");
>         }
>
>         @Test
>         public void test2() {
>                 assertTrue("a".equals("b"), "Error in test2");
>         }
>
>         @Test
>         public void test3() {
>                 assertTrue("a".equals("b"), "Error in test3");
>         }}
>
> ________________________________________________________________
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassB {
>
>         @Test
>         public void test11() {
>                 assertTrue("a".equals("a"), "Success in test11");
>         }
>
>         @Test
>         public void test22() {
>                 assertTrue("a".equals("b"), "Error in test22");
>         }
>
>         @Test
>         public void test33() {
>                 assertTrue("a".equals("b"), "Error in test33");
>         }}
>
> _____________________________________________________
>
> public class Analyzer implements IRetryAnalyzer {
>
>         private int count = 0;
>         private int maxCount = 3;
>         @Override
>         public boolean retry(ITestResult result) {
>                 if(count < maxCount) {
>                         System.out.println("Error in " + result.getName() + " with status "
> + result.getStatus()+ " Retrying " + count + " times");
>                         count += 1;
>                         return true;
>                 }
>                 return false;
>         }}
>
> ______________________________________________________________________________________________
>
> On Feb 18, 9:08 pm, Cédric Beust ♔ <[hidden email]> wrote:
>
> > Hi Mikkin,
>
> > I'm not sure I understand why IRetryAnalyzer doesn't mix well with parallel,
> > can you elaborate?
>
> > --
> > Cedric
>
> > On Thu, Feb 18, 2010 at 9:00 PM, mikkin <[hidden email]> wrote:
> > > Hi
>
> > > I was wondering if there is any way to re-run a failed test method at
> > > runtime. I tried using IRetryAnalyzer, but it does not work well with
> > > multi-threaded code(Since I would like to retry maximum twice and then
> > > fail or if success, then exit).
>
> > > Any help would be appreciated.
>
> > > Thanks
> > > Mikkin
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "testng-users" group.
> > > To post to this group, send email to [hidden email].
> > > To unsubscribe from this group, send email to
> > > [hidden email]<testng-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > ***Cédric
> > *

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Rerunning failed test method at runtime.

Indrani
Hi Cedric,

can you please direct me how to patch the suiteReporter. Clueless !!

--Indrani

On Saturday, February 20, 2010 10:49:29 PM UTC-8, Cedric wrote:
Hi Mikkin,

The easiest way to do this is to patch SuiteReporter, which is probably a very small change...

--
Cedric


On Fri, Feb 19, 2010 at 4:38 PM, mikkin <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="jTHvdJW29WAJ">mikki...@...> wrote:
Hi,

Now that I am running my multi-threaded tests using the approach
suggested by Francois in another thread, I am able to get by the
problem of not having to annotate each and every test method.

But I have one concern. The problem is that the testNG report displays
the test method that passed on retry in both failed as well as passed
test.
I understand it is important to have the test names mentioned in both
the places, but is there any way that I can get it to go away from the
failed tests list "if" they have passed on retry.

-Mikkin

On Feb 19, 10:45 am, mikkin <[hidden email]> wrote:
> Hi Cedric,
>
> I made a really silly mistake in my code and hence it was not working.
> I initially thought that in multi-threaded mode, it shares the same
> instance of RetryAnalyzer class, but was not the case.
>
> However, I cannot seem to get the retryanalyzer test annotation to
> work at class level. I did see Francois' reply on one of the prior
> post about using IAnnotationTransformer, but would be great if it
> worked out of the box :)
>
> Below is my code that I am trying to run with retryanalyzer at class
> level.
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassA {
>
>         @Test
>         public void test1() {
>                 assertTrue("a".equals("a"), "Success in test1");
>         }
>
>         @Test
>         public void test2() {
>                 assertTrue("a".equals("b"), "Error in test2");
>         }
>
>         @Test
>         public void test3() {
>                 assertTrue("a".equals("b"), "Error in test3");
>         }}
>
> ________________________________________________________________
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassB {
>
>         @Test
>         public void test11() {
>                 assertTrue("a".equals("a"), "Success in test11");
>         }
>
>         @Test
>         public void test22() {
>                 assertTrue("a".equals("b"), "Error in test22");
>         }
>
>         @Test
>         public void test33() {
>                 assertTrue("a".equals("b"), "Error in test33");
>         }}
>
> _____________________________________________________
>
> public class Analyzer implements IRetryAnalyzer {
>
>         private int count = 0;
>         private int maxCount = 3;
>         @Override
>         public boolean retry(ITestResult result) {
>                 if(count < maxCount) {
>                         System.out.println("Error in " + result.getName() + " with status "
> + result.getStatus()+ " Retrying " + count + " times");
>                         count += 1;
>                         return true;
>                 }
>                 return false;
>         }}
>
> ______________________________________________________________________________________________
>
> On Feb 18, 9:08 pm, Cédric Beust ♔ <[hidden email]> wrote:
>
> > Hi Mikkin,
>
> > I'm not sure I understand why IRetryAnalyzer doesn't mix well with parallel,
> > can you elaborate?
>
> > --
> > Cedric
>
> > On Thu, Feb 18, 2010 at 9:00 PM, mikkin <[hidden email]> wrote:
> > > Hi
>
> > > I was wondering if there is any way to re-run a failed test method at
> > > runtime. I tried using IRetryAnalyzer, but it does not work well with
> > > multi-threaded code(Since I would like to retry maximum twice and then
> > > fail or if success, then exit).
>
> > > Any help would be appreciated.
>
> > > Thanks
> > > Mikkin
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "testng-users" group.
> > > To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jTHvdJW29WAJ">testng...@....
> > > To unsubscribe from this group, send email to
> > > <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jTHvdJW29WAJ">testng-users...@googlegroups.com<testng-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > ***Cédric
> > *

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jTHvdJW29WAJ">testng...@....
To unsubscribe from this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jTHvdJW29WAJ">testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/ZZWrKkg2gwQJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Rerunning failed test method at runtime.

Indrani
Cedric or anyone who knows how to answer my question , will be very helpful

if retry count is set to 1, then second time if its passes , the test is both displayed as failed and passed, how can i tweak the reporter to not do this

On Thursday, December 6, 2012 2:17:59 PM UTC-8, Indrani biswas wrote:
Hi Cedric,

can you please direct me how to patch the suiteReporter. Clueless !!

--Indrani

On Saturday, February 20, 2010 10:49:29 PM UTC-8, Cedric wrote:
Hi Mikkin,

The easiest way to do this is to patch SuiteReporter, which is probably a very small change...

--
Cedric


On Fri, Feb 19, 2010 at 4:38 PM, mikkin <[hidden email]> wrote:
Hi,

Now that I am running my multi-threaded tests using the approach
suggested by Francois in another thread, I am able to get by the
problem of not having to annotate each and every test method.

But I have one concern. The problem is that the testNG report displays
the test method that passed on retry in both failed as well as passed
test.
I understand it is important to have the test names mentioned in both
the places, but is there any way that I can get it to go away from the
failed tests list "if" they have passed on retry.

-Mikkin

On Feb 19, 10:45 am, mikkin <[hidden email]> wrote:
> Hi Cedric,
>
> I made a really silly mistake in my code and hence it was not working.
> I initially thought that in multi-threaded mode, it shares the same
> instance of RetryAnalyzer class, but was not the case.
>
> However, I cannot seem to get the retryanalyzer test annotation to
> work at class level. I did see Francois' reply on one of the prior
> post about using IAnnotationTransformer, but would be great if it
> worked out of the box :)
>
> Below is my code that I am trying to run with retryanalyzer at class
> level.
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassA {
>
>         @Test
>         public void test1() {
>                 assertTrue("a".equals("a"), "Success in test1");
>         }
>
>         @Test
>         public void test2() {
>                 assertTrue("a".equals("b"), "Error in test2");
>         }
>
>         @Test
>         public void test3() {
>                 assertTrue("a".equals("b"), "Error in test3");
>         }}
>
> ________________________________________________________________
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassB {
>
>         @Test
>         public void test11() {
>                 assertTrue("a".equals("a"), "Success in test11");
>         }
>
>         @Test
>         public void test22() {
>                 assertTrue("a".equals("b"), "Error in test22");
>         }
>
>         @Test
>         public void test33() {
>                 assertTrue("a".equals("b"), "Error in test33");
>         }}
>
> _____________________________________________________
>
> public class Analyzer implements IRetryAnalyzer {
>
>         private int count = 0;
>         private int maxCount = 3;
>         @Override
>         public boolean retry(ITestResult result) {
>                 if(count < maxCount) {
>                         System.out.println("Error in " + result.getName() + " with status "
> + result.getStatus()+ " Retrying " + count + " times");
>                         count += 1;
>                         return true;
>                 }
>                 return false;
>         }}
>
> ______________________________________________________________________________________________
>
> On Feb 18, 9:08 pm, Cédric Beust ♔ <[hidden email]> wrote:
>
> > Hi Mikkin,
>
> > I'm not sure I understand why IRetryAnalyzer doesn't mix well with parallel,
> > can you elaborate?
>
> > --
> > Cedric
>
> > On Thu, Feb 18, 2010 at 9:00 PM, mikkin <[hidden email]> wrote:
> > > Hi
>
> > > I was wondering if there is any way to re-run a failed test method at
> > > runtime. I tried using IRetryAnalyzer, but it does not work well with
> > > multi-threaded code(Since I would like to retry maximum twice and then
> > > fail or if success, then exit).
>
> > > Any help would be appreciated.
>
> > > Thanks
> > > Mikkin
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "testng-users" group.
> > > To post to this group, send email to [hidden email].
> > > To unsubscribe from this group, send email to
> > > testng-users...@googlegroups.com<testng-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > ***Cédric
> > *

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/zhCckQgfeQgJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Rerunning failed test method at runtime.

stefanschuri
I'am also very interested in how that would work. having the same problem with duplicated tests in reports when tests retry.

-Stefan

Am Freitag, 11. Januar 2013 00:19:00 UTC+1 schrieb Indrani biswas:
Cedric or anyone who knows how to answer my question , will be very helpful

if retry count is set to 1, then second time if its passes , the test is both displayed as failed and passed, how can i tweak the reporter to not do this

On Thursday, December 6, 2012 2:17:59 PM UTC-8, Indrani biswas wrote:
Hi Cedric,

can you please direct me how to patch the suiteReporter. Clueless !!

--Indrani

On Saturday, February 20, 2010 10:49:29 PM UTC-8, Cedric wrote:
Hi Mikkin,

The easiest way to do this is to patch SuiteReporter, which is probably a very small change...

--
Cedric


On Fri, Feb 19, 2010 at 4:38 PM, mikkin <[hidden email]> wrote:
Hi,

Now that I am running my multi-threaded tests using the approach
suggested by Francois in another thread, I am able to get by the
problem of not having to annotate each and every test method.

But I have one concern. The problem is that the testNG report displays
the test method that passed on retry in both failed as well as passed
test.
I understand it is important to have the test names mentioned in both
the places, but is there any way that I can get it to go away from the
failed tests list "if" they have passed on retry.

-Mikkin

On Feb 19, 10:45 am, mikkin <[hidden email]> wrote:
> Hi Cedric,
>
> I made a really silly mistake in my code and hence it was not working.
> I initially thought that in multi-threaded mode, it shares the same
> instance of RetryAnalyzer class, but was not the case.
>
> However, I cannot seem to get the retryanalyzer test annotation to
> work at class level. I did see Francois' reply on one of the prior
> post about using IAnnotationTransformer, but would be great if it
> worked out of the box :)
>
> Below is my code that I am trying to run with retryanalyzer at class
> level.
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassA {
>
>         @Test
>         public void test1() {
>                 assertTrue("a".equals("a"), "Success in test1");
>         }
>
>         @Test
>         public void test2() {
>                 assertTrue("a".equals("b"), "Error in test2");
>         }
>
>         @Test
>         public void test3() {
>                 assertTrue("a".equals("b"), "Error in test3");
>         }}
>
> ________________________________________________________________
>
> @Test(retryAnalyzer=Analyzer.class)
> public class TestClassB {
>
>         @Test
>         public void test11() {
>                 assertTrue("a".equals("a"), "Success in test11");
>         }
>
>         @Test
>         public void test22() {
>                 assertTrue("a".equals("b"), "Error in test22");
>         }
>
>         @Test
>         public void test33() {
>                 assertTrue("a".equals("b"), "Error in test33");
>         }}
>
> _____________________________________________________
>
> public class Analyzer implements IRetryAnalyzer {
>
>         private int count = 0;
>         private int maxCount = 3;
>         @Override
>         public boolean retry(ITestResult result) {
>                 if(count < maxCount) {
>                         System.out.println("Error in " + result.getName() + " with status "
> + result.getStatus()+ " Retrying " + count + " times");
>                         count += 1;
>                         return true;
>                 }
>                 return false;
>         }}
>
> ______________________________________________________________________________________________
>
> On Feb 18, 9:08 pm, Cédric Beust ♔ <[hidden email]> wrote:
>
> > Hi Mikkin,
>
> > I'm not sure I understand why IRetryAnalyzer doesn't mix well with parallel,
> > can you elaborate?
>
> > --
> > Cedric
>
> > On Thu, Feb 18, 2010 at 9:00 PM, mikkin <[hidden email]> wrote:
> > > Hi
>
> > > I was wondering if there is any way to re-run a failed test method at
> > > runtime. I tried using IRetryAnalyzer, but it does not work well with
> > > multi-threaded code(Since I would like to retry maximum twice and then
> > > fail or if success, then exit).
>
> > > Any help would be appreciated.
>
> > > Thanks
> > > Mikkin
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "testng-users" group.
> > > To post to this group, send email to [hidden email].
> > > To unsubscribe from this group, send email to
> > > testng-users...@googlegroups.com<testng-users%2Bunsubscribe@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/testng-users?hl=en.
>
> > --
> > ***Cédric
> > *

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/2E-ZJymo8BEJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.