--On Saturday, September 17, 2005 12:34 PM -1000 Julie Ann Sakuda <[EMAIL PROTECTED]> wrote:

I googled quite a bit and it appears that it is as easy as setting the
proxy properties for java to use.  There is a Proxy.java in
org.hackystat.kernel.installer.util that I have written.  I haven't been
able to test it but it is basically a simplified version of the Ant
"SetProxy" task I believe.

Interesting. Here's the relevent part of Proxy.java:

144  /** Applies the proxy settings to the Java environment. */
145  public void applyWebProxySettings() {
146    Properties sysprops = System.getProperties();
147    if (this.proxyHost != null) {
148      if (this.proxyHost.length() > 0) {
149        sysprops.put("http.proxyHost", this.proxyHost);
150        String portString = Integer.toString(this.proxyPort);
151        sysprops.put("http.proxyPort", portString);
152        sysprops.put("https.proxyHost", this.proxyHost);
153        sysprops.put("https.proxyPort", portString);
154        if (this.proxyUser != null) {
155          sysprops.put("http.proxyUser", this.proxyUser);
156          sysprops.put("http.proxyPassword", this.proxyPassword);
157        }
158      }
159    }
160    // SOCKS proxy
161    if (this.socksProxyHost != null) {
162      if (this.socksProxyHost.length() > 0) {
163        sysprops.put("socksProxyHost", this.socksProxyHost);
164 sysprops.put("socksProxyPort", Integer.toString(this.socksProxyPort));
165        if (proxyUser != null) {
166          sysprops.put("java.net.socks.username", this.proxyUser);
167          sysprops.put("java.net.socks.password", this.proxyPassword);
168        }
169      }
170    }
171  }

The good news is that all Ant (and Julie) are doing is adding System properties, just like the FAQ suggested. The bad news is that the actual property names above are different from the ones suggested in the FAQ. Does anyone know which ones are correct?

The hackyInstaller.xml is currently saving
proxy properties but right now we have not added a way for the user to
access and change these properties.  I think as of now if you checked
your hackyInstaller.xml (if you have used the last stable release) it
would have proxy elements in the file.  This can easily be put into
sensor.properties if needed though.

Yes, please save the Proxy settings in sensor.properties, not hackyinstaller.xml; that way the sensors get them as well. Noted in Jira as:

<http://hackydev.ics.hawaii.edu:8080/browse/HACK-346>

I have also been wondering how I would test this.  Setting these
properties would ultimately change the environment settings that java
uses during the testing and nothing would be able access to internet (to
send build data etc.) I think.  This would be because I have set the
proxy settings but I wouldn't be behind a proxy.

Yes, this is a problem. While you should do a test to see that the properties can be set and retrieved (i.e. classic unit test), the larger 'system-level' test is problematic to do in an automated fashion. For now, I guess we need to find a guinea pig who's behind a firewall and can let us know if it works or not. :-)

Cheers,
Philip

Reply via email to