[jbosstools-commits] JBoss Tools SVN: r17446 - branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Sep 3 13:25:50 EDT 2009


Author: mareshkau
Date: 2009-09-03 13:25:50 -0400 (Thu, 03 Sep 2009)
New Revision: 17446

Modified:
   branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
Log:
Fix for VPE failing junit tests

Modified: branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
--- branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java	2009-09-03 16:50:05 UTC (rev 17445)
+++ branches/jbosstools-3.1.0.M3/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java	2009-09-03 17:25:50 UTC (rev 17446)
@@ -180,7 +180,19 @@
 		controller.getVisualBuilder().setShowInvisibleTags(true);
 		controller.visualRefresh();
 
-		TestUtil.waitForIdle();
+//		TestUtil.waitForIdle();
+		//added by Maksim Areshkau, when some non VPE background job 
+		//TestUtil.waitForIdle() can be throw exception in time when vpe works normally
+		long start = System.currentTimeMillis();
+		visualElement = findElementById(controller, elementId);
+		while (visualElement==null) {
+			TestUtil.delay(500);
+			if ( (System.currentTimeMillis()-start) > TestUtil.MAX_IDLE) {
+			throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
+			}
+			visualElement = findElementById(controller, elementId);
+		}
+		
 
 		// find visual element and check if it is not null
 		visualElement = findElementById(controller, elementId);



More information about the jbosstools-commits mailing list