[jbosstools-issues] [JBoss JIRA] (JBIDE-22240) Tests: frequent failures in ConnectionRegistryTest.shouldNotifyConnectionChange
Andre Dietisheim (JIRA)
issues at jboss.org
Sat Apr 23 18:41:01 EDT 2016
[ https://issues.jboss.org/browse/JBIDE-22240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196109#comment-13196109 ]
Andre Dietisheim edited comment on JBIDE-22240 at 4/23/16 6:40 PM:
-------------------------------------------------------------------
I discovered 2 issues in the test code (no application code is affected):
* the test class ConnectionsChange releases a lock before it is updating its internal values (that the testing code then asserts).
* an [erroneous usage of mockito|https://groups.google.com/forum/?fromgroups#!topic/mockito/9WUvkhZUy90]. To simulate returned values for partial mocks one should use {code} doReturn(...).when(spy).method() {code} and not {code} when(...).thenReturn() {code}
was (Author: adietish):
I discovered 2 issues in the test code (no application code is affected):
* the test class ConnectionsChange releases a lock before it is updating its internal values (that the testing code then asserts).
* an [erroneous usage of mockito|https://groups.google.com/forum/?fromgroups#!topic/mockito/9WUvkhZUy90]. To simulate returned values for partial mocks one should use {code} doReturn(...).when(spy).method() {code} (and not {code} when(...).thenReturn() {code}
> Tests: frequent failures in ConnectionRegistryTest.shouldNotifyConnectionChange
> -------------------------------------------------------------------------------
>
> Key: JBIDE-22240
> URL: https://issues.jboss.org/browse/JBIDE-22240
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.0.Alpha1
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Fix For: 4.4.0.Alpha1
>
>
> ConnectionRegistryTest.shouldNotifyConnectionChange is frequently (even though not always) failing when running tests via surefire.
> {code}
> shouldNotifyConnectionChange(org.jboss.tools.openshift.test.core.connection.ConnectionRegistryTest) Time elapsed: 0.002 sec <<< FAILURE!
> java.lang.AssertionError: Exp. a notification to the listener and there was none
> at org.junit.Assert.fail(Assert.java:88)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.jboss.tools.openshift.test.core.connection.ConnectionRegistryTest.shouldNotifyConnectionChange(ConnectionRegistryTest.java:142)
> Failed tests:
> ConnectionRegistryTest.shouldNotifyConnectionChange:142 Exp. a notification to the listener and there was none
> Tests run: 314, Failures: 1, Errors: 0, Skipped: 2
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jbosstools-issues
mailing list