diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/UtilityTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/UtilityTest.java index 9d06864d1b..2b86189bf0 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/UtilityTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/UtilityTest.java @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (c) 2003-2009, International Business Machines +* Copyright (c) 2003-2015, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Author: Alan Liu @@ -227,4 +227,15 @@ public class UtilityTest extends TestFmwk { errln("FAIL: str1("+str1+") != str2("+str2+")"); } } + + public void TestSourceLocation() { + String here = TestFmwk.sourceLocation(); + String there = CheckSourceLocale(); + String hereAgain = TestFmwk.sourceLocation(); + assertTrue("here < there < hereAgain", here.compareTo(there) < 0 && there.compareTo(hereAgain) < 0); + } + + public String CheckSourceLocale() { + return TestFmwk.sourceLocation(); + } } diff --git a/icu4j/main/tests/framework/src/com/ibm/icu/dev/test/TestFmwk.java b/icu4j/main/tests/framework/src/com/ibm/icu/dev/test/TestFmwk.java index 0c9461577d..81636d36d3 100644 --- a/icu4j/main/tests/framework/src/com/ibm/icu/dev/test/TestFmwk.java +++ b/icu4j/main/tests/framework/src/com/ibm/icu/dev/test/TestFmwk.java @@ -1547,14 +1547,14 @@ public class TestFmwk extends AbstractTestLog { private void msg(String message, int level, boolean incCount, boolean newln) { int oldLevel = level; -// if (level == WARN && (!warnings && !nodata)){ -// level = ERR; -// } + // if (level == WARN && (!warnings && !nodata)){ + // level = ERR; + // } if (incCount) { if (level == WARN) { warnCount++; -// invalidCount++; + // invalidCount++; } else if (level == ERR) { errorCount++; } @@ -1683,8 +1683,8 @@ public class TestFmwk extends AbstractTestLog { + " failure(s)" + ((warnDelta != 0) ? ", " + warnDelta + " warning(s)" : "") - + ((invalidDelta != 0) ? ", " + invalidDelta - + " test(s) skipped)" : ")")); + + ((invalidDelta != 0) ? ", " + invalidDelta + + " test(s) skipped)" : ")")); } else if (warnDelta != 0) { log.println(" ALERT (" + warnDelta @@ -1976,7 +1976,10 @@ public class TestFmwk extends AbstractTestLog { for (int i = 0; i < st.length; ++i) { String source = st[i].getFileName(); if (!source.equals("TestFmwk.java") && !source.equals("AbstractTestLog.java")) { - return "(" + st[i].getFileName() + ":" + st[i].getLineNumber() + ") "; + String methodName = st[i].getMethodName(); + if (methodName.startsWith("Test") || methodName.startsWith("test")) { + return "(" + source + ":" + st[i].getLineNumber() + ") "; + } } } throw new InternalError();