I created a TestNG Java test case and use thread pool for parallel
execution, and I got a different error.
Could you try my code to see what you get?
Thanks,
Jian
public class SampleTestNGParallelTest extends TelluriumTestNGTestCase {
@BeforeClass
public static void initUi() {
connectSeleniumServer();
useTrace(true);
}
@Test(threadPoolSize = 5, invocationCount = 10)
public void testOne() {
connectUrl("http://google.com");
assertEquals("location should be google", "http://www.google.com/",
connector.getSelenium().getProperty("location"));
try {
sleep(500);
} catch (InterruptedException e) {
}
}
@Test(threadPoolSize = 5, invocationCount = 10)
public void testTwo() {
connectUrl("http://amazon.com");
assertEquals("location should be amazon", "http://www.amazon.com/",
connector.getSelenium().getProperty("location"));
try {
sleep(500);
} catch (InterruptedException e) {
}
}
@AfterClass
public static void tearDown() {
showTrace();
}
}
On Wed, Mar 17, 2010 at 8:18 PM, Jian Fang <[email protected]> wrote:
> Issue 408 has been created to track this problem.
>
> http://code.google.com/p/aost/issues/detail?id=408
>
>
> On Wed, Mar 17, 2010 at 8:14 PM, Jian Fang <[email protected]>wrote:
>
>> Jason,
>>
>> Thanks for bringing this question up. You are right, we haven't thought of
>>
>> the parallel execution in Tellurium Core yet. We will reproduce your
>> problem
>> and see if we can have a quick fix.
>>
>> More important concerns may include the singleton pattern we used in
>> Tellurium
>> core. Perhaps we should consider both singleton and prototype objects like
>> Spring
>> bean or Google Guice does. We need to think about this more deeply.
>>
>> Thanks again,
>>
>> Jian
>>
>>
>> On Tue, Mar 16, 2010 at 9:45 PM, Jason <[email protected]> wrote:
>>
>>> Oops, I realize this test needs thread synchronization ( so that the
>>> connectUrl() and asserts are done in a synchronized block), but for
>>> now, just note that you'll get the selenium error:
>>>
>>> com.thoughtworks.selenium.SeleniumException:
>>> The_server_localhost_failed_to_respond_with_a_valid_HTTP_response
>>>
>>> instead of just assertion failures...
>>>
>>>
>>>
>>> On Mar 16, 6:41 pm, Jason <[email protected]> wrote:
>>> > OK, I think this demonstrates the issue. There are 2 parts -- one is
>>> > the suite file, the other is the test.
>>> >
>>> > Test first:
>>> >
>>> > import org.tellurium.test.groovy.*;
>>> >
>>> > import org.testng.annotations.*;
>>> > import static org.testng.AssertJUnit.*;
>>> > import org.tellurium.dsl.DslContext;
>>> >
>>> > public class UltraSimpleParallelTest extends
>>> > TelluriumGroovyTestNGTestCase {
>>> >
>>> > public void initUi() { }
>>> >
>>> > @Test
>>> > public void testOne() {
>>> > 1.upto(10) {
>>> > connectUrl("http://google.com");
>>> > assertEquals("location should be google", "
>>> http://www.google.com/", connector.sel.getProperty("location"));
>>> > sleep(500)
>>> > }
>>> > }
>>> >
>>> > @Test
>>> > public void testTwo() {
>>> > 1.upto(10) {
>>> > connectUrl("http://amazon.com");
>>> > assertEquals("location should be amazon", "
>>> http://www.amazon.com/", connector.sel.getProperty("location"));
>>> > sleep(500)
>>> > }
>>> > }
>>> >
>>> > }
>>> >
>>> > suite file:
>>> >
>>> > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
>>> > <suite thread-count="2" skipfailedinvocationCounts="false" verbose="1"
>>> > name="parallel_test" junit="false" parallel="methods"
>>> > annotations="JDK" data-provider-thread-count="2">
>>> > <test name="parallel_test" junit="false" parallel="methods"
>>> > annotations="JDK">
>>> > <classes>
>>> > <class name="UltraSimpleParallelTest">
>>> > <methods>
>>> > <include name="testOne"/>
>>> > <include name="testTwo"/>
>>> > </methods>
>>> > </class>
>>> > </classes>
>>> > </test>
>>> > </suite>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "tellurium-users" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<tellurium-users%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/tellurium-users?hl=en.
>>>
>>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"tellurium-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tellurium-users?hl=en.