Skip to content

Silently failing LaunchConfigurationTabGroupViewerTest#testOnlyDefaultTabInOtherConfigIsActivated #1075

Closed

Description

@HeikoKlare

Two test cases added with #860 are broken:

  • LaunchConfigurationTabGroupViewerTest#testOnlyDefaultTabInOtherConfigIsActivated()
  • LaunchConfigurationTabGroupViewerTest#testOtherTabInOtherConfigIsActivated()

They make false use of the not matcher from hamcrest, e.g.:

assertThat("Tab " + i + " should not have been initialized", not(((SpyTab) tabs[i]).isInitialized()));

The test class erroneously imports AssertJ's assertThat to which passing a matcher object is valid (other than to Hamcrests assertThat), but AssertJ's assertThat does nothing if no actual assert method is called afterwards (such as isTrue() for a boolean assertion). Thus, the two assertions using not within this class do actually not assert anything.

In addition, one of the assertions, namely the one in LaunchConfigurationTabGroupViewerTest#testOnlyDefaultTabInOtherConfigIsActivated(), fails if it is corrected. The tabs are initialized although they are assumed to not have been initialized. So there is either a flaw in the test or some bug in the tested code.

A correction could look as follows:

assertThat((((SpyTab) tabs[i]).isInitialized())).describedAs("Tab " + i + " should not have been initialized").isFalse();

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is neededregressionRegression defecttestjunit test related things

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions