Author: yzhishko
Date: 2009-07-29 09:17:32 -0400 (Wed, 29 Jul 2009)
New Revision: 16872
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/TestDomUtil.java
Log:
Method to clear \r symbols what comes from xulrunner.64 in #comments nodes was added.
Modified:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/TestDomUtil.java
===================================================================
---
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/TestDomUtil.java 2009-07-29
13:16:46 UTC (rev 16871)
+++
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/TestDomUtil.java 2009-07-29
13:17:32 UTC (rev 16872)
@@ -135,13 +135,30 @@
+ vpeNode.getNodeName() + "\"but must be \"" //$NON-NLS-1$
+ modelNode.getNodeName() + "\""); //$NON-NLS-1$
}
- if ((modelNode.getNodeValue() != null)
- && (!modelNode.getNodeValue().trim().equalsIgnoreCase(
- vpeNode.getNodeValue().trim()))) {
- throw new ComparisonException("value of " + vpeNode.getNodeName()
//$NON-NLS-1$
- + " is \"" + vpeNode.getNodeValue().trim() //$NON-NLS-1$
- + "\" but must be \"" + modelNode.getNodeValue().trim()
//$NON-NLS-1$
- + "\""); //$NON-NLS-1$
+
+ if ("#comment".equals(vpeNode.getNodeName())){
+ String vpeNodeValue = vpeNode.getNodeValue();
+ try {
+ vpeNodeValue = clearStringFromRSymbols(vpeNodeValue);
+ } catch (Exception e) {
+ }
+ if ((modelNode.getNodeValue() != null)
+ && (!modelNode.getNodeValue().trim().equalsIgnoreCase(
+ vpeNodeValue.trim()))) {
+ throw new ComparisonException("value of " + vpeNode.getNodeName()
//$NON-NLS-1$
+ + " is \"" + vpeNodeValue.trim() //$NON-NLS-1$
+ + "\" but must be \"" + modelNode.getNodeValue().trim()
//$NON-NLS-1$
+ + "\""); //$NON-NLS-1$
+ }
+ } else {
+ if ((modelNode.getNodeValue() != null)
+ && (!modelNode.getNodeValue().trim().equalsIgnoreCase(
+ vpeNode.getNodeValue().trim()))) {
+ throw new ComparisonException("value of " + vpeNode.getNodeName()
//$NON-NLS-1$
+ + " is \"" + vpeNode.getNodeValue().trim() //$NON-NLS-1$
+ + "\" but must be \"" + modelNode.getNodeValue().trim()
//$NON-NLS-1$
+ + "\""); //$NON-NLS-1$
+ }
}
// compare node's attributes
if (modelNode.getNodeType() == Node.ELEMENT_NODE) {
@@ -275,5 +292,16 @@
}
}
-
+
+ private static String clearStringFromRSymbols(String string){
+ int index = string.indexOf("\r");
+ while (index!=-1) {
+ String stringAfterSymbol = string.substring(index+1);
+ String stringBeforeSymbol = string.substring(0,index);
+ string = stringBeforeSymbol.concat(stringAfterSymbol);
+ index = string.indexOf("\r");
+ }
+ return string;
+ }
+
}
Show replies by date