Skip to content

Commit

Permalink
Merge AllPDEMinimalTests into AllPDETests and merge minimal tests
Browse files Browse the repository at this point in the history
This prevents future and resolves already existing discrepancies between
the tests run in the verification-builds and I-builds. All tests
executed in verification builds should also run in I-builds.
Only those that cannot succeed in verification builds are dynamically
disable using JUnit-Assume.

With this the 'AllPDETests' test-suite can be now be executed in
verification builds.

This also fixes the ConvertProjectToPluginTestCase for verification
builds and runs the full PluginRegistryTests and
ClasspathContributorTest which passes without changes.
  • Loading branch information
HannesWell committed Sep 17, 2023
1 parent ba4fde8 commit 8be6694
Show file tree
Hide file tree
Showing 18 changed files with 1,520 additions and 1,817 deletions.
3 changes: 2 additions & 1 deletion ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Require-Bundle: org.eclipse.pde.ui,
org.eclipse.pde.genericeditor.extension,
org.eclipse.equinox.simpleconfigurator.manipulator;bundle-version="2.1.300",
org.eclipse.platform,
org.eclipse.ui.ide.application
org.eclipse.ui.ide.application,
org.eclipse.pde.api.tools
Import-Package: javax.annotation;version="[1.3.0,2.0.0)",
javax.inject;version="[1.0.0,2.0.0)",
org.assertj.core.api;version="3.14.0",
Expand Down
2 changes: 1 addition & 1 deletion ui/org.eclipse.pde.ui.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<code.ignoredWarnings>-warn:-discouraged</code.ignoredWarnings>
<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
<testSuite>${project.artifactId}</testSuite>
<testClass>org.eclipse.pde.ui.tests.AllPDEMinimalTests</testClass>
<testClass>org.eclipse.pde.ui.tests.AllPDETests</testClass>
</properties>

<build>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005,2021 IBM Corporation and others.
* Copyright (c) 2005, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -15,6 +15,8 @@

import org.eclipse.pde.core.tests.internal.AllPDECoreTests;
import org.eclipse.pde.core.tests.internal.classpath.ClasspathResolutionTest;
import org.eclipse.pde.core.tests.internal.core.builders.BundleErrorReporterTest;
import org.eclipse.pde.core.tests.internal.util.PDESchemaHelperTest;
import org.eclipse.pde.ui.tests.build.properties.AllValidatorTests;
import org.eclipse.pde.ui.tests.classpathcontributor.ClasspathContributorTest;
import org.eclipse.pde.ui.tests.classpathresolver.ClasspathResolverTest;
Expand All @@ -38,27 +40,29 @@
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({
AllTargetTests.class,
AllNewProjectTests.class,
AllPreferenceTests.class,
AllImportTests.class,
AllBundleModelTests.class,
AllXMLModelTests.class,
AllValidatorTests.class,
AllNLSTests.class,
AllPDERuntimeTests.class,
ExportBundleTests.class,
AllLauncherTests.class,
AllLogViewTests.class,
ProjectCreationTests.class,
BundleRootTests.class,
PluginRegistryTests.class,
ClasspathResolverTest.class,
ClasspathContributorTest.class,
DynamicPluginProjectReferencesTest.class,
ClasspathResolutionTest.class,
AllPDECoreTests.class
@SuiteClasses({ //
AllTargetTests.class, //
AllNewProjectTests.class, //
AllPreferenceTests.class, //
AllImportTests.class, //
AllBundleModelTests.class, //
AllXMLModelTests.class, //
AllValidatorTests.class, //
AllNLSTests.class, //
AllPDERuntimeTests.class, //
ExportBundleTests.class, //
AllLauncherTests.class, //
AllLogViewTests.class, //
ProjectCreationTests.class, //
BundleRootTests.class, //
PluginRegistryTests.class, //
ClasspathResolverTest.class, //
PDESchemaHelperTest.class, //
ClasspathContributorTest.class, //
DynamicPluginProjectReferencesTest.class, //
ClasspathResolutionTest.class, //
BundleErrorReporterTest.class, //
AllPDECoreTests.class //
})
public class AllPDETests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2015 IBM Corporation and others.
* Copyright (c) 2005, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,6 +14,12 @@
package org.eclipse.pde.ui.tests;

import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;

import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
Expand All @@ -22,6 +28,7 @@
import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
Expand Down Expand Up @@ -131,4 +138,15 @@ private static void closeIntro(final IWorkbench wb) {
}
}
}

public static void assumeRunningInStandaloneEclipseSDK() {
try {
Path location = Path.of(Platform.getInstallLocation().getURL().toURI());
for (String directory : List.of("plugins", "features")) {
assumeTrue("Not running in a standalone Eclipse SDK", Files.isDirectory(location.resolve(directory)));
}
} catch (URISyntaxException e) {
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2017 IBM Corporation and others.
* Copyright (c) 2008, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -41,13 +41,19 @@
import org.eclipse.pde.ui.tests.runtime.TestUtils;
import org.eclipse.pde.ui.tests.util.ProjectUtils;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
* Tests exporting bundles.
*/
public class ExportBundleTests extends PDETestCase {

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

private static final IPath EXPORT_PATH = PDETestsPlugin.getDefault().getStateLocation().append(".export");

@Override
Expand Down
Loading

0 comments on commit 8be6694

Please sign in to comment.