[testng-users] Setting VM parameter in Eclipse plugin

2,907 views
Skip to first unread message

al80

unread,
Feb 18, 2011, 11:33:52 AM2/18/11
to testng...@googlegroups.com

If my tests need a lot of memory (for example a test using glassfish
embedded) I have to set "-XX:MaxPermSize=256m -Xmx1024m" for every
runconfiguration (usually this is one for every method you want to test).

Obviously this is not very handy. What about implementing some shared
preference where we can set VM arguments?

As a temporary workaround I am setting "-XX:MaxPermSize=256m -Xmx1024m" as
default JVM argument. (Preferences>Java>Installed JREs>... )
--
View this message in context: http://old.nabble.com/Setting-VM-parameter-in-Eclipse-plugin-tp30960156p30960156.html
Sent from the testng-users mailing list archive at Nabble.com.

Cédric Beust ♔

unread,
Feb 18, 2011, 3:56:15 PM2/18/11
to testng...@googlegroups.com, al80
Hi Alberto,

I just added this feature to the Eclipse plug-in: update your plug-in, go to "Preferences", select TestNG and you will notice a new node underneath called "Run / Debug". Select it and there, you can set the JVM args:

Screen shot 2011-02-18 at 12.55.34 PM.png

These args will be used whenever you launch a new TestNG configuration. I also added a trace in the console so you can confirm that the process is being invoked with the right parameters:

!MESSAGE [TestNGLaunchConfigurationDelegate] Launching:

  Classpath: /Users/cbeust/java/testng-eclipse/build/classes/ /Users/cbeust/java/testng-eclipse/lib/testng.jar /Users/cbeust/Documents/runtime-New_configuration/Simple/bin /Users/cbeust/java/testng/eclipse-build /Users/cbeust/java/testng/lib/ant-1.6.5.jar /Users/cbeust/java/testng/lib/guice-2.0.jar /Users/cbeust/java/testng/lib/junit-3.8.1.jar /Users/cbeust/java/testng/lib/jcommander-1.13.jar /Users/cbeust/java/testng/lib/bsh-2.0b4.jar /Users/cbeust/java/jbus/target/classes /Users/cbeust/java/jbus/target/test-classes /Users/cbeust/java/testng/lib/snakeyaml-1.6.jar

  VMArgs:    -Xmx128m -ea

  Class:     org.testng.remote.RemoteTestNG

  Args:      -serport 62342 -d /Users/cbeust/Documents/runtime-New_configuration/Simple/tmp/testng-eclipse /var/folders/2B/2BTas5adErSfcduaLOvo6U+++TM/-Tmp-/testng-eclipse--620135639/testng-customsuite.xml



Note that these preferences are global, not per project.

Can you try it and report back?

Thanks.

-- 
Cédric



--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.




--
Cédric


Screen shot 2011-02-18 at 12.55.34 PM.png

Laurent Go

unread,
Feb 23, 2011, 8:09:24 PM2/23/11
to testng-users
Hi,

I just tried this feature and it is almost what I was looking for :)
I'm still hoping for per-project settings (because different projects
require different settings) but at least global settings is a good
start.

I noticed something strange when a project specify native libraries: I
now have to add -Djava.library.path to my VM args (or to add it to my
TestNG settings) whereas before it was handled directly by eclipse.

Thanks,

Laurent
> >http://old.nabble.com/Setting-VM-parameter-in-Eclipse-plugin-tp309601...
> > Sent from the testng-users mailing list archive at Nabble.com.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "testng-users" group.
> > To post to this group, send email to testng...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > testng-users...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/testng-users?hl=en.
>
> --
> Cédric
>
>  Screen shot 2011-02-18 at 12.55.34 PM.png
> 30KViewDownload
Reply all
Reply to author
Forward
0 new messages