Skip to content

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Dec 16, 2025

This commit adds a new test class
GatherUnusedDependenciesOperationTest
to verify the behavior of GatherUnusedDependenciesOperation. It includes tests for:

  • Identifying unused dependencies.
  • Ensuring used dependencies are not reported.
  • Handling of mandatory dependencies that are also re-exported by optional dependencies.

The new test is registered in AllPDETests.

If the ignored test is enabled you also have an example for #2115

This commit adds a new test class
`GatherUnusedDependenciesOperationTest`
to verify the behavior of `GatherUnusedDependenciesOperation`.
It includes tests for:
- Identifying unused dependencies.
- Ensuring used dependencies are not reported.
- Handling of mandatory dependencies that are also re-exported by
optional dependencies.

The new test is registered in `AllPDETests`.

If the ignored test is enabled you also have an example for
eclipse-pde#2115
@vogella vogella force-pushed the clean-up-classpath-tests branch from e15515b to 79d8945 Compare December 16, 2025 17:03
@github-actions
Copy link

Test Results

  330 files   -   441    330 suites   - 441   40m 0s ⏱️ - 15m 58s
  986 tests  - 2 662    955 ✅  - 2 639  30 💤  - 24  1 ❌ +1 
2 892 runs   - 7 986  2 798 ✅  - 7 917  91 💤  - 72  3 ❌ +3 

For more details on these failures, see this check.

Results for commit 79d8945. ± Comparison against base commit abc3cc7.

This pull request removes 2665 and adds 3 tests. Note that renamed tests count towards both.
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[JUnit4 (JUnitPlatform) Fragment]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[JUnit4 (JUnitPlatform)]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[JUnit4 Fragment]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[JUnit4]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[JUnit5 Fragment]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[JUnit5]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[JUnit6 Fragment]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[JUnit6]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[Java 11 bundle with module limit]
JUnitRuntimeTests org.eclipse.pde.junit.runtime.tests.JUnitExecutionTest ‑ executeMethod[Using a 'test' source folder]
…
AllPDETests GatherUnusedDependenciesOperationTest ‑ testFindUnusedDependency
AllPDETests GatherUnusedDependenciesOperationTest ‑ testMinimizeRemovesMandatoryIfOptionalReexports
AllPDETests GatherUnusedDependenciesOperationTest ‑ testUsedDependencyNotReported

@laeubi
Copy link
Contributor

laeubi commented Dec 17, 2025

I would strongly recommend not creating test classes / bundles "inline" as it bloats the test (what makes it hard to read) and is harder to analyze (e.g. no real project structure to look at in the IDE only temporary java/class files).

It would be better to have a set of bundles that is then used in the test and can be imported for example in a workspace to see the problem in action.

}
}
}
Assert.assertFalse("Should NOT remove mandatory BundleB even if optional BundleA re-exports it", found);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

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

Successfully merging this pull request may close these issues.

2 participants