Author: dgolovin
Date: 2008-12-04 13:25:40 -0500 (Thu, 04 Dec 2008)
New Revision: 12286
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java
Log:
Fix JUnitErrors in JDTuiAllTests -
"org.eclipse.core.internal.resources.ResourceException: Problems encountered while
deleting resources."
new method deleteIProject( boolean) was added to SimpleTestProject class to control
content deletion for test projects.
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java 2008-12-04
18:00:56 UTC (rev 12285)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/SimpleTestProject.java 2008-12-04
18:25:40 UTC (rev 12286)
@@ -85,6 +85,15 @@
}
+ public void deleteIProject(boolean deleteContent) {
+ try {
+ project.delete(deleteContent, true, null);
+ } catch (CoreException ce) {
+ throw new RuntimeException(ce);
+ }
+
+ }
+
protected void buildSimpleTestProject() throws JavaModelException, CoreException,
IOException {
project = buildNewProject(projectName);
javaProject = buildJavaProject(project);
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java 2008-12-04
18:00:56 UTC (rev 12285)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java 2008-12-04
18:25:40 UTC (rev 12286)
@@ -20,6 +20,8 @@
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
@@ -126,8 +128,18 @@
@Override
protected void tearDown() throws Exception {
ccfg.reset();
- super.tearDown();
waitForJobs();
+
+ // This code overrides super method to handle error during deleting project with
contents.
+ // A deletion of content isn't really necessary because project name is unique
+ IEditorPart editorPart =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeEditor(editorPart,
false);
+
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(
+ PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.ui.resourcePerspective"));
//$NON-NLS-1$
+
+ getProject().deleteIProject(false);
+ waitForJobs();
}
public void testHQLDetector() throws JavaModelException {
Show replies by date