Hi
I got a little interested in this subject and started to play around ...
First, a simple JWebUnit test case named SimpleTestCase which just navigates to
a
page and checks for some link text.
I had never used JUnitPerf before and took a first browse through and tried the
LoadTest
decorator and successfully ran the ExampleThroughPutUnderLoadTest example
provided on
the web pages, substituting ExampleTestCase with my own JWebUnit SimpleTestCase.
I use Eclipse as my dev environment so set about recreating this problem.
As Julien noted in a previous thread Eclipse plays nicely, so I ran the same
tests via ANT and immediately started to get the same problem as had been
reported.
After some various messing around with JWebUnit code (eg: using dynamic loading
for
the test engine registry), I returned to the JUnitPerf pages and re-read the
LoadTest
section ...
"
If a test case intended to be decorated as a LoadTest contains test-specific
state in
the setUp() method, then the TestFactory should be used to ensure that
each concurrent
user thread uses a thread-local instance of the test. For example, to create
a load test
of 10 concurrent users with each user running a thread-local instance of
ExampleStatefulTest, use:
int users = 10;
Test factory = new TestFactory(ExampleStatefulTest.class);
Test loadTest = new LoadTest(factory, users);
or, to load test a single test method, use:
int users = 10;
Test factory = new TestMethodFactory(ExampleStatefulTest.class,
"testSomething");
Test loadTest = new LoadTest(factory, users);
"
This matched up with what I was doing so I changed my JUnitPerf test code from:
Test testCase = new SimpleTestCase("testNavLink");
to:
Test testCase = new TestMethodFactory(SimpleTestCase.class, "testNavLink");
No more errors.
So I wonder if the work you propose for JWebUnit is actually necessary ... at
least a simliar sounding issue to the one reported has been resolved by using
the JUnitPerf TestFactory classes.
<= Alex =>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On
>Behalf Of Julien HENRY
>Sent: 9. huhtikuuta 2007 20:23
>To: [email protected]
>Subject: [JWebUnit-users] Discussion about classloading issue
>
>Hi all,
>
>This kind of discussion should normally stay on devel mailing
>list, but I don't know if there are many people registered.
>
>As you may know, Raghu found a classloading issue in JWebUnit
>that prevents its use for load testing tests. I think it's a
>major issue, but I don't know what is the best wayto solve it,
>and I need some help.
>
>
>First, the description of the problem:
>
>We have a Java Interface (former IJWebUnitDialog, perhaps
>ITestingEngine in future release), that each plugin should
>implement. Currently, we have only one plugin : HtmlUnit, but
>I hope to add Selenium one for next release.
>
>JWebUnit provide a way to specify plugin at runtime:
> TestingEngineRegistry.addTestingEngine("myTestingEngine",
>"com.mycompany.this.class.implements.IJWebUnitDialog.theClass");
> tester.setTestingEngineKey("myTestingEngine");
> beginAt("...");
>
>To achieve this, I'm using Class.forName(). Unfortunately,
>this do not play well with multiple threads. In fact, another
>famous OSS is suffering of this problem: commons-logging.
>There are many articles about this problem, especially:
>http://www.qos.ch/logging/classloader.jsp
>
>One solution could be to use the same solution as slf4j
>project. This solution consists in linking statically with the
>implementation. The drawback is you can't change plugin at
>runtime, and you can't have more than one plugin at the same
>time in the classpath.
>
>Perhaps could we also experiment integration with a
>lightweight container like Spring to choose the implementation
>at runtime...
>
>
>Any idea or comments?
>
>++
>Julien
>
>
>
>
>
>
>
>
>_______________________________________________________________
>____________
>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