JVM proxy settings for JUnit WebService test

I was struggeling today at work with something.

We have quite hight security level at work and internal network is completelly seald from outside world. We have webservice that we’r using for dev test. I was trying to run a test, just to call simple method on remote WebService but … it turned out that I can’t couse test machine is behind firewall that will not allow anything in or out. Hm…

Good thing we got proxy. But hot to set up this damn thing. Turned out simple after a long time of google digging.

I am running my JUnit test either from maven (when building deployment) or from Eclipse (that I’m using for development). To set it up within Eclipse when I run my test I need to open Run menu and go to Argument tab.

There are two big fields for arguments. I was using JVM argumens.

It looked like this:

-Dhttp.proxyHost=blabla.proxy.host -Dhttp.proxyPort=80

That solved problem.

I do have other proxy that needs user and password and … I got no idea how to set these properties up. Maybe someone can share. http.proxyUser and http.proxyPass don’t work.

Hope this little tip will help someone with same problem.

Ass my Father always say: “Learn from someone else mistakes”

All best, Gigu