*** empty log message ***
diff --git a/ui/org.eclipse.pde.ui.tests/.classpath b/ui/org.eclipse.pde.ui.tests/.classpath index c8b1863..275b34c 100644 --- a/ui/org.eclipse.pde.ui.tests/.classpath +++ b/ui/org.eclipse.pde.ui.tests/.classpath
@@ -1,15 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="src" path="src/"/> - <classpathentry kind="src" path="/org.junit"/> - <classpathentry kind="src" path="/org.eclipse.pde.ui"/> - <classpathentry kind="src" path="/org.eclipse.pde.core"/> - <classpathentry kind="src" path="/org.eclipse.ui"/> - <classpathentry kind="src" path="/org.eclipse.core.resources"/> - <classpathentry kind="src" path="/org.eclipse.core.runtime"/> - <classpathentry kind="src" path="/org.eclipse.jdt.core"/> - <classpathentry kind="src" path="/org.eclipse.test.performance"/> - <classpathentry kind="src" path="/org.eclipse.core.boot"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> + <classpathentry kind="src" path="src/"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/AllPDETests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/AllPDETests.java index aec0f0e..d956036 100644 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/AllPDETests.java +++ b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/AllPDETests.java
@@ -1,6 +1,5 @@ package org.eclipse.pde.ui.tests; -import org.eclipse.pde.ui.tests.imports.*; import junit.framework.*; @@ -9,7 +8,6 @@ public static Test suite() { TestSuite suite = new TestSuite("Test Suite for org.eclipse.pde.ui"); //$NON-NLS-1$ - suite.addTest(PluginImportTest.suite()); return suite; } }
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/PluginImportTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/PluginImportTest.java deleted file mode 100644 index d0b2d73..0000000 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/imports/PluginImportTest.java +++ /dev/null
@@ -1,99 +0,0 @@ -package org.eclipse.pde.ui.tests.imports; - -import java.util.ArrayList; - -import junit.framework.*; - -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; -import org.eclipse.jdt.core.*; -import org.eclipse.pde.core.plugin.*; -import org.eclipse.pde.internal.core.*; -import org.eclipse.pde.internal.ui.wizards.imports.*; - - -public class PluginImportTest extends TestCase { - - public static Test suite() { - return new TestSuite(PluginImportTest.class); - } - - public void testImportBinary() { - try { - importPlugin("org.eclipse.jdt.ui", true, false); //$NON-NLS-1$ - } catch (Exception e) { - fail("testImportBinary: " + e); //$NON-NLS-1$ - } - } - - public void testImportBinaryWithLinks() { - try { - importPlugin("org.eclipse.pde.core", false, false); //$NON-NLS-1$ - } catch (Exception e) { - fail("testImportBinaryWithLinks: " + e); //$NON-NLS-1$ - } - } - - public void testImportWithSource() { - try { - importPlugin("org.eclipse.team.core", true, true); //$NON-NLS-1$ - } catch (Exception e) { - fail("testImportWithSource: " + e); //$NON-NLS-1$ - } - } - private void importPlugin(String id, boolean doImport, boolean doExtractSource) throws OperationCanceledException, CoreException { - ModelEntry entry = PDECore.getDefault().getModelManager().findEntry(id, ""); - assertNotNull(entry); - - IPluginModelBase model = entry.getExternalModel(); - assertNotNull(model); - ArrayList ids = new ArrayList(); - ids.add(model.getPluginBase().getId()); - PluginImportOperation op = - new PluginImportOperation( - new IPluginModelBase[] { model }, - ids, - doImport, - doExtractSource, - new PluginImportOperation.IReplaceQuery() { - public int doQuery(IProject project) { - return PluginImportOperation.IReplaceQuery.YES; - } - - }); - op.run(null); - - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - IProject project = workspaceRoot.getProject(id); - assertTrue(project.exists()); - assertTrue(project.hasNature(JavaCore.NATURE_ID)); - assertTrue(checkSourceAttached(JavaCore.create(project))); - } - - private boolean checkSourceAttached(IJavaProject jProject) throws CoreException { - IPackageFragmentRoot[] roots = jProject.getPackageFragmentRoots(); - for (int i = 0; i < roots.length; i++) { - IClasspathEntry entry = roots[i].getRawClasspathEntry(); - if (entry.getEntryKind() != IClasspathEntry.CPE_CONTAINER || !entry.getPath().equals(new Path(PDECore.CLASSPATH_CONTAINER_ID))) - continue; - if (roots[i].getSourceAttachmentPath() == null) - return false; - } - return true; - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() { - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - IProject[] projects = workspaceRoot.getProjects(); - try { - for (int i = 0; i < projects.length; i++) { - projects[i].delete(true, new NullProgressMonitor()); - } - } catch (CoreException e) { - // do nothing if deletion fails. No need to fail the test. - } - } -}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/PDEPerformanceTests.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/PDEPerformanceTests.java index 9016634..62810ce 100644 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/PDEPerformanceTests.java +++ b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/PDEPerformanceTests.java
@@ -1,15 +1,11 @@ package org.eclipse.pde.ui.tests.performance; -import org.eclipse.pde.ui.tests.performance.parts.*; - import junit.framework.*; public class PDEPerformanceTests { public static Test suite() { TestSuite suite = new TestSuite("Performance Test Suite for org.eclipse.pde.ui"); //$NON-NLS-1$ - suite.addTest(PluginsViewPerfTest.suite()); - suite.addTest(OpenManifestEditorPerfTest.suite()); return suite; }
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/OpenManifestEditorPerfTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/OpenManifestEditorPerfTest.java deleted file mode 100644 index ad1465f..0000000 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/OpenManifestEditorPerfTest.java +++ /dev/null
@@ -1,35 +0,0 @@ -package org.eclipse.pde.ui.tests.performance.parts; - -import junit.framework.*; - -import org.eclipse.pde.core.plugin.IMatchRules; -import org.eclipse.pde.core.plugin.IPluginModelBase; -import org.eclipse.pde.internal.core.PDECore; -import org.eclipse.pde.internal.ui.editor.manifest.ManifestEditor; -import org.eclipse.test.performance.*; -import org.eclipse.ui.*; - -public class OpenManifestEditorPerfTest extends PerformanceTestCase { - - public static Test suite() { - return new TestSuite(OpenManifestEditorPerfTest.class); - } - - public void testOpen() throws Exception { - tagAsGlobalSummary("Open Plug-in Editor", Dimension.CPU_TIME); //$NON-NLS-1$ - IWorkbenchPage page= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - IPluginModelBase model = PDECore.getDefault().getModelManager().findPlugin("org.eclipse.jdt.ui", null, IMatchRules.NONE); - assertFalse("org.eclipse.jdt.ui model does not exist", model == null); - model.setEnabled(true); - - for (int i = 0; i < 20; i++) { - startMeasuring(); - ManifestEditor.openPluginEditor("org.eclipse.jdt.ui"); //$NON-NLS-1$ - stopMeasuring(); - page.closeAllEditors(false); - } - commitMeasurements(); - assertPerformance(); - } - -}
diff --git a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/PluginsViewPerfTest.java b/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/PluginsViewPerfTest.java deleted file mode 100644 index 195b79f..0000000 --- a/ui/org.eclipse.pde.ui.tests/src/org/eclipse/pde/ui/tests/performance/parts/PluginsViewPerfTest.java +++ /dev/null
@@ -1,26 +0,0 @@ -package org.eclipse.pde.ui.tests.performance.parts; - -import junit.framework.*; - -import org.eclipse.pde.internal.ui.*; -import org.eclipse.test.performance.*; -import org.eclipse.ui.*; - - -public class PluginsViewPerfTest extends PerformanceTestCase { - - public static Test suite() { - return new TestSuite(PluginsViewPerfTest.class); - } - - public void testOpen() throws Exception { - tagAsGlobalSummary("Open Plug-ins View", Dimension.CPU_TIME); //$NON-NLS-1$ - IWorkbenchPage page= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - startMeasuring(); - page.showView(PDEPlugin.PLUGINS_VIEW_ID); - stopMeasuring(); - commitMeasurements(); - assertPerformance(); - } - -}