Author: snjeza
Date: 2008-10-18 09:15:43 -0400 (Sat, 18 Oct 2008)
New Revision: 10951
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
Log:
Checking the hibernate tests.
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-18
01:27:10 UTC (rev 10950)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-18
13:15:43 UTC (rev 10951)
@@ -7,9 +7,12 @@
import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
@@ -45,6 +48,8 @@
private ConsoleConfiguration ccfg;
+ private boolean deleted;
+
public HibernateErrorsTest2(String name) {
super(name);
}
@@ -152,18 +157,23 @@
// super.tearDown();
- IProject proj = getProject().getIProject();
+ final IProject proj = getProject().getIProject();
String projRoot = proj.getLocation().toFile().getAbsolutePath();
File file = new File(projRoot);
- boolean deleted = true;
+ deleted = false;
int nTrys = 0;
- while (!deleted && nTrys++ < 5)
- try {
- proj.delete(true, true, null);
- deleted = true;
- } catch (ResourceException re) {
- waitForJobs();
- Thread.sleep(100);
+ while (!deleted && nTrys++ < 5) {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ try {
+ proj.delete(true, true, null);
+ deleted = true;
+ } catch (ResourceException re) {
+ //waitForJobs();
+ delay(1000);
+ }
+ }
+ }, new NullProgressMonitor());
}
waitForJobs();
delete(file);
@@ -203,8 +213,12 @@
buffer.append(file.getAbsolutePath());
buffer.append(" file. ");
if (file.exists() && file.isDirectory()) {
+ String[] files = file.list();
buffer.append("List=");
- buffer.append(file.list());
+ buffer.append(files);
+ buffer.append("-");
+ for (int i = 0; i < files.length; i++)
+ buffer.append(files[i]);
}
return buffer.toString();
}
Show replies by date