httpunit-develop Mailing List for httpunit
Brought to you by:
russgold
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(12) |
Sep
(77) |
Oct
(48) |
Nov
(51) |
Dec
(50) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(64) |
Feb
(53) |
Mar
(62) |
Apr
(60) |
May
(90) |
Jun
(35) |
Jul
(86) |
Aug
(98) |
Sep
(88) |
Oct
(82) |
Nov
(85) |
Dec
(61) |
2002 |
Jan
(94) |
Feb
(121) |
Mar
(145) |
Apr
(80) |
May
(99) |
Jun
(93) |
Jul
(84) |
Aug
(90) |
Sep
(163) |
Oct
(179) |
Nov
(219) |
Dec
(125) |
2003 |
Jan
(133) |
Feb
(184) |
Mar
(270) |
Apr
(157) |
May
(157) |
Jun
(99) |
Jul
(136) |
Aug
(133) |
Sep
(113) |
Oct
(47) |
Nov
(64) |
Dec
(80) |
2004 |
Jan
(57) |
Feb
(82) |
Mar
(166) |
Apr
(80) |
May
(42) |
Jun
(96) |
Jul
(65) |
Aug
(76) |
Sep
(41) |
Oct
(155) |
Nov
(100) |
Dec
(64) |
2005 |
Jan
(84) |
Feb
(68) |
Mar
(38) |
Apr
(96) |
May
(69) |
Jun
(62) |
Jul
(50) |
Aug
(68) |
Sep
(52) |
Oct
(53) |
Nov
(39) |
Dec
(26) |
2006 |
Jan
(67) |
Feb
(41) |
Mar
(101) |
Apr
(60) |
May
(30) |
Jun
(24) |
Jul
(29) |
Aug
(18) |
Sep
(13) |
Oct
(9) |
Nov
(5) |
Dec
(13) |
2007 |
Jan
(17) |
Feb
(5) |
Mar
(16) |
Apr
(19) |
May
(3) |
Jun
(6) |
Jul
(2) |
Aug
(19) |
Sep
(14) |
Oct
(11) |
Nov
(18) |
Dec
(21) |
2008 |
Jan
(19) |
Feb
(5) |
Mar
(52) |
Apr
(84) |
May
(67) |
Jun
(15) |
Jul
(3) |
Aug
(10) |
Sep
(13) |
Oct
(4) |
Nov
(16) |
Dec
(7) |
2009 |
Jan
(4) |
Feb
(9) |
Mar
(6) |
Apr
(12) |
May
(9) |
Jun
(3) |
Jul
(5) |
Aug
(59) |
Sep
(17) |
Oct
(8) |
Nov
(3) |
Dec
(6) |
2010 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(9) |
May
(6) |
Jun
|
Jul
(2) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(3) |
Dec
|
2011 |
Jan
(9) |
Feb
(1) |
Mar
(15) |
Apr
(3) |
May
(9) |
Jun
|
Jul
(1) |
Aug
|
Sep
(4) |
Oct
|
Nov
(3) |
Dec
(5) |
2012 |
Jan
|
Feb
(1) |
Mar
(3) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Wolfgang F. <wf...@bi...> - 2014-11-05 08:29:29
|
Hi Santosh, thank you for your question, you might want to place your question at: http://stackoverflow.com/questions/tagged/http-unit so that other's can profit from the discussion. To get an answer for your question you also might want to supply a stripped down example that shows exactly what your problem is. The stripped down example should be in a shape that other's can try out what you are experiencing. Please note that javascript support in http-unit is limited. Your mileage regarding ajax calls might therefore vary. Cheers Wolfgang Am 04.11.14 um 14:17 schrieb Santosh Gdr: > Hi... > > I am using HttpClient to handle session.Here is my code to handle > session using httpclient. But httpclient won't handle ajax calls.I am > planning to move to httpunit to overcome my problem.Basically I have a > referral URL(or authentication server) from which I need to get > cookies and session and store it in client.And use this client across > website to get logged user information. > What is the appropriate solution for this using httpunit. > credentialsURL="https://www.,,,,.com./sapLogin.aspxHOOK_URL=https://authentication.server.address&username=<username>&password=<password>"; > > try{ > HttpEntity entity=null; > HttpGet httpget=null; > HttpResponse response=null; > httpclient = new DefaultHttpClient(); > httpget = new HttpGet(credentialsURL); > > httpget.setHeader(HttpHeaders.USER_AGENT, "Mozilla/5.0 (Windows > NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) > Chrome/15.0.874.120 Safari/535.2"); > response = httpclient.execute(httpget); > > entity = response.getEntity(); > > if (entity != null) { > > EntityUtils.consume(entity); > } > } > catch(Exception e){ > } > return httpclient; > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Httpunit-develop mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/httpunit-develop -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Santosh G. <gdr...@gm...> - 2014-11-04 13:17:59
|
Hi... I am using HttpClient to handle session.Here is my code to handle session using httpclient. But httpclient won't handle ajax calls.I am planning to move to httpunit to overcome my problem.Basically I have a referral URL(or authentication server) from which I need to get cookies and session and store it in client.And use this client across website to get logged user information. What is the appropriate solution for this using httpunit. credentialsURL="https://www.,,,,.com./sapLogin.aspxHOOK_URL= https://authentication.server.address &username=<username>&password=<password>"; try{ HttpEntity entity=null; HttpGet httpget=null; HttpResponse response=null; httpclient = new DefaultHttpClient(); httpget = new HttpGet(credentialsURL); httpget.setHeader(HttpHeaders.USER_AGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2"); response = httpclient.execute(httpget); entity = response.getEntity(); if (entity != null) { EntityUtils.consume(entity); } } catch(Exception e){ } return httpclient; |
From: Santosh G. <gdr...@gm...> - 2014-11-03 12:03:30
|
gdr...@gm... |
From: Keith F. <fog...@ya...> - 2014-05-10 11:38:59
|
Hi HttpUnit-developers, I was hoping you may be able to help. I'm working on a MSc. thesis and am looking to distinguish java Open Source Test-First/Test-Driven Development and Test-Last projects for a research experiment. To this end I was hoping that contributors to HttpUnit would consider filling out the linked short survey (12 questions) for this project (or any other open source java project you are involved in)? My research will look at and compare design pattern usage in Test-First and Test-Last projects in relation to effectiveness and design quality. If you would be interested in learning more about the project or its findings please enter your details in the comment box in the survey and I will contact you once the project is complete. I intend to use the results of the survey solely for the purposes of the dissertation. Individual contributors will not be named in any reporting of the project. If you do not wish your project to be identified you can indicate so in the survey and its name will be masked. Many thanks in advance; your help is very much appreciated. Keith Fogarty Link to survey: https://docs.google.com/a/mydit.ie/forms/d/160CG5J_LJM3cAbSUrtfzka55vTrAeUwL4o-PvsY8Wkw/viewform Open Source Software Project Survey Hi, I was hoping you may be able to help me. I'm currently working on an M.Sc. Thesis and require a number of Test-First and Test-Last subject projects as part o... View on docs.google.com Preview by Yahoo |
From: Mustafa C. <ac...@ya...> - 2013-01-31 02:09:39
|
Dear Sirs, im Mustafa Cayci http://stellerdesign.com/coffeechocko.php?ucvwqnlptvuw 1/31/2013 3:09:30 AM _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- "loneliness and seclusion as a strict Roman Catholic, in the midst of that little wedge of Roman Catholics JERRELL vituaaaa |
From: Wolfgang F. <wf...@bi...> - 2012-12-18 11:32:32
|
Dear httpunit developers, httpunit is discussed every once in a while on stackoverflow. I think that community is a bit more lively than our own. You are kindly invited to post any questions about httpunit there. This way we could also show that httpunit is "not dead": http://stackoverflow.com/questions/8630395/is-httpunit-deprecated-inactive-not-supported/13931972#13931972 Yours Wolfgang -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-11-12 08:43:05
|
Dear Mostafa, please find below a test case I just added to show what IMHO is happening. You might want to register your servlet with the fully qualifying url. If you register "validateLogin" but use "ISB/validateLogin" you'll get the exception you are seeing (as shown by the JUnit test case below. You are kindly invited to post your question on stackoverflow.com with the tag httpunit to let others know about this handling issue. Yours Wolfgang @Test /** * Test added by WF 2012-11-12 to answer question on developers mailing list * @throws Exception */ public void testInvalidConfig() throws Exception { final String resourceName = "something/interesting"; ServletRunner sr = new ServletRunner(); sr.registerServlet(resourceName, ConfigServlet.class.getName()); WebClient wc = sr.newClient(); try { WebResponse response = wc.getResponse("http://localhost/" + "ISB/"+ resourceName); fail("No Exception thrown"); } catch (Throwable th) { // com.meterware.httpunit.HttpNotFoundException: // Error on HTTP request: 404 No servlet mapping defined [http://localhost/ISB/something/interesting] String expected="Error on HTTP request: 404 No servlet mapping defined [http://localhost/ISB/something/interesting]"; assertTrue("HttpNotFoundException expected",th instanceof HttpNotFoundException); assertEquals("wrong exception message",expected,th.getMessage()); } } Am 12.11.12 01:38, schrieb mostafa kandil: > Hi httpunit developers team: > first i appreciate the work of httpunit framework, i have 4 weeks ago > searching for a tool i can use to test java Servlet. so when i found > your framework, i was so happy :D . > i have downloaded last released, and tried a simple case: > > void test(){ > try { > ServletRunner sr = new ServletRunner(); > sr.registerServlet("validateLogin", > "validateLogin"); > // or > sr.registerServlet("validateLogin", > validateLogin.class.getName()); > ServletUnitClient sc = sr.newClient(); > WebRequest request = new > PostMethodWebRequest("http://cuportal.cu.edu.eg:8080/ISB/validateLogin"); > > request.setParameter("un", "user1"); > request.setParameter("pwd", "userpwd"); > > WebResponse response = sc.getResponse(request); > assertEquals("requested resource", > "user_page.jsp", response.getText()); > } catch (Exception e) { > System.err.println("ERROR: " + e); > e.printStackTrace(); > } > } > > Always i got exception at red line : > > ERROR: com.meterware.httpunit.HttpNotFoundException: > Error on HTTP request: 404 No servlet mapping defined > [http://cuportal.cu.edu.eg:8080/ISB/validateLogin] > ___________________________________ > com.meterware.httpunit.HttpNotFoundException: Error on > HTTP request: 404 No servlet mapping defined > [http://cuportal.cu.edu.eg:8080/ISB/validateLogin] > at > com.meterware.servletunit.WebApplication$ServletRequestImpl.getServlet(WebApplication.java:772) > at > com.meterware.servletunit.InvocationContextImpl$ExecutionContext.getServlet(InvocationContextImpl.java:248) > at > com.meterware.servletunit.InvocationContextImpl.getServlet(InvocationContextImpl.java:86) > at > com.meterware.servletunit.InvocationContextImpl.service(InvocationContextImpl.java:76) > at > com.meterware.servletunit.ServletUnitClient.newResponse(ServletUnitClient.java:126) > at > com.meterware.httpunit.WebClient.createResponse(WebClient.java:647) > at > com.meterware.httpunit.WebWindow.getResource(WebWindow.java:220) > at > com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:181) > at > com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:158) > at > com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:125) > at > com.meterware.httpunit.WebClient.getResponse(WebClient.java:96) > at myServletTest.testISB(myServletTest.java:65) > at myServletTest.<init>(myServletTest.java:21) > at myServletTest.main(myServletTest.java:81) > > i'm using 'Java EE 6 Web', and netbeans tool. > i have added all libraries. > > Can you help me please solve that exception? > > thanks in advance > > > > > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > > > _______________________________________________ > Httpunit-develop mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/httpunit-develop -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: mostafa k. <mos...@ya...> - 2012-11-12 00:38:56
|
Hi httpunit developers team: first i appreciate the work of httpunit framework, i have 4 weeks ago searching for a tool i can use to test java Servlet. so when i found your framework, i was so happy :D . i have downloaded last released, and tried a simple case: void test(){ >>> try { >>> ServletRunner sr = new ServletRunner(); >>> sr.registerServlet("validateLogin", "validateLogin"); >>> // or sr.registerServlet("validateLogin", validateLogin.class.getName()); >>> ServletUnitClient sc = sr.newClient(); >>> WebRequest request = new PostMethodWebRequest("http://cuportal.cu.edu.eg:8080/ISB/validateLogin"); >>> >>> >>> request.setParameter("un", "user1"); >>> request.setParameter("pwd", "userpwd"); >>> >>> WebResponse response = sc.getResponse(request); >>> assertEquals("requested resource", "user_page.jsp", response.getText()); >>> } catch (Exception e) { >>> System.err.println("ERROR: " + e); >>> e.printStackTrace(); >>> } >>>}Always i got exception at red line : ERROR: com.meterware.httpunit.HttpNotFoundException: Error on HTTP request: 404 No servlet mapping defined [http://cuportal.cu.edu.eg:8080/ISB/validateLogin] >>>___________________________________ >>>com.meterware.httpunit.HttpNotFoundException: Error on HTTP request: 404 No servlet mapping defined [http://cuportal.cu.edu.eg:8080/ISB/validateLogin] >>>at com.meterware.servletunit.WebApplication$ServletRequestImpl.getServlet(WebApplication.java:772) >>>at com.meterware.servletunit.InvocationContextImpl$ExecutionContext.getServlet(InvocationContextImpl.java:248) >>>at com.meterware.servletunit.InvocationContextImpl.getServlet(InvocationContextImpl.java:86) >>>at com.meterware.servletunit.InvocationContextImpl.service(InvocationContextImpl.java:76) >>>at com.meterware.servletunit.ServletUnitClient.newResponse(ServletUnitClient.java:126) >>>at com.meterware.httpunit.WebClient.createResponse(WebClient.java:647) >>>at com.meterware.httpunit.WebWindow.getResource(WebWindow.java:220) >>>at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:181) >>>at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:158) >>>at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:125) >>>at com.meterware.httpunit.WebClient.getResponse(WebClient.java:96) >>>at myServletTest.testISB(myServletTest.java:65) >>>at myServletTest.<init>(myServletTest.java:21) >>>at myServletTest.main(myServletTest.java:81) >>> >>>i'm using 'Java EE 6 Web', and netbeans tool. i have added all libraries. Can you help me please solve that exception? thanks in advance |
From: Wolfgang F. <wf...@bi...> - 2012-10-24 07:02:02
|
Dear httpunit developers, I have put the question regarding the kohsuke patches on stackoverflow: http://stackoverflow.com/questions/13044235/what-is-the-difference-between-httpunit-1-7-2-and-the-kohsuke-patch May be we'll find an answer that way - you are kindly invited to participate. Yours Wolfgang -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-10-24 06:38:44
|
Dear httpunit developers, After three years of diligent preparation :-) ... httpunit 1.7.2 is available via maven central: http://search.maven.org/#search|ga|1|g%3A%22org.httpunit%22 see e.g. http://www.jarvana.com/jarvana/search?search_type=project&project=httpunit for a list of older "unofficial" versions. 1.7.2 should show up there soon, too. To use this latest version with maven you might want to use the following dependency: |<||dependency||>| | ||<||groupId||>org.httpunit</||groupId||>| | ||<||artifactId||>httpunit</||artifactId||>| | ||<||version||>1.7.2</||version||>| |</||dependency||>| A warm THANK YOU! to everybody who made this possible! Russ intends to update the webpage on Sourceforge.net soon, we intend to move the repositories to git and we are looking to release SNAPSHOT-builds in the future. Yours Wolfgang P.S.: I am looking for volunteers to check the patches that haven been out there e.g. the org.kohsuke.httpunit patch. Who is willing to contact the 'mighty' Kohsuke (http://kohsuke.org/) and ask what is needed to make httpunit compatible with his patch? Another way would be to diff the sources and let Kohsuke Kwaguchi know about it. -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-10-09 10:47:01
|
Dear httpunit developers, the 1.7.2 release is getting closer. You still might want to check the trackers for any items that you'd like to get included in 1.7.2: Bugs: https://sourceforge.net/tracker/?group_id=6550&atid=106550 Features: https://sourceforge.net/tracker/?group_id=6550&atid=356550 Patches: https://sourceforge.net/tracker/?group_id=6550&atid=306550 Support Requests: https://sourceforge.net/tracker/?group_id=6550&atid=206550 To check the current release candidate you might want to get it from subversion: > svn checkout https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit > cd httpunit > mvn test We have been running the tests in "endless" loops: while (mvn test); do echo date; done and the revision 1105 seems to be o.k. We had to switch of the use of ServerSocketFactory to get this result. If you need the ServerSocketFactory you can switch in on with PseudoServer.useFactory=true; We are looking forward to more feedback on this release candidate. Yours Wolfgang Am 06.10.12 14:18, schrieb Kai: > I found an dependency-conflict, which might cause subtle bugs (in my > case it was this one: > http://stackoverflow.com/questions/7034008/spring-3-0-5-tiles-2-2-error , > because httpunit exidentically was on the compile-classpath). > > It is fixed in the attached patch! > > Regards kai > > > Am 03.10.2012 19:35, schrieb Kai: >> The tests for this last version are now running nonstop without an error >> for 3 or 4 hours on my box. So, I think, there are no more bugs :) >> >> >> Regards kai > -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-10-09 10:26:37
|
Dear Kai, thank you for looking into this and your proposal. I have modified PseudoServer to allow the usage of the SocketFactory to be switched on or off. It is now off by default: /** * allow factory use to be switched on and off * by default the factory is not used any more since there were problems with the test cases as of 2012-10-09 */ public static final boolean useFactory=false; with this change the endless loop tests also works in my environment. Yours Wolfgang Am 03.10.12 16:35, schrieb Kai: > Am 03.10.2012 13:42, schrieb Russell Gold: >> Fantastic! >> > :) > > [..] >>> I'm runnig the test in an endless-loop now, to be sure, that there is >>> no other race-condition-issue: >>> >>> while (mvn test); do echo date ; done >>> >>> I will report, if that exposes any further race-condition-issues. >>> Otherwise, everything might be ready for an upload :) >>> > > Unfortunatly, there was still another bug showing up after some time, > when I was running the tests in an endless-loop like described above. > > But I was able to fix that bug too. Though, I'm not sure, if you are > lucky with my solution. > > This time, the bug was in WebClientTest. And it looked, like a > race-condition again, because it does not show up in every test-run. > > I had the suspicion, that it had something to do with the fact, that > the server-sockets were reused. So, I simply removed > ServerSocketFactory in PseudoServer and let every instance of > PseudoServer create it's own new ServerSocket (see attached file > patcht.txt). Since that change, the above endless-test-loop is running > without any new error showing up. > > The drawback of this quick solution is, that there is no limit on the > number of ServerSockets, that might be created, when using HttpUnit > unwisely. But I could reimplement this behavior, without reusing the > sockets, if needed... > > > Regards kai > -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-10-09 09:54:33
|
Dear Kai, revision 1101 has your fix. Yours Wolfgang Am 03.10.12 11:18, schrieb Kai: > I solved the bug! > > The final step was an upgrade from JUnit 4.7 to JUnit 4.10. > > JUnit 4.7 does not order the execution of Rules and @Before-annnotated > methods correctly. So, my fix lead to several wired failures in > Test-Cases with @Before-annotated methods, when executed with JUnit > 4.7, becaus the PseudoServer wasn't started, when it first was > accessed in the @Before-Method. > > You find my fix in the attached patch. > > I'm runnig the test in an endless-loop now, to be sure, that there is > no other race-condition-issue: > > while (mvn test); do echo date ; done > > I will report, if that exposes any further race-condition-issues. > Otherwise, everything might be ready for an upload :) > > > Regards kai > > Am 28.09.2012 17:05, schrieb Kai: >> I thin, I'm one step closer to a solution! >> >> First of all, I found a simple way, to reproduce the problem on all my >> machines. That was necessary, becaus the test-case >> WebPageTest.testTitle() only freezes on one of my machines (my old solw >> laptop). And lately, it even works there. >> >> The following simple line of shell-code reruns the test-case forever. >> This leads to a freeze after some time on all my machines: >> >> while (mvn test -Dtest=WebPageTest); do echo date; done >> >> So, I hope, now you are able to reproduce the error that I am >> witnessing :) >> >> >> Because I believe, that the root of the error is a race-condition in the >> test-case execution, my next step was, to isolate the single >> test-excecutions even more. Therefor, I changed PseudoServerTestSupport >> into an ExternalRule. >> >> See: >> http://blog.mycila.com/2009/11/writing-your-own-junit-extensions-using.html >> >> and: >> http://kentbeck.github.com/junit/javadoc/4.10/org/junit/rules/ExternalResource.html >> >> >> >> >> The good news: >> Since I've done that, WebPageTest never freezes. The simple loop is >> running on my fastest machine for over an hour now. Before the change, >> it took only some minutes to freeze the test-execution. >> >> The bad news: >> Now a lot of other tests fail :/ >> >> But I think, they are only failing, because they share a common >> preconfigured instance of PseudoServer, which was configured in the >> @BeforeClass-annotated method, that I removed in my quick hack, because >> the PseudoServer-Instance is recreated for every test-run. >> So one only needs two Base-Test-Classes. One for independent test-runs >> (like now after my quick hack) and one in the "old" style with a single >> shared instance of PseudoServer for the whole class. >> >> Unfortunatly, I'm lacking the time to implement these changes now. >> But I will try to find some time next week, to implment the changes. >> >> >> Another question is: >> Perhaps all this just works around a race-condition-bug, which might be >> located in PseudoServer. Another solution to the problem above might be, >> to rework the implementation of PseudoServer. IMHO it might be better, >> for example, to implement the listening threads with >> ExecutorService.execute() and wait() for them when the server is teared >> down... >> >> >> Regards, >> >> kai >> >> Am 23.09.2012 12:45, schrieb Kai Moritz: >>> Am 20.09.2012 13:28, schrieb Russell Gold: >>>> Sounds as though at times PseudoServer has nothing to send. That's the >>>> only way that should happen. But that's kind of odd. Is it the first >>>> read for the page? >>>> >>> Yes, I think so. >>> It is the first property of the WebResponse, which is checked in the >>> Test WebPageTest.testTitle() on line 189: >>> assertEquals("Title", "A Sample Page", simplePage.getTitle()); >>> >>> Regards, >>> kai >>> >>> >>>> On Sep 20, 2012, at 4:38 AM, Kai wrote: >>>>>> >>>>>> Testing always stops at that test-case on my box, sleeping for ever. >>>>>> 100% reproducable. That also happens, if I execute that test >>>>>> standalone >>>>>> with "mvn test -Dtest=WebPageTest". >>>>>> >>>>> I wasn't able to fix that error yet. >>>>> But I can provide some information, which may help tracking it down: >>>>> >>>>> This error surely is caused by some kind of a race-condition. >>>>> >>>>> The test-execution only freezes in one Test: WebPageTest.testTitle(), >>>>> when it tries to fetch the title for comparison in the line >>>>> "assertEquals("Title", "A Sample Page", simplePage.getTitle());" >>>>> >>>>> I debuged my way into the call stack up to >>>>> WebResponse.readFromStream():1157. There, a call to >>>>> inputStream.read() >>>>> is made: >>>>> "count = inputStream.read( buffer, 0, Math.min( maxBytes, >>>>> buffer.length ) );" >>>>> That call never returns. >>>>> >>>>> It may, again, be a race-condition in PseudoServer. >>>>> But this is only a guess. >>>>> >>>>> I will try to find out more later... >>> >> > -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-09-17 06:31:02
|
Dear Warwick, you wrote regarding https://sourceforge.net/tracker/?func=detail&atid=356550&aid=3281618&group_id=6550 > Date: 2012-09-15 15:07 > > Message: > Wolfgang, thanks for considering my feature request. > > In my case I use HttpUnit to test servlets that receive binary data and > respond with binary data. The binary data can be a custom one such as > application/x-mycompany-something or some sort of Google Protocol Buffer > application/x-protobuf;proto=something. > > I think trying to switch this behaviour based on the content type might be > hard to get right. Which content types would have the form data handling > and which would not? > > I like the idea of a new set of servlet options, similar to those for > HttpUnit and ClientProperties. > > Warwick If you supply a patch with a new Properties Handling mechanism and a test case showing that it works (as well as not breaking all other tests) I'll happily submit it. Hopefully this patch will make it into the upcoming release. Kai and Russell - would you please let us know what your ideas are about the timing of the release? Yours Wolfgang -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-09-13 10:57:09
|
Dear httpunit developers and users, Please let me know what other questions you'd like to see answered in this FAQ and I'll try to add them together with a decent answer. Please read the parts on Questions #5 and #6 before submitting any proposed changes ... this will speed up things a lot. Currently only about 3-4 out of 10 tracker or mailing list requests follow this procedure. If we get this up to more than 60% it would be a good start so that the response time can improve again. FAQ === 1. Where can I get information on httpunit? 2. Where do i get the most recent version of httpunit 3. Where do I find examples for the use of httpunit? 4. How do I sign up for the developer mailing list? 5. How do I get support for httpunit? 6. How can I suggest modifications to httpunit? 7. How do I find a testcase to start from? 8. What is the development environment for httpunit? 9. What do I do if i have trouble using httpunit with JavaScript? 10. Who are the developers behind httpunit? 11. What is the current version of httpunit? 1. Where can I get information on httpunit? ------------------------------------------- httpunit is an OpenSource Project and it is hosted on SourceForge at https://sourceforge.net/projects/httpunit. There is a project homepage at http://www.httpunit.org/ which contains a limited set of documentation. There is a general FAQ section at http://www.httpunit.org/doc/faq.html 2. Where do i get the most recent version of httpunit ----------------------------------------------------- The most recent version of httpunit can be found in the Subversion repository. The repository is explained at: https://sourceforge.net/scm/?type=svn&group_id=6550 the URL for it is: https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit/ to build and test it use the following commands (after installing maven ...) mvn compile (optional first step) mvn test (optional second step) mvn package (will compile and test anyway ...) A nice browser front end for it is: http://httpunit.svn.sourceforge.net/viewvc/httpunit/trunk/httpunit/ 3. Where do I find examples for the use of httpunit? ---------------------------------------------------- a) There is a "cookbook" http://www.httpunit.org/doc/cookbook.html b) There is a tutorial: http://www.httpunit.org/doc/tutorial/index.html c) There are examples delivered with httpunit and accesible via the subversion respository: http://httpunit.svn.sourceforge.net/viewvc/httpunit/trunk/httpunit/examples/ 4. How do I sign up for the developer mailing list? --------------------------------------------------- via the link https://lists.sourceforge.net/lists/listinfo/httpunit-develop 5. How do I get support for httpunit? ------------------------------------- This mailing list and the trackers on https://sourceforge.net/projects/httpunit/support Bugs: https://sourceforge.net/tracker/?group_id=6550&atid=106550 Features: https://sourceforge.net/tracker/?group_id=6550&atid=356550 Patches: https://sourceforge.net/tracker/?group_id=6550&atid=306550 Support Requests: https://sourceforge.net/tracker/?group_id=6550&atid=206550 are a good point to start. Don't expect too much - you might want to get active yourself. 6. How can I suggest modifications to httpunit? ----------------------------------------------- httpunit is strictly based on test-first development. If you'd like to get it modified you might want to prove your point by showing what is not working and how you would like it to work. Doing this within the JUnit testsuite of httpunit is the preferred way. And providing the test source code first gives you much better chances of a quick response. If you'd like to supply a minor change that is easy to understand and does not change anything or not much (e.g. adding a comment or changing the layout of a statement or doing an algorithm slightly different) then it might be sufficient to show that the change does not break any of the existing test cases. Don't count on this. A JUnit test case is your better option. Please supply a testcase with the expected result for the feature you are asking for and we'll look into implementing it. For a start you might want to get the trunk version from the subversion repository (see https://sourceforge.net/scm/?type=svn&group_id=6550 and have a look at the source code of some of the more than 800 JUnit based testcases in there. Eclipse workspace patch files are welcome - other formats are also o.k. but just a bit more work. When you are ready you might want to attach the testcase (and if you already have started implementing it also the actual code) to your feature request. If you propose a change make sure that all testcases run so after the change there should be more testcases than before and none of them is broken / does not work any more. Using maven checking out and testing the current subversion state is done with the following commands: svn checkout https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit httpunit cd httpunit mvn test This should give you a clue on what a proper testcase for httpunit looks like. The main communication about further details of the development is via the httpunit developer mailinglist. 7. How do I find a testcase to start from? ------------------------------------------ a) To find such tests I usually set a break point at the function that I'd like to test and then run all tests from the HttpUnitSuite. When the debugger halts at the breakpoint you'll see which test(s) called the function. b) Another option is to search the full source code of all tests for keywords that match what your are intending to do c) A third option is to look in the tracker items https://sourceforge.net/tracker/?group_id=6550 and look for a comparable issue. Then use the trackers id e.g. Bug report number to find a test case for it. 8. What is the development environment for httpunit? ---------------------------------------------------- You need a Java compiler and may be an Integrated Development Environment like Eclipse. Using maven is the simplest way to compile, test and package httpunit. If you use Eclipse you might want to set your MAVEN_REPOSITORY variable to the root of your maven repository e.g. on a Mac and or Linux to .m2/repository The m2eclipse plugin is also supported now. Currently httpunit is mostly tested on these operating systems: - Windows XP, Windows 7 - Ubuntu 12.04 LTS - The latest Mac OS X (10.6, 10.7) The test environment is Eclipse Indigo 3.7.1 with a JDK 1.6 compiler set to JDK 1.4 compatiblity mode (this is also what you'll find set up in the Subversion library) People from this mailing list also test with command line Maven environments, NetBeans and what have you got (it would be good to get some examples named here ... feel free to let me know your environment if it is an addition to the above) 9. What do I do if i have trouble using httpunit with JavaScript? ----------------------------------------------------------------- HttpUnit 1.x support of Javascript is limited. There is a new Javascript engine in development but the development is almost stalled due to limited resources. To work around the issue you might want to - try the new scripting engine - switch off javascript - if you get an org.mozilla.javascript.EcmAError ... undefined ... find the missing javascript function, implement it and supply the patch for the community see "6. How can I suggest modifications to httpunit?" 10. Who are the developers behind httpunit? ------------------------------------- Russell is the main developer of httpunit. He made it open source and dozens of people have since then supplied input e.g. in form of patches. Wolfgang has been committer for a few years now - he concentrates on communicating with the developers and gathering patches. 11. What is the current version of httpunit? ------------------------------------ The 1.7 release available for download on Sourceforge is stable but does not have the set of patches since that release. A maintainance release is due since mid 2010 and might show up anytime soon. Thank you for reading these Frequently Asked Questions and Answers. Yours Wolfgang -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-09-13 10:50:10
|
Dear httpunit developers, in the process of preparing the 1.7.2 release which is scheduled to be put on maven central the following steps have been done - see the current release notes (you might want to download these and then use a browser to look at them): http://httpunit.svn.sourceforge.net/viewvc/httpunit/trunk/httpunit/doc/release_notes.html?view=markup&pathrev=1099 The tracker items from 2009-08 until today have been assigned and checked. Quite a few patches have made it to be committed: Thank you for all the participants and for the patience! You might want to check the trackers for any items that you'd like to get included in 1.7.2: Bugs: https://sourceforge.net/tracker/?group_id=6550&atid=106550 Features: https://sourceforge.net/tracker/?group_id=6550&atid=356550 Patches: https://sourceforge.net/tracker/?group_id=6550&atid=306550 Support Requests: https://sourceforge.net/tracker/?group_id=6550&atid=206550 There are quite a few closed and pending items that simply have not been included due to missing testcases or patch proposals. I'll post the developers FAQ in a minute again so that people who would like to help get to know how they can do it. For the time being checking the latest state of the repository for running all tests correctly would be helpful: > svn checkout -r 1099 > https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit > httpunit1099 > cd httpunit1099 > mvn test Currently there is still trouble in getting the tests to run. A proper result should look something like this: Results : Tests run: 821, Failures: 0, Errors: 0, Skipped: 8 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 23.388s One of the troublesome Tests is WebPageTest.testTitle - it sometimes hangs. There is a commented "@Ignore" tag in the test which allows to switch it off. Please help fixing the remaining problems. It would also be great to get corrections and additions of the documentation e.g. instead of ant as a build system we should probably mention "maven" now. You are invited to send any documentation update proposals directly to me. Thank you for your support. Yours Wolfgang -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Wolfgang F. <wf...@bi...> - 2012-09-12 13:33:55
|
Warwick, thank you so much for this. I have focussed on ServletAccessTest for a start. It looks like this testcase can not be run on it's own. testServletParameters(com.meterware.servletunit.ServletAccessTest) Time elapsed: 0.004 sec <<< ERROR! java.lang.NullPointerException at com.meterware.servletunit.ServletUnitClient.newInvocation(ServletUnitClient.java:82) at setInvocationContextFactory is not called before calling newClient(). Instead of a null pointer exception there will be a RunTimeException now and it's checked that setInvocationContextFactory has a non-null parameter. /** * set the invocation context factory to be used * @param invocationContextFactory */ static void setInvocationContextFactory( InvocationContextFactory invocationContextFactory ) { if (invocationContextFactory==null) throw new RuntimeException("setInvocationContextFactory called with null invocationContextFactory parameter"); _invocationContextFactory = invocationContextFactory; } Russ - how do we get a proper InvocationContextFactory setup for ServletAccessTest? Yours Wolfgang Am 12.09.12 13:49, schrieb Warwick Hunter: > *Fedora 16 x86_64 Quad Core* > > I only tested the 1085 revision. Let me know if you want me to do more. > > Tests in error: > testServletParameters(com.meterware.servletunit.ServletAccessTest) > testTitle(com.meterware.httpunit.WebPageTest): Invalid Http response > > Tests run: 813, Failures: 0, Errors: 2, Skipped: 8 > > Details attached. > > Warwick > > Dear httpunit developers, > > Kai has proposed to upload the current state of httpunit to the > central maven repository. > Russell has than modified the project content to better support > maven. Unfortunately the test cases did not run through reliably > and as a first measure Russell has converted the tests to JUnit 4 > (see below) > > I'd like to ask all httpunit developers to help test and fix the > current httpunit state. > > Please find below a script which can test multiple httpunit > revisions using maven. Currently we are interested in the revison 1085 > test results and ways to fix the remaining problems. > > To test only revision 1085 the following commands will do: > > svn checkout -r 1085 > https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit > httpunit1085 > cd httpunit1085 > mvn test > > Thank you for your support > > Yours > Wolfgang > > > # test different versions of httpunit > # to check for regression > # WF 2009-10-05 > # retest 2012-09-06 > root=`pwd` > #r=971 > r=1085 > while [ $r -le 1085 ] > do > date=`date` > echo testing $r at $date > cd $root > svn checkout -r $r > https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit > httpunit$r > /dev/null > cd httpunit$r > mvn test > ../htestresult.$r > grep FAILURE ../htestresult.$r > echo done > r=`expr $r + 1` > done > > I have now converted the tests to JUnit4 and am initializing the > pseudoserver once per class rather than once per test. This speeds > up the tests slightly (about 15%) and makes them much more > reliable. On the other hand, it does mean that the tests can be > slightly interdependent - resource names should be made unique > between tests. What I see now is that there are two tests which > appear to be failing intermittently: >> >> WebClientTest.testInternalErrorException >> WebImageTest.testGetImage >> >> It might be worth taking a look to see if you are seeing the same >> behavior and if you have any ideas on how to fix it. >> > rev 1085 has the following results here: > > *Ubuntu 12.04 LTS Quad Core 2.3 GHz:** > *Tests run: 813, Failures: 0, Errors: 0, Skipped: 8 > [INFO] Total time: 18.200s > > *Mac OS Tiger Quad Core 2 GHz:* > Failed tests: > > testInternalErrorException(com.meterware.httpunit.WebClientTest): > Should have rejected the request > > Tests run: 813, *Failures: 1*, Errors: 0, Skipped: 8 > [INFO] BUILD FAILURE > [INFO] Total time: 20.650s > > *Windows XP virtual machine in Mac OS Quad Core env:** > *Tests hang at Running com.meterware.httpunit.WebPageTest ... and > one failure before that: > > Tests run: 38, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: > 1.781 sec <<< FAILURE! > Running com.meterware.httpunit.WebFormTest > > > -- > > BITPlan - smart solutions > Wolfgang Fahl > Pater-Delp-Str. 1, D-47877 Willich Schiefbahn > Tel. +49 2154 811-480 <tel:%2B49%202154%20811-480>, Fax +49 2154 811-481 <tel:%2B49%202154%20811-481> > Web: http://www.bitplan.de > BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. > Discussions > will include endpoint security, mobile security and the latest in > malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Httpunit-develop mailing list > Htt...@li... > <mailto:Htt...@li...> > https://lists.sourceforge.net/lists/listinfo/httpunit-develop > > > > > -- > Warwick Hunter > K1300S m: +61 4 1242 1576 skype: warwickhunter > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > _______________________________________________ > Httpunit-develop mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/httpunit-develop -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Warwick H. <w.h...@co...> - 2012-09-12 11:49:48
|
------------------------------------------------------------------------------- Test set: com.meterware.servletunit.ServletAccessTest ------------------------------------------------------------------------------- Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.009 sec <<< FAILURE! testServletParameters(com.meterware.servletunit.ServletAccessTest) Time elapsed: 0.004 sec <<< ERROR! java.lang.NullPointerException at com.meterware.servletunit.ServletUnitClient.newInvocation(ServletUnitClient.java:82) at com.meterware.servletunit.ServletUnitClient.newInvocation(ServletUnitClient.java:76) at com.meterware.servletunit.ServletUnitClient.newInvocation(ServletUnitClient.java:68) at com.meterware.servletunit.ServletAccessTest.testServletParameters(ServletAccessTest.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103) at $Proxy0.invoke(Unknown Source) at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150) at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69) |
From: Wolfgang F. <wf...@bi...> - 2012-09-10 09:08:10
|
Dear httpunit developers, Kai has proposed to upload the current state of httpunit to the central maven repository. Russell has than modified the project content to better support maven. Unfortunately the test cases did not run through reliably and as a first measure Russell has converted the tests to JUnit 4 (see below) I'd like to ask all httpunit developers to help test and fix the current httpunit state. Please find below a script which can test multiple httpunit revisions using maven. Currently we are interested in the revison 1085 test results and ways to fix the remaining problems. To test only revision 1085 the following commands will do: svn checkout -r 1085 https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit httpunit1085 cd httpunit1085 mvn test Thank you for your support Yours Wolfgang # test different versions of httpunit # to check for regression # WF 2009-10-05 # retest 2012-09-06 root=`pwd` #r=971 r=1085 while [ $r -le 1085 ] do date=`date` echo testing $r at $date cd $root svn checkout -r $r https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit httpunit$r > /dev/null cd httpunit$r mvn test > ../htestresult.$r grep FAILURE ../htestresult.$r echo done r=`expr $r + 1` done I have now converted the tests to JUnit4 and am initializing the pseudoserver once per class rather than once per test. This speeds up the tests slightly (about 15%) and makes them much more reliable. On the other hand, it does mean that the tests can be slightly interdependent - resource names should be made unique between tests. What I see now is that there are two tests which appear to be failing intermittently: > > WebClientTest.testInternalErrorException > WebImageTest.testGetImage > > It might be worth taking a look to see if you are seeing the same > behavior and if you have any ideas on how to fix it. > rev 1085 has the following results here: *Ubuntu 12.04 LTS Quad Core 2.3 GHz:** *Tests run: 813, Failures: 0, Errors: 0, Skipped: 8 [INFO] Total time: 18.200s *Mac OS Tiger Quad Core 2 GHz:* Failed tests: testInternalErrorException(com.meterware.httpunit.WebClientTest): Should have rejected the request Tests run: 813, *Failures: 1*, Errors: 0, Skipped: 8 [INFO] BUILD FAILURE [INFO] Total time: 20.650s *Windows XP virtual machine in Mac OS Quad Core env:** *Tests hang at Running com.meterware.httpunit.WebPageTest ... and one failure before that: Tests run: 38, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 1.781 sec <<< FAILURE! Running com.meterware.httpunit.WebFormTest -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |
From: Taylor, G. J <gre...@hi...> - 2012-05-30 15:10:50
|
Does httpunit 1.7 work with junit 4.x Greg Taylor gre...@hi... ________________________________ This e-mail and any attachments to it are confidential and are intended solely for use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this e-mail without the author's prior permission. The views expressed in this e-mail message do not necessarily represent the views of Highmark Inc., its subsidiaries, or affiliates. |
From: Webmaster <web...@qa...> - 2012-03-26 07:08:00
|
Dear SourceForge Manager WELCOME to QATestingTools.com archive, a unique testing tools and test management solutions archive, Your Product HttpUnit was successfully uploaded to the site with minimum information, please review tool information at http://www.qatestingtools.com/httpunit and update site with remarks, comment, updates and new/other of your testing tools which are not uploaded yet. Also view all tools under your business name at http://www.qatestingtools.com/sourceforge_project, please send us your business description (textual summary up to 100 words) Please submit updates, tool information and new tools with submit-tool form <http://www.qatestingtools.com/submit-tool> or mail to su...@qa... . Each testing tool in archive is set to tool-review as well, a process, which we publish, analyze and promote much more of the tool information. Your product, was already set to this process and you can view its place within the waiting list at http://www.qatestingtools.com/tool-review-waiting-list Tool-Review: What and Why Tool-Review process include 1. Reading your published material 2. Analyze and categorize it to fields of interest and characteristics 3. Publish the tool summary, features and advantages, under its own page. 4. Promoting the tool-review in site front page, Wordpress <http://qatestingtools.info/> , LinkedIn Group <http://www.linkedin.com/groups/QA-Testing-Tools-4183131> , Twitter <https://twitter.com/qatestingtools> , QualityTesting <http://www.qualitytesting.info/profiles/blog/list?user=11dnpfhvtp3c1> and Facebook <http://www.facebook.com/pages/QATestingTools/270004496395391> . Tool Review process include publishing, analyzing, categorizing and promoting the testing tools. The process gives our audience the ability the search for specific tool information and search for tools according to specific feature or tag. Each tool has its special page which give you and the audience the ability to comment and rate it accordingly. $$ Promote Your Testing Tools with QATestingTools $$ QA Testing Tools statistics data include 312 tools in archive, from 164 manufacturers, which 137 tools from them, we already reviewed. QA Testing Tools visiting statistics is showing a rapid growing trend of 22300 visitors totally, for the last 30 days the website traffic indicated on 6550 visitors, that hit site 90600 times, out of 515700 total from day 1. Alexa rate stands on 608900 . QA Testing Tools just started its Advertising sale options. Looking for good place to advertise your tools and service, ask us about advertising prices and details or visit http://www.qatestingtools.com/advertising . <http://www.qatestingtools.com/rss.xml> You can follow us via the RSS <http://www.qatestingtools.com/rss.xml> service, and get all the site news automatically. <http://www.qatestingtools.com/user/register> Please register <http://www.qatestingtools.com/user/register> to the site and enjoy more information and comment abilities, and be a part of a growing community that following testing tools and test management solutions. <http://www.qatestingtools.com/user> See you soon and Thank You for Reading. (* this is no spam and was send to you for your information and marketing acknowledgment) QA Testing Tools A Global Information Provider for the Automated Testing field <http://www.qatestingtools.com/> HYPERLINK "http://www.qatestingtools.com/register"HYPERLINK <http://www.qatestingtools.com/register> "http://www.qatestingtools.com/rss.xml" QA Testing Tools We Collect, Review and Analyze Testing Tools and Test Management Solutions. QA Testing Tools Visit websites: www.qatestingtools.com <http://www.qatestingtools.com/> www.qatestingtools.info Office: +972 775 618 002 Sales: +972 508 875 489 Mail us sa...@qa... LinkedIn Group: http://www.linkedin.com/groups/QA-Testing-Tools-4183131 Update your tool at http://www.qatestingtools.com/submit-tool P Please consider the environment before printing this email. |
From: Simmons, J. D. <jim...@wa...> - 2012-03-14 19:05:06
|
I am trying to test our servlet development framework with ServletUnit. I am using the code below as a starting point: package walgreens.test.bounce; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import javax.servlet.ServletException; import org.xml.sax.SAXException; import com.meterware.httpunit.PostMethodWebRequest; import com.meterware.httpunit.WebRequest; import com.meterware.httpunit.WebResponse; import com.meterware.servletunit.InvocationContext; import com.meterware.servletunit.ServletRunner; import com.meterware.servletunit.ServletUnitClient; public class TestValidation { @org.junit.Test public void testRequiredField() { File webXml = new File("WebContent/WEB-INF/web.xml"); try { ServletRunner sr = new ServletRunner(webXml, "/bOunceFrameworkTest"); ServletUnitClient sc = sr.newClient(); WebRequest request = new PostMethodWebRequest( "http://test.walgreens.com/bOunceFrameworkTest/StandardProxy"); InvocationContext ic = sc.newInvocation(request); ic.service(); WebResponse response = ic.getServletResponse(); System.out.println(response.getText()); assertTrue(response.getTitle() .equals("Test Server Side Validation")); } catch (MalformedURLException e) { e.printStackTrace(); } catch (ServletException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } Now this code runs our StandardProxy servlet just fine *except* for one thing. This code in the init() method of the servlet: applicationResources = ResourceBundle .getBundle("/ApplicationResources"); *cannot* find the file named ApplicationResources.properties. When I run the application under WebSphere or Tomcat there is no such problem and never has been. The file in question is in the root of the source directory for the application, just as it would be in Struts 2. It is only when using ServletRunner that there is a problem. I have tried copying the file to various places (root of the project, root of WebContent) but the file just will not be found. Is there some way to work around this problem? James Simmons |
From: Simmons, J. D. <jim...@wa...> - 2012-03-14 14:54:34
|
My company has written its own servlet framework. Instead of making every single request a servlet, we have one ServletProxy which runs actions. The URL looks like this: http://servername/ContextRoot/StandardProxy/actionname?name=value&name=value Now the absolutely essential part of this URL is the "actionname" which StandardProxy retrieves from the getPathInfo in the request, like this: http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getPathInfo%28%29 We want to use ServletUnit to test our framework but I cannot see any way to put this "Path Info" into our request. Putting it in the URL of the PostMethodWebRequest like this: WebRequest request = new PostMethodWebRequest("http://test.walgreens.com/StandardProxy/actionname"); Does not work. It says there is no servlet of the name defined. If you take the actionname off the URL it does recognize the servlet. Any ideas? James Simmons |
From: Sam K. <sam...@ya...> - 2012-02-22 18:44:58
|
Hi, I'm attempting to write a test against functionality which looks up (via JNDI I believe) environment variables in the tomcat web.xml file. Is this possible using HttpUnit? If so I'd appreciate it if anyone could provide info on how to bootstrap / mock / configure JNDI for this particular use case (i.e. not a datasource). Cheers, Sam |
From: Wolfgang F. <wf...@bi...> - 2011-12-19 07:59:07
|
Dear kesav, you might want to read the FAQ and the comments on the sourceforge project main page. Javascript is only partly supported by httpunit. You might want to switch the java script parser off as outlined in the FAQ. If the websites you need to test are using heavyweight javascript httpunit might not be the right tool for the task. I'm going to again post the FAQ in a minute. Wolfgang Am 15.12.11 14:06, schrieb kesav reddy: > Hi HttpUnit Developers, > > I am validating HttpUnit for my project use to just see HttpUnit can > be used for my next project. During this, i am facing problem. Hope > some one can help me out with this. Thanks in Advance. > > Problem:: I am getting below exception when i try to invoke > "http://search.yahoo.com/search?p=fbi+most+wanted" . I am attaching my > source code along with the mail. > > com.meterware.httpunit.ScriptException: Script 'var pL=0, > pUrl='http://ybinst9.ec.yimg.com/ec/fd/ls/l?IG=4a06755fc6924b6aa94ee9ebc4398ae8&CID=4a06755fc6924b6aa94ee9ebc4398ae8&Type=Event.CPT';function > <http://ybinst9.ec.yimg.com/ec/fd/ls/l?IG=4a06755fc6924b6aa94ee9ebc4398ae8&CID=4a06755fc6924b6aa94ee9ebc4398ae8&Type=Event.CPT%27;function> > SLB(s,pUrl){var url,img=new > Image(),dat='&DATA=';dat+=s?'%7B%22pp%22%3A%7B%22S%22%3A%22A%22%7D%7D':'%7B%22pp%22%3A%7B%22S%22%3A%22L%22%7D%7D';url=pUrl+dat;img.src=url+'&'+(new > Date()).getTime();pL=1}window.onbeforeunload=function(){(!pL)?SLB("A",pUrl):""};window.onload=function(){SLB("",pUrl)};(function(){var > h=document.documentElement;h.className+=" js";(new > Image()).src='http://l.yimg.com/pv/static/img/metro_sprite-201109271557.png';})() > <http://l.yimg.com/pv/static/img/metro_sprite-201109271557.png%27;%7D%29%28%29>;' > failed: org.mozilla.javascript.EcmaError: TypeError: Cannot read > property "className" from undefined > at > com.meterware.httpunit.javascript.ScriptingEngineImpl.handleScriptException(ScriptingEngineImpl.java:64) > at > com.meterware.httpunit.javascript.ScriptingEngineImpl.runScript(ScriptingEngineImpl.java:95) > at > com.meterware.httpunit.scripting.ScriptableDelegate.runScript(ScriptableDelegate.java:88) > at > com.meterware.httpunit.parsing.NekoDOMParser.runScript(NekoDOMParser.java:151) > at > com.meterware.httpunit.parsing.ScriptFilter.getTranslatedScript(ScriptFilter.java:150) > at > com.meterware.httpunit.parsing.ScriptFilter.endElement(ScriptFilter.java:131) > at > org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249) > at > org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:367) > at > org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1015) > at > org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:888) > at > org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2831) > at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809) > at > org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478) > at > org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) > at > com.meterware.httpunit.parsing.NekoHTMLParser.parse(NekoHTMLParser.java:48) > at com.meterware.httpunit.HTMLPage.parse(HTMLPage.java:271) > at > com.meterware.httpunit.WebResponse.getReceivedPage(WebResponse.java:1301) > at com.meterware.httpunit.WebResponse.getFrames(WebResponse.java:1285) > at > com.meterware.httpunit.WebResponse.getFrameRequests(WebResponse.java:1024) > at > com.meterware.httpunit.FrameHolder.updateFrames(FrameHolder.java:179) > at > com.meterware.httpunit.WebWindow.updateFrameContents(WebWindow.java:315) > at > com.meterware.httpunit.WebClient.updateFrameContents(WebClient.java:526) > at com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:201) > at > com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:183) > at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:158) > at com.meterware.httpunit.WebClient.getResponse(WebClient.java:122) > at com.yahoo.sample.httpUnit.Example.main(Example.java:17) > > > > ------------------------------------------------------------------------------ > 10 Tips for Better Server Consolidation > Server virtualization is being driven by many needs. > But none more important than the need to reduce IT complexity > while improving strategic productivity. Learn More! > http://www.accelacomm.com/jaw/sdnl/114/51507609/ > > > _______________________________________________ > Httpunit-develop mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/httpunit-develop -- BITPlan - smart solutions Wolfgang Fahl Pater-Delp-Str. 1, D-47877 Willich Schiefbahn Tel. +49 2154 811-480, Fax +49 2154 811-481 Web: http://www.bitplan.de BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl |