Author: mareshkau
Date: 2010-09-16 09:03:25 -0400 (Thu, 16 Sep 2010)
New Revision: 24960
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/ValidatorTest.java
Log:
Half automatic junit test for JBIDE-7021
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/ValidatorTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/ValidatorTest.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/ValidatorTest.java 2010-09-16
13:03:25 UTC (rev 24960)
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import java.io.IOException;
+import java.util.Date;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.editor.util.VpeDebugUtil;
+import org.jboss.tools.vpe.ui.test.ProjectsLoader;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ *
+ * Simple half-automatic validator test
+ * @author mareshkau
+ *
+ */
+public class ValidatorTest extends VpeTest{
+
+ public ValidatorTest(String name) {
+ super(name);
+ }
+
+ public void testValidationTime() throws IOException, CoreException{
+ IProject project =
ProjectsLoader.getInstance().getProject(JsfAllTests.IMPORT_PROJECT_NAME);
+ //wait wile import project job finished
+ TestUtil.waitForIdle(2000);
+ long startValidationTime = (new Date()).getTime();
+ ValidationFramework.getDefault().validate(new IProject[] { project },
+ false, false, new NullProgressMonitor());
+ //wait while validation job starts
+ TestUtil.delay(200);
+ TestUtil.waitForJobs();
+ VpeDebugUtil.debugInfo("Validation time was "+((new
Date()).getTime()-startValidationTime)/1000.0+"sec");
//$NON-NLS-1$//$NON-NLS-2$
+ }
+
+}
Show replies by date