Skip to content

Commit 1aece37

Browse files
committed
Fix FeatureBasedLaunchTest: use imports and @referenced annotation
Move from full-qualified access to imports. Use @referenced annotation instead of unused variables to prevent bundle removal. Add org.osgi.annotation.bundle to MANIFEST.MF.
1 parent a316e72 commit 1aece37

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
6969
org.junit.runners.model,
7070
org.mockito,
7171
org.mockito.stubbing,
72+
org.osgi.annotation.bundle;version="1.0.0",
7273
org.osgi.service.event;version="[1.3.0,2.0.0)"
7374
Bundle-RequiredExecutionEnvironment: JavaSE-21
7475
Eclipse-BundleShape: dir

ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/launcher/FeatureBasedLaunchTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,16 @@
6565
import org.eclipse.pde.launching.IPDELauncherConstants;
6666
import org.eclipse.pde.ui.tests.util.ProjectUtils.CoreConsumer;
6767
import org.eclipse.pde.ui.tests.util.TargetPlatformUtil;
68+
import org.eclipse.platform.internal.LaunchUpdateIntroAction;
69+
import org.eclipse.ui.internal.ide.application.IDEApplication;
6870
import org.junit.Before;
6971
import org.junit.Rule;
7072
import org.junit.Test;
7173
import org.junit.rules.TemporaryFolder;
74+
import org.osgi.annotation.bundle.Referenced;
7275
import org.osgi.framework.FrameworkUtil;
7376

77+
@Referenced({ LaunchUpdateIntroAction.class, IDEApplication.class })
7478
public class FeatureBasedLaunchTest extends AbstractLaunchTest {
7579

7680
@Rule
@@ -1450,10 +1454,6 @@ static Map<BundleLocationDescriptor, String> getEclipseAppRequirementClosureForR
14501454
DependencyManager.Options... closureOptions) throws Exception {
14511455
// ensure app requirements are registered (done at class initialization)
14521456
new EclipseApplicationLaunchConfiguration();
1453-
@SuppressWarnings("unused") // prevent bundle removal
1454-
org.eclipse.platform.internal.LaunchUpdateIntroAction a;
1455-
@SuppressWarnings("unused") // prevent bundle removal
1456-
org.eclipse.ui.internal.ide.application.IDEApplication app;
14571457

14581458
TargetPlatformUtil.setRunningPlatformAsTarget();
14591459

0 commit comments

Comments
 (0)