Index: tests/JettyScenario/src/JettyTestCase.java =================================================================== --- tests/JettyScenario/src/JettyTestCase.java (revision 544878) +++ tests/JettyScenario/src/JettyTestCase.java (working copy) @@ -28,6 +28,8 @@ import java.net.MalformedURLException; import java.net.URL; +import java.util.Vector; + import junit.framework.TestCase; public class JettyTestCase extends TestCase { @@ -101,20 +103,18 @@ String cs = null; String fs = null; + Vector cv = new Vector(); + Vector fv = new Vector(); + Vector sv = new Vector(); try { cs = creader.readLine(); fs = freader.readLine(); while (cs != null && fs != null) { if (!compareLines(cs, fs)) { - LOG_OUT.println("Lines:"); - LOG_OUT.println("--content-----------------------------------------------------------------------"); - LOG_OUT.println("(" + creader.getLineNumber() + ") " + cs); - LOG_OUT.println("--etalon------------------------------------------------------------------------"); - LOG_OUT.println("(" + freader.getLineNumber() + ") " + fs); - LOG_OUT.println("--------------------------------------------------------------------------------"); - LOG_OUT.println("do not match each other."); - return false; + cv.add(cs); + sv.add(fs); } + fv.add(fs); cs = creader.readLine(); fs = freader.readLine(); } @@ -125,10 +125,17 @@ } if (cs != null || fs != null) { - LOG_OUT.println("Files have different number of lines."); + LOG_OUT.println("Page have different number of lines than etalon."); return false; } + if (cv.size() != 0 || fv.size() != 0) { + if (!compareRegardlessOrder(cv, sv, fv)) { + LOG_OUT.println("Page differs from etalon (even if lines order is not checked)."); + return false; + } + } + try { creader.close(); freader.close(); @@ -141,6 +148,30 @@ return true; } + protected boolean compareRegardlessOrder(Vector first, Vector second, Vector third) { + for (int i = 0; i < first.size(); i++) { + boolean ok = false; + for (int j = 0; j < third.size(); j++) { + if (compareLines((String)first.elementAt(i), (String)third.elementAt(j))) { + ok = true; + } + } + if (!ok) { + LOG_OUT.println("Lines:"); + for (int j = 0; j < first.size(); j++) { + LOG_OUT.println("--content-----------------------------------------------------------------------"); + LOG_OUT.println((String)first.elementAt(j)); + LOG_OUT.println("--etalon------------------------------------------------------------------------"); + LOG_OUT.println((String)second.elementAt(j)); + } + LOG_OUT.println("--------------------------------------------------------------------------------"); + LOG_OUT.println("do not match each other."); + return false; + } + } + return true; + } + protected boolean compareLines(String first, String second) { if (second.startsWith("$$$")) { return first.matches(second.substring(3)); Index: adaptors/JettyScenario/parameters.xml =================================================================== --- adaptors/JettyScenario/parameters.xml (revision 542804) +++ adaptors/JettyScenario/parameters.xml (working copy) @@ -28,6 +28,9 @@ + Index: adaptors/JettyScenario/adaptor.xml =================================================================== --- adaptors/JettyScenario/adaptor.xml (revision 544878) +++ adaptors/JettyScenario/adaptor.xml (working copy) @@ -25,6 +25,10 @@ + + + + @@ -77,6 +81,7 @@ + + + + + + + + + + + + + + @@ -100,7 +119,7 @@ - + @@ -124,6 +143,7 @@ haltonfailure="false" printsummary="on" failureproperty="scenario.failed"> + @@ -158,7 +178,7 @@ - +