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

Enable most LocalTargetDefinitionTests in verification builds #1274

Merged
merged 1 commit into from
May 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading