diff options
author | wisberg <wisberg> | 2003-05-31 07:24:07 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-05-31 07:24:07 +0000 |
commit | fd8f53ceecda3faf75175cf8584287bc4ca4f37c (patch) | |
tree | c0f2ffcdcbcfafda6046137aa52ffc2d3b69a9e4 /testing/src | |
parent | 5a602c6007df9e46fefc1386fb88dd13f5c56ac3 (diff) | |
download | aspectj-fd8f53ceecda3faf75175cf8584287bc4ca4f37c.tar.gz aspectj-fd8f53ceecda3faf75175cf8584287bc4ca4f37c.zip |
better info/debug strings when JavaRun fails
Diffstat (limited to 'testing/src')
-rw-r--r-- | testing/src/org/aspectj/testing/harness/bridge/AbstractRunSpec.java | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/testing/src/org/aspectj/testing/harness/bridge/AbstractRunSpec.java b/testing/src/org/aspectj/testing/harness/bridge/AbstractRunSpec.java index cec21f19c..3eef0679e 100644 --- a/testing/src/org/aspectj/testing/harness/bridge/AbstractRunSpec.java +++ b/testing/src/org/aspectj/testing/harness/bridge/AbstractRunSpec.java @@ -704,25 +704,53 @@ abstract public class AbstractRunSpec implements IRunSpec { // XXX use MessageHa /** @return String of the form (# [options|paths|locations|messages]).. */ protected String containedSummary() { - int nOptions = options.size(); - int nPaths = paths.size(); - int nLoc = sourceLocations.size(); - int nMssg = messages.numMessages(null, true); - return - ( (nOptions == 0 ? "" : nOptions + " options " ) - + (nPaths == 0 ? "" : nPaths + " paths " ) - + (nLoc == 0 ? "" : nLoc + " locations " ) - + (nMssg == 0 ? "" : nMssg + " messages" )).trim(); + StringBuffer result = new StringBuffer(); + addListCount("options", options, result); + addListCount("paths", paths, result); + addListCount("sourceLocations", sourceLocations, result); + List messagesList = messages.getUnmodifiableListView(); + addListCount("messages", messagesList, result); + + return result.toString().trim(); } + public String toLongString() { String mssg = ""; if (0 < messages.numMessages(null, true)) { mssg = " expected messages (" + MessageUtil.renderCounts(messages) + ")"; } - return getPrintName() + containedSummary() + mssg.trim(); + return getPrintName() + containedToLongString() + mssg.trim(); } + /** @return String of the form (# [options|paths|locations|messages]).. */ + protected String containedToLongString() { + StringBuffer result = new StringBuffer(); + addListEntries("options", options, result); + addListEntries("paths", paths, result); + addListEntries("sourceLocations", sourceLocations, result); + List messagesList = messages.getUnmodifiableListView(); + addListEntries("messages", messagesList, result); + + return result.toString(); + } + + private static void addListCount(String name, List list, StringBuffer sink) { + int size = list.size(); + if ((null != list) && (0 < size)) { + sink.append(" " + size + " "); + sink.append(name); + } + } + + private static void addListEntries(String name, List list, StringBuffer sink) { + if ((null != list) && (0 < list.size())) { + sink.append(" " + list.size() + " "); + sink.append(name); + sink.append(": "); + sink.append(list.toString()); + } + } private ArrayList makeList(List list) { ArrayList result = new ArrayList(); if (null != list) { |