Hi,
I reproduced the problem, but only when test is run by Maven on command line.
With Eclipse, it works fine.
I will investigate...
++
Julien
----- Message d'origine ----
De : Raghu M <[EMAIL PROTECTED]>
À : Usage problems for JWebUnit <[email protected]>
Envoyé le : Mercredi, 28 Mars 2007, 13h58mn 33s
Objet : Re: [JWebUnit-users] RE : Re: RE : JWebUnit - Thread Safe?
Hi Julien,
I am attaching two files that contain the code for load testing of the 'Google
Language Tools page'. You should be able to reproduce the problem with this.
Note: you should have the junitperf-1.9.1.jar
in the buildpath. I have attached the file for your reference.
Thanks & Regards
Raghu. M
On 3/27/07, Julien HENRY <
[EMAIL PROTECTED]> wrote:Hi,
I'm not an expert with load testing, but I know
commons-logging from Apache is famous for its problems
with dynamic classloading [1]. And it makes me believe
it could be a mistake to do the same with JWebUnit.
The problem is we have an interface : IJwebUnitDialog,
and possibly several implementations (HtmlUnitDialog,
SeleniumDialog, ...). We don't want jwebunit-core
depends on the plugins, because people who don't use
Selenium plugin don't want all the Selenium jar in
their classpath.
That's why I'm using Class.forName in
TestingEngineRegistry to load only the needed plugin.
But I think it could be a problem with multi-thread.
Could you please provide a simple example of load
testing that throw the NPE?
Thanks
++
Julien
[1] : http://www.qos.ch/logging/classloader.jsp
--- Raghu M <
[EMAIL PROTECTED]> a écrit :
> Thanks Julien.
>
> I am trying to use JunitPerf for load testing of
> some JWebUnit tests. The
> test runs fine when i am running on a single thread.
> But, as soon as i
> increase the number of threads, the tests return
> null pointer exceptions.
>
> Any ideas, how to do load testing on JWebUnit tests?
>
> Thanks & Regards
> Raghu. M
>
> On 3/24/07, Julien HENRY <[EMAIL PROTECTED]> wrote:
> >
> > Hi raghu,
> >
> > I'm not sure, because I'm not using JWebUnit this
> way.
> > But some times ago, there was a patch to fix a
> memory
> > leak when using JWebUnit with multiple concurrent
> > threads.
> > That's why I supposed it should now works.
> >
> > But feel free to report any bug.
> >
> > ++
> >
> > Julien
> >
> >
> > --- Raghu M <[EMAIL PROTECTED]
> a écrit :
> >
> > > Is JwebUnit intended to be thread safe?
> > >
> > > Can a test be run on multiple threads
> concurrently
> > > without any problem?
> > >
> > > raghu
> > > >
> >
>
-------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of
> IT
> > > Join SourceForge.net's Techsay panel and you'll
> get
> > > the chance to share your
> > > opinions on IT & business topics through brief
> > > surveys-and earn cash
> > >
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>
> > _______________________________________________
> > > 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.answers.yahoo.com
> >
> >
>
-------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of
> IT
> > Join
SourceForge.net's Techsay panel and you'll
> get the chance to share
> > your
> > opinions on IT & business topics through brief
> surveys-and earn cash
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > JWebUnit-users mailing list
> >
[email protected]
> >
>
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
> >
> >
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get
> the chance to share your
> opinions on IT & business topics through brief
> surveys-and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
_______________________________________________
> 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.answers.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
package com.shopzilla.services.sample.client;
import net.sourceforge.jwebunit.junit.WebTestCase;
import net.sourceforge.jwebunit.util.TestingEngineRegistry;
public class AAExampleClass extends WebTestCase{
/**
* Just calls the base class.
*
* @param testName
* passed to the base class. Must not be null.
*/
public AAExampleClass (String testName) {
super(testName);
}
/**
* Sets the testing engine to HTMLUnit.
* Sets the Base URL to the value contained in usc.properties.
* Looks up the UserDao.
*
* @throws Exception
* if the lookup fails.
*/
public void setUp() throws Exception {
setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT);
getTestContext().setBaseUrl("http://www.google.co.in";);
}
/**
* Hits the Language Tools Page of Google and asserts
* that some of the key Text and links are present.
*/
public void testLanguageToolsPage() {
beginAt("/language_tools?hl=en");
assertTextPresent("Search Specific Languages or Countries");
assertTextPresent("Translate");
assertLinkPresentWithText("Hindi");
}
}
package com.shopzilla.services.sample.client;
import com.clarkware.junitperf.ConstantTimer;
import com.clarkware.junitperf.LoadTest;
import com.clarkware.junitperf.TimedTest;
import com.clarkware.junitperf.Timer;
import junit.extensions.RepeatedTest;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class AAExampleClassPerformance extends TestCase {
public static Test suite() {
// create a timed test that verifies that the called function
// is completed in the specified time
TestSuite suite = new TestSuite();
Test languageToolsTest = new AAExampleClass("testLanguageToolsPage");
long maxLanguageToolsTime = 10000;
Test languageToolsTimedTest= new TimedTest(languageToolsTest,
maxLanguageToolsTime);
suite.addTest(languageToolsTimedTest);
// load test by simulating 15 users
languageToolsTest = new AAExampleClass("testLanguageToolsPage");
int numConcurrentUsers = 15;
Timer timer = new ConstantTimer(10);
languageToolsTimedTest = new TimedTest(languageToolsTest,
maxLanguageToolsTime);
Test languageToolsLoadTest = new LoadTest(languageToolsTimedTest,
numConcurrentUsers, timer);
suite.addTest(languageToolsLoadTest);
return suite;
}
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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.answers.yahoo.com-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users