Eclipse plugin support for dependsOnGroups?

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

Eclipse plugin support for dependsOnGroups?

perreaultj

Hi Alex,

I'm running Eclipse 3.2.1 with a bugfix follow-on of the 5.4.0.0 TestNG
plugin. I'm seeing two problems.

I have test class XxxTest with test methods:

        @Test(groups = {"group1"})
        public void testX() {
                // empty
        }

        @Test(dependsOnGroups = {"group1"})
        public void testY() {
                // empty
        }


Problem 1

Within Eclipse, I run the test class by right-clicking the test class
java file in the Package Explorer window and selecting menu "Run As ->
TestNG Test". I get the following warning pop-up:

"XxxTest defines group dependencies that will be ignored. To reliably
test methods with group dependencies use a suite definition.

Reason: XxxTest uses group dependencies which due to a plugin
limitation will be ignored."

The test then proceeds to execute.

In two other launch scenarios, the test seems to execute without
warning about the group dependency (but in this simple example I don't
know whether it is actually honoring the dependency, or if the tests
just happen to execute in the dependent order). The non-warning launch
scenarios are:

a) Right-click the test class java file in Package Explorer window, but
instead select "Run As -> Run..." and execute from the TestNG Run
Configuration screen.

b) With the test class java file in the editor window, right-click in
the editor text area and select "TestNG -> Run as test".


Problem 2

Under the Test tab of the TestNG Run Configuration screen, the "Class"
button is selected and class field contains <package>.XxxTest.

I subsequently run the test from Package Explorer menu selection that
causes the warning that group dependencies will be ignored, and when I
look at TestNG Run Configuration afterward, I find the class field has
been modified. In addition to the test class originally specified, the
field has been appended to add <package>.TestngXxx. This does not
correspond to any class or file I have defined; I have class files only
for class under test Xxx, and test class XxxTest. (And this
configuration obviously does not run successfully, I must delete the
appended class from the class field.)

Would appreciate your comments on true state of support for group
dependencies within the plugin (Problem 1) and on TestNG Run
Configuration class field bug when launched from Package Explorer
right-click "Run As -> TestNG Test" (Problem 2).

Thanks,
Jason


--~--~---------~--~----~------------~-------~--~----~
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: Eclipse plugin support for dependsOnGroups?

Alexandru Popescu ☀

Hi Jason!

Just to allow me to better address your questions, can you please add
some details:

On 1/18/07, perreaultj <[hidden email]> wrote:

>
> Hi Alex,
>
> I'm running Eclipse 3.2.1 with a bugfix follow-on of the 5.4.0.0 TestNG
> plugin. I'm seeing two problems.
>
> I have test class XxxTest with test methods:
>
>         @Test(groups = {"group1"})
>         public void testX() {
>                 // empty
>         }
>
>         @Test(dependsOnGroups = {"group1"})
>         public void testY() {
>                 // empty
>         }
>
>
> Problem 1
>
> Within Eclipse, I run the test class by right-clicking the test class
> java file in the Package Explorer window and selecting menu "Run As ->
> TestNG Test". I get the following warning pop-up:
>
> "XxxTest defines group dependencies that will be ignored. To reliably
> test methods with group dependencies use a suite definition.
>
> Reason: XxxTest uses group dependencies which due to a plugin
> limitation will be ignored."
>
> The test then proceeds to execute.
>

It looks like you are trying to execute the 2nd method from the
package explorer and not the whole class. Is this true?

> In two other launch scenarios, the test seems to execute without
> warning about the group dependency (but in this simple example I don't
> know whether it is actually honoring the dependency, or if the tests
> just happen to execute in the dependent order).

I am not sure what do you exactly mean by this. You can place some
code in those methods and check if the contract is respected or nor.
Or do I misunderstand something?


> The non-warning launch
> scenarios are:
>
> a) Right-click the test class java file in Package Explorer window, but
> instead select "Run As -> Run..." and execute from the TestNG Run
> Configuration screen.
>
> b) With the test class java file in the editor window, right-click in
> the editor text area and select "TestNG -> Run as test".
>
>
> Problem 2
>
> Under the Test tab of the TestNG Run Configuration screen, the "Class"
> button is selected and class field contains <package>.XxxTest.
>
> I subsequently run the test from Package Explorer menu selection that
> causes the warning that group dependencies will be ignored, and when I
> look at TestNG Run Configuration afterward, I find the class field has
> been modified. In addition to the test class originally specified, the
> field has been appended to add <package>.TestngXxx.

