Hi Julien, we ran into this problem when we implemented unit tests for our application, that simulated heavy traffic. Basically, we did the following: a) defined a set of pages/links that should be visited/clicked b) defined a random, small time between the clicks/visits c) generated a thread pool of 100 or so threads d) used each thread to go through the set of pages for a predefined number of times
Hope, that helps. Regards, Tom Julien HENRY wrote: > Hi Tom, > > Thanks for your contribution. I will try to fix this for the next > release. Do you know a sample scenario that can reproduce the concurrent > issue? > If not, can I ask you to test the 1.4 version before I release it to > know if it is really solved. > The problem is I will modify TestingEngineRegistry, so I can't apply > your patch "as it". > > ++ > > Julien > > ----- Message d'origine ---- > De : Tom Ziemer <[EMAIL PROTECTED]> > À : [email protected] > Envoyé le : Mardi, 7 Novembre 2006, 11h01mn 09s > Objet : [Jwebunit-users] Concurrency problems > > Hi Julien, > > some months ago, a colleague and I submitted a patch that resolved > concurrency issues in jWebUnit. A couple of days ago I was contacted by > somebody who had a similar problem with the current version. Assuming > this is still an open issue (I haven't checked the current source), I am > re-submitting our patch. > > Regards, > Tom > 22d21 > < > 31c30,31 > < * @return > --- >> * @return a [EMAIL PROTECTED] Hashtable} containing all registered >> testing > engine classnames >> * @throws ClassNotFoundException if a testing engine cannot be > found in the classpath > 33,34c33,35 > < public static Hashtable getTestingEngineMap() { > < if (testingEngineMap == null) { > --- >> // needs to synchronized for concurrent testing >> public static synchronized Hashtable getTestingEngineMap() throws > ClassNotFoundException{ >> if (testingEngineMap == null) { > 36,41c37,44 > < try { > < String cp = > "net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog"; > < Class.forName(cp); > < testingEngineMap.put(TESTING_ENGINE_HTMLUNIT, cp); > < } catch (ClassNotFoundException e) { > < //Nothing to do > --- >> String cp = > "net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog"; >> try{ >> Class.forName(cp); >> testingEngineMap.put(TESTING_ENGINE_HTMLUNIT, cp); >> }catch(ClassNotFoundException cnfex){ >> // couldn't find the class we were looking for >> // pass the exception on to the caller >> throw new ClassNotFoundException("The testing engine > class <"+cp+"> could not be found."); > 55,56c58 > < Class theClass = Class > < .forName((String) getTestingEngineMap().get(aKey)); > --- >> Class theClass = Class.forName((String) > getTestingEngineMap().get(aKey)); > 35c35 > < > --- >> > 2096,2103c2096,2110 > < if (TestingEngineRegistry.getTestingEngineMap().keys() > < .hasMoreElements()) { > < setTestingEngineKey((String) TestingEngineRegistry > < .getTestingEngineMap().keys().nextElement()); > < } else { > < throw new RuntimeException( > < "TestingEngineRegistry contains no dialog. > Check you put at least one plugin in the classpath."); > < } > --- >> >> // trying to get registered testing engine >> // throwing a RuntimeException if this fails >> try{ >> if (TestingEngineRegistry.getTestingEngineMap().keys() >> .hasMoreElements()) { >> setTestingEngineKey((String) TestingEngineRegistry >> .getTestingEngineMap().keys().nextElement()); >> } else { >> throw new RuntimeException( >> "TestingEngineRegistry contains no dialog. > Check you put at least one plugin in the classpath."); >> } >> }catch(ClassNotFoundException cnfex){ >> throw new RuntimeException("Error obtaining testing > engine. Details follow. "+ cnfex.getMessage()); >> } > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> > _______________________________________________ > Jwebunit-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > ------------------------------------------------------------------------ > Découvrez une nouvelle façon d'obtenir des réponses à toutes vos > questions ! Profitez des connaissances, des opinions et des expériences > des internautes sur Yahoo! Questions/Réponses > <http://fr.rd.yahoo.com/evt=42054/*http://fr.answers.yahoo.com>. > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Jwebunit-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jwebunit-users ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Jwebunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jwebunit-users
