Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [swtbot-dev] problems running swtbot test suite in some configurations

Some follow-ups: if I run the same test from Eclipse (using Indigo
target platform) as a Junit test it succeds... if I run it with mvn that
test fails... and sometimes other tests fail in the same plugin:

Failed tests:   getsAllShells(org.eclipse.swtbot.swt.finder.SWTBotTest):
expected:<2> but was:<4>
  getsActiveShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShellTest):

bringsShellToFront(org.eclipse.swtbot.swt.finder.widgets.SWTBotShellTest):

Tests run: 376, Failures: 3, Errors: 0, Skipped: 8

by looking at the xml surefire reports I see for the above tests:

java.lang.AssertionError: expected:<2> but was:<4>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:743)
	at org.junit.Assert.assertEquals(Assert.java:118)
	at org.junit.Assert.assertEquals(Assert.java:555)
	at org.junit.Assert.assertEquals(Assert.java:542)
	at
org.eclipse.swtbot.swt.finder.SWTBotTest.getsAllShells(SWTBotTest.java:98)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule.runTestThread(RunUIThreadRule.java:52)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule.access$4(RunUIThreadRule.java:48)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule$2.run(RunUIThreadRule.java:42)
	at java.lang.Thread.run(Thread.java:662)


java.lang.AssertionError:
Expected: sameInstance(<Shell {*Wrong Thread*}>)
     but: was <Shell {*Wrong Thread*}>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
	at
org.eclipse.swtbot.swt.finder.SWTBotAssert.assertSameWidget(SWTBotAssert.java:115)
	at
org.eclipse.swtbot.swt.finder.SWTBotTestCase.assertSameWidget(SWTBotTestCase.java:98)
	at
org.eclipse.swtbot.swt.finder.widgets.SWTBotShellTest.getsActiveShell(SWTBotShellTest.java:105)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule.runTestThread(RunUIThreadRule.java:52)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule.access$4(RunUIThreadRule.java:48)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule$2.run(RunUIThreadRule.java:42)
	at java.lang.Thread.run(Thread.java:662)


java.lang.AssertionError:
Expected: sameInstance(<Shell {*Wrong Thread*}>)
     but: was <Shell {*Wrong Thread*}>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
	at
org.eclipse.swtbot.swt.finder.SWTBotAssert.assertSameWidget(SWTBotAssert.java:115)
	at
org.eclipse.swtbot.swt.finder.SWTBotTestCase.assertSameWidget(SWTBotTestCase.java:98)
	at
org.eclipse.swtbot.swt.finder.widgets.SWTBotShellTest.bringsShellToFront(SWTBotShellTest.java:67)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule.runTestThread(RunUIThreadRule.java:52)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule.access$4(RunUIThreadRule.java:48)
	at
org.eclipse.swtbot.swt.finder.RunUIThreadRule$2.run(RunUIThreadRule.java:42)
	at java.lang.Thread.run(Thread.java:662)


At this point, I wouldn't know how to proceed...

> 
> thanks for the suggestions!
> I looked in that folder and there's actually on test failing:
> 
> -------------------------------------------------------------------------------
> Test set: org.eclipse.swtbot.swt.finder.SWTBotTest
> -------------------------------------------------------------------------------
> Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 13.103
> sec <<< FAILURE!
> getsAllShells(org.eclipse.swtbot.swt.finder.SWTBotTest)  Time elapsed:
> 0.233 sec  <<< FAILURE!
> java.lang.AssertionError: expected:<2> but was:<4>
> 	at org.junit.Assert.fail(Assert.java:88)
> 	at org.junit.Assert.failNotEquals(Assert.java:743)
> 	at org.junit.Assert.assertEquals(Assert.java:118)
> 	at org.junit.Assert.assertEquals(Assert.java:555)
> 	at org.junit.Assert.assertEquals(Assert.java:542)
> 	at
> org.eclipse.swtbot.swt.finder.SWTBotTest.getsAllShells(SWTBotTest.java:98)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> 	at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> 	at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> 	at
> org.eclipse.swtbot.swt.finder.RunUIThreadRule.runTestThread(RunUIThreadRule.java:52)
> 	at
> org.eclipse.swtbot.swt.finder.RunUIThreadRule.access$4(RunUIThreadRule.java:48)
> 	at
> org.eclipse.swtbot.swt.finder.RunUIThreadRule$2.run(RunUIThreadRule.java:42)
> 	at java.lang.Thread.run(Thread.java:662)
> doesNotWait5SecondsAndPassesForPassingCondition(org.eclipse.swtbot.swt.finder.SWTBotTest)
>  Time elapsed: 0.034
> secwaitsMoreThan5sWhenConditionDoesNotSwitchToFailing(org.eclipse.swtbot.swt.finder.SWTBotTest)
>  Time elapsed: 5.036
> secwaitsLessThan5sWhenConditionSwitchToFailing(org.eclipse.swtbot.swt.finder.SWTBotTest)
>  Time elapsed: 2.551
> secthrowsExceptionOnNegativeTimeOut(org.eclipse.swtbot.swt.finder.SWTBotTest)
>  Time elapsed: 0.057
> secfindsShellsById(org.eclipse.swtbot.swt.finder.SWTBotTest)  Time
> elapsed: 0.064
> secwaits5SecondsAndFailsForFailingCondition(org.eclipse.swtbot.swt.finder.SWTBotTest)
>  Time elapsed: 5.036 sec
> 
>> HTH
>> -- 
>> Mickael Istria
>> Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
>> My blog <http://mickaelistria.wordpress.com> - My Tweets
>> <http://twitter.com/mickaelistria>
>>
>>
>> _______________________________________________
>> swtbot-dev mailing list
>> swtbot-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/swtbot-dev
>>
> 
> 


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book




Back to the top