Author: dgolovin
Date: 2007-09-17 19:16:09 -0400 (Mon, 17 Sep 2007)
New Revision: 3667
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
Log:
fix JUnit tests errors
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 2007-09-17
23:15:52 UTC (rev 3666)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2007-09-17
23:16:09 UTC (rev 3667)
@@ -21,6 +21,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
@@ -46,6 +47,7 @@
import org.jboss.tools.seam.ui.views.actions.ScopePresentationActionProvider;
import
org.jboss.tools.seam.ui.views.actions.SeamViewLayoutActionGroup.SeamContributionItem;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
/**
@@ -66,12 +68,11 @@
RedHat4WebPerspectiveFactory.PERSPECTIVE_ID,
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow());
TestProjectProvider provider=null;
- try {
- provider = new TestProjectProvider("org.jboss.tools.seam.ui.test", null,
"TestComponentView", true);
- } catch (Exception e1) {
- JUnitUtils.fail("Cannot create Project Provider", e1);
- }
- project = provider.getProject();
+ project =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("TestComponentView");
+
+ if(project==null) {
+ project =
ResourcesUtils.importProject(Platform.getBundle("org.jboss.tools.seam.ui.test"),
"/projects/TestComponentView", new NullProgressMonitor());
+ }
componentsFile = project.getFile("WebContent/WEB-INF/components.xml");
assertTrue("Cannot find components.xml in test project", componentsFile !=
null && componentsFile.exists());
}
@@ -79,8 +80,6 @@
public void testAddComponentInXmlFile(){
SeamCorePlugin.getSeamProject(project, true);
- refreshProject(project);
-
CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
@@ -578,14 +577,6 @@
System.out.println("Refresh project "+count);
try {
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-// waitForJobs();
-// try {
-// waitForJob();
-// } catch (InterruptedException e) {
-// JUnitUtils.fail(e.getMessage(),e);
-// }
-// project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
- //waitForJobs();
try {
waitForJob();
} catch (InterruptedException e) {