Author: akazakov
Date: 2009-06-15 15:02:01 -0400 (Mon, 15 Jun 2009)
New Revision: 15960
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
Fixed JUnit test failures.
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-06-15
18:59:03 UTC (rev 15959)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-06-15
19:02:01 UTC (rev 15960)
@@ -698,7 +698,7 @@
IFile abcComponentFile =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/AbcComponent.java");
refreshProject(project);
-
+
int number = getMarkersNumber(abcComponentXHTMLFile);
assertEquals("Problem marker was found in abcComponent.xhtml", 0, number);
@@ -843,15 +843,24 @@
}
JobUtils.waitForIdle();
int[] lineNumbers = getMarkersNumbersOfLine(duplicateJavaComponentFile);
- assertEquals("There shuold be the only one error marker in
DuplicateComponent.java.", 1, lineNumbers.length);
+ assertEquals("There should be the only one error marker in
DuplicateComponent.java.", 1, lineNumbers.length);
assertEquals("Problem marker has wrong line number", 5, lineNumbers[0]);
lineNumbers = getMarkersNumbersOfLine(componentsXmlFile);
- assertEquals("There shuold be two error marker in components.xml.", 2,
lineNumbers.length);
- assertEquals("Problem marker has wrong line number", 8, lineNumbers[0]);
- assertEquals("Problem marker has wrong line number", 9, lineNumbers[1]);
+ assertEquals("There should be two error marker in components.xml.", 2,
lineNumbers.length);
+ assertTrue("Problem marker was not found on 8 line", findLine(lineNumbers,
8));
+ assertTrue("Problem marker was not found on 9 line", findLine(lineNumbers,
9));
}
+ private static boolean findLine(int[] lines, int number) {
+ for (int i = 0; i < lines.length; i++) {
+ if(lines[i]==number) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private void modifyPreferences(){
IPreferenceStore store = SeamCorePlugin.getDefault().getPreferenceStore();
store.putValue(SeamPreferences.UNKNOWN_EL_VARIABLE_NAME, SeamPreferences.ERROR);
Show replies by date