You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(30) |
Sep
(15) |
Oct
(26) |
Nov
(12) |
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(7) |
Feb
(27) |
Mar
(73) |
Apr
(17) |
May
(17) |
Jun
(78) |
Jul
(67) |
Aug
(60) |
Sep
(89) |
Oct
(140) |
Nov
(173) |
Dec
(46) |
2004 |
Jan
(39) |
Feb
(7) |
Mar
(21) |
Apr
(31) |
May
(13) |
Jun
(86) |
Jul
(14) |
Aug
(14) |
Sep
(53) |
Oct
(184) |
Nov
(186) |
Dec
(319) |
2005 |
Jan
(336) |
Feb
(274) |
Mar
(226) |
Apr
(102) |
May
(196) |
Jun
(130) |
Jul
(119) |
Aug
(143) |
Sep
(76) |
Oct
(85) |
Nov
(70) |
Dec
(159) |
2006 |
Jan
(125) |
Feb
(100) |
Mar
(80) |
Apr
(39) |
May
(55) |
Jun
(58) |
Jul
(50) |
Aug
(76) |
Sep
(55) |
Oct
(101) |
Nov
(163) |
Dec
(85) |
2007 |
Jan
(56) |
Feb
(53) |
Mar
(180) |
Apr
(221) |
May
(290) |
Jun
(199) |
Jul
(322) |
Aug
(515) |
Sep
(121) |
Oct
(297) |
Nov
(177) |
Dec
(103) |
2008 |
Jan
(516) |
Feb
(315) |
Mar
(586) |
Apr
(615) |
May
(197) |
Jun
(381) |
Jul
(390) |
Aug
(195) |
Sep
(603) |
Oct
(499) |
Nov
(622) |
Dec
(350) |
2009 |
Jan
(313) |
Feb
(338) |
Mar
(507) |
Apr
(317) |
May
(197) |
Jun
(375) |
Jul
(235) |
Aug
(424) |
Sep
(410) |
Oct
(338) |
Nov
(286) |
Dec
(306) |
2010 |
Jan
(367) |
Feb
(339) |
Mar
(371) |
Apr
(172) |
May
(233) |
Jun
(264) |
Jul
(421) |
Aug
(110) |
Sep
(218) |
Oct
(189) |
Nov
(185) |
Dec
(168) |
2011 |
Jan
(145) |
Feb
(213) |
Mar
(205) |
Apr
(64) |
May
(159) |
Jun
(67) |
Jul
(104) |
Aug
(126) |
Sep
(144) |
Oct
(106) |
Nov
(154) |
Dec
(225) |
2012 |
Jan
(111) |
Feb
(87) |
Mar
(131) |
Apr
(102) |
May
(180) |
Jun
(160) |
Jul
(412) |
Aug
(315) |
Sep
(311) |
Oct
(369) |
Nov
(464) |
Dec
(284) |
2013 |
Jan
(343) |
Feb
(165) |
Mar
(174) |
Apr
(120) |
May
(153) |
Jun
(134) |
Jul
(202) |
Aug
(105) |
Sep
(228) |
Oct
(332) |
Nov
(192) |
Dec
(219) |
2014 |
Jan
(348) |
Feb
(194) |
Mar
(189) |
Apr
(188) |
May
(297) |
Jun
(206) |
Jul
(79) |
Aug
(279) |
Sep
(111) |
Oct
(159) |
Nov
(61) |
Dec
(78) |
2015 |
Jan
(152) |
Feb
(145) |
Mar
(239) |
Apr
(223) |
May
(248) |
Jun
(296) |
Jul
(172) |
Aug
(189) |
Sep
(338) |
Oct
(217) |
Nov
(131) |
Dec
(184) |
2016 |
Jan
(118) |
Feb
(221) |
Mar
(414) |
Apr
(412) |
May
(303) |
Jun
(133) |
Jul
(129) |
Aug
(121) |
Sep
(136) |
Oct
(67) |
Nov
(89) |
Dec
(245) |
2017 |
Jan
(349) |
Feb
(90) |
Mar
(328) |
Apr
(430) |
May
(284) |
Jun
(199) |
Jul
(164) |
Aug
(120) |
Sep
(57) |
Oct
(105) |
Nov
(108) |
Dec
(146) |
2018 |
Jan
(85) |
Feb
(48) |
Mar
(97) |
Apr
(62) |
May
(64) |
Jun
(136) |
Jul
(123) |
Aug
(87) |
Sep
(17) |
Oct
(27) |
Nov
(9) |
Dec
(16) |
2019 |
Jan
(9) |
Feb
(17) |
Mar
(18) |
Apr
(14) |
May
(8) |
Jun
|
Jul
(6) |
Aug
(12) |
Sep
(5) |
Oct
|
Nov
(2) |
Dec
|
2020 |
Jan
(8) |
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2023 |
Jan
|
Feb
(6) |
Mar
(9) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: James A. <the...@ya...> - 2003-08-14 17:33:38
|
I, too, have just come across a need for this. I already know the path to the file, I just need a way of accessing the input field for the path, I'm assuming I'll be able to do that with this patch? Also, I don't know how to use this patch, do I need to do a CVS check out from the HtmlUnit CVS? Thanks, James --- Brad Clarke <bc...@bo...> wrote: > > RFE: > http://sourceforge.net/tracker/index.php?func=detail&aid=625328&group_id=47038&atid=448269 > > I have managed to get an HtmlFileInput to upload a > file to the server with > this patch. It's likely in no condition to go into > just CVS yet, I'm just > looking for comments and suggestions for > improvement. > > My personal issues with it are: > - I really have no clue what I'm doing :) > - It requires the unreleased commons-httpclient 2.0 > (this is probably > unavoidable) > - I've really done nothing to see how this mimics > real world web browsers, > I just know it worked for me > - FormEncodingType seems sort of like a waste to me, > but it seemed "right" > to model it after SubmitMethod > - FormEncodingType naming conventions were basically > random. Someone with > more experience with this could probably name things > better. > - I had to add a lot of new API to preserve > compatibility because so many > things are public. Maybe some of this could be > removed?? > - KeyDataPair seems like a really bad idea to me, > but it helped to not have > to touch much of the surrounding code > - I really have no idea how to "properly" unit test > this, so there are no > new tests (though all the old ones still pass) > - The new stuff is completely unimplemented in > FakeWebConnection > - There were other little things I noticed in the > RFCs that I just ignored > because I don't know exactly how commons-httpclient > fits in > - The checkstyle task in the ant build.xml won't > work so I doubt this meets > the standards (though I did make an effort) > - The copyright is not on the new files, but only to > make the diff smaller. > Just act like it's there :) > - If the encoding type on the form is not correct it > defaults to the old > broken behavior. From the RFCs it sounds like there > should be a MIME > encoding of the file and it added to the POST as > text. I could live with > this being ignored but maybe others can't? > > Brad C > > > Index: > src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java > =================================================================== > RCS file: > src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java > diff -N > src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ > src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java > 12 Aug > 2003 22:56:55 -0000 > @@ -0,0 +1,73 @@ > +package com.gargoylesoftware.htmlunit; > + > +import > org.apache.commons.httpclient.methods.PostMethod; > +import > org.apache.commons.httpclient.methods.MultipartPostMethod; > + > +/** > + * A collection of constants that represent the > various ways a form can be > + * encoded when submitted > + * > + * @version $Revision: 1.1 $ > + */ > +public class FormEncodingType { > + > + /** > + * URL_ENCODED > + */ > + public static final FormEncodingType URL_ENCODED = > + new > FormEncodingType(PostMethod.FORM_URL_ENCODED_CONTENT_TYPE); > + /** > + * MULTIPART > + */ > + public static final FormEncodingType MULTIPART = > + new > FormEncodingType(MultipartPostMethod.MULTIPART_FORM_CONTENT_TYPE); > + > + private final String name_; > + > + private FormEncodingType(final String name) { > + name_ = name; > + } > + > + /** > + * Return the name of this EncodingType > + * > + * @return See above > + */ > + public String getName() { > + return name_; > + } > + > + /** > + * Return the constant that matches the given > name > + * > + * @param name The name to search by > + * @return See above > + */ > + public static FormEncodingType getInstance(final > String name) { > + final String lowerCaseName = name.toLowerCase(); > + final FormEncodingType allInstances[] = new > FormEncodingType[] { > URL_ENCODED, MULTIPART }; > + > + int i; > + for (i = 0; i < allInstances.length; i++) { > + if > (allInstances[i].getName().equals(lowerCaseName)) { > + return allInstances[i]; > + } > + } > + > + // Special case: empty string defaults to url > encoded > + if (name.equals("")) { > + return URL_ENCODED; > + } > + > + throw new IllegalArgumentException("No encoding > type found for [" + name > + "]"); > + } > + > + /** > + * Return a string representation of this object > + * > + * @return See above > + */ > + public String toString() { > + return "EncodingType[name=" + getName() + "]"; > + } > +} > Index: > src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java > =================================================================== > RCS file: > /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java,v > retrieving revision 1.13 > diff -u -r1.13 HttpWebConnection.java > --- > src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java > 19 Jul > 2003 17:17:30 -0000 1.13 > +++ > src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java > 12 Aug > 2003 22:56:55 -0000 > @@ -37,6 +37,7 @@ > */ > package com.gargoylesoftware.htmlunit; > > +import java.io.File; > import java.io.ByteArrayInputStream; > import java.io.IOException; > import java.io.InputStream; > @@ -58,6 +59,7 @@ > import org.apache.commons.httpclient.URI; > import org.apache.commons.httpclient.URIException; > import > org.apache.commons.httpclient.cookie.CookiePolicy; > +import > org.apache.commons.httpclient.methods.MultipartPostMethod; > import > org.apache.commons.httpclient.methods.GetMethod; > import > org.apache.commons.httpclient.methods.PostMethod; > import org.apache.commons.logging.Log; > @@ -98,12 +100,32 @@ > super(webClient, proxyHost, proxyPort); > } > > - > + /** > + * Submit a request and retrieve a response > + * > === message truncated === __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Mike B. <mb...@Ga...> - 2003-08-13 20:17:22
|
James Asher wrote: > The thing I'm unsure about is how do I go about doing > this. What I mean to say is that since the code for > doing the logging isn't in my actual test that I > wrote, how do I access it to do the overriding? Which > seems possible after looking through the javaDoc's. > > I'm not sure if I'm being concise enough or not. If > not, let me know and I'll try to explain what I'm > thinking a little better. The information you need to configure the logger is explained in this package summary. http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/package-summary.html Docs for configuring the SimpleLog are found here: http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/impl/SimpleLog.html Hope this helps -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: James A. <the...@ya...> - 2003-08-13 19:01:36
|
The thing I'm unsure about is how do I go about doing this. What I mean to say is that since the code for doing the logging isn't in my actual test that I wrote, how do I access it to do the overriding? Which seems possible after looking through the javaDoc's. I'm not sure if I'm being concise enough or not. If not, let me know and I'll try to explain what I'm thinking a little better. - James --- Mike Bowler <mb...@Ga...> wrote: > James Asher wrote: > > I don't have the log4j jar in my classpath > anymore, > > yet it keeps trying to use it to log with it. > > > > This is the specific error: > > [junit] ------------- Standard Error > ----------------- > > [junit] log4j:ERROR setFile(null,true) call > > failed. > > [junit] java.io.FileNotFoundException: > > /usr/local/keas/webtech/logs/keas/debug.log > > (Permission denied) > > > > The jar is present when I compile, but not when i > run, > > does that matter? > > I would guess that log4j *is* still in your > classpath even though you > think you've removed it. The check for log4j is > done only at runtime so > it's the runtime classpath you need to check. > > I believe that it's possible to override the default > implementation so > that it won't even do the check for log4j but I > can't recall exactly how > to do that. It would be in the commons-logging > documentation. > > -- > Mike Bowler > Principal, Gargoyle Software Inc. > Voice: (416) 822-0973 | Email : > mb...@Ga... > Fax : (416) 822-0975 | Website: > http://www.GargoyleSoftware.com > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual > Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > HtmlUnit-develop mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-develop __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Mike B. <mb...@Ga...> - 2003-08-13 17:07:04
|
James Asher wrote: > I don't have the log4j jar in my classpath anymore, > yet it keeps trying to use it to log with it. > > This is the specific error: > [junit] ------------- Standard Error ----------------- > [junit] log4j:ERROR setFile(null,true) call > failed. > [junit] java.io.FileNotFoundException: > /usr/local/keas/webtech/logs/keas/debug.log > (Permission denied) > > The jar is present when I compile, but not when i run, > does that matter? I would guess that log4j *is* still in your classpath even though you think you've removed it. The check for log4j is done only at runtime so it's the runtime classpath you need to check. I believe that it's possible to override the default implementation so that it won't even do the check for log4j but I can't recall exactly how to do that. It would be in the commons-logging documentation. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: James A. <the...@ya...> - 2003-08-13 16:54:22
|
I don't have the log4j jar in my classpath anymore, yet it keeps trying to use it to log with it. This is the specific error: [junit] ------------- Standard Error ----------------- [junit] log4j:ERROR setFile(null,true) call failed. [junit] java.io.FileNotFoundException: /usr/local/keas/webtech/logs/keas/debug.log (Permission denied) The jar is present when I compile, but not when i run, does that matter? --- Mike Bowler <mb...@Ga...> wrote: > James Asher wrote: > > I do have log4j in my classpath, but I don't want > it > > to log anything. I use HtmlUnit with JUnit and > > JUnitReport, so I have report-type information > there. > > > > The reason I'm getting the debug information ( I > > believe ) is because it is trying to write to the > log > > and i don't have permission to it, so it throws a > > FileNotFoundException. > > > > So, I guess, is there any way to turn that all > off? > > That would have to be disabled through the log4j > configuration file. > It's been a long time since I've used log4j so I'm > afraid I won't be > much help here. > > There is no way to disable the messages from within > HtmlUnit itself - > all of that is left up to the logging implementation > (log4j in this case). > > -- > Mike Bowler > Principal, Gargoyle Software Inc. > Voice: (416) 822-0973 | Email : > mb...@Ga... > Fax : (416) 822-0975 | Website: > http://www.GargoyleSoftware.com > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual > Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > HtmlUnit-develop mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-develop __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Mike B. <mb...@Ga...> - 2003-08-13 16:06:42
|
Brad Clarke wrote: > I sent this last night but I think sourceforge ate it while their > servers were down. If you already got it, please excuse the spam. Yes, it did come through ok both times but I haven't had a chance to look at it yet. In the meantime, hopefully somebody else will provide some feedback. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Brad C. <bc...@bo...> - 2003-08-13 15:26:39
|
I sent this last night but I think sourceforge ate it while their servers were down. If you already got it, please excuse the spam. RFE: http://sourceforge.net/tracker/index.php?func=detail&aid=625328&group_id=47038&atid=448269 I have managed to get an HtmlFileInput to upload a file to the server with this patch. It's likely in no condition to go into just CVS yet, I'm just looking for comments and suggestions for improvement. My personal issues with it are: - I really have no clue what I'm doing :) - It requires the unreleased commons-httpclient 2.0 (this is probably unavoidable) - I've really done nothing to see how this mimics real world web browsers, I just know it worked for me - FormEncodingType seems sort of like a waste to me, but it seemed "right" to model it after SubmitMethod - FormEncodingType naming conventions were basically random. Someone with more experience with this could probably name things better. - I had to add a lot of new API to preserve compatibility because so many things are public. Maybe some of this could be removed?? - KeyDataPair seems like a really bad idea to me, but it helped to not have to touch much of the surrounding code - I really have no idea how to "properly" unit test this, so there are no new tests (though all the old ones still pass) - The new stuff is completely unimplemented in FakeWebConnection - There were other little things I noticed in the RFCs that I just ignored because I don't know exactly how commons-httpclient fits in - The checkstyle task in the ant build.xml won't work so I doubt this meets the standards (though I did make an effort) - The copyright is not on the new files, but only to make the diff smaller. Just act like it's there :) - If the encoding type on the form is not correct it defaults to the old broken behavior. From the RFCs it sounds like there should be a MIME encoding of the file and it added to the POST as text. I could live with this being ignored but maybe others can't? Brad C Index: src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java =================================================================== RCS file: src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java diff -N src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java 12 Aug 2003 22:56:55 -0000 @@ -0,0 +1,73 @@ +package com.gargoylesoftware.htmlunit; + +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.methods.MultipartPostMethod; + +/** + * A collection of constants that represent the various ways a form can be + * encoded when submitted + * + * @version $Revision: 1.1 $ + */ +public class FormEncodingType { + + /** + * URL_ENCODED + */ + public static final FormEncodingType URL_ENCODED = + new FormEncodingType(PostMethod.FORM_URL_ENCODED_CONTENT_TYPE); + /** + * MULTIPART + */ + public static final FormEncodingType MULTIPART = + new FormEncodingType(MultipartPostMethod.MULTIPART_FORM_CONTENT_TYPE); + + private final String name_; + + private FormEncodingType(final String name) { + name_ = name; + } + + /** + * Return the name of this EncodingType + * + * @return See above + */ + public String getName() { + return name_; + } + + /** + * Return the constant that matches the given name + * + * @param name The name to search by + * @return See above + */ + public static FormEncodingType getInstance(final String name) { + final String lowerCaseName = name.toLowerCase(); + final FormEncodingType allInstances[] = new FormEncodingType[] { URL_ENCODED, MULTIPART }; + + int i; + for (i = 0; i < allInstances.length; i++) { + if (allInstances[i].getName().equals(lowerCaseName)) { + return allInstances[i]; + } + } + + // Special case: empty string defaults to url encoded + if (name.equals("")) { + return URL_ENCODED; + } + + throw new IllegalArgumentException("No encoding type found for [" + name + "]"); + } + + /** + * Return a string representation of this object + * + * @return See above + */ + public String toString() { + return "EncodingType[name=" + getName() + "]"; + } +} Index: src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java,v retrieving revision 1.13 diff -u -r1.13 HttpWebConnection.java --- src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java 19 Jul 2003 17:17:30 -0000 1.13 +++ src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java 12 Aug 2003 22:56:55 -0000 @@ -37,6 +37,7 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.File; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -58,6 +59,7 @@ import org.apache.commons.httpclient.URI; import org.apache.commons.httpclient.URIException; import org.apache.commons.httpclient.cookie.CookiePolicy; +import org.apache.commons.httpclient.methods.MultipartPostMethod; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.logging.Log; @@ -98,12 +100,32 @@ super(webClient, proxyHost, proxyPort); } - + /** + * Submit a request and retrieve a response + * + * @param parameters Any parameters + * @param url The url of the server + * @param submitMethod The submit method. Ie SubmitMethod.GET + * @param requestHeaders Any headers that need to be put in the request. + * @return See above + * @exception IOException If an IO error occurs + */ + public WebResponse getResponse( + final URL url, + final SubmitMethod submitMethod, + final List parameters, + final Map requestHeaders ) + throws + IOException { + return this.getResponse(url, FormEncodingType.URL_ENCODED, submitMethod, parameters, requestHeaders); + } + /** * Submit a request and retrieve a response * * @param parameters Any parameters * @param url The url of the server + * @param encType Encoding type of the form when done as a POST * @param submitMethod The submit method. Ie SubmitMethod.GET * @param requestHeaders Any headers that need to be put in the request. * @return See above @@ -111,6 +133,7 @@ */ public WebResponse getResponse( final URL url, + final FormEncodingType encType, final SubmitMethod submitMethod, final List parameters, final Map requestHeaders ) @@ -122,14 +145,14 @@ try { long startTime, endTime; - HttpMethod httpMethod = makeHttpMethod( url, submitMethod, parameters, requestHeaders ); + HttpMethod httpMethod = makeHttpMethod( url, encType, submitMethod, parameters, requestHeaders ); startTime = System.currentTimeMillis(); int responseCode = httpClient.executeMethod( httpMethod ); endTime = System.currentTimeMillis(); if( responseCode == 401 ) { // Authentication required final KeyValuePair pair = getCredentials( httpMethod, url ); if( pair != null ) { - httpMethod = makeHttpMethod( url, submitMethod, parameters, requestHeaders ); + httpMethod = makeHttpMethod( url, encType, submitMethod, parameters, requestHeaders ); addCredentialsToHttpMethod( httpMethod, pair ); startTime = System.currentTimeMillis(); responseCode = httpClient.executeMethod( httpMethod ); @@ -200,6 +223,7 @@ private HttpMethod makeHttpMethod( final URL url, + final FormEncodingType encType, final SubmitMethod method, final List parameters, final Map requestHeaders ) @@ -224,7 +248,11 @@ } } else if( method == SubmitMethod.POST ) { - httpMethod = new PostMethod( path ); + if (encType == FormEncodingType.URL_ENCODED) { + httpMethod = new PostMethod( path ); + } else { + httpMethod = new MultipartPostMethod(path); + } final String queryString = url.getQuery(); if( queryString != null ) { httpMethod.setQueryString(queryString); @@ -234,16 +262,29 @@ // Note that this has to be done in two loops otherwise it won't // be able to support two elements with the same name. iterator = parameters.iterator(); - while( iterator.hasNext() ) { - final NameValuePair pair = ( NameValuePair )iterator.next(); - ( ( PostMethod )httpMethod ).removeParameter( pair.getName(), pair.getValue() ); - } - - iterator = parameters.iterator(); - while( iterator.hasNext() ) { - final NameValuePair pair = ( NameValuePair )iterator.next(); - ( ( PostMethod )httpMethod ).addParameter( pair.getName(), pair.getValue() ); - } + if (encType == FormEncodingType.URL_ENCODED) { + while( iterator.hasNext() ) { + final NameValuePair pair = ( NameValuePair )iterator.next(); + ( ( PostMethod )httpMethod ).removeParameter( pair.getName(), pair.getValue() ); + } + + iterator = parameters.iterator(); + while( iterator.hasNext() ) { + final NameValuePair pair = ( NameValuePair )iterator.next(); + ( ( PostMethod )httpMethod ).addParameter( pair.getName(), pair.getValue() ); + } + } else { + iterator = parameters.iterator(); + while (iterator.hasNext()) { + final KeyValuePair pair = (KeyValuePair) iterator.next(); + if (pair instanceof KeyDataPair) { + File f = (File) ((KeyDataPair)pair).getData(); + ((MultipartPostMethod) httpMethod).addParameter(pair.getName(), f); + } else { + ((MultipartPostMethod) httpMethod).addParameter(pair.getName(), pair.getValue()); + } + } + } } else { throw new IllegalStateException( "Submit method not yet supported: " + method ); Index: src/java/com/gargoylesoftware/htmlunit/KeyDataPair.java =================================================================== RCS file: src/java/com/gargoylesoftware/htmlunit/KeyDataPair.java diff -N src/java/com/gargoylesoftware/htmlunit/KeyDataPair.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/java/com/gargoylesoftware/htmlunit/KeyDataPair.java 12 Aug 2003 22:56:55 -0000 @@ -0,0 +1,20 @@ +package com.gargoylesoftware.htmlunit; + +public class KeyDataPair extends KeyValuePair { + + private Object dataObject; + + public KeyDataPair(String key, String value) { + super(key, value); + } + + public KeyDataPair(String key, Object data) { + super(key, data.toString()); + this.dataObject = data; + } + + public Object getData() { + return this.dataObject; + } + +} Index: src/java/com/gargoylesoftware/htmlunit/WebClient.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebClient.java,v retrieving revision 1.45 diff -u -r1.45 WebClient.java --- src/java/com/gargoylesoftware/htmlunit/WebClient.java 16 Jul 2003 20:11:21 -0000 1.45 +++ src/java/com/gargoylesoftware/htmlunit/WebClient.java 12 Aug 2003 22:56:55 -0000 @@ -275,8 +275,64 @@ FailingHttpStatusCodeException { return getPage(webWindow, url, method, parameters, getThrowExceptionOnFailingStatusCode()); } - - + /** + * Return a page. + * + * @param webWindow The window that the new page will be loaded into. + * @param url The url of the server + * @param encType Encoding type of the form when done as a POST + * @param method The submit method. Ie Submit.GET or SubmitMethod.POST + * @param parameters A list of {@link + * com.gargoylesoftware.htmlunit.KeyValuePair KeyValuePair}'s that + * contain the parameters to send to the server + * @return The page that was loaded. + * @exception IOException If an IO error occurs + * @exception FailingHttpStatusCodeException If the server returns a + * failing status code AND the property + * "throwExceptionOnFailingStatusCode" is set to true (see {@link + * #setThrowExceptionOnFailingStatusCode(boolean)}) + */ + public Page getPage( + final WebWindow webWindow, + final URL url, + final FormEncodingType encType, + final SubmitMethod method, + final List parameters ) + throws + IOException, + FailingHttpStatusCodeException { + return getPage(webWindow, url, encType, method, parameters, getThrowExceptionOnFailingStatusCode()); + } + + /** + * Return a page. + * + * @param webWindow The window that the new page will be loaded into. + * @param url The url of the server + * @param method The submit method. Ie Submit.GET or SubmitMethod.POST + * @param parameters A list of {@link + * com.gargoylesoftware.htmlunit.KeyValuePair KeyValuePair}'s that + * contain the parameters to send to the server + * @param throwExceptionOnFailingStatusCode true if this method should throw + * an exception whenever a failing status code is received. + * @return The page that was loaded. + * @exception IOException If an IO error occurs + * @exception FailingHttpStatusCodeException If the server returns a + * failing status code AND the variable + * "throwExceptionOnFailingStatusCode" is set to true + */ + public Page getPage( + final WebWindow webWindow, + final URL url, + final SubmitMethod method, + final List parameters, + final boolean throwExceptionOnFailingStatusCode ) + throws + IOException, + FailingHttpStatusCodeException { + return this.getPage(webWindow, url, FormEncodingType.URL_ENCODED, method, parameters, throwExceptionOnFailingStatusCode); + } + /** * Send a request to a server and return a Page that represents the * response from the server. This page will be used to populate this frame.<p> @@ -308,6 +364,7 @@ * * @param webWindow The window that the new page will be loaded into. * @param url The url of the server + * @param encType Encoding type of the form when done as a POST * @param method The submit method. Ie Submit.GET or SubmitMethod.POST * @param parameters A list of {@link * com.gargoylesoftware.htmlunit.KeyValuePair KeyValuePair}'s that @@ -323,6 +380,7 @@ public Page getPage( final WebWindow webWindow, final URL url, + final FormEncodingType encType, final SubmitMethod method, final List parameters, final boolean throwExceptionOnFailingStatusCode ) @@ -336,7 +394,7 @@ webResponse = makeWebResponseForJavaScriptUrl(webWindow, url); } else { - webResponse = loadWebResponse( url, method, parameters ); + webResponse = loadWebResponse( url, encType, method, parameters ); } final String contentType = webResponse.getContentType(); final int statusCode = webResponse.getStatusCode(); @@ -947,17 +1005,32 @@ }; } + /** + * Load a {@link WebResponse} from the server + * @param url The url to load the response from. + * @param method The {@link SubmitMethod} to use + * @param parameters Any parameters that are being passed into the request + * @throws IOException if an IO problem occurs + * @return The WebResponse + */ + public final WebResponse loadWebResponse( + final URL url, final SubmitMethod method, final List parameters) + throws + IOException { + return this.loadWebResponse(url, FormEncodingType.URL_ENCODED, method, parameters); + } /** * Load a {@link WebResponse} from the server * @param url The url to load the response from. + * @param encType Encoding type of the form when done as a POST * @param method The {@link SubmitMethod} to use * @param parameters Any parameters that are being passed into the request * @throws IOException if an IO problem occurs * @return The WebResponse */ public final WebResponse loadWebResponse( - final URL url, final SubmitMethod method, final List parameters) + final URL url, final FormEncodingType encType, final SubmitMethod method, final List parameters) throws IOException { @@ -965,7 +1038,7 @@ Assert.notNull("method", method); Assert.notNull("parameters", parameters); - final WebResponse webResponse = getWebConnection().getResponse( url, method, parameters, requestHeaders_ ); + final WebResponse webResponse = getWebConnection().getResponse( url, encType, method, parameters, requestHeaders_ ); final int statusCode = webResponse.getStatusCode(); if( statusCode >= 301 && statusCode <=307 && isRedirectEnabled() ) { Index: src/java/com/gargoylesoftware/htmlunit/WebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebConnection.java,v retrieving revision 1.7 diff -u -r1.7 WebConnection.java --- src/java/com/gargoylesoftware/htmlunit/WebConnection.java 16 Jul 2003 20:11:21 -0000 1.7 +++ src/java/com/gargoylesoftware/htmlunit/WebConnection.java 12 Aug 2003 22:56:55 -0000 @@ -103,7 +103,26 @@ throws IOException; - + /** + * Submit a request and retrieve a response + * + * @param parameters Any parameters + * @param url The url of the server + * @param encType Encoding type of the form when done as a POST + * @param submitMethod The submit method. Ie SubmitMethod.GET + * @param requestHeaders Any headers that need to be put into the request. + * @return See above + * @exception IOException If an IO error occurs + */ + public abstract WebResponse getResponse( + final URL url, + final FormEncodingType encType, + final SubmitMethod submitMethod, + final List parameters, + final Map requestHeaders ) + throws + IOException; + /** * Return the web client * @return The web client. Index: src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java,v retrieving revision 1.22 diff -u -r1.22 HtmlForm.java --- src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java 11 Aug 2003 15:24:57 -0000 1.22 +++ src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java 12 Aug 2003 22:56:55 -0000 @@ -37,6 +37,7 @@ */ package com.gargoylesoftware.htmlunit.html; +import com.gargoylesoftware.htmlunit.FormEncodingType; import com.gargoylesoftware.htmlunit.Assert; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.KeyValuePair; @@ -163,10 +164,10 @@ catch( final MalformedURLException e ) { throw new IllegalArgumentException( "Not a valid url: " + action ); } - + final FormEncodingType encType = FormEncodingType.getInstance( this.getEnctypeAttribute() ); final SubmitMethod method = SubmitMethod.getInstance( getAttributeValue( "method" ) ); final WebWindow webWindow = htmlPage.getEnclosingWindow(); - return htmlPage.getWebClient().getPage( webWindow, url, method, parameterList ); + return htmlPage.getWebClient().getPage( webWindow, url, encType, method, parameterList ); } Index: src/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java,v retrieving revision 1.25 diff -u -r1.25 HtmlInput.java --- src/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java 23 Jul 2003 17:26:52 -0000 1.25 +++ src/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java 12 Aug 2003 22:56:55 -0000 @@ -37,12 +37,15 @@ */ package com.gargoylesoftware.htmlunit.html; +import com.gargoylesoftware.htmlunit.KeyDataPair; import com.gargoylesoftware.htmlunit.Assert; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.KeyValuePair; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.ScriptResult; import org.w3c.dom.Element; + +import java.io.File; import java.io.IOException; /** @@ -107,7 +110,14 @@ }; } } - return new KeyValuePair[]{new KeyValuePair( getNameAttribute(), getValueAttribute() )}; + if (!this.getTypeAttribute().equals("file")) { + return new KeyValuePair[]{new KeyValuePair( getNameAttribute(), getValueAttribute() )}; + } else { + File f = new File(getValueAttribute()); + return new KeyValuePair[]{new KeyDataPair( getNameAttribute(), f )}; + } + + } Index: src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java,v retrieving revision 1.5 diff -u -r1.5 FakeWebConnection.java --- src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java 16 Jul 2003 20:11:20 -0000 1.5 +++ src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java 12 Aug 2003 22:56:55 -0000 @@ -110,17 +110,34 @@ super( webClient ); } + /** + * Submit a request to the processor + * + * @param url The url + * @param method The method to use + * @param parameters any parameters + * @return The response as an input stream + */ + public WebResponse getResponse( + final URL url, + final SubmitMethod method, + final List parameters, + final Map requestParameters ) { + return this.getResponse(url, FormEncodingType.URL_ENCODED, method, parameters, requestParameters); + } /** * Submit a request to the processor * * @param url The url + * @param encType form encoding type to use for POST method * @param method The method to use * @param parameters any parameters * @return The response as an input stream */ public WebResponse getResponse( final URL url, + final FormEncodingType encType, final SubmitMethod method, final List parameters, final Map requestParameters ) { |
From: Brad C. <bc...@bo...> - 2003-08-13 00:17:51
|
RFE: http://sourceforge.net/tracker/index.php?func=detail&aid=625328&group_id=47038&atid=448269 I have managed to get an HtmlFileInput to upload a file to the server with this patch. It's likely in no condition to go into just CVS yet, I'm just looking for comments and suggestions for improvement. My personal issues with it are: - I really have no clue what I'm doing :) - It requires the unreleased commons-httpclient 2.0 (this is probably unavoidable) - I've really done nothing to see how this mimics real world web browsers, I just know it worked for me - FormEncodingType seems sort of like a waste to me, but it seemed "right" to model it after SubmitMethod - FormEncodingType naming conventions were basically random. Someone with more experience with this could probably name things better. - I had to add a lot of new API to preserve compatibility because so many things are public. Maybe some of this could be removed?? - KeyDataPair seems like a really bad idea to me, but it helped to not have to touch much of the surrounding code - I really have no idea how to "properly" unit test this, so there are no new tests (though all the old ones still pass) - The new stuff is completely unimplemented in FakeWebConnection - There were other little things I noticed in the RFCs that I just ignored because I don't know exactly how commons-httpclient fits in - The checkstyle task in the ant build.xml won't work so I doubt this meets the standards (though I did make an effort) - The copyright is not on the new files, but only to make the diff smaller. Just act like it's there :) - If the encoding type on the form is not correct it defaults to the old broken behavior. From the RFCs it sounds like there should be a MIME encoding of the file and it added to the POST as text. I could live with this being ignored but maybe others can't? Brad C Index: src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java =================================================================== RCS file: src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java diff -N src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/java/com/gargoylesoftware/htmlunit/FormEncodingType.java 12 Aug 2003 22:56:55 -0000 @@ -0,0 +1,73 @@ +package com.gargoylesoftware.htmlunit; + +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.methods.MultipartPostMethod; + +/** + * A collection of constants that represent the various ways a form can be + * encoded when submitted + * + * @version $Revision: 1.1 $ + */ +public class FormEncodingType { + + /** + * URL_ENCODED + */ + public static final FormEncodingType URL_ENCODED = + new FormEncodingType(PostMethod.FORM_URL_ENCODED_CONTENT_TYPE); + /** + * MULTIPART + */ + public static final FormEncodingType MULTIPART = + new FormEncodingType(MultipartPostMethod.MULTIPART_FORM_CONTENT_TYPE); + + private final String name_; + + private FormEncodingType(final String name) { + name_ = name; + } + + /** + * Return the name of this EncodingType + * + * @return See above + */ + public String getName() { + return name_; + } + + /** + * Return the constant that matches the given name + * + * @param name The name to search by + * @return See above + */ + public static FormEncodingType getInstance(final String name) { + final String lowerCaseName = name.toLowerCase(); + final FormEncodingType allInstances[] = new FormEncodingType[] { URL_ENCODED, MULTIPART }; + + int i; + for (i = 0; i < allInstances.length; i++) { + if (allInstances[i].getName().equals(lowerCaseName)) { + return allInstances[i]; + } + } + + // Special case: empty string defaults to url encoded + if (name.equals("")) { + return URL_ENCODED; + } + + throw new IllegalArgumentException("No encoding type found for [" + name + "]"); + } + + /** + * Return a string representation of this object + * + * @return See above + */ + public String toString() { + return "EncodingType[name=" + getName() + "]"; + } +} Index: src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java,v retrieving revision 1.13 diff -u -r1.13 HttpWebConnection.java --- src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java 19 Jul 2003 17:17:30 -0000 1.13 +++ src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java 12 Aug 2003 22:56:55 -0000 @@ -37,6 +37,7 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.File; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -58,6 +59,7 @@ import org.apache.commons.httpclient.URI; import org.apache.commons.httpclient.URIException; import org.apache.commons.httpclient.cookie.CookiePolicy; +import org.apache.commons.httpclient.methods.MultipartPostMethod; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.logging.Log; @@ -98,12 +100,32 @@ super(webClient, proxyHost, proxyPort); } - + /** + * Submit a request and retrieve a response + * + * @param parameters Any parameters + * @param url The url of the server + * @param submitMethod The submit method. Ie SubmitMethod.GET + * @param requestHeaders Any headers that need to be put in the request. + * @return See above + * @exception IOException If an IO error occurs + */ + public WebResponse getResponse( + final URL url, + final SubmitMethod submitMethod, + final List parameters, + final Map requestHeaders ) + throws + IOException { + return this.getResponse(url, FormEncodingType.URL_ENCODED, submitMethod, parameters, requestHeaders); + } + /** * Submit a request and retrieve a response * * @param parameters Any parameters * @param url The url of the server + * @param encType Encoding type of the form when done as a POST * @param submitMethod The submit method. Ie SubmitMethod.GET * @param requestHeaders Any headers that need to be put in the request. * @return See above @@ -111,6 +133,7 @@ */ public WebResponse getResponse( final URL url, + final FormEncodingType encType, final SubmitMethod submitMethod, final List parameters, final Map requestHeaders ) @@ -122,14 +145,14 @@ try { long startTime, endTime; - HttpMethod httpMethod = makeHttpMethod( url, submitMethod, parameters, requestHeaders ); + HttpMethod httpMethod = makeHttpMethod( url, encType, submitMethod, parameters, requestHeaders ); startTime = System.currentTimeMillis(); int responseCode = httpClient.executeMethod( httpMethod ); endTime = System.currentTimeMillis(); if( responseCode == 401 ) { // Authentication required final KeyValuePair pair = getCredentials( httpMethod, url ); if( pair != null ) { - httpMethod = makeHttpMethod( url, submitMethod, parameters, requestHeaders ); + httpMethod = makeHttpMethod( url, encType, submitMethod, parameters, requestHeaders ); addCredentialsToHttpMethod( httpMethod, pair ); startTime = System.currentTimeMillis(); responseCode = httpClient.executeMethod( httpMethod ); @@ -200,6 +223,7 @@ private HttpMethod makeHttpMethod( final URL url, + final FormEncodingType encType, final SubmitMethod method, final List parameters, final Map requestHeaders ) @@ -224,7 +248,11 @@ } } else if( method == SubmitMethod.POST ) { - httpMethod = new PostMethod( path ); + if (encType == FormEncodingType.URL_ENCODED) { + httpMethod = new PostMethod( path ); + } else { + httpMethod = new MultipartPostMethod(path); + } final String queryString = url.getQuery(); if( queryString != null ) { httpMethod.setQueryString(queryString); @@ -234,16 +262,29 @@ // Note that this has to be done in two loops otherwise it won't // be able to support two elements with the same name. iterator = parameters.iterator(); - while( iterator.hasNext() ) { - final NameValuePair pair = ( NameValuePair )iterator.next(); - ( ( PostMethod )httpMethod ).removeParameter( pair.getName(), pair.getValue() ); - } - - iterator = parameters.iterator(); - while( iterator.hasNext() ) { - final NameValuePair pair = ( NameValuePair )iterator.next(); - ( ( PostMethod )httpMethod ).addParameter( pair.getName(), pair.getValue() ); - } + if (encType == FormEncodingType.URL_ENCODED) { + while( iterator.hasNext() ) { + final NameValuePair pair = ( NameValuePair )iterator.next(); + ( ( PostMethod )httpMethod ).removeParameter( pair.getName(), pair.getValue() ); + } + + iterator = parameters.iterator(); + while( iterator.hasNext() ) { + final NameValuePair pair = ( NameValuePair )iterator.next(); + ( ( PostMethod )httpMethod ).addParameter( pair.getName(), pair.getValue() ); + } + } else { + iterator = parameters.iterator(); + while (iterator.hasNext()) { + final KeyValuePair pair = (KeyValuePair) iterator.next(); + if (pair instanceof KeyDataPair) { + File f = (File) ((KeyDataPair)pair).getData(); + ((MultipartPostMethod) httpMethod).addParameter(pair.getName(), f); + } else { + ((MultipartPostMethod) httpMethod).addParameter(pair.getName(), pair.getValue()); + } + } + } } else { throw new IllegalStateException( "Submit method not yet supported: " + method ); Index: src/java/com/gargoylesoftware/htmlunit/KeyDataPair.java =================================================================== RCS file: src/java/com/gargoylesoftware/htmlunit/KeyDataPair.java diff -N src/java/com/gargoylesoftware/htmlunit/KeyDataPair.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/java/com/gargoylesoftware/htmlunit/KeyDataPair.java 12 Aug 2003 22:56:55 -0000 @@ -0,0 +1,20 @@ +package com.gargoylesoftware.htmlunit; + +public class KeyDataPair extends KeyValuePair { + + private Object dataObject; + + public KeyDataPair(String key, String value) { + super(key, value); + } + + public KeyDataPair(String key, Object data) { + super(key, data.toString()); + this.dataObject = data; + } + + public Object getData() { + return this.dataObject; + } + +} Index: src/java/com/gargoylesoftware/htmlunit/WebClient.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebClient.java,v retrieving revision 1.45 diff -u -r1.45 WebClient.java --- src/java/com/gargoylesoftware/htmlunit/WebClient.java 16 Jul 2003 20:11:21 -0000 1.45 +++ src/java/com/gargoylesoftware/htmlunit/WebClient.java 12 Aug 2003 22:56:55 -0000 @@ -275,8 +275,64 @@ FailingHttpStatusCodeException { return getPage(webWindow, url, method, parameters, getThrowExceptionOnFailingStatusCode()); } - - + /** + * Return a page. + * + * @param webWindow The window that the new page will be loaded into. + * @param url The url of the server + * @param encType Encoding type of the form when done as a POST + * @param method The submit method. Ie Submit.GET or SubmitMethod.POST + * @param parameters A list of {@link + * com.gargoylesoftware.htmlunit.KeyValuePair KeyValuePair}'s that + * contain the parameters to send to the server + * @return The page that was loaded. + * @exception IOException If an IO error occurs + * @exception FailingHttpStatusCodeException If the server returns a + * failing status code AND the property + * "throwExceptionOnFailingStatusCode" is set to true (see {@link + * #setThrowExceptionOnFailingStatusCode(boolean)}) + */ + public Page getPage( + final WebWindow webWindow, + final URL url, + final FormEncodingType encType, + final SubmitMethod method, + final List parameters ) + throws + IOException, + FailingHttpStatusCodeException { + return getPage(webWindow, url, encType, method, parameters, getThrowExceptionOnFailingStatusCode()); + } + + /** + * Return a page. + * + * @param webWindow The window that the new page will be loaded into. + * @param url The url of the server + * @param method The submit method. Ie Submit.GET or SubmitMethod.POST + * @param parameters A list of {@link + * com.gargoylesoftware.htmlunit.KeyValuePair KeyValuePair}'s that + * contain the parameters to send to the server + * @param throwExceptionOnFailingStatusCode true if this method should throw + * an exception whenever a failing status code is received. + * @return The page that was loaded. + * @exception IOException If an IO error occurs + * @exception FailingHttpStatusCodeException If the server returns a + * failing status code AND the variable + * "throwExceptionOnFailingStatusCode" is set to true + */ + public Page getPage( + final WebWindow webWindow, + final URL url, + final SubmitMethod method, + final List parameters, + final boolean throwExceptionOnFailingStatusCode ) + throws + IOException, + FailingHttpStatusCodeException { + return this.getPage(webWindow, url, FormEncodingType.URL_ENCODED, method, parameters, throwExceptionOnFailingStatusCode); + } + /** * Send a request to a server and return a Page that represents the * response from the server. This page will be used to populate this frame.<p> @@ -308,6 +364,7 @@ * * @param webWindow The window that the new page will be loaded into. * @param url The url of the server + * @param encType Encoding type of the form when done as a POST * @param method The submit method. Ie Submit.GET or SubmitMethod.POST * @param parameters A list of {@link * com.gargoylesoftware.htmlunit.KeyValuePair KeyValuePair}'s that @@ -323,6 +380,7 @@ public Page getPage( final WebWindow webWindow, final URL url, + final FormEncodingType encType, final SubmitMethod method, final List parameters, final boolean throwExceptionOnFailingStatusCode ) @@ -336,7 +394,7 @@ webResponse = makeWebResponseForJavaScriptUrl(webWindow, url); } else { - webResponse = loadWebResponse( url, method, parameters ); + webResponse = loadWebResponse( url, encType, method, parameters ); } final String contentType = webResponse.getContentType(); final int statusCode = webResponse.getStatusCode(); @@ -947,17 +1005,32 @@ }; } + /** + * Load a {@link WebResponse} from the server + * @param url The url to load the response from. + * @param method The {@link SubmitMethod} to use + * @param parameters Any parameters that are being passed into the request + * @throws IOException if an IO problem occurs + * @return The WebResponse + */ + public final WebResponse loadWebResponse( + final URL url, final SubmitMethod method, final List parameters) + throws + IOException { + return this.loadWebResponse(url, FormEncodingType.URL_ENCODED, method, parameters); + } /** * Load a {@link WebResponse} from the server * @param url The url to load the response from. + * @param encType Encoding type of the form when done as a POST * @param method The {@link SubmitMethod} to use * @param parameters Any parameters that are being passed into the request * @throws IOException if an IO problem occurs * @return The WebResponse */ public final WebResponse loadWebResponse( - final URL url, final SubmitMethod method, final List parameters) + final URL url, final FormEncodingType encType, final SubmitMethod method, final List parameters) throws IOException { @@ -965,7 +1038,7 @@ Assert.notNull("method", method); Assert.notNull("parameters", parameters); - final WebResponse webResponse = getWebConnection().getResponse( url, method, parameters, requestHeaders_ ); + final WebResponse webResponse = getWebConnection().getResponse( url, encType, method, parameters, requestHeaders_ ); final int statusCode = webResponse.getStatusCode(); if( statusCode >= 301 && statusCode <=307 && isRedirectEnabled() ) { Index: src/java/com/gargoylesoftware/htmlunit/WebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebConnection.java,v retrieving revision 1.7 diff -u -r1.7 WebConnection.java --- src/java/com/gargoylesoftware/htmlunit/WebConnection.java 16 Jul 2003 20:11:21 -0000 1.7 +++ src/java/com/gargoylesoftware/htmlunit/WebConnection.java 12 Aug 2003 22:56:55 -0000 @@ -103,7 +103,26 @@ throws IOException; - + /** + * Submit a request and retrieve a response + * + * @param parameters Any parameters + * @param url The url of the server + * @param encType Encoding type of the form when done as a POST + * @param submitMethod The submit method. Ie SubmitMethod.GET + * @param requestHeaders Any headers that need to be put into the request. + * @return See above + * @exception IOException If an IO error occurs + */ + public abstract WebResponse getResponse( + final URL url, + final FormEncodingType encType, + final SubmitMethod submitMethod, + final List parameters, + final Map requestHeaders ) + throws + IOException; + /** * Return the web client * @return The web client. Index: src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java,v retrieving revision 1.22 diff -u -r1.22 HtmlForm.java --- src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java 11 Aug 2003 15:24:57 -0000 1.22 +++ src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java 12 Aug 2003 22:56:55 -0000 @@ -37,6 +37,7 @@ */ package com.gargoylesoftware.htmlunit.html; +import com.gargoylesoftware.htmlunit.FormEncodingType; import com.gargoylesoftware.htmlunit.Assert; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.KeyValuePair; @@ -163,10 +164,10 @@ catch( final MalformedURLException e ) { throw new IllegalArgumentException( "Not a valid url: " + action ); } - + final FormEncodingType encType = FormEncodingType.getInstance( this.getEnctypeAttribute() ); final SubmitMethod method = SubmitMethod.getInstance( getAttributeValue( "method" ) ); final WebWindow webWindow = htmlPage.getEnclosingWindow(); - return htmlPage.getWebClient().getPage( webWindow, url, method, parameterList ); + return htmlPage.getWebClient().getPage( webWindow, url, encType, method, parameterList ); } Index: src/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java,v retrieving revision 1.25 diff -u -r1.25 HtmlInput.java --- src/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java 23 Jul 2003 17:26:52 -0000 1.25 +++ src/java/com/gargoylesoftware/htmlunit/html/HtmlInput.java 12 Aug 2003 22:56:55 -0000 @@ -37,12 +37,15 @@ */ package com.gargoylesoftware.htmlunit.html; +import com.gargoylesoftware.htmlunit.KeyDataPair; import com.gargoylesoftware.htmlunit.Assert; import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.KeyValuePair; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.ScriptResult; import org.w3c.dom.Element; + +import java.io.File; import java.io.IOException; /** @@ -107,7 +110,14 @@ }; } } - return new KeyValuePair[]{new KeyValuePair( getNameAttribute(), getValueAttribute() )}; + if (!this.getTypeAttribute().equals("file")) { + return new KeyValuePair[]{new KeyValuePair( getNameAttribute(), getValueAttribute() )}; + } else { + File f = new File(getValueAttribute()); + return new KeyValuePair[]{new KeyDataPair( getNameAttribute(), f )}; + } + + } Index: src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java,v retrieving revision 1.5 diff -u -r1.5 FakeWebConnection.java --- src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java 16 Jul 2003 20:11:20 -0000 1.5 +++ src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java 12 Aug 2003 22:56:55 -0000 @@ -110,17 +110,34 @@ super( webClient ); } + /** + * Submit a request to the processor + * + * @param url The url + * @param method The method to use + * @param parameters any parameters + * @return The response as an input stream + */ + public WebResponse getResponse( + final URL url, + final SubmitMethod method, + final List parameters, + final Map requestParameters ) { + return this.getResponse(url, FormEncodingType.URL_ENCODED, method, parameters, requestParameters); + } /** * Submit a request to the processor * * @param url The url + * @param encType form encoding type to use for POST method * @param method The method to use * @param parameters any parameters * @return The response as an input stream */ public WebResponse getResponse( final URL url, + final FormEncodingType encType, final SubmitMethod method, final List parameters, final Map requestParameters ) { |
From: Mike B. <mb...@Ga...> - 2003-08-12 18:15:05
|
James Asher wrote: > I do have log4j in my classpath, but I don't want it > to log anything. I use HtmlUnit with JUnit and > JUnitReport, so I have report-type information there. > > The reason I'm getting the debug information ( I > believe ) is because it is trying to write to the log > and i don't have permission to it, so it throws a > FileNotFoundException. > > So, I guess, is there any way to turn that all off? That would have to be disabled through the log4j configuration file. It's been a long time since I've used log4j so I'm afraid I won't be much help here. There is no way to disable the messages from within HtmlUnit itself - all of that is left up to the logging implementation (log4j in this case). -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: James A. <the...@ya...> - 2003-08-12 17:41:05
|
I do have log4j in my classpath, but I don't want it to log anything. I use HtmlUnit with JUnit and JUnitReport, so I have report-type information there. The reason I'm getting the debug information ( I believe ) is because it is trying to write to the log and i don't have permission to it, so it throws a FileNotFoundException. So, I guess, is there any way to turn that all off? --- Mike Bowler <mb...@Ga...> wrote: > James Asher wrote: > > Indeed, it was an older version of xerces. I > thought > > it was the current version, but I guess not - all > I > > did was replace it with your distributed version. > > > > I can now see in the output that it is returning > > values now where before there were none. However, > now > > I get many lines of DEBUG information in the > > System.out, is that a setting that I've turned on > > unknowningly? A default? Can I turn it off? > > By default, you should only be seeing INFO, ERROR > and FATAL messages. > DEBUG and TRACE messages should only display if you > have explicitly > turned them on. Having said that, it's always > possible that I've got > the setting wrong for the default case. > > HtmlUnit is using commons-logging which in turn will > delegate to another > logging framework. If you are using java 1.4 then > it will use the java > built in logging support. If you are not using 1.4 > but have log4j in > your classpath then it will use that. Otherwise it > will use SimpleLog. > How you change the logging settings varies according > to the logging > implementation you are using. Docs for SimpleLog > can be found at > http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/impl/SimpleLog.html > > Hope this helps. > > -- > Mike Bowler > Principal, Gargoyle Software Inc. > Voice: (416) 822-0973 | Email : > mb...@Ga... > Fax : (416) 822-0975 | Website: > http://www.GargoyleSoftware.com > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual > Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > HtmlUnit-develop mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-develop __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: James A. <the...@ya...> - 2003-08-12 17:13:19
|
Indeed, it was an older version of xerces. I thought it was the current version, but I guess not - all I did was replace it with your distributed version. I can now see in the output that it is returning values now where before there were none. However, now I get many lines of DEBUG information in the System.out, is that a setting that I've turned on unknowningly? A default? Can I turn it off? Thanks again. --- Mike Bowler <mb...@Ga...> wrote: > James Asher wrote: > > I can't seem to get any attributes of anything. > The > > only way I can is through the .toString() method. > Is > > there something that I could have done to have > this > > happen? > > Sorry about not responding sooner but work has been > hectic. > > There are unit tests to test every attribute on > every class and they're > all passing for me which would imply that the > problem is configuration > related. > > Is it possible that you are picking up a different > version of the xerces > jars before the ones that ship with HtmlUnit? Do > you have any other > jars in your classpath that implement the xml dom > model? Can you try > moving the xerces jars to the front of the > classpath? > > Are you running from within an IDE or from the > command line? IDE's > often put things on your classpath that you weren't > expecting. > > What version of java are you using? > > -- > Mike Bowler > Principal, Gargoyle Software Inc. > Voice: (416) 822-0973 | Email : > mb...@Ga... > Fax : (416) 822-0975 | Website: > http://www.GargoyleSoftware.com > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual > Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > HtmlUnit-develop mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-develop __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Mike B. <mb...@Ga...> - 2003-08-12 17:12:58
|
James Asher wrote: > Indeed, it was an older version of xerces. I thought > it was the current version, but I guess not - all I > did was replace it with your distributed version. > > I can now see in the output that it is returning > values now where before there were none. However, now > I get many lines of DEBUG information in the > System.out, is that a setting that I've turned on > unknowningly? A default? Can I turn it off? By default, you should only be seeing INFO, ERROR and FATAL messages. DEBUG and TRACE messages should only display if you have explicitly turned them on. Having said that, it's always possible that I've got the setting wrong for the default case. HtmlUnit is using commons-logging which in turn will delegate to another logging framework. If you are using java 1.4 then it will use the java built in logging support. If you are not using 1.4 but have log4j in your classpath then it will use that. Otherwise it will use SimpleLog. How you change the logging settings varies according to the logging implementation you are using. Docs for SimpleLog can be found at http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/impl/SimpleLog.html Hope this helps. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Mike B. <mb...@Ga...> - 2003-08-11 21:13:15
|
James Asher wrote: > I can't seem to get any attributes of anything. The > only way I can is through the .toString() method. Is > there something that I could have done to have this > happen? Sorry about not responding sooner but work has been hectic. There are unit tests to test every attribute on every class and they're all passing for me which would imply that the problem is configuration related. Is it possible that you are picking up a different version of the xerces jars before the ones that ship with HtmlUnit? Do you have any other jars in your classpath that implement the xml dom model? Can you try moving the xerces jars to the front of the classpath? Are you running from within an IDE or from the command line? IDE's often put things on your classpath that you weren't expecting. What version of java are you using? -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: SourceForge.net <no...@so...> - 2003-08-11 20:54:52
|
Feature Requests item #625328, was opened at 2002-10-18 12:28 Message generated for change (Comment added) made by yourgod You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=625328&group_id=47038 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Add HtmlFileInput support Initial Comment: Need HtmlFileInput to simulate file upload. ---------------------------------------------------------------------- Comment By: Brad Clarke (yourgod) Date: 2003-08-11 15:46 Message: Logged In: YES user_id=257129 Just ran into a need for this one myself and I'm looking at how to implement it. Any suggestions? ---------------------------------------------------------------------- Comment By: Thomas Bartz (phos4) Date: 2003-07-15 08:10 Message: Logged In: YES user_id=746059 Is there still any chance to see this in one of the next releases? Would be very great! ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2002-10-29 12:29 Message: Logged In: YES user_id=46756 I'm going to defer this to 1.2 as I'm close to wrapping up 1.1 and this feature will require quite a bit of work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=625328&group_id=47038 |
From: James A. <the...@ya...> - 2003-08-11 19:35:26
|
I can't seem to get any attributes of anything. The only way I can is through the .toString() method. Is there something that I could have done to have this happen? Things, thus far, that do not work: - HtmlPage + .getTitleText() - HtmlAnchor + .getHrefAttribute() + .getNameAttribute() + .getClassAttribute() + .getIdAttribute() + .getTitleAttribute() - HtmlForm + .getMethodAttribute() + .getNameAttribute() + .getClassAttribute() + .getIdAttribute() + .getTitleAttribute() - HtmlInput + .getNameAttribute() + .getClassAttribute() + .getIdAttribute() + .getTitleAttribute() + .getTypeAttribute() Nothing works, it all just outputs an empty string. The only thing that does work is the .toString method. Here is my java file: http://www.k-state.edu/test/james/HtmlUnitTest1UTest.java Here is my copy of the output from ant: http://www.k-state.edu/test/james/formOutput.txt I really think that HtmlUnit is the solution to my project, but nothing seems to be working the way ( I believe ) it should. Let me reiterate that I could have done something wrong like that, but I don't see how or where I did. Thank you for your time and attention. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: <no...@us...> - 2003-08-11 15:36:03
|
Log Message: ----------- Removed redundant code (mostly casts and semicolons) as identified by eclipse 3.0 Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit: ScriptFilter.java /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit: WebClientTest.java /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html: HtmlForm.java HtmlElement.java /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html: HtmlFormTest.java HtmlAnchorTest.java AttributesTest.java HtmlPageTest.java /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host: DocumentTest.java Revision Data ------------- Index: ScriptFilter.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/ScriptFilter.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ScriptFilter.java 10 Jun 2003 11:56:56 -0000 1.17 +++ ScriptFilter.java 11 Aug 2003 15:24:56 -0000 1.18 @@ -68,7 +68,6 @@ private StringBuffer scriptBuffer_; private StringBuffer newContentBuffer_; private String systemId_; - private int scriptCount_; /** * Create an instance @@ -103,7 +102,6 @@ scriptCharset_ = null; scriptBuffer_ = null; systemId_ = locator != null ? locator.getLiteralSystemId() : null; - scriptCount_ = 0; super.startDocument( locator, encoding, augmentations ); } Index: WebClientTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebClientTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- WebClientTest.java 10 Jun 2003 11:57:00 -0000 1.2 +++ WebClientTest.java 11 Aug 2003 15:24:57 -0000 1.3 @@ -435,7 +435,7 @@ list.add(page); return page; } - }; + } final List collectedPageCreationItems = new ArrayList(); client.setPageCreator( new CollectingPageCreator(collectedPageCreationItems) ); @@ -650,7 +650,7 @@ webClient.setAlertHandler( new CollectingAlertHandler(collectedAlerts) ); final HtmlPage page = getPageForKeyboardTest(webClient, new String[]{ "1", "2", "3" }); - final HtmlElement button = (HtmlElement)page.getHtmlElementById("button1"); + final HtmlElement button = page.getHtmlElementById("button1"); final List expectedAlerts = Collections.singletonList("buttonPushed"); collectedAlerts.clear(); Index: HtmlFormTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlFormTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HtmlFormTest.java 10 Jun 2003 11:57:00 -0000 1.3 +++ HtmlFormTest.java 11 Aug 2003 15:24:58 -0000 1.4 @@ -141,7 +141,7 @@ SubmitMethod.POST, Collections.EMPTY_LIST ); final HtmlForm form = ( HtmlForm )page.getHtmlElementById( "form1" ); - final HtmlInput pushButton = ( HtmlInput )form.getInputByName( "button" ); + final HtmlInput pushButton = form.getInputByName( "button" ); assertNotNull(pushButton); try { Index: HtmlAnchorTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlAnchorTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HtmlAnchorTest.java 10 Jun 2003 11:57:00 -0000 1.3 +++ HtmlAnchorTest.java 11 Aug 2003 15:24:58 -0000 1.4 @@ -301,7 +301,7 @@ final HtmlPage page = ( HtmlPage )client.getPage( new URL( "http://www.gargoylesoftware.com" ), SubmitMethod.POST, Collections.EMPTY_LIST ); - final HtmlAnchor testAnchor = (HtmlAnchor)page.getAnchorByName("testJavascript"); + final HtmlAnchor testAnchor = page.getAnchorByName("testJavascript"); testAnchor.click(); // blows up here } } Index: AttributesTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/AttributesTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AttributesTest.java 28 Jun 2003 16:42:54 -0000 1.2 +++ AttributesTest.java 11 Aug 2003 15:24:58 -0000 1.3 @@ -78,7 +78,7 @@ static { EXCLUDED_METHODS.add("getHtmlElementsByAttribute"); EXCLUDED_METHODS.add("getOneHtmlElementByAttribute"); - }; + } /** * Return a test suite containing a seperate test for each attribute Index: HtmlPageTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPageTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- HtmlPageTest.java 19 Jul 2003 18:19:36 -0000 1.6 +++ HtmlPageTest.java 11 Aug 2003 15:24:58 -0000 1.7 @@ -128,7 +128,7 @@ new URL( "http://www.gargoylesoftware.com" ), SubmitMethod.POST, Collections.EMPTY_LIST ); final HtmlForm form = ( HtmlForm )page.getHtmlElementById( "form1" ); - final HtmlInput input = ( HtmlInput )form.getInputByName( "textInput1" ); + final HtmlInput input = form.getInputByName( "textInput1" ); assertEquals( "name", "textInput1", input.getNameAttribute() ); assertEquals( "value", "textInput1", input.getValueAttribute() ); @@ -165,7 +165,7 @@ new URL( "http://www.gargoylesoftware.com" ), SubmitMethod.POST, Collections.EMPTY_LIST ); final HtmlForm form = ( HtmlForm )page.getHtmlElementById( "form1" ); - final HtmlInput textInput = ( HtmlInput )form.getInputByName( "textInput1" ); + final HtmlInput textInput = form.getInputByName( "textInput1" ); textInput.setValueAttribute( "foo" ); final HtmlSubmitInput button = ( HtmlSubmitInput )form.getInputByName( "submitInput1" ); @@ -230,7 +230,7 @@ assertSame( "form1", form, page.getHtmlElementById( "form1" ) ); assertSame( "form2", form, page.getHtmlElement( form.getElement() ) ); - final HtmlInput input = ( HtmlInput )form.getInputByName( "textInput1" ); + final HtmlInput input = form.getInputByName( "textInput1" ); assertSame( "input1", input, form.getInputByName( "textInput1" ) ); assertSame( "input2", input, page.getHtmlElement( input.getElement() ) ); Index: HtmlForm.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html/HtmlForm.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- HtmlForm.java 16 Jun 2003 21:03:24 -0000 1.21 +++ HtmlForm.java 11 Aug 2003 15:24:57 -0000 1.22 @@ -100,7 +100,7 @@ while( iterator.hasNext() ) { final HtmlInput input = (HtmlInput)iterator.next(); if( input.getTypeAttribute().equals("submit")) { - return submit( ( SubmittableElement )input ); + return submit( input ); } } @@ -266,7 +266,7 @@ return false; } - final Attr disabled = (Attr)getElement().getAttributeNode("disabled"); + final Attr disabled = getElement().getAttributeNode("disabled"); if( disabled != null ) { return false; } @@ -274,7 +274,7 @@ if( tagName.equals( "input" ) ) { final String type = getAttributeValue(element, "type" ).toLowerCase(); if( type.equals( "radio" ) || type.equals( "checkbox" ) ) { - final Attr checked = (Attr)element.getAttributeNode("checked"); + final Attr checked = element.getAttributeNode("checked"); return checked != null; } if( type.equals("submit") || type.equals("image") ){ Index: HtmlElement.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html/HtmlElement.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- HtmlElement.java 28 Jun 2003 16:42:54 -0000 1.25 +++ HtmlElement.java 11 Aug 2003 15:24:57 -0000 1.26 @@ -204,7 +204,7 @@ public final String getAttributeValue( final Element element, final String attributeName ) { Assert.notNull("element", element); - final Attr attribute = (Attr)element.getAttributeNode(attributeName.toUpperCase()); + final Attr attribute = element.getAttributeNode(attributeName.toUpperCase()); if( attribute == null ) { return ATTRIBUTE_NOT_DEFINED; } Index: DocumentTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/DocumentTest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- DocumentTest.java 16 Jul 2003 20:11:20 -0000 1.15 +++ DocumentTest.java 11 Aug 2003 15:24:58 -0000 1.16 @@ -180,7 +180,7 @@ final HtmlPage page = (HtmlPage)client.getPage(new URL("http://first")); assertEquals( "", page.getTitleText() ); - final HtmlAnchor testAnchor = (HtmlAnchor)page.getAnchorByName("testJavascript"); + final HtmlAnchor testAnchor = page.getAnchorByName("testJavascript"); final HtmlPage secondPage = (HtmlPage)testAnchor.click(); assertEquals( "second", secondPage.getTitleText() ); } |
From: <no...@us...> - 2003-08-11 15:30:00
|
Log Message: ----------- Added jelly dependencies back in now that 1.2.3 is released Modified Files: -------------- /cvsroot/htmlunit/htmlunit: project.xml Revision Data ------------- Index: project.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/project.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- project.xml 31 Jul 2003 23:18:17 -0000 1.26 +++ project.xml 11 Aug 2003 15:19:30 -0000 1.27 @@ -126,7 +126,7 @@ <htmlunit.description>Additional support for testing</htmlunit.description> </properties> </dependency> -<!-- + <dependency> <groupId>commons-jelly</groupId> <artifactId>commons-jelly</artifactId> @@ -197,7 +197,7 @@ <htmlunit.description>Javabean support</htmlunit.description> </properties> </dependency> ---> + <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> |
From: Mike B. <mb...@Ga...> - 2003-08-10 19:59:29
|
HtmlUnit-1.2.3 has been released. Full change log at http://htmlunit.sourceforge.net/changes-report.html -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: <no...@us...> - 2003-08-10 19:35:34
|
Log Message: ----------- Packaging changes for 1.2.3 Modified Files: -------------- /cvsroot/htmlunit/htmlunit: project.properties maven.xml Revision Data ------------- Index: project.properties =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/project.properties,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- project.properties 15 Jul 2003 18:55:23 -0000 1.10 +++ project.properties 10 Aug 2003 19:35:03 -0000 1.11 @@ -2,6 +2,7 @@ # Build and Deployment ##################################################### maven.repo.remote=http://www.ibiblio.org/maven/,http://nanning.sourceforge.net/maven-repo/ +maven.dist.bin.assembly.dir=./target ##################################################### # Properties related to project-site Index: maven.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/maven.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- maven.xml 3 Jul 2003 19:29:51 -0000 1.4 +++ maven.xml 10 Aug 2003 19:35:03 -0000 1.5 @@ -14,18 +14,18 @@ <preGoal name="xdoc:transform"> <attainGoal name="faq"/> - <attainGoal name="createDependenciesPage"/> + <attainGoal name="createDependenciesPage"/> </preGoal> - + <goal name="createDependenciesPage" description="Generates the dependencies document"> <j:set var="destfile" value="${maven.build.dir}/generated-xdocs/dependencies.xml"/> <ant:mkdir dir="${maven.build.dir}/generated-xdocs"/> - + <u:file var="destfileFile" name="${destfile}"/> <j:set var="destfile" value="${destfileFile.getCanonicalPath()}"/> - + <j:set var="outputencoding" value="${maven.docs.outputencoding}"/> <j:file name="${destfile}" encoding="${outputencoding}" outputMode="xml"> @@ -36,73 +36,147 @@ </properties> <body> <section name="Dependencies"> - <p> - These are the various dependencies required by HtmlUnit. Some jars - are mandatory for even the simplest use of HtmlUnit, others are optional. - If the optional JARs are missing then the main functionality will - continue to work but some functions will not. - </p> - <table> - <tr><th>Required JARs</th><th>Description</th></tr> - <tr><td>HtmlUnit.jar</td><td>The main HtmlUnit classes</td></tr> - <j:forEach var="lib" items="${pom.artifacts}"> - <j:set var="dep" value="${lib.dependency}"/> - <j:if test="${dep.getProperty('htmlunit.group')=='required'}"> - <tr> - <tr> - <td><a href="${dep.url}">${dep.artifact}</a></td> - <td>${dep.getProperty('htmlunit.description')}</td> - </tr> - </tr> - </j:if> - </j:forEach> + <p> - <tr><th>Optional JARs for jelly scripting support</th><th>Description</th></tr> - <j:forEach var="lib" items="${pom.artifacts}"> - <j:set var="dep" value="${lib.dependency}"/> - <j:if test="${dep.getProperty('htmlunit.group')=='jelly'}"> - <tr> - <tr> - <td><a href="${dep.url}">${dep.artifact}</a></td> - <td>${dep.getProperty('htmlunit.description')}</td> - </tr> - </tr> - </j:if> - </j:forEach> + These are the various dependencies required by HtmlUnit. Some jars + are mandatory for even the simplest use of HtmlUnit, others are optional. + If the optional JARs are missing then the main functionality will + continue to work but some functions will not. + </p> + <table> + <tr><th>Required JARs</th><th>Description</th></tr> + <tr><td>HtmlUnit.jar</td><td>The main HtmlUnit classes</td></tr> + <j:forEach var="lib" items="${pom.artifacts}"> + <j:set var="dep" value="${lib.dependency}"/> - <tr><th>Optional JARs for running the unit tests</th><th>Description</th></tr> - <j:forEach var="lib" items="${pom.artifacts}"> - <j:set var="dep" value="${lib.dependency}"/> - <j:if test="${dep.getProperty('htmlunit.group')=='test'}"> - <tr> - <td><a href="${dep.url}">${dep.artifact}</a></td> - <td>${dep.getProperty('htmlunit.description')}</td> - </tr> - </j:if> - </j:forEach> + <j:if test="${dep.getProperty('htmlunit.group')=='required'}"> + <tr> + <tr> + <td><a href="${dep.url}">${dep.artifact}</a></td> + <td>${dep.getProperty('htmlunit.description')}</td> + </tr> + </tr> + </j:if> - <tr><th>Optional JARs for SSL support</th><th>Description</th></tr> - <tr> - <td><a href="http://java.sun.com/products/jsse/">JSSE</a></td> - <td>Java Secure Socket Extension. Not required if you are running Java 1.4+</td> - </tr> + </j:forEach> - <tr><th>Other optional JARs</th><th>Description</th></tr> - <j:forEach var="lib" items="${pom.artifacts}"> - <j:set var="dep" value="${lib.dependency}"/> - <j:if test="${dep.getProperty('htmlunit.group')=='optional'}"> - <tr> - <tr> - <td><a href="${dep.url}">${dep.artifact}</a></td> - <td>${dep.getProperty('htmlunit.description')}</td> - </tr> - </tr> - </j:if> - </j:forEach> - </table> + <tr><th>Optional JARs for jelly scripting support</th><th>Description</th></tr> + <j:forEach var="lib" items="${pom.artifacts}"> + <j:set var="dep" value="${lib.dependency}"/> + <j:if test="${dep.getProperty('htmlunit.group')=='jelly'}"> + <tr> + <tr> + + <td><a href="${dep.url}">${dep.artifact}</a></td> + <td>${dep.getProperty('htmlunit.description')}</td> + </tr> + </tr> + </j:if> + </j:forEach> + + <tr><th>Optional JARs for running the unit tests</th><th>Description</th></tr> + + <j:forEach var="lib" items="${pom.artifacts}"> + <j:set var="dep" value="${lib.dependency}"/> + <j:if test="${dep.getProperty('htmlunit.group')=='test'}"> + <tr> + <td><a href="${dep.url}">${dep.artifact}</a></td> + <td>${dep.getProperty('htmlunit.description')}</td> + </tr> + </j:if> + + </j:forEach> + + <tr><th>Optional JARs for SSL support</th><th>Description</th></tr> + <tr> + <td><a href="http://java.sun.com/products/jsse/">JSSE</a></td> + <td>Java Secure Socket Extension. Not required if you are running Java 1.4+</td> + </tr> + + <tr><th>Other optional JARs</th><th>Description</th></tr> + <j:forEach var="lib" items="${pom.artifacts}"> + <j:set var="dep" value="${lib.dependency}"/> + <j:if test="${dep.getProperty('htmlunit.group')=='optional'}"> + <tr> + <tr> + <td><a href="${dep.url}">${dep.artifact}</a></td> + + <td>${dep.getProperty('htmlunit.description')}</td> + </tr> + </tr> + </j:if> + </j:forEach> + </table> </section> </body> + </document> </j:file> - </goal> -</project> + </goal> + + + <goal + name="buildzip" + prereqs="xdoc:init, java:jar, javadoc:generate" + description="Builds the distribution"> + + <ant:mkdir dir="${maven.dist.bin.assembly.dir}/${maven.final.name}"/> + <ant:mkdir dir="${maven.dist.bin.assembly.dir}/${maven.final.name}/lib"/> + + <ant:mkdir dir="${maven.dist.bin.assembly.dir}/${maven.final.name}/docs"/> + + <ant:echo> + +------------------------------------------+ + | C R E A T I N G D I S T R I B U T I O N | + +------------------------------------------+ + </ant:echo> + + <ant:copy todir="${maven.dist.bin.assembly.dir}/${maven.final.name}"> + <ant:fileset dir="."> + <ant:include name="README.txt"/> + <ant:include name="LICENSE*"/> + + </ant:fileset> + </ant:copy> + + <!-- Copy Jars --> + <ant:copy todir="${maven.dist.bin.assembly.dir}/${maven.final.name}/lib"> + <ant:fileset dir="${maven.build.dir}"> + <ant:include name="${maven.final.name}.jar"/> + </ant:fileset> + </ant:copy> + + <!-- Copy dependencies --> + <j:forEach var="lib" items="${pom.artifacts}"> + <j:set var="dep" value="${lib.dependency}"/> + <j:if test="${dep.getProperty('htmlunit.group')!='test'}"> + <ant:copy todir="${maven.dist.bin.assembly.dir}/${maven.final.name}/lib" file="${lib.path}"/> + </j:if> + </j:forEach> + + <!-- Copy documentation --> + <j:set var="docsDest" + value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}"/> + <ant:mkdir dir="${maven.dist.bin.assembly.dir}/${maven.final.name}/docs"/> + <ant:copy todir="${maven.dist.bin.assembly.dir}/${maven.final.name}/docs"> + <ant:fileset dir="${docsDest}"> + <ant:include name="**"/> + </ant:fileset> + </ant:copy> + + <!-- Copy the source --> + <ant:mkdir dir="${maven.dist.bin.assembly.dir}/${maven.final.name}/src"/> + <ant:copy todir="${maven.dist.bin.assembly.dir}/${maven.final.name}/src"> + <ant:fileset dir="src"> + <ant:include name="**"/> + <ant:exclude name="xdocs"/> + </ant:fileset> + </ant:copy> + + <!-- Build the zip --> + <zip + destfile="${maven.dist.bin.assembly.dir}/${maven.final.name}.zip" + basedir="${maven.dist.bin.assembly.dir}/${maven.final.name}"/> + </goal> + +</project> \ No newline at end of file |
From: Mike B. <mb...@Ga...> - 2003-08-06 23:17:27
|
th...@cy... wrote: > does anybody know a good package to check a page for valid html code? > Would be nice to include into the tests automaticaly a check if the > current page received is valid concerning the W3C-specification. If your page is xhtml then you can get the xhtml dtd or schema (both are available) from w3.org and perform validation with any xml parser. I typically write xhtml just because it's easy to validate. If your page is regular html then you might be able to do that with either NekoHTML or JTidy. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: <th...@cy...> - 2003-08-06 20:24:44
|
Hi there, does anybody know a good package to check a page for valid html code? Would be nice to include into the tests automaticaly a check if the current page received is valid concerning the W3C-specification. I know there are tools for doing that on command line, but I've not found something yet, that is kind of a Java package. I have to admit, I didn't _really_ search for it yet, but maybe someone here has something like that at hand already ;) Best regards Thomas Bartz Berlin |
From: Mike B. <mb...@Ga...> - 2003-08-06 18:45:53
|
James Asher wrote: > After playing with this some more, I came up with a > much simpler test to make sure I was doing things > correctly, yet I still get the same errors, actually I > seem to have gotten more. Very strange - not what I would have expected at all. I should have some time later today to try this out. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: James A. <the...@ya...> - 2003-08-06 18:06:49
|
After playing with this some more, I came up with a much simpler test to make sure I was doing things correctly, yet I still get the same errors, actually I seem to have gotten more. Here is the html I'm testing: <html> <body> <form name="test" id="test" method="post"> <input name="inputBox" type="text"> <input name="submitButton" type="submit" value="submit it"> </form> </body> </html> Here is the test I have: public void testHomePage() throws Exception { /* used for JSSE */ System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); final WebClient webClient = new WebClient(); webClient.setJavaScriptEnabled(false); webClient.setRedirectEnabled(true); final URL url = new URL("https://www.ksu.edu/test/james/formTest.html"); HtmlPage page1 = (HtmlPage)webClient.getPage(url); writeToFile(page1); /* used to save the returned hmtml */ List l = page1.getAllForms(); final HtmlForm form = (HtmlForm)l.get(l.size() -1); HtmlInput ip = null; /* getAllInputsByName("") shouldn't have "", it should be "test", but that doesn't work */ ArrayList al = new ArrayList(form.getAllInputsByName("")); for(int i = 0; i < al.size(); i++) { ip = (HtmlInput)al.get(i); System.out.println("|"+ip.getNameAttribute()+"|"); System.out.println("|"+ip.getTypeAttribute()+"|"); System.out.println("|"+ip.getValueAttribute()+"|"); System.out.println("|"+ip.toString()+"|"); } System.out.println(al.size()); } And that returns this: [junit] ------------- Standard Output --------------- [junit] || [junit] || [junit] || [junit] |HtmlTextInput[<input name="inputBox" type="text">]| [junit] || [junit] || [junit] || [junit] |HtmlTextInput[<input name="submitButton" type="submit" value="submit it">]| [junit] 2 [junit] ------------- ---------------- --------------- So something is wrong here, either HtmlUnit isn't working right, or I'm doing something wrong, but either way, I don't know what to do to fix it. Thank you. --- James Asher <the...@ya...> wrote: > I am having problems getting certain form elements. > I > can't get HtmlForm or HtmlInput by the name > attribute. > If I do something like this: > > final HtmlForm form = (HtmlForm)l.get(l.size() -1); > HtmlInput ip = null; > ArrayList al = new > ArrayList(form.getAllSubmittableElements()); > for(int i = 0; i < al.size(); i++) { > ip = (HtmlInput)al.get(i); > > System.out.println("|"+ip.getNameAttribute()+"|"); > } > > I get output like this: > || > || > || > > The form I'm trying to get and eventually submit > looks > like this: > <form name="signonForm" method="POST" > action="/keas/profile/signon.do;jsessionid=3D51678DB56D4A16C867DA7DEBA"> > > <table border="0" cellspacing="10" cellpadding="0" > width="60%" summary=""> > <tr><td rowspan="5" width="20%"> </td> > <td colspan="2" align="left"></td></tr> > <tr><td width="30%"><span class="title" > style="color:#333333;"><label > for="eid">eID</label></span></td> > <td width="50%" align="right"><input type="text" > name="eid" maxlength="50" size="22" value="" > class="plain"></td></tr> > <tr><td colspan="2" align="left"></td></tr> > <tr><td width="30%"><span class="title" > style="color:#333333;"><label > for="passwd">password</label></span></td> > <td width="50%" align="right"><input > type="password" name="password" maxlength="50" > size="22" value="" class="plain"></td></tr> > <tr><td colspan="2" align="right"><input > type="image" > name="" > src="/keas/images/signin-button.gif;jsessionid=3D59178DB56DA16C81867DEBAE9" > alt="Sign in" border="0"></td></tr> > </table> > </form> > > They all have name attributes, so what's the deal? > > I had this problem in 1.2.2 as well as 1.2.3 > > > Thuroughly perplexed, > - Asher. > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site > design software > http://sitebuilder.yahoo.com > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual > Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > HtmlUnit-develop mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-develop __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: James A. <the...@ya...> - 2003-08-06 16:54:34
|
I am having problems getting certain form elements. I can't get HtmlForm or HtmlInput by the name attribute. If I do something like this: final HtmlForm form = (HtmlForm)l.get(l.size() -1); HtmlInput ip = null; ArrayList al = new ArrayList(form.getAllSubmittableElements()); for(int i = 0; i < al.size(); i++) { ip = (HtmlInput)al.get(i); System.out.println("|"+ip.getNameAttribute()+"|"); } I get output like this: || || || The form I'm trying to get and eventually submit looks like this: <form name="signonForm" method="POST" action="/keas/profile/signon.do;jsessionid=3D51678DB56D4A16C867DA7DEBA"> <table border="0" cellspacing="10" cellpadding="0" width="60%" summary=""> <tr><td rowspan="5" width="20%"> </td> <td colspan="2" align="left"></td></tr> <tr><td width="30%"><span class="title" style="color:#333333;"><label for="eid">eID</label></span></td> <td width="50%" align="right"><input type="text" name="eid" maxlength="50" size="22" value="" class="plain"></td></tr> <tr><td colspan="2" align="left"></td></tr> <tr><td width="30%"><span class="title" style="color:#333333;"><label for="passwd">password</label></span></td> <td width="50%" align="right"><input type="password" name="password" maxlength="50" size="22" value="" class="plain"></td></tr> <tr><td colspan="2" align="right"><input type="image" name="" src="/keas/images/signin-button.gif;jsessionid=3D59178DB56DA16C81867DEBAE9" alt="Sign in" border="0"></td></tr> </table> </form> They all have name attributes, so what's the deal? I had this problem in 1.2.2 as well as 1.2.3 Thuroughly perplexed, - Asher. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Mike B. <mb...@Ga...> - 2003-08-05 20:59:48
|
I'm using a new way of packaging up the release and I'm not convinced that I've worked all the kinks out of it. The official release of 1.2.3 will be out in a day or two but here is my first attempt at packaging. If you've got the time to try this version I'd appreciate it. http://htmlunit.sourceforge.net/htmlunit-1.2.3-rc1.zip The code for HtmlUnit isn't expected to change between now and 1.2.3, this is just a test of the new packaging code to make sure all the requisite parts have been included. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |