[testng-dev] run classes sequentialy without interleaves

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

[testng-dev] run classes sequentialy without interleaves

daniel lutoff
Hi all,
I'm sure that the following question has already been asked and solved, but I was not able to find it ...

Here is my context.
I've several classes and each has a beforeClass, afterClass and tests in it, something like
Class C1
   @BeforeClass
   public void before_c1() ...
      @Test
      public void test_c1_t1 ...
   @Test
  
public void test_c1_t2 ...
   @AfterClass
   public void after_c1() ... 

Class C2
   @BeforeClass
   public void before_c2() ...  
      @Test
      public void test_c2_t1 ...
   @Test
  
public void test_c2_t2 ...
   @AfterClass
   public void after_c2() ... 

In my context, and in the worse case, "before" methods start a server, "after" methods can stop it
(Note also that dependsOnMethod in used in some classes.)

So, in that context, I CANNOT have the following sequential method call

before_c1              <--  start the server
   test_c1_t1
before_c2
       <-- start the server (nothing to do: server already started)

   test_c1_t2
   test_c2_t1
after_c1        <-- stop the server
   test_c2_t2   <-- FAILED: server was stopped by
after_c1


Here is my question: How can I be sure that ALL methods in a class are executed in an isolated manner?
My need is to NO interleave between classes, even if the dependencies (
dependsOnMethod) are used in the java code

Thanks
Daniel


--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: [testng-dev] run classes sequentialy without interleaves

Tomek Kaczanowski-3
Hi,

would starting/stopping server per group work for you? Is it important
that you start / stop it per class?

2013/10/15 daniel lutoff <[hidden email]>:

> Hi all,
> I'm sure that the following question has already been asked and solved, but
> I was not able to find it ...
>
> Here is my context.
> I've several classes and each has a beforeClass, afterClass and tests in it,
> something like
> Class C1
>    @BeforeClass
>    public void before_c1() ...
>       @Test
>       public void test_c1_t1 ...
>    @Test
>    public void test_c1_t2 ...
>    @AfterClass
>    public void after_c1() ...
>
> Class C2
>    @BeforeClass
>    public void before_c2() ...
>       @Test
>       public void test_c2_t1 ...
>    @Test
>    public void test_c2_t2 ...
>    @AfterClass
>    public void after_c2() ...
>
> In my context, and in the worse case, "before" methods start a server,
> "after" methods can stop it
> (Note also that dependsOnMethod in used in some classes.)
>
> So, in that context, I CANNOT have the following sequential method call
> before_c1              <--  start the server
>    test_c1_t1
> before_c2       <-- start the server (nothing to do: server already started)
>    test_c1_t2
>    test_c2_t1
> after_c1        <-- stop the server
>    test_c2_t2   <-- FAILED: server was stopped by after_c1
>
>
> Here is my question: How can I be sure that ALL methods in a class are
> executed in an isolated manner?
> My need is to NO interleave between classes, even if the dependencies
> (dependsOnMethod) are used in the java code
>
> Thanks
> Daniel
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "testng-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/testng-dev.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Regards / Pozdrawiam
Tomek Kaczanowski
http://practicalunittesting.com

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/groups/opt_out.