Author: yradtsevich
Date: 2010-02-24 08:18:09 -0500 (Wed, 24 Feb 2010)
New Revision: 20470
Modified:
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ProjectsLoader.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5837
Make possible to run VPE JUnit tests one by one
- Struts VPE test are being failed on Hudson. Code to show full log has been added.
Modified:
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java
===================================================================
---
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java 2010-02-24
13:16:28 UTC (rev 20469)
+++
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java 2010-02-24
13:18:09 UTC (rev 20470)
@@ -10,7 +10,12 @@
******************************************************************************/
package org.jboss.tools.struts.vpe.struts.test;
+import java.util.HashMap;
+
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.vpe.ui.test.ProjectsLoader;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
@@ -50,7 +55,35 @@
}
public void testImage() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/image.jsp",
IMPORT_PROJECT_NAME)); //$NON-NLS-1$
+ /*
+ * XXX temporary code is used to debug Struts tests on Hudson.
+ * It must be removed when the problem with the failing tests is resolved.
+ */
+ StringBuilder debugInfo = new StringBuilder();
+ debugInfo.append("projectNameToPath = ")
+ .append(ProjectsLoader.getInstance().getProjectNameToPath())
+ .append(";\n");
+
+ IProject project = ProjectsLoader.getInstance().getProject(IMPORT_PROJECT_NAME);
+ assertNotNull(debugInfo.toString(), project);
+ debugInfo.append("project = ").append(project).append(";\n")
+ .append("project.exists() =
").append(project.exists()).append(";\n")
+ .append("project.isOpen() =
").append(project.isOpen()).append(";\n");
+
+ IFolder folder = project.getFolder("WebContent/pages");
+ assertNotNull(debugInfo.toString(), folder);
+ debugInfo.append("folder = ").append(folder).append(";\n")
+ .append("folder.exists() =
").append(folder.exists()).append(";\n");
+
+ IFile testFile = (IFile) folder.findMember("components/html/image.jsp");
+ assertNotNull(debugInfo.toString(), testFile);
+ debugInfo.append("testFile = ").append(folder).append(";\n")
+ .append("testFile.exists() =
").append(testFile.exists()).append(";\n");
+
+ performTestForVpeComponent(testFile);
+ fail(debugInfo.toString());
+
+ //
performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/image.jsp",
IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testImg() throws Throwable {
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ProjectsLoader.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ProjectsLoader.java 2010-02-24
13:16:28 UTC (rev 20469)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ProjectsLoader.java 2010-02-24
13:18:09 UTC (rev 20470)
@@ -168,4 +168,13 @@
removeProject(project);
}
}
+
+ /*
+ * XXX This temporary method is used to debug Struts tests on Hudson.
+ * It must be removed when the problem with the failing tests is resolved.
+ */
+ @Deprecated
+ public Map<String, String> getProjectNameToPath() {
+ return projectNameToPath;
+ }
}