Eclipse plug-in 5.4.0.0 - TestNG launch

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

Eclipse plug-in 5.4.0.0 - TestNG launch

perreaultj

I'm running Eclipse 3.2 w/ JRE 1.5.0-08. Trying to use newly installed
TestNG 5.4.0.0 Eclipse plug-in on a trivial test class with body
fail(), and I'm seeing inconsistencies in launch of test:

>From menu bar select "Run->Run..." and create new TestNG launch
configuration for the test class. Run it and it creates/executes
temp-testng-customsuite.xml, which lists no test classes. Console
reports "[TestNG] No tests found. Nothing was run"

But, from Package Explorer or Outline, can select test file or class,
right-click, and from menu select "Run As -> TestNG Test". Updates
temp-testng-customsuite.xml to list the test class, and executes the
test method. (And seems to honor the annotation and log level settings
previously configured in launch configuration that failed to execute
the test).

>From editor window, right-click in body of test code. Here, instead of
a "TestNG Test" option below "Run As"; there's a "TestNG" menu option
at the same menu level as "Run As". This "TestNG" option has two
suboptions, "Run as test" and "Debug as test", but they are both
inactive (grayed out).

Any idea whether this is a problem with the plug-in, or something in my
configuration?

Thanks for any help.
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 plug-in 5.4.0.0 - TestNG launch

Alexandru Popescu ☀

On 12/14/06, perreaultj <[hidden email]> wrote:

>
> I'm running Eclipse 3.2 w/ JRE 1.5.0-08. Trying to use newly installed
> TestNG 5.4.0.0 Eclipse plug-in on a trivial test class with body
> fail(), and I'm seeing inconsistencies in launch of test:
>
> >From menu bar select "Run->Run..." and create new TestNG launch
> configuration for the test class. Run it and it creates/executes
> temp-testng-customsuite.xml, which lists no test classes. Console
> reports "[TestNG] No tests found. Nothing was run"
>
> But, from Package Explorer or Outline, can select test file or class,
> right-click, and from menu select "Run As -> TestNG Test". Updates
> temp-testng-customsuite.xml to list the test class, and executes the
> test method. (And seems to honor the annotation and log level settings
> previously configured in launch configuration that failed to execute
> the test).
>
> >From editor window, right-click in body of test code. Here, instead of
> a "TestNG Test" option below "Run As"; there's a "TestNG" menu option
> at the same menu level as "Run As". This "TestNG" option has two
> suboptions, "Run as test" and "Debug as test", but they are both
> inactive (grayed out).
>
> Any idea whether this is a problem with the plug-in, or something in my
> configuration?
>

Couple of questions:

Can you show me your test class? Have you saved it/compiled before
attempting to run it?

The problem for scenarios 1/ and 3/ may be due to the fact that the
file was newly created and the information about the class was stale.
I will be looking into this, but unfortunately it will take a while.
As an workaround you can close the editor and reopen it and it should
start working as expected.

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




> Thanks for any help.
> 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 plug-in 5.4.0.0 - TestNG launch

perreaultj

Hi Alex, thanks for the response.

Test class is saved (and auto-compiled on save) before attempting to
run test. Test class appended below, along with the .xml for cases
where test does / does not execute.

Your suggestion to close, then reopen, the test class editor window,
did make the editor right-click menu suboptions "TestNG->Run as
test/Debug as test" active. But invoking "TestNG->Run as test" seems to
track the behavior of the last invocation via one of the other methods.

For example, if I right-click Package Explorer or Outline "Run As ->
TestNG Test", the test actually runs; and following with invocation by
right-click in editor "TestNG->Run as test" will also execute the test.

If I invoke Test NG Launch Configuration (via menu bar "Run->Run...",
or right-click "Run As->Run..." from Package Explorer or Outline),
TestNG console reports "...No Tests Found..."; and subsequent
invocation from editor window right-click will then do the same.

(Also: Just a cosmetic thing, but I didn't understand why the editor
window right-click TestNG menu structure wasn't consistent with those
for Package Explorer and Outline.)

Thanks,
Jason

(test class)
package com.jp.testtest;

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

public class NGTestXxx {

    @Test()
    public void testXxx() {
        fail("Test failed." );
    }
}

(temp-testng-customsuite.xml for "...Test Not Found..." case)
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Custom suite">
  <test verbose="2" name="testtest" annotations="JDK">
    <classes>
    </classes>
  </test>
</suite>

(temp-testng-customsuite.xml for test class execution)
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Custom suite">
  <test verbose="2" name="testtest" annotations="JDK">
    <classes>
      <class name="com.jp.testtest.NGTestXxx">
        <methods>
          <include name=""/>
        </methods>
      </class>
    </classes>
  </test>
</suite>


--~--~---------~--~----~------------~-------~--~----~
 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 plug-in 5.4.0.0 - TestNG launch

Alexandru Popescu ☀

I'll look into it. About the cosmetic thing: I have an opened JIRA
issue for it, but I must confess I have no idea how to place that menu
with the others. I've been looking into it for a while and couldn't
find the solution - probably it is there right in front of my eyes,
but I just cannot see it.

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


On 12/14/06, perreaultj <[hidden email]> wrote:

>
> Hi Alex, thanks for the response.
>
> Test class is saved (and auto-compiled on save) before attempting to
> run test. Test class appended below, along with the .xml for cases
> where test does / does not execute.
>
> Your suggestion to close, then reopen, the test class editor window,
> did make the editor right-click menu suboptions "TestNG->Run as
> test/Debug as test" active. But invoking "TestNG->Run as test" seems to
> track the behavior of the last invocation via one of the other methods.
>
> For example, if I right-click Package Explorer or Outline "Run As ->
> TestNG Test", the test actually runs; and following with invocation by
> right-click in editor "TestNG->Run as test" will also execute the test.
>
> If I invoke Test NG Launch Configuration (via menu bar "Run->Run...",
> or right-click "Run As->Run..." from Package Explorer or Outline),
> TestNG console reports "...No Tests Found..."; and subsequent
> invocation from editor window right-click will then do the same.
>
> (Also: Just a cosmetic thing, but I didn't understand why the editor
> window right-click TestNG menu structure wasn't consistent with those
> for Package Explorer and Outline.)
>
> Thanks,
> Jason
>
> (test class)
> package com.jp.testtest;
>
> import org.testng.annotations.Test;
> import static org.testng.AssertJUnit.*;
>
> public class NGTestXxx {
>
>     @Test()
>     public void testXxx() {
>         fail("Test failed." );
>     }
> }
>
> (temp-testng-customsuite.xml for "...Test Not Found..." case)
> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
> <suite name="Custom suite">
>   <test verbose="2" name="testtest" annotations="JDK">
>     <classes>
>     </classes>
>   </test>
> </suite>
>
> (temp-testng-customsuite.xml for test class execution)
> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
> <suite name="Custom suite">
>   <test verbose="2" name="testtest" annotations="JDK">
>     <classes>
>       <class name="com.jp.testtest.NGTestXxx">
>         <methods>
>           <include name=""/>
>         </methods>
>       </class>
>     </classes>
>   </test>
> </suite>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
 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 plug-in 5.4.0.0 - TestNG launch

David L. Crow-2

I am running the 5.4.0.0 plugin and also seeing the same problem where
I can run my tests by clicking on the class or the method in the
Outline View, but when I try to run them from a Run configuration, the
classes list in the generated in the XML file is empty.

The issue that I have is that I need to specify a JVM argument for my
tests to work, so I really need to create a run configuration.  So when
I say "I can run my tests from the outline view" above, I can't really
run them, but I can successfully launch them and see that the plugin is
doing its work correctly.

-- David


--~--~---------~--~----~------------~-------~--~----~
 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 plug-in 5.4.0.0 - TestNG launch

Alexandru Popescu ☀

On 12/20/06, David L. Crow <[hidden email]> wrote:

>
> I am running the 5.4.0.0 plugin and also seeing the same problem where
> I can run my tests by clicking on the class or the method in the
> Outline View, but when I try to run them from a Run configuration, the
> classes list in the generated in the XML file is empty.
>
> The issue that I have is that I need to specify a JVM argument for my
> tests to work, so I really need to create a run configuration.  So when
> I say "I can run my tests from the outline view" above, I can't really
> run them, but I can successfully launch them and see that the plugin is
> doing its work correctly.
>

Thanks for the feedback David. I will look into it soon and get back to you.

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

> -- David
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
 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 plug-in 5.4.0.0 - TestNG launch

Alexandru Popescu ☀
I think I have figured out the problem. Please go to TestNG plugin
directory and replace in eclipse-testng.jar the corresponding existing
.class with the attached ones (package: org.testng.eclipse.ui.util).

Sorry for the inconvinience, and please do let me know if it works for you.

TIA,

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




On 12/20/06, Alexandru Popescu <[hidden email]> wrote:

> On 12/20/06, David L. Crow <[hidden email]> wrote:
> >
> > I am running the 5.4.0.0 plugin and also seeing the same problem where
> > I can run my tests by clicking on the class or the method in the
> > Outline View, but when I try to run them from a Run configuration, the
> > classes list in the generated in the XML file is empty.
> >
> > The issue that I have is that I need to specify a JVM argument for my
> > tests to work, so I really need to create a run configuration.  So when
> > I say "I can run my tests from the outline view" above, I can't really
> > run them, but I can successfully launch them and see that the plugin is
> > doing its work correctly.
> >
>
> Thanks for the feedback David. I will look into it soon and get back to you.
>
> ./alex
> --
> .w( the_mindstorm )p.
>   TestNG co-founder
> EclipseTestNG Creator
>
> > -- David
> >
> >
> > > >
> >
>
--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---


ConfigurationHelper.class (18K) Download Attachment
ConfigurationHelper$LaunchInfo.class (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Eclipse plug-in 5.4.0.0 - TestNG launch

perreaultj

Hi Alex,

These classes seem to have fixed the problem, the test classes now seem
to execute properly from the testng launch config screen. I no longer
get an empty test class list in the .xml file.

Thanks very much for the quick response.

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 plug-in 5.4.0.0 - TestNG launch

David L. Crow-2

Works for me now, too.  Thanks!


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