Author: dgolovin
Date: 2008-10-14 15:14:10 -0400 (Tue, 14 Oct 2008)
New Revision: 10838
Removed:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java
trunk/common/tests/org.jboss.tools.common.test/META-INF/MANIFEST.MF
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/converter/OpenTagLib.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTestSetup.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java
Log:
fix test project import/deletion
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -24,9 +24,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.rules.IToken;
@@ -37,7 +34,6 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
import org.jboss.tools.common.text.ext.ExtensionsPlugin;
-import org.jboss.tools.common.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
import org.jboss.tools.common.text.ext.util.CSSTextScanner;
import org.jboss.tools.common.text.ext.util.RegionHolder;
@@ -282,10 +278,10 @@
for (int i = 0; list != null && i < list.getLength(); i++) {
IDOMNode element = (IDOMNode)list.item(i);
- String axis = JSPRootHyperlinkPartitioner.computeAxis(getDocument(),
element.getStartOffset());
- axis = axis.toLowerCase();
+ //String axis = JSPRootHyperlinkPartitioner.computeAxis(getDocument(),
element.getStartOffset());
+ //axis = axis.toLowerCase();
- if (axis.endsWith("/link")) {
+ if ("link".equals(element.getNodeName())) {
Node relAttr = element.getAttributes().getNamedItem("rel");
if (relAttr != null) {
String val = relAttr.getNodeValue().toLowerCase();
@@ -298,7 +294,7 @@
}
}
- if (axis.endsWith("/style")) {
+ if ("link".equals(element.getNodeName())) {
// String value = element.getNodeValue();
styleLinks.add(element);
}
Modified:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -5,6 +5,8 @@
import java.net.URL;
import java.util.List;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -18,11 +20,9 @@
import org.eclipse.jdt.core.JavaCore;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.test.util.TestProjectProvider;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
import org.osgi.framework.Bundle;
-import junit.framework.TestCase;
-
/**
* Automatic test for JBIDE-1811.
* Checks that EclipseResourceUtil.getClassPath(IProject)
@@ -53,7 +53,7 @@
project1.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
project2.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
IJavaProject jp = JavaCore.create(project2);
IClasspathEntry[] es = jp.getRawClasspath();
@@ -70,7 +70,7 @@
jp.setRawClasspath(esn, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
public void testGetClassPath() throws CoreException, IOException {
Modified: trunk/common/tests/org.jboss.tools.common.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/META-INF/MANIFEST.MF 2008-10-14
18:50:05 UTC (rev 10837)
+++ trunk/common/tests/org.jboss.tools.common.test/META-INF/MANIFEST.MF 2008-10-14
19:14:10 UTC (rev 10838)
@@ -8,7 +8,8 @@
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.junit,
- org.jboss.tools.common
+ org.jboss.tools.common,
+ org.jboss.tools.tests;bundle-version="2.0.0"
Provide-Package: org.jboss.tools.common.test.util
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.common.reporting.test,
Modified:
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -10,30 +10,25 @@
******************************************************************************/
package org.jboss.tools.common.test.util;
-import java.io.File;
import java.io.IOException;
-import java.net.URL;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
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;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.jboss.tools.common.test.CommonAllTests;
import org.jboss.tools.common.util.FileUtil;
-import org.osgi.framework.Bundle;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
/**
* Test plugins may define test projects to be added
@@ -59,80 +54,36 @@
* @throws Exception
*/
public TestProjectProvider(String bundleName, String projectPath, String name, boolean
makeCopy) throws CoreException {
- if(projectPath == null) {
- projectPath = "/projects/" + name;
- } else if(name == null) {
- name = projectPath.substring(projectPath.lastIndexOf('/')+1);
+ try {
+ if( null == projectPath ) {
+ project = ResourcesUtils.importProject(bundleName, "projects" +
Path.SEPARATOR + name, null);
+ } else {
+ project = ResourcesUtils.importProject(bundleName, projectPath, null);
+ }
+ } catch (IOException e) {
+ throw new CoreException(new Status(Status.ERROR,bundleName,e.getMessage(),e));
+ } catch (InvocationTargetException e) {
+ throw new CoreException(new Status(Status.ERROR,bundleName,e.getMessage(),e));
+ } catch (InterruptedException e) {
+ throw new CoreException(new Status(Status.ERROR,bundleName,e.getMessage(),e));
}
- this.makeCopy = makeCopy;
- init(bundleName, projectPath, name);
}
public IProject getProject() {
return project;
}
- private void init(String bundleName, String projectPath, String name) throws
CoreException {
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- if(p.exists()) {
- project = p;
- if(!p.isOpen()) {
- project.open(new NullProgressMonitor());
- System.out.println("open");
- }
- return;
- }
-
- Bundle bundle = Platform.getBundle(bundleName);
- URL url = null;
- try {
- url = FileLocator.resolve(bundle.getEntry(projectPath));
- } catch (IOException e) {
- String msg = "Cannot find project " + name + " in " + bundleName;
- IStatus status = new Status(IStatus.ERROR, CommonAllTests.PLUGIN_ID, msg, e);
- throw new CoreException(status);
- }
- String location = url.getFile();
- if(makeCopy) {
- IPath root = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- File destination = new File(root.toFile(), name);
- FileUtil.copyDir(new File(location), destination, true);
- importExistingProject(p, destination.getAbsolutePath(), name);
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new
NullProgressMonitor());
- } else {
- importExistingProject(p, location, name);
- }
- if(p.exists()) {
- project = p;
- }
- }
-
- static void importExistingProject(IProject project, String location, String name) throws
CoreException {
- IPath path = new Path(location).append(".project");
- IProjectDescription description =
ResourcesPlugin.getWorkspace().loadProjectDescription(path);
- description.setName(name);
- try {
- project.create(description, new NullProgressMonitor());
- project.open(IResource.BACKGROUND_REFRESH, new NullProgressMonitor());
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new
NullProgressMonitor());
- } catch (Exception e) {
- throw new RuntimeException("Cannot create project " + name + " from
" + location, e);
- }
- }
-
public void dispose() throws CoreException {
if(project == null || !project.exists()) return;
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IPath loc = project.getLocation();
- project.close(new NullProgressMonitor());
- project.delete(false, true, new NullProgressMonitor());
- if(makeCopy) {
- FileUtil.remove(loc.toFile());
- }
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new
NullProgressMonitor());
- }
- }, new NullProgressMonitor());
+ boolean oldAutoBuilding = true;
+ try {
+ oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
+ project.delete(true, null);
+ JobUtils.waitForIdle();
+ } finally {
+ ResourcesUtils.setBuildAutomatically(oldAutoBuilding);
+ }
}
TestDescriptionFactory tests = null;
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
===================================================================
---
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2008-10-14
19:14:10 UTC (rev 10838)
@@ -15,11 +15,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.jboss.tools.common.verification.verifybuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
Deleted:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp
===================================================================
---
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp 2008-10-14
19:14:10 UTC (rev 10838)
@@ -1,2 +0,0 @@
-<jsp:forward
page="forward/forwardHiperlinkPage2Tests.jsp"></jsp:forward>
-<jsp:forward page="forwardHiperlinkPage1Tests.jsp"></jsp:forward>
\ No newline at end of file
Deleted:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp
===================================================================
---
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp 2008-10-14
19:14:10 UTC (rev 10838)
@@ -1,2 +0,0 @@
-<jsp:forward
page="include/includeHiperlinkPage2Tests.jsp"></jsp:forward>
-<jsp:forward page="includeHiperlinkPage1Tests.jsp"></jsp:forward>
\ No newline at end of file
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/converter/OpenTagLib.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/converter/OpenTagLib.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/converter/OpenTagLib.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -25,18 +25,19 @@
if(uri.length() == 0) return JSFUIMessages.URI_ISNOT_SPECIFIED;
XModelObject t = findTagLib(model, uri);
if(t == null) return NLS.bind(JSFUIMessages.CANNOT_FIND_TAG_LIBRARY, uri);
+ FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
if(tag != null) {
if(tag.length() == 0) return JSFUIMessages.TAG_ISNOT_SPECIFIED;
t = findTag(t, tag);
if(t == null) return NLS.bind(JSFUIMessages.CANNOT_FIND_TAG_IN_LIBRARY, tag, uri);
+ FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
}
- FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
if(attribute != null) {
if(attribute.length() == 0) return JSFUIMessages.ATTRIBUTE_ISNOT_SPECIFIED;
t = findAttribute(t, attribute);
if(t == null) return NLS.bind(JSFUIMessages.CANNOT_FIND_ATTRIBUTE_IN_TAG, attribute,
tag);
+ FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
}
- FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
return null;
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -33,13 +33,11 @@
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
-import org.jboss.tools.common.model.XJob;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.util.AxisUtil;
import org.jboss.tools.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner;
-import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class ELExprPartitionerTest extends TestCase {
TestProjectProvider provider = null;
@@ -72,8 +70,9 @@
}
public void testELExprPartitioner() {
- try { EditorTestHelper.joinBackgroundActivities(); }
- catch (Exception e) {
+ try {
+ JobUtils.waitForIdle();
+ } catch (Exception e) {
assertNull("An exception caught: " + e.getMessage(), e);
}
assertTrue("Test project \"" + PROJECT_NAME + "\" is not
loaded", (project != null));
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -18,7 +18,7 @@
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class ContentAssistantTestCase extends TestCase {
protected IProject project = null;
@@ -31,7 +31,7 @@
protected void openEditor(String fileName) {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
@@ -61,7 +61,7 @@
// Delay for 3 seconds so that
// the Favorites view can be seen.
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();;
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -6,7 +6,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -15,7 +14,7 @@
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JsfJspJbide1704Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -52,7 +51,7 @@
public void testJsfJspJbide1704 () {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -8,11 +8,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JsfJspJbide1717Test extends ContentAssistantTestCase {
@@ -90,7 +89,7 @@
assertFalse("Content Assistant returned no proposals of type
CustomCompletionProposal.",customCompletionProposals.isEmpty());
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -14,7 +14,7 @@
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JsfJspJbide2437Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -51,7 +51,7 @@
public void testJsfJspJbide2437 () {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -6,11 +6,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JstJspJbide1641Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -98,7 +97,7 @@
assertTrue("The proposal to apply not found.", bPropoosalToApplyFound);
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -9,11 +9,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JstJspJbide1759Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -51,7 +50,7 @@
public void testJstJspJbide1641() {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
@@ -107,7 +106,7 @@
assertFalse("Content Assistant returned no proposals of type
CustomCompletionProposal.",customCompletionProposals.isEmpty());
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -6,10 +6,9 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class StrutsJspJbide1648Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -45,7 +44,7 @@
public void testStrutsJspJbide1648() {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -47,7 +47,6 @@
}
public void testJsfBeanPropertyList() {
- waitForJobs();
// seam beans list
List beanList = webPromptingProvider.getList(projectModel,
WebPromptingProvider.JSF_BEAN_PROPERTIES, "facesManagedBean", new
Properties());
assertTrue("Bean property list does not contain Managed bean property in
XModel.", beanList.contains("property1"));
@@ -61,17 +60,8 @@
List bundlePropertyList = webPromptingProvider.getList(projectModel,
WebPromptingProvider.JSF_BUNDLE_PROPERTIES,
"org.jboss.seam.example.numberguess.test", null);
assertTrue("Bundle property list does not contain expected property in
XModel.", bundlePropertyList.contains("bundleProperty1"));
}
-
- void waitForJobs() {
- try {
- XJob.waitForJob();
- } catch (InterruptedException e) {
- fail("Interrupted");
- }
- }
public void testTlds() {
- waitForJobs();
List tldList = webPromptingProvider.getList(projectModel,
WebPromptingProvider.JSF_GET_TAGLIBS, "", null);
assertTrue("TLD list does not contain expected TLD in XModel.",
tldList.contains("http://jboss.com/products/seam/taglib"));
}
@@ -81,7 +71,6 @@
project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, null);
project.build(IncrementalProjectBuilder.FULL_BUILD,null);
- waitForJobs();
XModelObject xmo = EclipseResourceUtil.getObjectByResource(project);
assertNotNull("Can't get XModel Object for test project.", xmo);
projectModel = xmo.getModel();
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -21,8 +21,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.jboss.tools.common.model.XJob;
-import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -52,7 +50,6 @@
import org.jboss.tools.seam.internal.core.scanner.lib.LibraryScanner;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
public class ScannerTest extends TestCase {
IProject project = null;
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -16,6 +16,8 @@
import java.util.List;
import java.util.Set;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IncrementalProjectBuilder;
@@ -28,11 +30,9 @@
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
import org.osgi.framework.Bundle;
-import junit.framework.TestCase;
-
/**
* Test checks that loading Seam model does not depend as N*N on the number of components
N.
* It works as follows:
@@ -58,7 +58,7 @@
File template = getTemplateFile();
SeamBigProjectGenerator g = new SeamBigProjectGenerator();
g.generate(folder, template);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
//To ensure that the project is built.
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
}
@@ -121,7 +121,7 @@
ISeamProject sp = getSeamProject();
SeamProject impl = (SeamProject)sp;
if(impl != null) impl.clearStorage();
- EditorTestHelper.joinJobs(1000, 10000, 500);
+ JobUtils.waitForIdle();
provider.dispose();
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.seam.core.test;
-import java.lang.reflect.InvocationTargetException;
-
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
@@ -19,17 +17,11 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.refactoring.RenameSupport;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
/**
* @author V.Kabanovich
@@ -58,14 +50,13 @@
projectWAR.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
projectEJB.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
private ISeamProject getSeamProject(IProject project) throws CoreException {
project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
-
+ JobUtils.waitForIdle();
ISeamProject seamProject = null;
/*
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -15,8 +15,8 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
@@ -59,8 +59,8 @@
pref.put(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE,
"invalidConnectionName");
pref.flush();
- EditorTestHelper.joinBackgroundActivities();
- EditorTestHelper.runEventQueue(2000);
+ JobUtils.waitForIdle();
+ JobUtils.delay(2000);
}
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -16,7 +16,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -31,8 +30,9 @@
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.validation.ISeamValidator;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
public class SeamValidatorsTest extends AbstractResourceMarkerTest {
@@ -57,18 +57,20 @@
project = setup.importProject();
}
this.project = project.getProject();
- this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
public void tearDown() throws Exception {
- if(project != null){
-// project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
- project.close(new NullProgressMonitor());
- project.delete(true, new NullProgressMonitor());
- project = null;
- EditorTestHelper.joinBackgroundActivities();
+ boolean autoBuild = ResourcesUtils.setBuildAutomatically(false);
+ try {
+ if(project != null){
+ JobUtils.waitForIdle();
+ project.delete(true, new NullProgressMonitor());
+ project = null;
+ JobUtils.waitForIdle();
+ }
+ } finally {
+ ResourcesUtils.setBuildAutomatically(autoBuild);
}
}
@@ -123,13 +125,6 @@
public void testJiraJbide1631() throws CoreException {
// Test for
http://jira.jboss.com/jira/browse/JBIDE-1631
IFile jbide1631XHTMLFile = project.getFile("WebContent/JBIDE-1631.xhtml");
- IFile jbide1631XHTMLFileWithFoo =
project.getFile("WebContent/JBIDE-1631.1");
- try{
- jbide1631XHTMLFile.setContents(jbide1631XHTMLFileWithFoo.getContents(), true, false,
new NullProgressMonitor());
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'JBIDE-1631.xhtml' content to "
+
- "'JBIDE-1631.1'", ex);
- }
refreshProject(project);
assertMarkerIsCreated(jbide1631XHTMLFile, null, "\"foo1\" cannot be
resolved", 16 );
assertMarkerIsCreated(jbide1631XHTMLFile, null, "\"foo2\" cannot be
resolved", 16 );
@@ -848,10 +843,8 @@
}
private void refreshProject(IProject project){
- waitForJob();
+ JobUtils.delay(1000);
+ JobUtils.waitForIdle();
+ JobUtils.delay(500);
}
-
- public static void waitForJob() {
- EditorTestHelper.joinJobs(1000,10000,500);
- }
}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -4,6 +4,8 @@
import java.util.Properties;
import java.util.Set;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -21,12 +23,10 @@
import org.jboss.tools.seam.internal.core.SeamXmlComponentDeclaration;
import org.jboss.tools.seam.internal.core.SeamXmlFactory;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.w3c.dom.Element;
-import junit.framework.TestCase;
-
public class SerializationTest extends TestCase {
IProject project = null;
boolean makeCopy = true;
@@ -39,7 +39,7 @@
project = ResourcesUtils.importProject(
"org.jboss.tools.seam.core.test","/projects/TestScanner" , new
NullProgressMonitor());
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
protected void tearDown() throws Exception {
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -52,9 +52,9 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
* @author Alexey Kazakov
@@ -110,7 +110,7 @@
private ISeamProject loadSeamProject(IProject project) throws CoreException {
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
assertNotNull("Seam project for " + project.getName() + " is null",
seamProject);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
return seamProject;
}
@@ -296,7 +296,7 @@
JUnitUtils.fail("Exception during perform folder renaming: " + folderPath,
e);
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
IPath path = new Path(folderPath);
String newFolderPath = path.removeLastSegments(1).append(newFolderName).toString();
@@ -370,7 +370,7 @@
} catch (InvocationTargetException e) {
JUnitUtils.fail("Rename failed", e);
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
private IFolder moveFolder(String folderPath, String destinationFolderPath) throws
CoreException {
@@ -423,7 +423,7 @@
JUnitUtils.fail("Exception during perform folder moving: " + folderPath,
e);
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
String newFolderPath =
destination.getFullPath().append(resource.getName()).toString();
resource = ResourcesPlugin.getWorkspace().getRoot().findMember(newFolderPath);
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -6,12 +6,11 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class SeamELContentAssistJbide1645Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -83,7 +82,7 @@
}
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -26,7 +26,7 @@
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class SeamELContentAssistJbide1676Test extends TestCase {
TestProjectProvider provider = null;
@@ -224,7 +224,7 @@
public void testSeamELContentAssistJbide1676() {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
@@ -256,7 +256,7 @@
// Delay for 3 seconds so that
// the Favorites view can be seen.
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -18,7 +18,6 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
@@ -29,10 +28,8 @@
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
-import sun.management.counter.Units;
-
public class SeamELContentAssistTest extends ContentAssistantTestCase {
TestProjectProvider provider = null;
boolean makeCopy = false;
@@ -78,7 +75,7 @@
}catch(Exception e){
JUnitUtils.fail("Error during changing
'TestComponentForVarAttributes.java' content to
'TestComponentForVarAttributes.1'", e);
}
- EditorTestHelper.joinJobs(1000,10000,500);
+ JobUtils.waitForIdle();
checkProposals("/WebContent/varAttributes.xhtml", 458, new
String[]{"test.name"}, false);
checkProposals("/WebContent/varAttributes.xhtml", 640, new
String[]{"item.name"}, false);
@@ -88,7 +85,7 @@
}catch(Exception e){
JUnitUtils.fail("Error during changing
'TestComponentForVarAttributes.java' content to
'TestComponentForVarAttributes.2'", e);
}
- EditorTestHelper.joinJobs(1000,10000,500);
+ JobUtils.waitForIdle();
}
private static final String[] VALID_SEAM_EL_PROPOSALS = new String[] {
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -31,8 +31,8 @@
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.util.AxisUtil;
import org.jboss.tools.seam.text.ext.hyperlink.SeamViewHyperlinkPartitioner;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
public class SeamViewHyperlinkPartitionerTest extends TestCase {
@@ -63,7 +63,7 @@
public void testSeamViewPartitioner() throws CoreException {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
assertTrue("Test project \"" + PROJECT_NAME + "\" is not
loaded", (project != null));
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -33,8 +33,8 @@
import org.jboss.tools.seam.ui.preferences.SeamPreferencesMessages;
import org.jboss.tools.seam.ui.preferences.SeamSettingsPreferencePage;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.osgi.framework.Bundle;
/**
@@ -58,7 +58,7 @@
assertNotNull(PROJECT_NAME + " project is not imported.", project);
this.project = project.getProject();
this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
public void testSettingsPage() throws Exception {
@@ -99,7 +99,7 @@
dialog.close();
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
assertNotNull("Can't load seam project. It seems seam nature was not added to
rpoject by seam settings page.", seamProject);
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -36,7 +36,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.navigator.CommonNavigator;
-import org.jboss.tools.jst.web.ui.WebDevelopmentPerspectiveFactory;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -44,8 +43,8 @@
import org.jboss.tools.seam.ui.SeamPerspectiveFactory;
import
org.jboss.tools.seam.ui.views.actions.SeamViewLayoutActionGroup.SeamContributionItem;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
*
@@ -73,7 +72,7 @@
assertTrue("Cannot find components.xml in test project", componentsFile !=
null && componentsFile.exists());
this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
public void testAddComponentInXmlFile() throws CoreException{
@@ -155,7 +154,7 @@
seamPackage = findSeamPackage(tree, "myPackage");
assertTrue("Expected package 'myPackage' was not found it tree",
seamPackage!=null);
- EditorTestHelper.runEventQueue(1000);
+ JobUtils.delay(1000);
component = findSeamComponent(seamPackage, "myPackage.myTextComponent");
assertTrue("Expected component 'myPackage.myTextComponent' not found
" +
"after renaming",component!=null);
@@ -175,7 +174,7 @@
navigator.getCommonViewer().expandAll();
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
seamPackage = findSeamPackage(tree, "myNewPackage");
assertTrue("Expected package 'myNewPackage' was not found it tree after
" +
@@ -191,7 +190,7 @@
CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
Tree tree = navigator.getCommonViewer().getTree();
ISeamPackage seamPackage = findSeamPackage(tree, "myNewPackage");
@@ -538,7 +537,7 @@
System.out.println("Refresh project "+count);
try {
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (CoreException e) {
JUnitUtils.fail("Cannot build test Project", e);
break;
@@ -547,7 +546,7 @@
count++;
if(count > NUMBER_OF_REFRESHES) break;
}
- EditorTestHelper.runEventQueue(1000);
+ JobUtils.delay(1000);
}
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTestSetup.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTestSetup.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTestSetup.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -17,9 +17,9 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.jst.web.ui.WebDevelopmentPerspectiveFactory;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
* @author eskimo
@@ -45,16 +45,16 @@
WorkbenchUtils.getWorkbench().showPerspective(
WebDevelopmentPerspectiveFactory.PERSPECTIVE_ID,
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
project =
ResourcesUtils.importProject(Platform.getBundle("org.jboss.tools.seam.ui.test"),
"/projects/TestComponentView", new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
/* (non-Javadoc)
* @see junit.extensions.TestSetup#tearDown()
*/
protected void tearDown() throws Exception {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();;
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
try {
project.delete(true,true, null);
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -52,7 +52,7 @@
import org.jboss.tools.seam.ui.wizard.SeamEntityWizard.SeamEntityCreateOperation;
import org.jboss.tools.seam.ui.wizard.SeamFormWizard.SeamFormCreateOperation;
import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
import org.osgi.service.prefs.BackingStoreException;
abstract public class AbstractSeamNewOperationTest extends AbstractSeamFacetTest {
@@ -86,11 +86,11 @@
protected void setUp() throws Exception {
super.setUp();
try {
- EditorTestHelper.joinBackgroundActivities(); }
- catch (Exception e) {
+ JobUtils.waitForIdle();
+ } catch (Exception e) {
JUnitUtils.fail(e.getMessage(), e);
}
- EditorTestHelper.runEventQueue(3000);
+ JobUtils.delay(3000);
}
abstract protected IProject getProject();
@@ -121,7 +121,7 @@
protected ISeamProject loadSeamProject(IProject project) throws CoreException {
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
assertNotNull("Seam project for " + project.getName() + " is null",
seamProject);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
return seamProject;
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -14,17 +14,15 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog;
import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog.SeamComponentWrapper;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
* @author Daniel Azarov
@@ -50,19 +48,19 @@
this.project = project.getProject();
this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
@Override
protected void tearDown() throws Exception {
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
if(project != null){
project.close(new NullProgressMonitor());
project.delete(true, new NullProgressMonitor());
project = null;
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
} finally {
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
@@ -95,7 +93,7 @@
dialog.beginTest();
if(wait){
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}catch(Exception ex){
ex.printStackTrace();
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -23,8 +23,9 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.ui.wizard.IParameter;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.WorkbenchUtils;
public class Seam12EARNewOperationTest extends AbstractSeamNewOperationTest {
@@ -59,7 +60,7 @@
createSeamEarProject(SEAM_EAR_PROJECTNAME);
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
JUnitUtils.fail(e.getMessage(), e);
}
@@ -88,7 +89,7 @@
}
protected void tearDown() throws Exception {
- EditorTestHelper.closeAllEditors();
+ WorkbenchUtils.closeAllEditors();
super.tearDown();
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -24,8 +24,9 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.ui.wizard.IParameter;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.WorkbenchUtils;
public class Seam12WARNewOperationTest extends AbstractSeamNewOperationTest {
private static final String SEAM_WAR_PROJECTNAME = "seam_war";
@@ -53,7 +54,7 @@
createSeamWarProject(SEAM_WAR_PROJECTNAME);
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
JUnitUtils.fail(e.getMessage(), e);
}
@@ -74,7 +75,7 @@
protected void tearDown() throws Exception {
- EditorTestHelper.closeAllEditors();
+ WorkbenchUtils.closeAllEditors();
super.tearDown();
Modified:
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java
===================================================================
---
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -26,7 +26,7 @@
import org.jboss.tools.common.model.ui.texteditors.XMLTextEditorComponent;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class StrutsJbide1762Test extends TestCase {
TestProjectProvider provider = null;
@@ -61,7 +61,7 @@
public void testStrutsJbide1762 () {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
@@ -93,7 +93,7 @@
// Delay for 3 seconds so that
// the Favorites view can be seen.
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
@@ -141,7 +141,7 @@
}
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -19,7 +19,6 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
* @author eskimo
@@ -55,9 +54,9 @@
public IProject[] importProjects() throws Exception {
IProject[] projects = new IProject[projectPaths.length];
for (int i = 0; i < projectPaths.length; i++) {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
projects[i] = (IProject)ResourcesUtils.importProject(bundleName, projectPaths[i]);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
return projects;
}
@@ -71,7 +70,7 @@
} catch (ResourceException e) {
JUnitUtils.fail(e.getMessage(), e);
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
return result;
}
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -100,4 +100,8 @@
}
return part;
}
+
+ public static void closeAllEditors() {
+ getWorkbenchActivePage().closeAllEditors(false);
+ }
}
\ No newline at end of file
Modified:
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java
===================================================================
---
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java 2008-10-14
18:50:05 UTC (rev 10837)
+++
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java 2008-10-14
19:14:10 UTC (rev 10838)
@@ -60,7 +60,6 @@
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
public abstract class AbstractJBossWSCommandTest extends TestCase {
@@ -110,15 +109,19 @@
createServer(JBOSS_RUNTIME_42, JBOSS_SERVER_42, JBOSS_AS_42_HOME,
"default");
- try { EditorTestHelper.joinBackgroundActivities(); }
- catch (Exception e) { JUnitUtils.fail(e.getMessage(), e); }
- EditorTestHelper.runEventQueue(3000);
+ try {
+ JobUtils.waitForIdle();
+ } catch (Exception e) {
+ JUnitUtils.fail(e.getMessage(), e);
+ }
+
+ JobUtils.delay(3000);
}
public IProject createProject(String prjName) throws CoreException {
provider = new TestProjectProvider(BUNDLE,"/projects/"+prjName , prjName,
true);
IProject prj = provider.getProject();
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
return prj;
}