Bug 257103 - modify execution environment tests to not break real environments
diff --git a/org.eclipse.jdt.debug.tests/plugin.xml b/org.eclipse.jdt.debug.tests/plugin.xml
index 5310294..7e92c3d 100644
--- a/org.eclipse.jdt.debug.tests/plugin.xml
+++ b/org.eclipse.jdt.debug.tests/plugin.xml
@@ -278,31 +278,21 @@
<extension
point="org.eclipse.jdt.launching.executionEnvironments">
<environment
- description="Java 2 Platform, Standard Edition 1.4.x"
+ description="Java 2 Platform, Test Edition 1.4.x"
id="org.eclipse.jdt.debug.tests.environment.j2se14x"
ruleParticipant="org.eclipse.jdt.debug.testplugin.AccessRuleParticipant"/>
- <analyzer
- class="org.eclipse.jdt.debug.testplugin.AnalyzerJ2SE14x"
- id="org.eclipse.jdt.debug.tests.analyzer.j2se14x"/>
<environment
- description="Java 2 Platform, Standard Edition 1.3.x"
+ description="Java 2 Platform, Test Edition 1.3.x"
id="org.eclipse.jdt.debug.tests.environment.j2se13x"/>
- <analyzer
- class="org.eclipse.jdt.debug.testplugin.AnalyzerJ2SE13x"
- id="org.eclipse.jdt.debug.tests.analyzer.j2se13x"/>
<ruleParticipant
class="org.eclipse.jdt.debug.testplugin.SecondaryAccessRuleParticipant"
id="org.eclipse.jdt.debug.tests.secondaryRuleParticipant">
</ruleParticipant>
<environment
- description="Java 2 Platform, Standard Edition 1.5.x"
+ description="Java 2 Platform, Test Edition 1.5.x"
id="org.eclipse.jdt.debug.tests.environment.j2se15x"
ruleParticipant="org.eclipse.jdt.debug.testplugin.AccessRuleParticipant">
</environment>
- <analyzer
- class="org.eclipse.jdt.debug.testplugin.AnalyzerJ2SE15x"
- id="org.eclipse.jdt.debug.tests.analyzer.j2se15x">
- </analyzer>
<environment
description="Test default system package access rules"
id="org.eclipse.jdt.debug.tests.systemPackages"
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE13x.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE13x.java
deleted file mode 100644
index 617b404..0000000
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE13x.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.debug.testplugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.environments.CompatibleEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironmentAnalyzerDelegate;
-
-/**
- * @since 3.2
- *
- */
-public class AnalyzerJ2SE13x implements IExecutionEnvironmentAnalyzerDelegate {
-
- /**
- * @see org.eclipse.jdt.launching.environments.IExecutionEnvironmentAnalyzerDelegate#analyze(org.eclipse.jdt.launching.IVMInstall, org.eclipse.core.runtime.IProgressMonitor)
- */
- public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
- if (vm instanceof IVMInstall2) {
- IVMInstall2 vm2 = (IVMInstall2) vm;
- String javaVersion = vm2.getJavaVersion();
- if (javaVersion != null) {
- IExecutionEnvironment environment = JavaRuntime.getExecutionEnvironmentsManager()
- .getEnvironment("org.eclipse.jdt.debug.tests.environment.j2se13x");
- if (javaVersion.startsWith("1.3")) {
- return new CompatibleEnvironment[] { new CompatibleEnvironment(environment, true)};
- }
- if (javaVersion.startsWith("1.4")) {
- return new CompatibleEnvironment[] { new CompatibleEnvironment(environment, false)};
- }
- if (javaVersion.startsWith("1.5")) {
- return new CompatibleEnvironment[] { new CompatibleEnvironment(environment, false)};
- }
- }
- }
- return new CompatibleEnvironment[0];
- }
-
-}
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE14x.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE14x.java
deleted file mode 100644
index 7000166..0000000
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE14x.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.debug.testplugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.environments.CompatibleEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironmentAnalyzerDelegate;
-
-/**
- * @since 3.2
- *
- */
-public class AnalyzerJ2SE14x implements IExecutionEnvironmentAnalyzerDelegate {
-
- /**
- * @see org.eclipse.jdt.launching.environments.IExecutionEnvironmentAnalyzerDelegate#analyze(org.eclipse.jdt.launching.IVMInstall, org.eclipse.core.runtime.IProgressMonitor)
- */
- public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
- if (vm instanceof IVMInstall2) {
- IVMInstall2 vm2 = (IVMInstall2) vm;
- String javaVersion = vm2.getJavaVersion();
- if (javaVersion != null) {
- IExecutionEnvironment environment = JavaRuntime
- .getExecutionEnvironmentsManager()
- .getEnvironment(
- "org.eclipse.jdt.debug.tests.environment.j2se14x");
- if (javaVersion.startsWith("1.4")) {
- return new CompatibleEnvironment[] { new CompatibleEnvironment(
- environment, true) };
- }
- if (javaVersion.startsWith("1.5")) {
- return new CompatibleEnvironment[] { new CompatibleEnvironment(
- environment, false) };
- }
- if (javaVersion.startsWith("1.6")) {
- return new CompatibleEnvironment[] { new CompatibleEnvironment(
- environment, false) };
- }
- }
- }
- return new CompatibleEnvironment[0];
- }
-
-}
diff --git a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE15x.java b/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE15x.java
deleted file mode 100644
index 84fd9ae..0000000
--- a/org.eclipse.jdt.debug.tests/test plugin/org/eclipse/jdt/debug/testplugin/AnalyzerJ2SE15x.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jdt.debug.testplugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.environments.CompatibleEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
-import org.eclipse.jdt.launching.environments.IExecutionEnvironmentAnalyzerDelegate;
-
-/**
- * @since 3.2
- *
- */
-public class AnalyzerJ2SE15x implements IExecutionEnvironmentAnalyzerDelegate {
-
- /**
- * @see org.eclipse.jdt.launching.environments.IExecutionEnvironmentAnalyzerDelegate#analyze(org.eclipse.jdt.launching.IVMInstall, org.eclipse.core.runtime.IProgressMonitor)
- */
- public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
- if (vm instanceof IVMInstall2) {
- IVMInstall2 vm2 = (IVMInstall2) vm;
- String javaVersion = vm2.getJavaVersion();
- if (javaVersion != null) {
- IExecutionEnvironment environment = JavaRuntime
- .getExecutionEnvironmentsManager()
- .getEnvironment(
- "org.eclipse.jdt.debug.tests.environment.j2se15x");
- if (javaVersion.startsWith("1.5")) {
- return new CompatibleEnvironment[] { new CompatibleEnvironment(
- environment, true) };
- }
- if (javaVersion.startsWith("1.6")) {
- return new CompatibleEnvironment[] { new CompatibleEnvironment(
- environment, false) };
- }
- }
- }
- return new CompatibleEnvironment[0];
- }
-
-}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ExecutionEnvironmentTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ExecutionEnvironmentTests.java
index 8ca0970..9c07c57 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ExecutionEnvironmentTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/ExecutionEnvironmentTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,19 +36,19 @@
assertTrue("Should be at least one environment", executionEnvironments.length > 0);
for (int i = 0; i < executionEnvironments.length; i++) {
IExecutionEnvironment environment = executionEnvironments[i];
- if (environment.getId().equals("org.eclipse.jdt.debug.tests.environment.j2se14x")) {
+ if (environment.getId().equals("J2SE-1.4")) {
return;
}
}
- assertTrue("Did not find test environment org.eclipse.jdt.debug.tests.environment.j2se14x", false);
+ assertTrue("Did not find environment J2SE-1.4", false);
}
public void testAnalyze() throws Exception {
IVMInstall vm = JavaRuntime.getDefaultVMInstall();
IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
- IExecutionEnvironment environment = manager.getEnvironment("org.eclipse.jdt.debug.tests.environment.j2se14x");
- assertNotNull("Missing environment j2se14x", environment);
+ IExecutionEnvironment environment = manager.getEnvironment("J2SE-1.4");
+ assertNotNull("Missing environment J2SE-1.4", environment);
IVMInstall[] installs = environment.getCompatibleVMs();
assertTrue("Should be at least one vm install for the environment", installs.length > 0);
for (int i = 0; i < installs.length; i++) {
@@ -57,7 +57,7 @@
return;
}
}
- assertTrue("vm should be j2se14x", false);
+ assertTrue("vm should be J2SE-1.4 compliant", false);
}
public void testAccessRuleParticipants() throws Exception {