Skip to content

Commit

Permalink
Enable most LocalTargetDefinitionTests in verification builds
Browse files Browse the repository at this point in the history
Don't disable LocalTargetDefinitionTests by default in verification
builds, only disable those that fail.
Some of the disabled tests should probably work even in verification
builds and IDE JUnit Plugin tests, but that is left for later.

And fix LocalTargetDefinitionTests.testDeleteCleansCaches() test-case
that is current failing in I-builds.
  • Loading branch information
HannesWell committed May 19, 2024
1 parent e41da13 commit 98b03a3
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import org.eclipse.pde.internal.launching.launcher.LaunchArgumentsHelper;
import org.eclipse.pde.ui.tests.PDETestCase;
import org.eclipse.pde.ui.tests.PDETestsPlugin;
import org.junit.BeforeClass;
import org.junit.Test;
import org.osgi.framework.ServiceReference;

Expand All @@ -71,11 +70,6 @@
*/
public class LocalTargetDefinitionTests extends AbstractTargetTest {

@BeforeClass
public static void requireStandaloneEclipseSDKEnvironment() {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
}

public static final NameVersionDescriptor MULTI_VERSION_LOW_DESCRIPTION = new NameVersionDescriptor(
"a.typical.bundle", "1.0.0.200907071058");
public static final NameVersionDescriptor MULTI_VERSION_HIGH_DESCRIPTION = new NameVersionDescriptor(
Expand Down Expand Up @@ -153,6 +147,7 @@ public void testResetTargetPlatform() throws Exception {
*/
@Test
public void testDefaultTargetPlatform() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
// the new way
ITargetDefinition definition = getNewTarget();
ITargetLocation container = getTargetService().newProfileLocation(TargetPlatform.getDefaultLocation(), null);
Expand Down Expand Up @@ -197,6 +192,7 @@ public void testRestrictedDefaultTargetPlatform() throws Exception {
*/
@Test
public void testVersionRestrictedDefaultTargetPlatform() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
ITargetDefinition definition = getNewTarget();
ITargetLocation container = getTargetService().newProfileLocation(TargetPlatform.getDefaultLocation(), null);
definition.setTargetLocations(new ITargetLocation[] { container });
Expand Down Expand Up @@ -243,6 +239,7 @@ public void testVersionRestrictedDefaultTargetPlatform() throws Exception {
*/
@Test
public void testMissingVersionRestrictedDefaultTargetPlatform() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
ITargetDefinition definition = getNewTarget();
ITargetLocation container = getTargetService().newProfileLocation(TargetPlatform.getDefaultLocation(), null);
NameVersionDescriptor[] restrictions = new NameVersionDescriptor[] {
Expand All @@ -269,6 +266,7 @@ public void testMissingVersionRestrictedDefaultTargetPlatform() throws Exception
*/
@Test
public void testEclipseHomeTargetPlatform() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
// the new way
ITargetDefinition definition = getNewTarget();
ITargetLocation container = getTargetService().newProfileLocation("${eclipse_home}", null);
Expand All @@ -291,6 +289,7 @@ public void testEclipseHomeTargetPlatform() throws Exception {
*/
@Test
public void testEclipseHomeTargetPlatformAndConfigurationArea() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
// the new way
ITargetDefinition definition = getNewTarget();
ITargetLocation container = getTargetService().newProfileLocation("${eclipse_home}",
Expand All @@ -312,6 +311,7 @@ public void testEclipseHomeTargetPlatformAndConfigurationArea() throws Exception
*/
@Test
public void testDirectoryBundleContainer() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
ITargetDefinition definition = getNewTarget();
ITargetLocation container = getTargetService()
.newDirectoryLocation(TargetPlatform.getDefaultLocation() + "/plugins");
Expand All @@ -327,6 +327,7 @@ public void testDirectoryBundleContainer() throws Exception {
*/
@Test
public void testVariableDirectoryBundleContainer() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
ITargetDefinition definition = getNewTarget();
ITargetLocation container = getTargetService().newDirectoryLocation("${eclipse_home}/plugins");
definition.setTargetLocations(new ITargetLocation[] { container });
Expand Down Expand Up @@ -681,6 +682,7 @@ public void testArgumentsPluginsDirectory() throws Exception {
*/
@Test
public void testArgumentsInstallDirectory() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
ITargetLocation installDirectory = getTargetService().newDirectoryLocation(TargetPlatform.getDefaultLocation());
String[] installArgs = installDirectory.getVMArguments();
assertNotNull("Install directory should have arguments", installArgs);
Expand All @@ -702,6 +704,7 @@ public void testArgumentsFeatureContainer() throws Exception {
*/
@Test
public void testArgumentsProfileContainer() throws Exception {
PDETestCase.assumeRunningInStandaloneEclipseSDK();
ITargetLocation profileContainer = getTargetService().newProfileLocation(TargetPlatform.getDefaultLocation(),
null);
String[] arguments = profileContainer.getVMArguments();
Expand Down Expand Up @@ -771,6 +774,9 @@ public void testArguments() throws Exception {
@Test
public void testDeleteCleansCaches() throws Exception {
ITargetDefinition definition = getNewTarget();
// dummy content to ensure the target is cached
ITargetLocation container = getTargetService().newProfileLocation(TargetPlatform.getDefaultLocation(), null);
definition.setTargetLocations(new ITargetLocation[] { container });
try {
assertFalse(TargetPlatformHelper.getTargetDefinitionMap().containsKey(definition.getHandle()));
definition.resolve(null);
Expand Down

0 comments on commit 98b03a3

Please sign in to comment.