Author: vrubezhny
Date: 2009-05-20 15:14:13 -0400 (Wed, 20 May 2009)
New Revision: 15376
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
Log:
JBIDE-4342: JstWebAllTests/testTlds fails because of webpromptingprovider returning an
empty list
It seem that some TestCase from this suite invokes a new job or thread that doesn't
allow the TLD-testcase to be succeeded.
The magic with the WaitForIdle() utility and the re-ordering the testcases within the
suite are solved the problem on my comptuter. But this is the subject to perform the
testing on Hudson.
Modified: trunk/jst/tests/org.jboss.tools.jst.web.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.test/META-INF/MANIFEST.MF 2009-05-20 17:58:16
UTC (rev 15375)
+++ trunk/jst/tests/org.jboss.tools.jst.web.test/META-INF/MANIFEST.MF 2009-05-20 19:14:13
UTC (rev 15376)
@@ -9,7 +9,8 @@
org.junit,
org.jboss.tools.common.test,
org.eclipse.core.resources,
- org.jboss.tools.common.model
+ org.jboss.tools.common.model,
+ org.jboss.tools.tests;bundle-version="2.0.0"
Eclipse-LazyStart: true
Bundle-Vendor: %Bundle-Vendor.0
Export-Package: org.jboss.tools.jst.web.test
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 2009-05-20
17:58:16 UTC (rev 15375)
+++
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2009-05-20
19:14:13 UTC (rev 15376)
@@ -26,6 +26,7 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
+import org.jboss.tools.test.util.JobUtils;
public class WebContentAssistProviderTest extends TestCase {
@@ -39,6 +40,14 @@
return new TestSuite(WebContentAssistProviderTest.class);
}
+ public void testTlds() {
+ // Wait all the builders to finish
+ JobUtils.waitForIdle(2000);
+
+ 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"));
+ }
+
public void testJsfBeanPropertyList() {
// seam beans list
List beanList = webPromptingProvider.getList(projectModel,
WebPromptingProvider.JSF_BEAN_PROPERTIES, "facesManagedBean", new
Properties());
@@ -54,11 +63,6 @@
assertTrue("Bundle property list does not contain expected property in
XModel.", bundlePropertyList.contains("bundleProperty1"));
}
- public void testTlds() {
- 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"));
- }
-
public void setUp() throws Exception {
provider = new TestProjectProvider("org.jboss.tools.jst.web.test", null,
"TestsWebArtefacts", makeCopy);
project = provider.getProject();
@@ -70,6 +74,10 @@
Watcher.getInstance(projectModel).forceUpdate();
projectModel.update();
assertNotNull("Can't get XModel for test project.", projectModel);
+
+ // Wait all the builders to finish
+ JobUtils.waitForIdle(2000);
+
webPromptingProvider = WebPromptingProvider.getInstance();
}