Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Import Groovy Maven Project in IDE


Groovy Maven Project is structured for users to easily import the project into IDE. If you already have an IDE which supports Groovy and Maven, you can easily import it. However if you don’t have it yet, please follow the instruction in Install Groovy IDE first. If you prefer to use IntellJ instead of Eclipse, go Import Groovy Maven Project in IntelliJ.

If you have installed the Eclipse based Groovy IDE and created Groovy Maven Project in nGrinder subversion, you can import the Groovy Maven Project using the subversion client in Eclipse.

       image

Notice that there is the subversion URL field in the script management page in nGrinder. The above screenshot shows the our test instance. In this instance, the created Groovy Maven project can be accessed through http://ngrinder-staging.nhncorp.com:8080/svn/admin/project URL according to the above page .
OK. Let’s import the project.

  1. Open your Eclipse and Choose File ==> Others ==> Maven ==> Check out Maven Projects from SCM
    image
  2. Select svn in the SVN URL and type the SVN URL provided in nGrinder. Then click Finish.
    image
  3. Then the project will be imported.
    image
  4. Enable Groovy on this project.
    image
  5. Remove groovy libraries from classpath by selecting "Groovy ==> Remove Groovy libraries from classpath".
    It's because there is a conflict between groovy libraries provided by Maven and Eclipse.
    image
  6. Select the Groovy test case and Select Run As ==> JUnit Test.
    image
  7. Then you might see the following error. It’s because the specialized nGrinder JUnit Runner(named GrinderRunner) needs a special JVM argument for instrumentation
    image
  8. Check the error message and add the JVM argument following the instruction. Select Run As ==> Run Configurations ==> Select Test1 ==> Select Arguments panel.
    image
    Please be aware that the argument varies depending on the user account. So provide the exact argument which is shown in the JUnit error message. This setting should be provided for every JUnit test running set. If you like to make it as a default vm option for every test run. You can set it up in the global configuration. Please check Install Groovy IDE for details.
  9. Then run as JUnit test again.
    image
  10. In my case, the access to please_modify_this.com causes the error. Ater changing this to http://www.google.com . It shows the green bar now.
    image
  11. You can add the break point in the test case. Then select Debug As ==> JUnit Test.
    image
  12. Then you can debug the test case using the generic Eclipse debugging feature.
    image
  13. When you think the test case writing is almost completed, you may want to see the result in the repeated run situation. You can provide the @Repeat annotation on the test case class for this need. Then run as JUnit test again.
    image
  14. Then you can see that test case is executed multiple times you specified. Please note that it’s 100 repetition by single thread. (not multi thread or multi process)
    image
  15. If you think the test case is ready, commit it into subversion selecting Team ==> Commit. Finally run this test in nGrinder.
Attachment
comments powered by Disqus
Page info
viewed 2049 times
translations en
Author
posted last year by
junoyoon
Contributors
updated 10 months ago by
View revisions
Share this article