Not sure I get it: in the first place it contains <package>XxxTest and
in the 2nd <package>.XxxTest.

> This does not
> correspond to any class or file I have defined; I have class files only
> for class under test Xxx, and test class XxxTest. (And this
> configuration obviously does not run successfully, I must delete the
> appended class from the class field.)
>

Is your XxxTest in the default package?

> Would appreciate your comments on true state of support for group
> dependencies within the plugin (Problem 1) and on TestNG Run
> Configuration class field bug when launched from Package Explorer
> right-click "Run As -> TestNG Test" (Problem 2).
>

Looking forward to hear more details,

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator

> Thanks,
> Jason
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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: Eclipse plugin support for dependsOnGroups?

perreaultj

Alex,

First, my apologies re Problem 2, ignore it, it was due a local problem
that I have fixed.

Second, here is a different test class I cooked up:

package com.jp.testtest;

import org.testng.annotations.*;
import static org.testng.AssertJUnit.*;

public class XxxTest {

        // Test Methods.

        @Test(dependsOnGroups = {"group1", "group2"})
        public void testZ() {
                // empty
        }
        @Test(groups = {"group1"})
        public void testX() {
                // empty
        }

        @Test(groups = {"group2"}, dependsOnGroups = {"group1"})
        public void testY() {
                // empty
        }

}


After some experimentation simply swapping the names of the test
methods and observing the order of execution as shown on the TestNG
console output, it appears the group dependencies are being honored
after all.

So, the only issue may be the pop-up that warns "group dependencies
will be ignored due to plugin limitation".

And this only occurs when I launch the test in one particular way:

> >
> >
> > Problem 1
> >
> > Within Eclipse, I run the test class by right-clicking the test class
> > java file in the Package Explorer window and selecting menu "Run As ->
> > TestNG Test". I get the following warning pop-up:
> >
> > "XxxTest defines group dependencies that will be ignored. To reliably
> > test methods with group dependencies use a suite definition.
> >
> > Reason: XxxTest uses group dependencies which due to a plugin
> > limitation will be ignored."
> >
>

I click OK on the pop-up and the tests proceed to execute in the
expected dependent order.

It seems the plugin no longer has the limitation, but the warning
pop-up was not removed.

Do you confirm that the Eclipse plugin should be honoring group
dependencies, and the warning is incorrect?

Thanks,
Jason


--~--~---------~--~----~------------~-------~--~----~
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: Eclipse plugin support for dependsOnGroups?

Alexandru Popescu ☀

On 1/18/07, perreaultj <[hidden email]> wrote:

>
> Alex,
>
> First, my apologies re Problem 2, ignore it, it was due a local problem
> that I have fixed.
>
> Second, here is a different test class I cooked up:
>
> package com.jp.testtest;
>
> import org.testng.annotations.*;
> import static org.testng.AssertJUnit.*;
>
> public class XxxTest {
>
>         // Test Methods.
>
>         @Test(dependsOnGroups = {"group1", "group2"})
>         public void testZ() {
>                 // empty
>         }
>         @Test(groups = {"group1"})
>         public void testX() {
>                 // empty
>         }
>
>         @Test(groups = {"group2"}, dependsOnGroups = {"group1"})
>         public void testY() {
>                 // empty
>         }
>
> }
>
>
> After some experimentation simply swapping the names of the test
> methods and observing the order of execution as shown on the TestNG
> console output, it appears the group dependencies are being honored
> after all.
>
> So, the only issue may be the pop-up that warns "group dependencies
> will be ignored due to plugin limitation".
>
> And this only occurs when I launch the test in one particular way:
>
> > >
> > >
> > > Problem 1
> > >
> > > Within Eclipse, I run the test class by right-clicking the test class
> > > java file in the Package Explorer window and selecting menu "Run As ->
> > > TestNG Test". I get the following warning pop-up:
> > >
> > > "XxxTest defines group dependencies that will be ignored. To reliably
> > > test methods with group dependencies use a suite definition.
> > >
> > > Reason: XxxTest uses group dependencies which due to a plugin
> > > limitation will be ignored."
> > >
> >
>
> I click OK on the pop-up and the tests proceed to execute in the
> expected dependent order.
>
> It seems the plugin no longer has the limitation, but the warning
> pop-up was not removed.
>
> Do you confirm that the Eclipse plugin should be honoring group
> dependencies, and the warning is incorrect?
>

I confirm that the Eclipse plugin should be honoring group dependencies :-), but
there is not easy way to achieve this (the only possible way is to
scan all classes in your project(s) and figure out if there are not or
not in the depending groups. Considering that this is a recursive
operation the time required is imo not worth it and the usage of a
suite definition would be a lot more easier and safer) and so the
warning is correct. The real issue is that it is not consistent over
the different launching types. I will take care of this in the
upcoming days.

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator


> Thanks,
> Jason
>

--~--~---------~--~----~------------~-------~--~----~
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: Eclipse plugin support for dependsOnGroups?

perreaultj


>
> I confirm that the Eclipse plugin should be honoring group dependencies :-), but
> there is not easy way to achieve this (the only possible way is to
> scan all classes in your project(s) and figure out if there are not or
> not in the depending groups. Considering that this is a recursive
> operation the time required is imo not worth it and the usage of a
> suite definition would be a lot more easier and safer) and so the
> warning is correct. The real issue is that it is not consistent over
> the different launching types. I will take care of this in the
> upcoming days.
>
> ./alex
>

Hi Alex,

Sorry to ask again but I want to be sure I understand the limits of the
plugin support for group dependencies:

Partial support? (for methods within same test class, as I seem to
observe with my XxxTest example)

Or not at all? (the behavior of my example was coincidental; should not
rely on this to work)

If the group dependencies are honored within a single test class, that
can still be useful to me.

Thanks,
Jason


--~--~---------~--~----~------------~-------~--~----~
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: Eclipse plugin support for dependsOnGroups?

Alexandru Popescu ☀

On 1/19/07, perreaultj <[hidden email]> wrote:

>
>
> >
> > I confirm that the Eclipse plugin should be honoring group dependencies :-), but
> > there is not easy way to achieve this (the only possible way is to
> > scan all classes in your project(s) and figure out if there are not or
> > not in the depending groups. Considering that this is a recursive
> > operation the time required is imo not worth it and the usage of a
> > suite definition would be a lot more easier and safer) and so the
> > warning is correct. The real issue is that it is not consistent over
> > the different launching types. I will take care of this in the
> > upcoming days.
> >
> > ./alex
> >
>
> Hi Alex,
>
> Sorry to ask again but I want to be sure I understand the limits of the
> plugin support for group dependencies:
>

No problem. It is a legitimate question. The principle is that as long
as dependencies are inside the same class then they will work as
expected. If they cross the borders of the class (when running a class
test) then this will not work.

Is this answering your question?

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator

> Partial support? (for methods within same test class, as I seem to
> observe with my XxxTest example)
>
 > Or not at all? (the behavior of my example was coincidental; should not

> rely on this to work)
>
> If the group dependencies are honored within a single test class, that
> can still be useful to me.
>
> Thanks,
> Jason
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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: Eclipse plugin support for dependsOnGroups?

perreaultj


Alexandru Popescu wrote:

> On 1/19/07, perreaultj <[hidden email]> wrote:
> >
> >
> > >
> > > I confirm that the Eclipse plugin should be honoring group dependencies :-), but
> > > there is not easy way to achieve this (the only possible way is to
> > > scan all classes in your project(s) and figure out if there are not or
> > > not in the depending groups. Considering that this is a recursive
> > > operation the time required is imo not worth it and the usage of a
> > > suite definition would be a lot more easier and safer) and so the
> > > warning is correct. The real issue is that it is not consistent over
> > > the different launching types. I will take care of this in the
> > > upcoming days.
> > >
> > > ./alex
> > >
> >
> > Hi Alex,
> >
> > Sorry to ask again but I want to be sure I understand the limits of the
> > plugin support for group dependencies:
> >
>
> No problem. It is a legitimate question. The principle is that as long
> as dependencies are inside the same class then they will work as
> expected. If they cross the borders of the class (when running a class
> test) then this will not work.
>
> Is this answering your question?
>
> ./alex
> --
> .w( the_mindstorm )p.
>   TestNG co-founder
> EclipseTestNG Creator
>

Yes, very clear, thank you.

Jason


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---