Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: TestIdentityMap is never executed during GWT builds and has three failing tests #10070

Open
jnehlmeier opened this issue Dec 23, 2024 · 1 comment

Comments

@jnehlmeier
Copy link
Member

Description

In dev/core/test we have TestIdentityMap in the Apache commons test package. This test has a method testCreate commented out which results in three other test failures.

The class itself is never executed during ANT builds because by default we filter on com.google tests only.

  • testEmptyMapCompatibility
  • testCanonicalFullCollectionExists
  • testCanonicalEmptyCollectionExists

Maybe we should disable these tests.

It is a bit annoying if trying to run all gwt-dev tests via IDE as you do not expect to use a filter on tests.

Steps to reproduce

Run ALL tests in dev/core/test by overriding -Dgwt.junit.testcase.dev.core.includes

@jnehlmeier
Copy link
Member Author

GWT extends Apache Commons Collections TestIdentityMap in IdentityMapExtTest and overrides a factory method makeObject to make TestIdentityMap and its superclass AbstractTestObject use a custom GWT implementation of identity map.

However TestIdentityMap only uses makeObject in tests defined in AbstractTestObject which boils down to equals/hashcode contract tests and serialization tests with serialization tests being disabled in IdentityMapExtTest. The real tests that verify that we have an identity map are

  • TestIdentityMap.testBasic()
  • TestIdentityMap.testHashEntry()

and those two tests don't use makeObject but instead use the Apache Commons Collections IdentityMap directly. As a result IdentityMapExtTest likely not test the GWT implementation as intended.

Two possible solutions:

  • Let IdentityMapExtTest extend AbstractTestObject directly, push the test logic of TestIdentityMap.testBasic()/testHashEntry() down to IdentityMapExtTest and let it actually use the GWT implementation of an identity map. Finally TestIdentityMap can be deleted.
  • Refactor TestIdentityMap: Make it abstract so it won't be picked up as independent test case and then give it a way that IdentityMapExtTest can provide a map implementation for the test methods defined in TestIdentityMap.

My ultimate goal is to have all tests run in IDE (IntelliJ) without much configuration of IDE run configuration. For collection tests it requires to fix this issue and to hide BulkTest as independent test (see #10071)

I think I would vote for the first solution because we do not use TestIdentityMap multiple times in code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant