MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
PredatorVI
Post subject: MyEclipse 10.1 + Maven Profiles + TestNG Test debugging.  PostPosted: Apr 27, 2012 - 05:48 PM
Registered Member
Registered Member


Joined: Oct 20, 2011
Posts: 6

I have a Maven project with many TestNG test classes. I also have Maven profiles that I set in order to determine the environment to run tests against.

In my Maven Project, I opened the TestNG Test file, right clicked, went to "Debug As->" and selected "Debug Configurations..."

In the Arguments->Program arguments box I added -Pdev to set the profile.

When I "Debug" the test, the entire MyEclipse IDE hangs. I've set breakpoints and such but it doesn't reach any.

I have also tried going to the Project properties then to MyEclipse->Maven4MyEclipse and entered "dev" into the "Active Maven Profiles (comma separated):" text field, but that value is not used apparently because if I remove the -Pdev option from program arguments, I get an error in my code that the profile isn't set, even though it is in my project.

Thoughts? How are you supposed to run/debug TestNG tests from a Maven project in MyEclipse?
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: Apr 30, 2012 - 10:41 AM



Joined: Mar 09, 2011
Posts: 916

PredatorVI,

I'm not familiar with TestNG but I tried a simple test class in a simple java project (created with the maven quickstart archetype) and couldn't replicate your problem. However, when I entered -Pdev in the program arguments, TestNG threw an error as it wasn't a recognized parameter.

I suspect that I'm not trying to execute the way you are, so could you provide more details?


  1. Please attach your installations details as given in MyEclipse->Installation Summary->Installation Details.
  2. Are you using the TestNG eclipse plug-in? If so, which version is it (you can determine this by going to Help->About...->Installation details->Plug-ins and looking for the plug-in name of "TestNG Eclipse Support")?
  3. In this particular case, are you using maven to execute the test or TestNG? Maven recognizes maven profiles but I don't think TestNG does. Please provide detailed steps on how you are trying to run your test.
  4. Is your test coded to recognize maven profiles in some way and expect a profile to be set? Can you please elaborate, as I'm not sure why a test would complain about a maven profile not being set. I've only created a test class for TestNG; there may be other ways to write tests, so I'm not sure what you mean by "TestNG Test file".

If there is any other information or screen shots that you think might help us reproduce the problem, please let us know.

One last point; I noticed, from the TestNG site, that it refers to Maven 2. The maven plug-in is probably still valid for Maven 3 (as I had no problems running the maven test goal against my project), which is what our embedded support provides, but there may be some incompatibilities that you might hit with a more complex test. Note that you can specify other maven installations (other than the built-in MyEclipse one) through the MyEclipse preferences.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits