From 5702c144cee3b5140dd47ff15e772a04493bb12d Mon Sep 17 00:00:00 2001 From: wisberg Date: Wed, 14 May 2003 05:09:56 +0000 Subject: stricter test run comparisons --- .../org/aspectj/testing/harness/bridge/AjcSpecTest.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'testing') diff --git a/testing/testsrc/org/aspectj/testing/harness/bridge/AjcSpecTest.java b/testing/testsrc/org/aspectj/testing/harness/bridge/AjcSpecTest.java index 0b2f8365d..2110fbe45 100644 --- a/testing/testsrc/org/aspectj/testing/harness/bridge/AjcSpecTest.java +++ b/testing/testsrc/org/aspectj/testing/harness/bridge/AjcSpecTest.java @@ -13,6 +13,7 @@ package org.aspectj.testing.harness.bridge; +import java.util.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -22,6 +23,7 @@ import junit.framework.Assert; import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import org.aspectj.bridge.*; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.MessageUtil; @@ -71,8 +73,10 @@ public class AjcSpecTest extends TestCase { // XXX sameList(lhs.globalOptions, rhs.globalOptions, a); sameList(lhs.getOptionsList(), rhs.getOptionsList(), a); sameList(lhs.getPathsList(), rhs.getPathsList(), a); - sameList(lhs.keywords, rhs.keywords, a); // XXX getters - assertEquals(lhs.comment, rhs.comment); // XXX getters + assertEquals(lhs.isStaging(), rhs.isStaging()); + sameList(lhs.keywords, rhs.keywords, a); + assertEquals(lhs.comment, rhs.comment); + assertEquals(lhs.badInput, rhs.badInput); // xml adds sourceloc? //sameSourceLocation(lhs.getSourceLocation(), rhs.getSourceLocation(), a); // XXX also sourceLocations? @@ -270,12 +274,13 @@ public class AjcSpecTest extends TestCase { sameList(lhs.added, rhs.added, a); } - public static void sameMessages(List one, List two, Assert a) { + public static void sameMessages(IMessageHolder one, IMessageHolder two, Assert a) { if ((null == one) && (null == two)) { return; } - Iterator lhs = one.iterator(); - Iterator rhs = two.iterator(); + // order matters here + ListIterator lhs = one.getUnmodifiableListView().listIterator(); + ListIterator rhs = two.getUnmodifiableListView().listIterator(); while (lhs.hasNext() && rhs.hasNext()) { sameMessage((IMessage) lhs.next(), (IMessage) rhs.next(), a); } -- cgit v1.2.3