facebook

MyEclipse 10.1 + Maven Profiles + TestNG Test debugging.

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #325613 Reply

    PredatorVI
    Member

    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?

    #325648 Reply

    support-tony
    Keymaster

    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.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: MyEclipse 10.1 + Maven Profiles + TestNG Test debugging.

You must be logged in to post in the forum log in