]> granicus.if.org Git - icu/commitdiff
ICU-12603 Annotates ICU4J unit test classes which use JUnit with @RunWith(JUnit4...
authorNorbert Runge <nrunge@google.com>
Fri, 8 Sep 2017 16:46:18 +0000 (16:46 +0000)
committerNorbert Runge <nrunge@google.com>
Fri, 8 Sep 2017 16:46:18 +0000 (16:46 +0000)
X-SVN-Rev: 40375

206 files changed:
icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java
icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestSelection.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/AlphabeticIndexTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationAPITest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationChineseTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationCreationMethodTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationCurrencyTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationDummyTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationEnglishTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationFinnishTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationFrenchTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationFrozenMonkeyTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationGermanTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationIteratorTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationKanaTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationMiscTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationMonkeyTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationRegressionTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationServiceTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationSpanishTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationThaiTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationThreadTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationTurkishTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/G7CollationTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/LotusCollationKoreanTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/UCAConformanceTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/format/GlobalizationPreferencesTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/format/RbnfLenientScannerTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/search/SearchTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/ICUResourceBundleCollationTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/LocaleAliasCollationTest.java
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/ULocaleCollationTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/bidi/BiDiConformanceTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/bidi/TestBidiTransform.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/bigdec/DiagBigDecimalTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/AstroTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CalendarRegressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CalendarTestFmwk.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/ChineseTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/ChineseTestCase.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CompatibilityTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CopticTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/DangiTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/EthiopicTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/HebrewTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/HolidayTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IndianTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IslamicTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/JapaneseTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/PersianTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/charsetdet/TestCharsetDetector.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/compression/DecompressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/compression/ExhaustiveTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/DataReadWriteTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/ICUDurationTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/LanguageTestFmwk.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/PeriodBuilderFactoryTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/PeriodTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/RegressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/duration/ResourceBasedPeriodFormatterDataServiceTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/BigNumberFormatTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatMiscTests.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatRegressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatRegressionTestJ.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatRoundTripTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestDateFormat.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestDateFormatAPI.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestDateFormatAPIC.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestDateFormatSymbols.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPI.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatAPIC.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatSymbols.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestDecimalFormatSymbolsC.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestNumberFormat.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestNumberFormatAPI.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/IntlTestSimpleDateFormatAPI.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/ListFormatterTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitThreadTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MessagePatternUtilTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MessageRegressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatRegistrationTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatRegressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatRoundTripTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatSpecificationTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberRegressionTests.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/PluralFormatTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/PluralFormatUnitTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/PluralRangesTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/PluralRulesTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/RBNFParseTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/RbnfRoundTripTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/RbnfTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/RelativeDateTimeFormatterTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/ScientificNumberFormatterTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/SelectFormatAPITest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/SelectFormatUnitTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/TestMessageFormat.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/TimeUnitTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/TimeZoneFormatTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/impl/CSCharacterIteratorTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/impl/CacheTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/iterator/TestUCharacterIterator.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/TestUScript.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/TestUScriptRun.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterCaseTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterCategoryTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterDirectionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterSurrogateTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterThreadTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UPropertyAliasesTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UTF16Test.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UnicodeSetStringSpanTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UnicodeSetTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/BasicTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/ConformanceTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/NormalizationMonkeyTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/NormalizerRegressionTests.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/TestCanonicalIterator.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/TestDeprecatedNormalizerAPI.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/UTS46Test.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/normalizer/UnicodeNormalizerConformanceTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/FormatQuantityTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/AbstractBreakIteratorTests.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/BreakIteratorRegTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/BreakIteratorTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBIAPITest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBIMonkeyTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestExtended.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/shaping/ArabicShapingRegTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/stringprep/IDNAConformanceTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/stringprep/TestIDNA.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/stringprep/TestIDNARef.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/stringprep/TestStringPrep.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/stringprep/TestStringPrepProfiles.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/text/SpoofCheckerTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timescale/TimeScaleAPITest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timescale/TimeScaleDataTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timescale/TimeScaleMonkeyTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timezone/TimeZoneAliasTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timezone/TimeZoneBoundaryTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timezone/TimeZoneOffsetLocalTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timezone/TimeZoneRegressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timezone/TimeZoneRuleTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/timezone/TimeZoneTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/BytesTrieTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/CharsTrieTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/CompactArrayTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/CurrencyTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DebugUtilitiesTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DisplayNameTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/GenderInfoTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUBinaryTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUServiceTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUServiceThreadTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleAliasTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleBuilderTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleDataTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleMatcherTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocalePriorityListTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/RegionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/SimpleFormatterTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/StringTokenizerTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/TestLocaleValidity.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/TextTrieMapTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/TrieMapTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/TrieTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/UtilityTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/VersionInfoTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/XLocaleDistanceTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/XLocaleMatcherTest.java
icu4j/main/tests/core/src/com/ibm/icu/text/DigitListTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/BreakIteratorTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/CollatorTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/CurrencyNameTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/DateFormatSymbolsTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/DateFormatTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/DecimalFormatSymbolsTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/LocaleNameTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/NumberFormatTest.java
icu4j/main/tests/localespi/src/com/ibm/icu/dev/test/localespi/TimeZoneNameTest.java
icu4j/main/tests/packaging/src/com/ibm/icu/dev/test/TestLocaleNamePackaging.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/AnyScriptTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/CompoundTransliteratorTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/ErrorTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/JamoTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/RegexUtilitiesTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/ReplaceableTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/RoundTripTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/ThreadTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/TransliteratorTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/UnicodeMapTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/util/TestUtilities.java

index a95bc778ac9cd21282495ed2bff260b157dc407a..9a5dc189d3e2ab75f85752a345202dc87425f09a 100644 (file)
@@ -27,6 +27,8 @@ import java.util.Set;
 import java.util.SortedMap;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.charset.CharsetCallback;
 import com.ibm.icu.charset.CharsetDecoderICU;
@@ -37,6 +39,7 @@ import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.UTF16;
 import com.ibm.icu.text.UnicodeSet;
 
+@RunWith(JUnit4.class)
 public class TestCharset extends TestFmwk {
     @Test
     public void TestUTF16Converter(){
@@ -44,18 +47,18 @@ public class TestCharset extends TestFmwk {
         Charset cs1 = icu.charsetForName("UTF-16BE");
         CharsetEncoder e1 = cs1.newEncoder();
         CharsetDecoder d1 = cs1.newDecoder();
-        
+
         Charset cs2 = icu.charsetForName("UTF-16LE");
         CharsetEncoder e2 = cs2.newEncoder();
         CharsetDecoder d2 = cs2.newDecoder();
-        
+
         for(int i=0x0000; i<0x10FFFF; i+=0xFF){
             CharBuffer us = CharBuffer.allocate(0xFF*2);
             ByteBuffer bs1 = ByteBuffer.allocate(0xFF*8);
             ByteBuffer bs2 = ByteBuffer.allocate(0xFF*8);
             for(int j=0;j<0xFF; j++){
                 int c = i+j;
-              
+
                 if((c>=0xd800&&c<=0xdFFF)||c>0x10FFFF){
                     continue;
                 }
@@ -77,7 +80,7 @@ public class TestCharset extends TestFmwk {
                     bs1.put((byte)(lead&0xFF));
                     bs1.put((byte)(trail>>8));
                     bs1.put((byte)(trail&0xFF));
-                    
+
                     bs2.put((byte)(lead&0xFF));
                     bs2.put((byte)(lead>>8));
                     bs2.put((byte)(trail&0xFF));
@@ -92,63 +95,63 @@ public class TestCharset extends TestFmwk {
                     }else{
                         bs1.put((byte)(c>>8));
                         bs1.put((byte)(c&0xFF));
-                        
+
                         bs2.put((byte)(c&0xFF));
                         bs2.put((byte)(c>>8));
                     }
                     us.put((char)c);
                 }
             }
-            
-            
+
+
             us.limit(us.position());
             us.position(0);
             if(us.length()==0){
                 continue;
             }
-            
+
 
             bs1.limit(bs1.position());
             bs1.position(0);
             ByteBuffer newBS = ByteBuffer.allocate(bs1.capacity());
             //newBS.put((byte)0xFE);
             //newBS.put((byte)0xFF);
-            newBS.put(bs1);    
+            newBS.put(bs1);
             bs1.position(0);
             smBufDecode(d1, "UTF-16", bs1, us);
             smBufEncode(e1, "UTF-16", us, newBS);
-            
+
             bs2.limit(bs2.position());
             bs2.position(0);
             newBS.clear();
             //newBS.put((byte)0xFF);
             //newBS.put((byte)0xFE);
-            newBS.put(bs2);     
+            newBS.put(bs2);
             bs2.position(0);
             smBufDecode(d2, "UTF16-LE", bs2, us);
             smBufEncode(e2, "UTF-16LE", us, newBS);
-            
+
         }
     }
-    
+
     @Test
     public void TestUTF32Converter(){
         CharsetProvider icu = new CharsetProviderICU();
         Charset cs1 = icu.charsetForName("UTF-32BE");
         CharsetEncoder e1 = cs1.newEncoder();
         CharsetDecoder d1 = cs1.newDecoder();
-        
+
         Charset cs2 = icu.charsetForName("UTF-32LE");
         CharsetEncoder e2 = cs2.newEncoder();
         CharsetDecoder d2 = cs2.newDecoder();
-        
+
         for(int i=0x000; i<0x10FFFF; i+=0xFF){
             CharBuffer us = CharBuffer.allocate(0xFF*2);
             ByteBuffer bs1 = ByteBuffer.allocate(0xFF*8);
             ByteBuffer bs2 = ByteBuffer.allocate(0xFF*8);
             for(int j=0;j<0xFF; j++){
                 int c = i+j;
-              
+
                 if((c>=0xd800&&c<=0xdFFF)||c>0x10FFFF){
                     continue;
                 }
@@ -163,13 +166,13 @@ public class TestCharset extends TestFmwk {
                     us.put((char)c);
                 }
                 bs1.put((byte) (c >>> 24));
-                bs1.put((byte) (c >>> 16)); 
-                bs1.put((byte) (c >>> 8)); 
-                bs1.put((byte) (c & 0xFF));       
-                                
-                bs2.put((byte) (c & 0xFF));  
+                bs1.put((byte) (c >>> 16));
+                bs1.put((byte) (c >>> 8));
+                bs1.put((byte) (c & 0xFF));
+
+                bs2.put((byte) (c & 0xFF));
                 bs2.put((byte) (c >>> 8));
-                bs2.put((byte) (c >>> 16)); 
+                bs2.put((byte) (c >>> 16));
                 bs2.put((byte) (c >>> 24));
             }
             bs1.limit(bs1.position());
@@ -181,41 +184,41 @@ public class TestCharset extends TestFmwk {
             if(us.length()==0){
                 continue;
             }
-             
+
 
             ByteBuffer newBS = ByteBuffer.allocate(bs1.capacity());
-            
+
             newBS.put((byte)0x00);
             newBS.put((byte)0x00);
             newBS.put((byte)0xFE);
             newBS.put((byte)0xFF);
-            
+
             newBS.put(bs1);
             bs1.position(0);
             smBufDecode(d1, "UTF-32", bs1, us);
             smBufEncode(e1, "UTF-32", us, newBS);
-            
-            
+
+
             newBS.clear();
-            
+
             newBS.put((byte)0xFF);
             newBS.put((byte)0xFE);
             newBS.put((byte)0x00);
             newBS.put((byte)0x00);
-            
-            newBS.put(bs2);    
+
+            newBS.put(bs2);
             bs2.position(0);
             smBufDecode(d2, "UTF-32LE", bs2, us);
             smBufEncode(e2, "UTF-32LE", us, newBS);
 
         }
     }
-    
+
     @Test
     public void TestASCIIConverter() {
         runTestASCIIBasedConverter("ASCII", 0x80);
     }
-    
+
     @Test
     public void Test88591Converter() {
         runTestASCIIBasedConverter("iso-8859-1", 0x100);
@@ -228,8 +231,8 @@ public class TestCharset extends TestFmwk {
         CharsetDecoder decoder = icuChar.newDecoder();
         CoderResult cr;
 
-        /* test with and without array-backed buffers */ 
-        
+        /* test with and without array-backed buffers */
+
         byte[] bytes = new byte[0x10000];
         char[] chars = new char[0x10000];
         for (int j = 0; j <= 0xffff; j++) {
@@ -241,7 +244,7 @@ public class TestCharset extends TestFmwk {
         boolean arrays = false;
         boolean decoding = false;
         int i;
-        
+
         // 0 thru limit - 1
         ByteBuffer bs = ByteBuffer.wrap(bytes, 0, limit);
         CharBuffer us = CharBuffer.wrap(chars, 0, limit);
@@ -256,26 +259,26 @@ public class TestCharset extends TestFmwk {
                 decoding = true;
                 arrays = true;
                 smBufDecode(decoder, converter, bs, us, true, false, true);
-                
+
                 decoding = true;
                 arrays = false;
                 smBufDecode(decoder, converter, bs, us, true, false, false);
-                
+
                 decoding = false;
                 arrays = true;
                 smBufEncode(encoder, converter, us, bs, true, false, true);
-                
+
                 decoding = false;
                 arrays = false;
                 smBufEncode(encoder, converter, us, bs, true, false, false);
-                
+
             } catch (Exception ex) {
                 errln("Failed to fail to " + (decoding ? "decode" : "encode") + " 0x"
                         + Integer.toHexString(i) + (arrays ? " with arrays" : " without arrays") + " in " + converter);
                 return;
             }
         }
-        
+
         // decode limit thru 255
         for (i = limit; i <= 0xff; i++) {
             bs = ByteBuffer.wrap(bytes, i, 1).slice();
@@ -300,7 +303,7 @@ public class TestCharset extends TestFmwk {
                     + (arrays ? " with arrays" : " without arrays") + " in " + converter);
             return;
         }
-        
+
         // encode limit thru 0xffff, skipping through much of the 1ff to feff range to save
         // time (it would take too much time to test every possible case)
         for (i = limit; i <= 0xffff; i = ((i>=0x1ff && i<0xfeff) ? i+0xfd : i+1)) {
@@ -326,7 +329,7 @@ public class TestCharset extends TestFmwk {
                     + (arrays ? " with arrays" : " without arrays") + " in " + converter);
             return;
         }
-        
+
         // test overflow / underflow edge cases
         outer: for (int n = 1; n <= 3; n++) {
             for (int m = 0; m < n; m++) {
@@ -356,7 +359,7 @@ public class TestCharset extends TestFmwk {
                     fail = true;
                     break outer;
                 }
-                
+
                 // expecting overflow
                 try {
                     bs = ByteBuffer.wrap(bytes, 'a', n).slice();
@@ -409,7 +412,7 @@ public class TestCharset extends TestFmwk {
             errln("Incorrect result in " + converter + " for underflow / overflow edge cases");
             return;
         }
-        
+
         // test surrogate combinations in encoding
         String lead = "\ud888";
         String trail = "\udc88";
@@ -439,7 +442,7 @@ public class TestCharset extends TestFmwk {
                 CoderResult.unmappableForLength(1),
                 CoderResult.unmappableForLength(1),
         };
-        
+
         for (int index = 0; index < input.length; index++) {
             CharBuffer source = CharBuffer.wrap(input[index]);
             cr = encoder.encode(source, bs, true);
@@ -472,7 +475,7 @@ public class TestCharset extends TestFmwk {
             }
         }
     }
-    
+
     @Test
     public void TestUTF8Converter() {
         String converter = "UTF-8";
@@ -484,13 +487,13 @@ public class TestCharset extends TestFmwk {
         CharBuffer us;
         CoderResult cr;
 
-        
+
         int[] size = new int[] { 1<<7, 1<<11, 1<<16 }; // # of 1,2,3 byte combinations
         byte[] bytes = new byte[size[0] + size[1]*2 + size[2]*3];
         char[] chars = new char[size[0] + size[1] + size[2]];
         int i = 0;
         int x, y;
-        
+
         // 0 to 1 << 7 (1 byters)
         for (; i < size[0]; i++) {
             bytes[i] = (byte) i;
@@ -554,7 +557,7 @@ public class TestCharset extends TestFmwk {
             } else {
                 bs = ByteBuffer.wrap(bytes, x, 3).slice();
                 us = CharBuffer.wrap(chars, y, 1).slice();
-                
+
                 decoder.reset();
                 cr = decoder.decode(bs, us, true);
                 bs.rewind();
@@ -573,10 +576,10 @@ public class TestCharset extends TestFmwk {
                             + Integer.toHexString(i) + " received " + cr);
                     break;
                 }
-                
+
                 bs = ByteBuffer.wrap(bytes, x, 3).slice();
                 us = CharBuffer.wrap(new String(chars, y, 1));
-                
+
                 decoder.reset();
                 cr = decoder.decode(bs, us, true);
                 bs.rewind();
@@ -595,14 +598,14 @@ public class TestCharset extends TestFmwk {
                             + Integer.toHexString(i) + " received " + cr);
                     break;
                 }
-                
-                
+
+
             }
         }
         if (true)
             return;
     }
-    
+
     @Test
     public void TestHZ() {
         /* test input */
@@ -620,7 +623,7 @@ public class TestCharset extends TestFmwk {
                 0x0051, 0x0052, 0x0053, 0x000A, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
                 0x005A, 0x005B, 0x005C, 0x000A
           };
-        
+
         String converter = "HZ";
         CharsetProvider icu = new CharsetProviderICU();
         Charset icuChar = icu.charsetForName(converter);
@@ -630,14 +633,14 @@ public class TestCharset extends TestFmwk {
             CharBuffer start = CharBuffer.wrap(in);
             ByteBuffer bytes = encoder.encode(start);
             CharBuffer finish = decoder.decode(bytes);
-            
+
             if (!equals(start, finish)) {
                 errln(converter + " roundtrip test failed: start does not match finish");
-                
+
                 char[] finishArray = new char[finish.limit()];
                 for (int i=0; i<finishArray.length; i++)
                     finishArray[i] = finish.get(i);
-                
+
                 logln("start:  " + hex(in));
                 logln("finish: " + hex(finishArray));
             }
@@ -645,7 +648,7 @@ public class TestCharset extends TestFmwk {
             errln(converter + " roundtrip test failed: " + ex.getMessage());
             ex.printStackTrace(System.err);
         }
-        
+
         /* For better code coverage */
         CoderResult result = CoderResult.UNDERFLOW;
         byte byteout[] = {
@@ -667,7 +670,7 @@ public class TestCharset extends TestFmwk {
             bb.position(bbPositions[i]);
             cb.position(ccPositions[i]);
             result = encoder.encode(cb, bb, true);
-            
+
             if (i < 3) {
                 if (!result.isOverflow()) {
                     errln("Overflow buffer error should have occurred while encoding HZ (" + i + ")");
@@ -721,12 +724,12 @@ public class TestCharset extends TestFmwk {
             { '\u0062', },
             { '\u0062', },
         };
-        
+
         String converter = "UTF-8";
         CharsetProvider icu = new CharsetProviderICU();
         Charset icuChar = icu.charsetForName(converter);
         CharsetDecoder decoder = icuChar.newDecoder();
-        
+
         int i;
         try {
             for (i = 0; i < in.length; i++) {
@@ -754,24 +757,24 @@ public class TestCharset extends TestFmwk {
             errln("Incorrect result in " + converter);
         }
     }
-    
+
     @Test
     public void TestSurrogateBehavior() {
         CharsetProviderICU icu = new CharsetProviderICU();
-        
+
         // get all the converters into an array
         Object[] converters = CharsetProviderICU.getAvailableNames();
-        
+
         String norm = "a";
         String ext = "\u0275"; // theta
         String lead = "\ud835";
         String trail = "\udd04";
         // lead + trail = \U1d504 (fraktur capital A)
-        
-        String input = 
+
+        String input =
                         // error    position
                 ext     // unmap(1) 1
-                + lead  // under    1  
+                + lead  // under    1
                 + lead  // malf(1)  2
                 + trail // unmap(2) 4
                 + trail // malf(1)  5
@@ -789,7 +792,7 @@ public class TestCharset extends TestFmwk {
         };
         int[] positions = new int[] { 1,1,2,4,5,6,7 };
         int n = positions.length;
-        
+
         int badcount = 0;
         int goodcount = 0;
         int[] uhohindices = new int[n];
@@ -798,7 +801,7 @@ public class TestCharset extends TestFmwk {
         int[] unmapindices = new int[n];
         ArrayList pass = new ArrayList();
         ArrayList exempt = new ArrayList();
-        
+
         outer: for (int conv=0; conv<converters.length; conv++) {
             String converter = (String)converters[conv];
             if (converter.equals("x-IMAP-mailbox-name") || converter.equals("UTF-7") || converter.equals("CESU-8") || converter.equals("BOCU-1") ||
@@ -806,12 +809,12 @@ public class TestCharset extends TestFmwk {
                 exempt.add(converter);
                 continue;
             }
-            
+
             boolean currentlybad = false;
             Charset icuChar = icu.charsetForName(converter);
             CharsetEncoder encoder = icuChar.newEncoder();
             CoderResult cr;
-                
+
             CharBuffer source = CharBuffer.wrap(input);
             ByteBuffer target = ByteBuffer.allocate(30);
             ByteBuffer expected = null;
@@ -828,7 +831,7 @@ public class TestCharset extends TestFmwk {
                 errln(converter + " " + ex.getClass().getName() + ": " + ex.getMessage());
                 continue outer;
             }
-            
+
             encoder.onUnmappableCharacter(CodingErrorAction.REPORT);
             encoder.onMalformedInput(CodingErrorAction.REPORT);
             for (int i=0; i<n; i++) {
@@ -852,23 +855,23 @@ public class TestCharset extends TestFmwk {
                     badposindices[i]++;
                     errln("(index=" + i + ") " + converter + " Received: " + source.position() + " Expected: " + positions[i]);
                 }
-                    
+
             }
             encoder.reset();
-            
+
             //System.out.println("\n" + hex(target.array()));
             //System.out.println(hex(expected.array()) + "\n" + expected.limit());
             if (!(equals(target, expected, expected.limit()) && target.position() == expected.limit())) {
                 if (!currentlybad) {currentlybad = true; badcount++; logln(""); }
                 errln(converter + " Received: \"" + hex(target.array()) + "\" Expected: \"" + hex(expected.array()) + "\"");
             }
-            
+
             if (!currentlybad) {
                 goodcount++;
                 pass.add(converter);
             }
         }
-        
+
         logln("\n" + badcount + " / " + (converters.length - exempt.size()) + "   (" + goodcount + " good, " + badcount + " bad)");
         log("index\t"); for (int i=0; i<n; i++) log(i + "\t"); logln("");
         log("unmap\t"); for (int i=0; i<n; i++) log(unmapindices[i] + "\t"); logln("");
@@ -876,35 +879,35 @@ public class TestCharset extends TestFmwk {
         log("pos  \t"); for (int i=0; i<n; i++) log(badposindices[i] + "\t"); logln("");
         log("uhoh \t"); for (int i=0; i<n; i++) log(uhohindices[i] + "\t"); logln("");
         logln("");
-        log("The few that passed: "); for (int i=0; i<pass.size(); i++) log(pass.get(i) + ", "); logln(""); 
-        log("The few that are exempt: "); for (int i=0; i<exempt.size(); i++) log(exempt.get(i) + ", "); logln(""); 
+        log("The few that passed: "); for (int i=0; i<pass.size(); i++) log(pass.get(i) + ", "); logln("");
+        log("The few that are exempt: "); for (int i=0; i<exempt.size(); i++) log(exempt.get(i) + ", "); logln("");
     }
-    
+
 //    public void TestCharsetCallback() {
 //        String currentTest = "initialization";
 //        try {
 //            Class[] params;
-//            
+//
 //            // get the classes
 //            Class CharsetCallback = Class.forName("com.ibm.icu.charset.CharsetCallback");
 //            Class Decoder = Class.forName("com.ibm.icu.charset.CharsetCallback$Decoder");
 //            Class Encoder = Class.forName("com.ibm.icu.charset.CharsetCallback$Encoder");
-//            
+//
 //            // set up encoderCall
-//            params = new Class[] {CharsetEncoderICU.class, Object.class, 
-//                    CharBuffer.class, ByteBuffer.class, IntBuffer.class, 
+//            params = new Class[] {CharsetEncoderICU.class, Object.class,
+//                    CharBuffer.class, ByteBuffer.class, IntBuffer.class,
 //                    char[].class, int.class, int.class, CoderResult.class };
 //            Method encoderCall = Encoder.getDeclaredMethod("call", params);
-//            
+//
 //            // set up decoderCall
-//            params = new Class[] {CharsetDecoderICU.class, Object.class, 
+//            params = new Class[] {CharsetDecoderICU.class, Object.class,
 //                    ByteBuffer.class, CharBuffer.class, IntBuffer.class,
 //                    char[].class, int.class, CoderResult.class};
 //            Method decoderCall = Decoder.getDeclaredMethod("call", params);
-//            
+//
 //            // get relevant fields
 //            Object SUB_STOP_ON_ILLEGAL = getFieldValue(CharsetCallback, "SUB_STOP_ON_ILLEGAL", null);
-//            
+//
 //            // set up a few arguments
 //            CharsetProvider provider = new CharsetProviderICU();
 //            Charset charset = provider.charsetForName("UTF-8");
@@ -925,12 +928,12 @@ public class TestCharset extends TestFmwk {
 //            CoderResult unmap = CoderResult.unmappableForLength(2);
 //            CoderResult malf = CoderResult.malformedForLength(2);
 //            CoderResult under = CoderResult.UNDERFLOW;
-//            
+//
 //            // set up error arrays
 //            Integer invalidCharLength = new Integer(1);
 //            Byte subChar1 = new Byte((byte)0);
 //            Byte subChar1_alternate = new Byte((byte)1); // for TO_U_CALLBACK_SUBSTITUTE
-//            
+//
 //            // set up chars and bytes backups and expected values for certain cases
 //            CharBuffer charsBackup = bufferCopy(chars);
 //            ByteBuffer bytesBackup = bufferCopy(bytes);
@@ -942,70 +945,70 @@ public class TestCharset extends TestFmwk {
 //            CharBuffer decoderCharsExpected2 = bufferCopy(chars);
 //            IntBuffer decoderOffsetsExpected1 = bufferCopy(offsets);
 //            IntBuffer decoderOffsetsExpected2 = bufferCopy(offsets);
-//            
+//
 //            // initialize fields to obtain expected data
 //            setFieldValue(CharsetDecoderICU.class, "invalidCharLength", decoder, invalidCharLength);
 //            setFieldValue(CharsetICU.class, "subChar1", ((CharsetICU) decoder.charset()), subChar1);
-//            
+//
 //            // run cbFromUWriteSub
 //            Method cbFromUWriteSub = CharsetEncoderICU.class.getDeclaredMethod("cbFromUWriteSub", new Class[] { CharsetEncoderICU.class, CharBuffer.class, ByteBuffer.class, IntBuffer.class});
 //            cbFromUWriteSub.setAccessible(true);
 //            CoderResult encoderResultExpected = (CoderResult)cbFromUWriteSub.invoke(encoder, new Object[] {encoder, encoderCharsExpected, encoderBytesExpected, encoderOffsetsExpected});
-//            
+//
 //            // run toUWriteUChars with normal data
 //            Method toUWriteUChars = CharsetDecoderICU.class.getDeclaredMethod("toUWriteUChars", new Class[] { CharsetDecoderICU.class, char[].class, int.class, int.class, CharBuffer.class, IntBuffer.class, int.class});
 //            toUWriteUChars.setAccessible(true);
 //            CoderResult decoderResultExpected1 = (CoderResult)toUWriteUChars.invoke(decoder, new Object[] {decoder, new char[] {0xFFFD}, new Integer(0), new Integer(1), decoderCharsExpected1, decoderOffsetsExpected1, new Integer(bytes.position())});
-//            
+//
 //            // reset certain fields
 //            setFieldValue(CharsetDecoderICU.class, "invalidCharLength", decoder, invalidCharLength);
 //            setFieldValue(CharsetICU.class, "subChar1", ((CharsetICU) decoder.charset()), subChar1_alternate);
-//            
+//
 //            // run toUWriteUChars again
 //            CoderResult decoderResultExpected2 = (CoderResult)toUWriteUChars.invoke(decoder, new Object[] {decoder, new char[] {0x1A}, new Integer(0), new Integer(1), decoderCharsExpected2, decoderOffsetsExpected2, new Integer(bytes.position())});
-//            
+//
 //            // begin creating the tests array
 //            ArrayList tests = new ArrayList();
-//            
+//
 //            // create tests for FROM_U_CALLBACK_SKIP   0
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_SKIP", new Object[] { encoder, null, chars, bytes, offsets, buffer, length, cp, null }, under, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_SKIP", new Object[] { encoder, SUB_STOP_ON_ILLEGAL, chars, bytes, offsets, buffer, length, cp, malf }, malf, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_SKIP", new Object[] { encoder, SUB_STOP_ON_ILLEGAL, chars, bytes, offsets, buffer, length, cp, unmap }, under, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_SKIP", new Object[] { encoder, SUB_STOP_ON_ILLEGAL + "xx", chars, bytes, offsets, buffer, length, cp, null }, null, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
-//            
+//
 //            // create tests for TO_U_CALLBACK_SKIP    4
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_SKIP", new Object[] { decoder, null, bytes, chars, offsets, buffer, length, null }, under, charsBackup, bytesBackup, offsetsBackup, new Object[] { invalidCharLength, subChar1 }});
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_SKIP", new Object[] { decoder, SUB_STOP_ON_ILLEGAL, bytes, chars, offsets, buffer, length, malf }, malf, charsBackup, bytesBackup, offsetsBackup, new Object[] { invalidCharLength, subChar1 }});
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_SKIP", new Object[] { decoder, SUB_STOP_ON_ILLEGAL, bytes, chars, offsets, buffer, length, unmap }, under, charsBackup, bytesBackup, offsetsBackup, new Object[] { invalidCharLength, subChar1 }});
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_SKIP", new Object[] { decoder, SUB_STOP_ON_ILLEGAL + "xx", bytes, chars, offsets, buffer, length, null }, null, charsBackup, bytesBackup, offsetsBackup, new Object[] { invalidCharLength, subChar1 }});
-//            
+//
 //            // create tests for FROM_U_CALLBACK_STOP   8
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_STOP", new Object[] { encoder, null, chars, bytes, offsets, buffer, length, cp, null }, null, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_STOP", new Object[] { encoder, SUB_STOP_ON_ILLEGAL, chars, bytes, offsets, buffer, length, cp, malf }, malf, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_STOP", new Object[] { encoder, SUB_STOP_ON_ILLEGAL, chars, bytes, offsets, buffer, length, cp, unmap }, unmap, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_STOP", new Object[] { encoder, SUB_STOP_ON_ILLEGAL + "xx", chars, bytes, offsets, buffer, length, cp, null }, null, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
-//            
+//
 //            // create tests for TO_U_CALLBACK_STOP   12
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_STOP", new Object[] { decoder, null, bytes, chars, offsets, buffer, length, null }, null, charsBackup, bytesBackup, offsetsBackup, new Object[] { invalidCharLength, subChar1 }});
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_STOP", new Object[] { decoder, SUB_STOP_ON_ILLEGAL, bytes, chars, offsets, buffer, length, malf }, malf, charsBackup, bytesBackup, offsetsBackup, new Object[] { invalidCharLength, subChar1 }});
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_STOP", new Object[] { decoder, SUB_STOP_ON_ILLEGAL, bytes, chars, offsets, buffer, length, unmap }, unmap, charsBackup, bytesBackup, offsetsBackup, new Object[] { invalidCharLength, subChar1 }});
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_STOP", new Object[] { decoder, SUB_STOP_ON_ILLEGAL + "xx", bytes, chars, offsets, buffer, length, null }, null, charsBackup, bytesBackup, offsetsBackup, new Object[] { invalidCharLength, subChar1 }});
-//            
+//
 //            // create tests for FROM_U_CALLBACK_SUBSTITUTE  16
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_SUBSTITUTE", new Object[] { encoder, null, chars, bytes, offsets, buffer, length, cp, null }, encoderResultExpected, encoderCharsExpected, encoderBytesExpected, encoderOffsetsExpected, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_SUBSTITUTE", new Object[] { encoder, SUB_STOP_ON_ILLEGAL, chars, bytes, offsets, buffer, length, cp, malf }, malf, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_SUBSTITUTE", new Object[] { encoder, SUB_STOP_ON_ILLEGAL, chars, bytes, offsets, buffer, length, cp, unmap }, encoderResultExpected, encoderCharsExpected, encoderBytesExpected, encoderOffsetsExpected, new Object[] { }});
 //            tests.add(new Object[] {encoderCall, "FROM_U_CALLBACK_SUBSTITUTE", new Object[] { encoder, SUB_STOP_ON_ILLEGAL + "xx", chars, bytes, offsets, buffer, length, cp, null }, null, charsBackup, bytesBackup, offsetsBackup, new Object[] { }});
-//            
+//
 //            // create tests for TO_U_CALLBACK_SUBSTITUTE   20
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_SUBSTITUTE", new Object[] { decoder, null, bytes, chars, offsets, buffer, length, null }, decoderResultExpected1, decoderCharsExpected1, bytesBackup, decoderOffsetsExpected1, new Object[] { invalidCharLength, subChar1 }});
 //            tests.add(new Object[] {decoderCall, "TO_U_CALLBACK_SUBSTITUTE", new Object[] { decoder, null, bytes, chars, offsets, buffer, length, null }, decoderResultExpected2, decoderCharsExpected2, bytesBackup, decoderOffsetsExpected2, new Object[] { invalidCharLength, subChar1_alternate }});
-//            
+//
 //            Iterator iter = tests.iterator();
 //            for (int i=0; iter.hasNext(); i++) {
 //                // get the data out of the map
 //                Object[] next = (Object[])iter.next();
-//                
+//
 //                Method method = (Method)next[0];
 //                String fieldName = (String)next[1];
 //                Object field = getFieldValue(CharsetCallback, fieldName, null);
@@ -1014,7 +1017,7 @@ public class TestCharset extends TestFmwk {
 //                CharBuffer charsExpected = (CharBuffer)next[4];
 //                ByteBuffer bytesExpected = (ByteBuffer)next[5];
 //                IntBuffer offsetsExpected = (IntBuffer)next[6];
-//                
+//
 //                // set up error arrays and certain fields
 //                Object[] values = (Object[])next[7];
 //                if (method == decoderCall) {
@@ -1024,18 +1027,18 @@ public class TestCharset extends TestFmwk {
 //                } else if (method == encoderCall) {
 //                    encoder.reset();
 //                }
-//                
+//
 //                try {
 //                    // invoke the method
 //                    CoderResult actual = (CoderResult)method.invoke(field, args);
-//                    
+//
 //                    // if expected != actual
 //                    if (!coderResultsEqual(expected, actual)) {
 //                        // case #i refers to the index in the arraylist tests
 //                        errln(fieldName + " failed to return the correct result for case #" + i + ".");
 //                    }
 //                    // if the expected buffers != actual buffers
-//                    else if (!(buffersEqual(chars, charsExpected) && 
+//                    else if (!(buffersEqual(chars, charsExpected) &&
 //                            buffersEqual(bytes, bytesExpected) &&
 //                            buffersEqual(offsets, offsetsExpected))) {
 //                        // case #i refers to the index in the arraylist tests
@@ -1046,7 +1049,7 @@ public class TestCharset extends TestFmwk {
 //                    errln(fieldName + " threw an exception for case #" + i + ": " + ex.getCause());
 //                    //ex.getCause().printStackTrace();
 //                }
-//                
+//
 //                // reset the buffers
 //                System.arraycopy(bytesBackup.array(), 0, bytes.array(), 0, 10);
 //                System.arraycopy(charsBackup.array(), 0, chars.array(), 0, 10);
@@ -1055,13 +1058,13 @@ public class TestCharset extends TestFmwk {
 //                chars.position(charsBackup.position());
 //                offsets.position(offsetsBackup.position());
 //            }
-//            
+//
 //        } catch (Exception ex) {
 //            errln("TestCharsetCallback skipped due to " + ex.toString());
 //            ex.printStackTrace();
 //        }
 //    }
-//    
+//
 //    private Object getFieldValue(Class c, String name, Object instance) throws Exception {
 //        Field field = c.getDeclaredField(name);
 //        field.setAccessible(true);
@@ -1147,7 +1150,7 @@ public class TestCharset extends TestFmwk {
 //        dest.position(src.position());
 //        return dest;
 //    }
-    
+
 
     @Test
     public void TestAPISemantics(/*String encoding*/) {
@@ -1243,7 +1246,7 @@ public class TestCharset extends TestFmwk {
                 }
                 if (result.isError()) {
                     errln("ToChars single the result is an error "+result.toString());
-                } 
+                }
             }
             if (unistr.length() != (chars.limit())) {
                 errln("ToChars single len does not match");
@@ -1476,7 +1479,7 @@ public class TestCharset extends TestFmwk {
         } else {
             boolean result = true;
             for (int i = 0; i < chars.length; i++) {
-                if (chars[i] != compareTo[i]) {    
+                if (chars[i] != compareTo[i]) {
                     logln(
                         "Got: "
                             + hex(chars[i])
@@ -1548,7 +1551,7 @@ public class TestCharset extends TestFmwk {
   /*
     @Test
     public void TestCallback(String encoding) throws Exception {
-        
+
         byte[] gbSource =
             {
                 (byte) 0x81,
@@ -1583,20 +1586,20 @@ public class TestCharset extends TestFmwk {
         if (!equals(myTarget, new String(expectedResult))) {
             errln("Test callback GB18030 to Unicode : FAILED");
         }
-        
+
     }
 */
 
     @Test
     public void TestCanConvert(/*String encoding*/)throws Exception {
-        char[] mySource = { 
+        char[] mySource = {
             '\ud800', '\udc00',/*surrogate pair */
             '\u22A6','\u22A7','\u22A8','\u22A9','\u22AA',
             '\u22AB','\u22AC','\u22AD','\u22AE','\u22AF',
             '\u22B0','\u22B1','\u22B2','\u22B3','\u22B4',
             '\ud800','\udc00',/*surrogate pair */
             '\u22B5','\u22B6','\u22B7','\u22B8','\u22B9',
-            '\u22BA','\u22BB','\u22BC','\u22BD','\u22BE' 
+            '\u22BA','\u22BB','\u22BC','\u22BD','\u22BE'
             };
         String encoding = "UTF-16";
         CharsetEncoder encoder = null;
@@ -1613,7 +1616,7 @@ public class TestCharset extends TestFmwk {
         }
 
     }
-    
+
     @Test
     public void TestAvailableCharsets() {
         SortedMap map = Charset.availableCharsets();
@@ -1640,7 +1643,7 @@ public class TestCharset extends TestFmwk {
             errln("Did not get the expected canonical name. Got: "+canonicalName); //get the canonical name
         }
     }
-    
+
     @Test
     public void TestICUAvailableCharsets() {
         CharsetProviderICU icu = new CharsetProviderICU();
@@ -1711,27 +1714,27 @@ public class TestCharset extends TestFmwk {
             warnln("Error creating charset encoder for " + encoding + ": " + e);
         }
     }
-    
+
     @Test
     public void TestSubBytes(){
         try{
             //create utf-8 decoder
             CharsetDecoder decoder = new CharsetProviderICU().charsetForName("utf-8").newDecoder();
-    
+
             //create a valid byte array, which can be decoded to " buffer"
             byte[] unibytes = new byte[] { 0x0020, 0x0062, 0x0075, 0x0066, 0x0066, 0x0065, 0x0072 };
-    
+
             ByteBuffer buffer = ByteBuffer.allocate(20);
-    
+
             //add a evil byte to make the byte buffer be malformed input
             buffer.put((byte)0xd8);
-    
+
             //put the valid byte array
             buffer.put(unibytes);
-    
+
             //reset postion
-            buffer.flip();  
-            
+            buffer.flip();
+
             decoder.onMalformedInput(CodingErrorAction.REPLACE);
             CharBuffer out = decoder.decode(buffer);
             String expected = "\ufffd buffer";
@@ -1748,7 +1751,7 @@ public class TestCharset extends TestFmwk {
 
         @Test
     public void TestImplFlushFailure(){
-   
+
        try{
            CharBuffer in = CharBuffer.wrap("\u3005\u3006\u3007\u30FC\u2015\u2010\uFF0F");
            CharsetEncoder encoder = new CharsetProviderICU().charsetForName("iso-2022-jp").newEncoder();
@@ -1758,16 +1761,16 @@ public class TestCharset extends TestFmwk {
            if(out.position()!= 20){
                errln("Did not get the expected position from flush");
            }
-           
+
        }catch (Exception ex){
            errln("Could not create encoder for  iso-2022-jp exception: "+ex.toString());
-       } 
+       }
     }
    */
 
         @Test
     public void TestISO88591() {
-       
+
         Charset cs = new CharsetProviderICU().charsetForName("iso-8859-1");
         if(cs!=null){
             CharsetEncoder encoder = cs.newEncoder();
@@ -1779,7 +1782,7 @@ public class TestCharset extends TestFmwk {
         }else{
             errln("Could not create Charset for iso-8859-1");
         }
-        
+
     }
 
     @Test
@@ -1828,7 +1831,7 @@ public class TestCharset extends TestFmwk {
                logln("\\ud800 is malformed for JDK utf-8 encoder");
               //e.printStackTrace();
            }
-           
+
            CharsetEncoder encoderJDK = Charset.forName("utf-8").newEncoder();
            try {
                encoderJDK.encode(CharBuffer.wrap("\ud800"));
@@ -1836,9 +1839,9 @@ public class TestCharset extends TestFmwk {
            } catch (Exception e) {
                logln("\\ud800 is malformed for JDK utf-8 encoder");
                //e.printStackTrace();
-           }         
+           }
     }
-    
+
     @Test
     public void TestUTF16Bom(){
 
@@ -1875,7 +1878,7 @@ public class TestCharset extends TestFmwk {
             equals(rt, in);
         }
     }
-     
+
     private void smBufDecode(CharsetDecoder decoder, String encoding, ByteBuffer source, CharBuffer target,
             boolean throwException, boolean flush) throws BufferOverflowException, Exception {
         smBufDecode(decoder, encoding, source, target, throwException, flush, true);
@@ -2173,11 +2176,11 @@ public class TestCharset extends TestFmwk {
     }
 
     /*private void fromUnicodeTest() throws Exception {
-        
+
         logln("Loaded Charset: " + charset.getClass().toString());
         logln("Loaded CharsetEncoder: " + encoder.getClass().toString());
         logln("Loaded CharsetDecoder: " + decoder.getClass().toString());
-        
+
         ByteBuffer myTarget = ByteBuffer.allocate(gbSource.length);
         logln("Created ByteBuffer of length: " + uSource.length);
         CharBuffer mySource = CharBuffer.wrap(uSource);
@@ -2187,17 +2190,17 @@ public class TestCharset extends TestFmwk {
         encoder.encode(mySource, myTarget, true);
         if (!equals(myTarget, gbSource)) {
             errln("--Test Unicode to " + encoding + ": FAILED");
-        } 
+        }
         logln("Test Unicode to " + encoding +" passed");
     }
 
     @Test
     public void TestToUnicode( ) throws Exception {
-        
+
         logln("Loaded Charset: " + charset.getClass().toString());
         logln("Loaded CharsetEncoder: " + encoder.getClass().toString());
         logln("Loaded CharsetDecoder: " + decoder.getClass().toString());
-        
+
         CharBuffer myTarget = CharBuffer.allocate(uSource.length);
         ByteBuffer mySource = ByteBuffer.wrap(getByteArray(gbSource));
         decoder.reset();
@@ -2235,7 +2238,7 @@ public class TestCharset extends TestFmwk {
             errln("Encountered exception in smBufCharset");
         }
     }
-    
+
     @Test
     public void TestMultithreaded() throws Exception {
         final Charset cs = Charset.forName(encoding);
@@ -2249,7 +2252,7 @@ public class TestCharset extends TestFmwk {
                     // commented out since the mehtods on
                     // Charset API are supposed to be thread
                     // safe ... to test it we dont sync
-            
+
                     // synchronized(charset){
                    while (!interrupted()) {
                         try {
@@ -2362,9 +2365,9 @@ public class TestCharset extends TestFmwk {
         }
     }
     */
-    
+
     @Test
-    public void TestMBCS(){      
+    public void TestMBCS(){
         {
             // Encoder: from Unicode conversion
             CharsetEncoder encoderICU = new CharsetProviderICU().charsetForName("ibm-971").newEncoder();
@@ -2400,11 +2403,11 @@ public class TestCharset extends TestFmwk {
             }
         }
     }
-    
+
     @Test
     public void TestJB4897(){
         CharsetProviderICU provider = new CharsetProviderICU();
-        Charset charset = provider.charsetForName("x-abracadabra");  
+        Charset charset = provider.charsetForName("x-abracadabra");
         if(charset!=null && charset.canEncode()== true){
             errln("provider.charsetForName() does not validate the charset names" );
         }
@@ -2427,7 +2430,7 @@ public class TestCharset extends TestFmwk {
     //test to make sure that number of aliases and canonical names are in the charsets that are in
     @Test
     public void TestAllNames() {
-        
+
         CharsetProviderICU provider= new CharsetProviderICU();
         Object[] available = CharsetProviderICU.getAvailableNames();
         for(int i=0; i<available.length;i++){
@@ -2439,7 +2442,7 @@ public class TestCharset extends TestFmwk {
                     continue;
                 }
                 Charset cs = provider.charsetForName((String)available[i]);
-              
+
                 Object[] javaAliases =  cs.aliases().toArray();
                 //seach for ICU canonical name in javaAliases
                 boolean inAliasList = false;
@@ -2534,7 +2537,7 @@ public class TestCharset extends TestFmwk {
         CharBuffer out = CharBuffer.allocate(3);
         return decoder.decode(in, out, true);
     }
-    
+
     @Test
     public void TestJavaUTF16Decoder(){
         CharsetProviderICU provider = new CharsetProviderICU();
@@ -2578,14 +2581,14 @@ public class TestCharset extends TestFmwk {
     public void TestUTF32BOM(){
 
         Charset cs = (new CharsetProviderICU()).charsetForName("UTF-32");
-        char[] in = new char[] { 0xd800, 0xdc00, 
+        char[] in = new char[] { 0xd800, 0xdc00,
                                  0xd801, 0xdc01,
-                                 0xdbff, 0xdfff, 
-                                 0xd900, 0xdd00, 
+                                 0xdbff, 0xdfff,
+                                 0xd900, 0xdd00,
                                  0x0000, 0x0041,
                                  0x0000, 0x0042,
                                  0x0000, 0x0043};
-        
+
         CharBuffer inBuf = CharBuffer.allocate(in.length);
         inBuf.put(in);
         CharsetEncoder encoder = cs.newEncoder();
@@ -2593,7 +2596,7 @@ public class TestCharset extends TestFmwk {
         inBuf.rewind();
         encoder.encode(inBuf, outBuf, true);
         outBuf.rewind();
-        if(outBuf.get(0)!= (byte)0x00 && outBuf.get(1)!= (byte)0x00 && 
+        if(outBuf.get(0)!= (byte)0x00 && outBuf.get(1)!= (byte)0x00 &&
                 outBuf.get(2)!= (byte)0xFF && outBuf.get(3)!= (byte)0xFE){
             errln("The UTF32 encoder did not appended bom. Length returned: " + outBuf.remaining());
         }
@@ -2620,12 +2623,12 @@ public class TestCharset extends TestFmwk {
             // swallow the expection.
         }
     }
-    
+
     /*
      *  Michael Ow
      *  Modified 070424
      */
-    /*The following two methods provides the option of exceptions when Decoding 
+    /*The following two methods provides the option of exceptions when Decoding
      * and Encoding if needed for testing purposes.
      */
     private void smBufDecode(CharsetDecoder decoder, String encoding, ByteBuffer source, CharBuffer target) {
@@ -2634,8 +2637,8 @@ public class TestCharset extends TestFmwk {
     private void smBufDecode(CharsetDecoder decoder, String encoding, ByteBuffer source, CharBuffer target, boolean backedByArray) {
         try {
             smBufDecode(decoder, encoding, source, target, false, false, backedByArray);
-        }    
-        catch (Exception ex) {           
+        }
+        catch (Exception ex) {
             System.out.println("!exception!");
         }
     }
@@ -2644,7 +2647,7 @@ public class TestCharset extends TestFmwk {
     }
     private void smBufEncode(CharsetEncoder encoder, String encoding, CharBuffer source, ByteBuffer target, boolean backedByArray)  {
         try {
-            smBufEncode(encoder, encoding, source, target, false, false); 
+            smBufEncode(encoder, encoding, source, target, false, false);
         }
         catch (Exception ex) {
             System.out.println("!exception!");
@@ -2656,7 +2659,7 @@ public class TestCharset extends TestFmwk {
     public void TestNullCanonicalName() {
         String enc = null;
         String canonicalName = CharsetProviderICU.getICUCanonicalName(enc);
-        
+
         if (canonicalName != null) {
             errln("getICUCanonicalName return a non-null string for given null string");
         }
@@ -2665,9 +2668,9 @@ public class TestCharset extends TestFmwk {
     @Test
     public void TestGetAllNames() {
         String[] names = null;
-        
+
         names = CharsetProviderICU.getAllNames();
-        
+
         if (names == null) {
             errln("getAllNames returned a null string.");
         }
@@ -2677,29 +2680,29 @@ public class TestCharset extends TestFmwk {
     @Test
     public void TestCharsetContains() {
         boolean test;
-        
-        CharsetProvider provider = new CharsetProviderICU();     
+
+        CharsetProvider provider = new CharsetProviderICU();
         Charset cs1 = provider.charsetForName("UTF-32");
         Charset cs2 = null;
-        
+
         test = cs1.contains(cs2);
-        
+
         if (test != false) {
             errln("Charset.contains returned true for a null charset.");
         }
-        
+
         cs2 = CharsetICU.forNameICU("UTF-32");
-        
+
         test = cs1.contains(cs2);
-        
+
         if (test != true) {
             errln("Charset.contains returned false for an identical charset.");
         }
-        
+
         cs2 = provider.charsetForName("UTF-8");
-        
+
         test = cs1.contains(cs2);
-        
+
         if (test != false) {
             errln("Charset.contains returned true for a different charset.");
         }
@@ -2708,42 +2711,42 @@ public class TestCharset extends TestFmwk {
     @Test
     public void TestCharsetICUNullCharsetName() {
         String charsetName = null;
-        
+
         try {
             CharsetICU.forNameICU(charsetName);
             errln("CharsetICU.forName should have thown an exception after getting a null charsetName.");
         }
-        catch(Exception ex) {          
+        catch(Exception ex) {
         }
     }
-    
+
     //Test CharsetASCII
     @Test
     public void TestCharsetASCIIOverFlow() {
         int byteBufferLimit;
         int charBufferLimit;
-        
+
         CharsetProvider provider = new CharsetProviderICU();
-        Charset cs = provider.charsetForName("ASCII");        
+        Charset cs = provider.charsetForName("ASCII");
         CharsetEncoder encoder = cs.newEncoder();
         CharsetDecoder decoder = cs.newDecoder();
-        
+
         CharBuffer charBuffer = CharBuffer.allocate(0x90);
         ByteBuffer byteBuffer = ByteBuffer.allocate(0x90);
-        
+
         CharBuffer charBufferTest = CharBuffer.allocate(0xb0);
         ByteBuffer byteBufferTest = ByteBuffer.allocate(0xb0);
-        
+
         for(int j=0;j<=0x7f; j++){
            charBuffer.put((char)j);
            byteBuffer.put((byte)j);
         }
-        
+
         byteBuffer.limit(byteBufferLimit = byteBuffer.position());
         byteBuffer.position(0);
         charBuffer.limit(charBufferLimit = charBuffer.position());
         charBuffer.position(0);
-        
+
         //test for overflow
         byteBufferTest.limit(byteBufferLimit - 5);
         byteBufferTest.position(0);
@@ -2761,7 +2764,7 @@ public class TestCharset extends TestFmwk {
         }
         catch (Exception ex) {
         }
-        
+
         // For better code coverage
         /* For better code coverage */
         byte byteout[] = {
@@ -2786,20 +2789,20 @@ public class TestCharset extends TestFmwk {
     public void TestCharsetUTF7() {
         CoderResult result = CoderResult.UNDERFLOW;
         CharsetProvider provider = new CharsetProviderICU();
-        Charset cs = provider.charsetForName("UTF-7");        
+        Charset cs = provider.charsetForName("UTF-7");
         CharsetEncoder encoder = cs.newEncoder();
         CharsetDecoder decoder = cs.newDecoder();
-        
+
         CharBuffer us = CharBuffer.allocate(0x100);
         ByteBuffer bs = ByteBuffer.allocate(0x100);
-        
+
         /* Unicode :  A<not equal to Alpha Lamda>. */
         /* UTF7: AImIDkQ. */
         us.put((char)0x41); us.put((char)0x2262); us.put((char)0x391); us.put((char)0x39B); us.put((char)0x2e);
-        bs.put((byte)0x41); bs.put((byte)0x2b); bs.put((byte)0x49); bs.put((byte)0x6d); 
-        bs.put((byte)0x49); bs.put((byte)0x44); bs.put((byte)0x6b); bs.put((byte)0x51); 
+        bs.put((byte)0x41); bs.put((byte)0x2b); bs.put((byte)0x49); bs.put((byte)0x6d);
+        bs.put((byte)0x49); bs.put((byte)0x44); bs.put((byte)0x6b); bs.put((byte)0x51);
         bs.put((byte)0x4f); bs.put((byte)0x62); bs.put((byte)0x2e);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
@@ -2807,20 +2810,20 @@ public class TestCharset extends TestFmwk {
 
         smBufDecode(decoder, "UTF-7", bs, us);
         smBufEncode(encoder, "UTF-7", us, bs);
-        
+
         /* Testing UTF-7 toUnicode with substitute callbacks */
         {
             byte [] bytesTestErrorConsumption = {
                     /* a~       a+AB~                         a+AB\x0c                      a+AB-                         a+AB.                         a+. */
                     0x61, 0x7e, 0x61, 0x2b, 0x41, 0x42, 0x7e, 0x61, 0x2b, 0x41, 0x42, 0x0c, 0x61, 0x2b, 0x41, 0x42, 0x2d, 0x61, 0x2b, 0x41, 0x42, 0x2e, 0x61, 0x2b, 0x2e
-    
+
             };
             char [] unicodeTestErrorConsumption = {
                     0x61, 0xfffd, 0x61, 0xfffd, 0xfffd, 0x61, 0xfffd, 0xfffd, 0x61, 0xfffd, 0x61, 0xfffd, 0x2e, 0x61, 0xfffd, 0x2e
             };
             bs = ByteBuffer.wrap(bytesTestErrorConsumption);
             us = CharBuffer.wrap(unicodeTestErrorConsumption);
-    
+
             CodingErrorAction savedMal = decoder.malformedInputAction();
             CodingErrorAction savedUMap = decoder.unmappableCharacterAction();
             decoder.onMalformedInput(CodingErrorAction.REPLACE);
@@ -2839,16 +2842,16 @@ public class TestCharset extends TestFmwk {
             errln("Buffer Overflow exception should have been thrown while decoding UTF-7.");
         } catch (Exception ex) {
         }
-        
+
         //The rest of the code in this method is to provide better code coverage
         CharBuffer ccus = CharBuffer.allocate(0x10);
         ByteBuffer ccbs = ByteBuffer.allocate(0x10);
-        
+
         //start of charset decoder code coverage code
         //test for accurate illegal and control character checking
         ccbs.put((byte)0x0D); ccbs.put((byte)0x05);
         ccus.put((char)0x0000);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
@@ -2860,131 +2863,131 @@ public class TestCharset extends TestFmwk {
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for illegal base64 character
         ccbs.put((byte)0x2b); ccbs.put((byte)0xff);
         ccus.put((char)0x0000);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-7-CC-DE-2", ccbs, ccus, true, false);
             errln("Exception while decoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for illegal order of the base64 character sequence
         ccbs.put((byte)0x2b); ccbs.put((byte)0x2d); ccbs.put((byte)0x2b); ccbs.put((byte)0x49); ccbs.put((byte)0x2d);
         ccus.put((char)0x0000); ccus.put((char)0x0000);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-7-CC-DE-3", ccbs, ccus, true, false);
             errln("Exception while decoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
-        //test for illegal order of the base64 character sequence 
+
+        //test for illegal order of the base64 character sequence
         ccbs.put((byte)0x2b); ccbs.put((byte)0x0a); ccbs.put((byte)0x09);
         ccus.put((char)0x0000);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-7-CC-DE-4", ccbs, ccus, true, false);
             errln("Exception while decoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for illegal order of the base64 character sequence
         ccbs.put((byte)0x2b); ccbs.put((byte)0x49); ccbs.put((byte)0x0a);
         ccus.put((char)0x0000);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-7-CC-DE-5", ccbs, ccus, true, false);
             errln("Exception while decoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for illegal order of the base64 character sequence
         ccbs.put((byte)0x2b); ccbs.put((byte)0x00);
         ccus.put((char)0x0000);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-7-CC-DE-6", ccbs, ccus, true, false);
             errln("Exception while decoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccbs.put((byte)0x2b); ccbs.put((byte)0x49);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(0);
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-7-CC-DE-7", ccbs, ccus, true, false);
             errln("Exception while decoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccbs.put((byte)0x0c); ccbs.put((byte)0x0c);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(0);
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-7-CC-DE-8", ccbs, ccus, true, false);
             errln("Exception while decoding UTF-7 code coverage test should have been thrown.");
@@ -2992,48 +2995,48 @@ public class TestCharset extends TestFmwk {
         catch (Exception ex) {
         }
         //end of charset decoder code coverage code
-        
+
         //start of charset encoder code coverage code
         ccbs.clear();
         ccus.clear();
         //test for overflow buffer error
         ccus.put((char)0x002b);
-        ccbs.put((byte)0x2b); 
-        
+        ccbs.put((byte)0x2b);
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-1", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x002b); ccus.put((char)0x2262);
         ccbs.put((byte)0x2b); ccbs.put((byte)0x2d); ccbs.put((byte)0x00); ccbs.put((byte)0x00);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-2", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        } 
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x2262); ccus.put((char)0x0049);
         ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00);
@@ -3041,17 +3044,17 @@ public class TestCharset extends TestFmwk {
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-3", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        }  
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x2262); ccus.put((char)0x0395);
         ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00);
@@ -3059,17 +3062,17 @@ public class TestCharset extends TestFmwk {
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-4", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        }  
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x2262); ccus.put((char)0x0395);
         ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00);
@@ -3077,17 +3080,17 @@ public class TestCharset extends TestFmwk {
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-5", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        }  
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x2262); ccus.put((char)0x0395); ccus.put((char)0x0391);
         ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00);
@@ -3095,54 +3098,54 @@ public class TestCharset extends TestFmwk {
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-6", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        }  
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x2262); ccus.put((char)0x0395); ccus.put((char)0x0391);
-        ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); 
+        ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00);
         ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00);
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-7", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        }  
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x0049); ccus.put((char)0x0048);
-        ccbs.put((byte)0x00); 
+        ccbs.put((byte)0x00);
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-8", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        } 
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x2262);
         ccbs.put((byte)0x00);
@@ -3150,17 +3153,17 @@ public class TestCharset extends TestFmwk {
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-9", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        } 
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x2262); ccus.put((char)0x0049);
         ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00); ccbs.put((byte)0x00);
@@ -3168,21 +3171,21 @@ public class TestCharset extends TestFmwk {
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF-7-CC-EN-10", ccus, ccbs, true, false);
             errln("Exception while encoding UTF-7 code coverage test should have been thrown.");
         }
         catch (Exception ex) {
-        }  
-        
+        }
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         ccus.put((char)0x2262);
         ccbs.put((byte)0x2b); ccbs.put((byte)0x49); ccbs.put((byte)0x6d); ccbs.put((byte)0x49); ccbs.put((byte)0x2d);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
@@ -3192,20 +3195,20 @@ public class TestCharset extends TestFmwk {
         } catch (Exception ex) {
             errln("Exception while encoding UTF-7 code coverage test should not have been thrown.");
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test for overflow buffer error
         encoder.reset();
         ccus.put((char)0x3980); ccus.put((char)0x2715);
         ccbs.put((byte)0x2b); ccbs.put((byte)0x4f); ccbs.put((byte)0x59); ccbs.put((byte)0x2d);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         result = encoder.encode(ccus, ccbs, true);
         result = encoder.flush(ccbs);
         if (!result.isOverflow()) {
@@ -3218,104 +3221,104 @@ public class TestCharset extends TestFmwk {
     @Test
     public void TestCharsetISCII() {
         CharsetProvider provider = new CharsetProviderICU();
-        Charset cs = provider.charsetForName("ISCII,version=0");        
+        Charset cs = provider.charsetForName("ISCII,version=0");
         CharsetEncoder encoder = cs.newEncoder();
         CharsetDecoder decoder = cs.newDecoder();
-        
+
         CharBuffer us = CharBuffer.allocate(0x100);
         ByteBuffer bs = ByteBuffer.allocate(0x100);
         ByteBuffer bsr = ByteBuffer.allocate(0x100);
-        
+
         //test full range of Devanagari
         us.put((char)0x0901); us.put((char)0x0902); us.put((char)0x0903); us.put((char)0x0905); us.put((char)0x0906); us.put((char)0x0907);
         us.put((char)0x0908); us.put((char)0x0909); us.put((char)0x090A); us.put((char)0x090B); us.put((char)0x090E); us.put((char)0x090F);
         us.put((char)0x0910); us.put((char)0x090D); us.put((char)0x0912); us.put((char)0x0913); us.put((char)0x0914); us.put((char)0x0911);
         us.put((char)0x0915); us.put((char)0x0916); us.put((char)0x0917); us.put((char)0x0918); us.put((char)0x0919); us.put((char)0x091A);
         us.put((char)0x091B); us.put((char)0x091C); us.put((char)0x091D); us.put((char)0x091E); us.put((char)0x091F); us.put((char)0x0920);
-        us.put((char)0x0921); us.put((char)0x0922); us.put((char)0x0923); us.put((char)0x0924); us.put((char)0x0925); us.put((char)0x0926); 
-        us.put((char)0x0927); us.put((char)0x0928); us.put((char)0x0929); us.put((char)0x092A); us.put((char)0x092B); us.put((char)0x092C); 
-        us.put((char)0x092D); us.put((char)0x092E); us.put((char)0x092F); us.put((char)0x095F); us.put((char)0x0930); us.put((char)0x0931); 
-        us.put((char)0x0932); us.put((char)0x0933); us.put((char)0x0934); us.put((char)0x0935); us.put((char)0x0936); us.put((char)0x0937); 
-        us.put((char)0x0938); us.put((char)0x0939); us.put((char)0x200D); us.put((char)0x093E); us.put((char)0x093F); us.put((char)0x0940); 
-        us.put((char)0x0941); us.put((char)0x0942); us.put((char)0x0943); us.put((char)0x0946); us.put((char)0x0947); us.put((char)0x0948); 
-        us.put((char)0x0945); us.put((char)0x094A); us.put((char)0x094B); us.put((char)0x094C); us.put((char)0x0949); us.put((char)0x094D); 
-        us.put((char)0x093D); us.put((char)0x0966); us.put((char)0x0967); us.put((char)0x0968); us.put((char)0x0969); us.put((char)0x096A); 
-        us.put((char)0x096B); us.put((char)0x096C); us.put((char)0x096D); us.put((char)0x096E); us.put((char)0x096F); 
-        
+        us.put((char)0x0921); us.put((char)0x0922); us.put((char)0x0923); us.put((char)0x0924); us.put((char)0x0925); us.put((char)0x0926);
+        us.put((char)0x0927); us.put((char)0x0928); us.put((char)0x0929); us.put((char)0x092A); us.put((char)0x092B); us.put((char)0x092C);
+        us.put((char)0x092D); us.put((char)0x092E); us.put((char)0x092F); us.put((char)0x095F); us.put((char)0x0930); us.put((char)0x0931);
+        us.put((char)0x0932); us.put((char)0x0933); us.put((char)0x0934); us.put((char)0x0935); us.put((char)0x0936); us.put((char)0x0937);
+        us.put((char)0x0938); us.put((char)0x0939); us.put((char)0x200D); us.put((char)0x093E); us.put((char)0x093F); us.put((char)0x0940);
+        us.put((char)0x0941); us.put((char)0x0942); us.put((char)0x0943); us.put((char)0x0946); us.put((char)0x0947); us.put((char)0x0948);
+        us.put((char)0x0945); us.put((char)0x094A); us.put((char)0x094B); us.put((char)0x094C); us.put((char)0x0949); us.put((char)0x094D);
+        us.put((char)0x093D); us.put((char)0x0966); us.put((char)0x0967); us.put((char)0x0968); us.put((char)0x0969); us.put((char)0x096A);
+        us.put((char)0x096B); us.put((char)0x096C); us.put((char)0x096D); us.put((char)0x096E); us.put((char)0x096F);
+
         bs.put((byte)0xEF); bs.put((byte)0x42);
         bs.put((byte)0xA1); bs.put((byte)0xA2); bs.put((byte)0xA3); bs.put((byte)0xA4); bs.put((byte)0xA5); bs.put((byte)0xA6);
-        bs.put((byte)0xA7); bs.put((byte)0xA8); bs.put((byte)0xA9); bs.put((byte)0xAA); bs.put((byte)0xAB); bs.put((byte)0xAC); 
-        bs.put((byte)0xAD); bs.put((byte)0xAE); bs.put((byte)0xAF); bs.put((byte)0xB0); bs.put((byte)0xB1); bs.put((byte)0xB2); 
-        bs.put((byte)0xB3); bs.put((byte)0xB4); bs.put((byte)0xB5); bs.put((byte)0xB6); bs.put((byte)0xB7); bs.put((byte)0xB8); 
-        bs.put((byte)0xB9); bs.put((byte)0xBA); bs.put((byte)0xBB); bs.put((byte)0xBC); bs.put((byte)0xBD); bs.put((byte)0xBE); 
-        bs.put((byte)0xBF); bs.put((byte)0xC0); bs.put((byte)0xC1); bs.put((byte)0xC2); bs.put((byte)0xC3); bs.put((byte)0xC4); 
-        bs.put((byte)0xC5); bs.put((byte)0xC6); bs.put((byte)0xC7); bs.put((byte)0xC8); bs.put((byte)0xC9); bs.put((byte)0xCA); 
-        bs.put((byte)0xCB); bs.put((byte)0xCC); bs.put((byte)0xCD); bs.put((byte)0xCE); bs.put((byte)0xCF); bs.put((byte)0xD0); 
-        bs.put((byte)0xD1); bs.put((byte)0xD2); bs.put((byte)0xD3); bs.put((byte)0xD4); bs.put((byte)0xD5); bs.put((byte)0xD6); 
-        bs.put((byte)0xD7); bs.put((byte)0xD8); bs.put((byte)0xD9); bs.put((byte)0xDA); bs.put((byte)0xDB); bs.put((byte)0xDC); 
-        bs.put((byte)0xDD); bs.put((byte)0xDE); bs.put((byte)0xDF); bs.put((byte)0xE0); bs.put((byte)0xE1); bs.put((byte)0xE2); 
-        bs.put((byte)0xE3); bs.put((byte)0xE4); bs.put((byte)0xE5); bs.put((byte)0xE6); bs.put((byte)0xE7); bs.put((byte)0xE8); 
-        bs.put((byte)0xEA); bs.put((byte)0xE9); bs.put((byte)0xF1); bs.put((byte)0xF2); bs.put((byte)0xF3); bs.put((byte)0xF4); 
-        bs.put((byte)0xF5); bs.put((byte)0xF6); bs.put((byte)0xF7); bs.put((byte)0xF8); bs.put((byte)0xF9); bs.put((byte)0xFA); 
-        
+        bs.put((byte)0xA7); bs.put((byte)0xA8); bs.put((byte)0xA9); bs.put((byte)0xAA); bs.put((byte)0xAB); bs.put((byte)0xAC);
+        bs.put((byte)0xAD); bs.put((byte)0xAE); bs.put((byte)0xAF); bs.put((byte)0xB0); bs.put((byte)0xB1); bs.put((byte)0xB2);
+        bs.put((byte)0xB3); bs.put((byte)0xB4); bs.put((byte)0xB5); bs.put((byte)0xB6); bs.put((byte)0xB7); bs.put((byte)0xB8);
+        bs.put((byte)0xB9); bs.put((byte)0xBA); bs.put((byte)0xBB); bs.put((byte)0xBC); bs.put((byte)0xBD); bs.put((byte)0xBE);
+        bs.put((byte)0xBF); bs.put((byte)0xC0); bs.put((byte)0xC1); bs.put((byte)0xC2); bs.put((byte)0xC3); bs.put((byte)0xC4);
+        bs.put((byte)0xC5); bs.put((byte)0xC6); bs.put((byte)0xC7); bs.put((byte)0xC8); bs.put((byte)0xC9); bs.put((byte)0xCA);
+        bs.put((byte)0xCB); bs.put((byte)0xCC); bs.put((byte)0xCD); bs.put((byte)0xCE); bs.put((byte)0xCF); bs.put((byte)0xD0);
+        bs.put((byte)0xD1); bs.put((byte)0xD2); bs.put((byte)0xD3); bs.put((byte)0xD4); bs.put((byte)0xD5); bs.put((byte)0xD6);
+        bs.put((byte)0xD7); bs.put((byte)0xD8); bs.put((byte)0xD9); bs.put((byte)0xDA); bs.put((byte)0xDB); bs.put((byte)0xDC);
+        bs.put((byte)0xDD); bs.put((byte)0xDE); bs.put((byte)0xDF); bs.put((byte)0xE0); bs.put((byte)0xE1); bs.put((byte)0xE2);
+        bs.put((byte)0xE3); bs.put((byte)0xE4); bs.put((byte)0xE5); bs.put((byte)0xE6); bs.put((byte)0xE7); bs.put((byte)0xE8);
+        bs.put((byte)0xEA); bs.put((byte)0xE9); bs.put((byte)0xF1); bs.put((byte)0xF2); bs.put((byte)0xF3); bs.put((byte)0xF4);
+        bs.put((byte)0xF5); bs.put((byte)0xF6); bs.put((byte)0xF7); bs.put((byte)0xF8); bs.put((byte)0xF9); bs.put((byte)0xFA);
+
         bsr.put((byte)0xA1); bsr.put((byte)0xA2); bsr.put((byte)0xA3); bsr.put((byte)0xA4); bsr.put((byte)0xA5); bsr.put((byte)0xA6);
-        bsr.put((byte)0xA7); bsr.put((byte)0xA8); bsr.put((byte)0xA9); bsr.put((byte)0xAA); bsr.put((byte)0xAB); bsr.put((byte)0xAC); 
-        bsr.put((byte)0xAD); bsr.put((byte)0xAE); bsr.put((byte)0xAF); bsr.put((byte)0xB0); bsr.put((byte)0xB1); bsr.put((byte)0xB2); 
-        bsr.put((byte)0xB3); bsr.put((byte)0xB4); bsr.put((byte)0xB5); bsr.put((byte)0xB6); bsr.put((byte)0xB7); bsr.put((byte)0xB8); 
-        bsr.put((byte)0xB9); bsr.put((byte)0xBA); bsr.put((byte)0xBB); bsr.put((byte)0xBC); bsr.put((byte)0xBD); bsr.put((byte)0xBE); 
-        bsr.put((byte)0xBF); bsr.put((byte)0xC0); bsr.put((byte)0xC1); bsr.put((byte)0xC2); bsr.put((byte)0xC3); bsr.put((byte)0xC4); 
-        bsr.put((byte)0xC5); bsr.put((byte)0xC6); bsr.put((byte)0xC7); bsr.put((byte)0xC8); bsr.put((byte)0xC9); bsr.put((byte)0xCA); 
-        bsr.put((byte)0xCB); bsr.put((byte)0xCC); bsr.put((byte)0xCD); bsr.put((byte)0xCE); bsr.put((byte)0xCF); bsr.put((byte)0xD0); 
-        bsr.put((byte)0xD1); bsr.put((byte)0xD2); bsr.put((byte)0xD3); bsr.put((byte)0xD4); bsr.put((byte)0xD5); bsr.put((byte)0xD6); 
-        bsr.put((byte)0xD7); bsr.put((byte)0xD8); bsr.put((byte)0xD9); bsr.put((byte)0xDA); bsr.put((byte)0xDB); bsr.put((byte)0xDC); 
-        bsr.put((byte)0xDD); bsr.put((byte)0xDE); bsr.put((byte)0xDF); bsr.put((byte)0xE0); bsr.put((byte)0xE1); bsr.put((byte)0xE2); 
-        bsr.put((byte)0xE3); bsr.put((byte)0xE4); bsr.put((byte)0xE5); bsr.put((byte)0xE6); bsr.put((byte)0xE7); bsr.put((byte)0xE8); 
-        bsr.put((byte)0xEA); bsr.put((byte)0xE9); bsr.put((byte)0xF1); bsr.put((byte)0xF2); bsr.put((byte)0xF3); bsr.put((byte)0xF4); 
-        bsr.put((byte)0xF5); bsr.put((byte)0xF6); bsr.put((byte)0xF7); bsr.put((byte)0xF8); bsr.put((byte)0xF9); bsr.put((byte)0xFA); 
-        
+        bsr.put((byte)0xA7); bsr.put((byte)0xA8); bsr.put((byte)0xA9); bsr.put((byte)0xAA); bsr.put((byte)0xAB); bsr.put((byte)0xAC);
+        bsr.put((byte)0xAD); bsr.put((byte)0xAE); bsr.put((byte)0xAF); bsr.put((byte)0xB0); bsr.put((byte)0xB1); bsr.put((byte)0xB2);
+        bsr.put((byte)0xB3); bsr.put((byte)0xB4); bsr.put((byte)0xB5); bsr.put((byte)0xB6); bsr.put((byte)0xB7); bsr.put((byte)0xB8);
+        bsr.put((byte)0xB9); bsr.put((byte)0xBA); bsr.put((byte)0xBB); bsr.put((byte)0xBC); bsr.put((byte)0xBD); bsr.put((byte)0xBE);
+        bsr.put((byte)0xBF); bsr.put((byte)0xC0); bsr.put((byte)0xC1); bsr.put((byte)0xC2); bsr.put((byte)0xC3); bsr.put((byte)0xC4);
+        bsr.put((byte)0xC5); bsr.put((byte)0xC6); bsr.put((byte)0xC7); bsr.put((byte)0xC8); bsr.put((byte)0xC9); bsr.put((byte)0xCA);
+        bsr.put((byte)0xCB); bsr.put((byte)0xCC); bsr.put((byte)0xCD); bsr.put((byte)0xCE); bsr.put((byte)0xCF); bsr.put((byte)0xD0);
+        bsr.put((byte)0xD1); bsr.put((byte)0xD2); bsr.put((byte)0xD3); bsr.put((byte)0xD4); bsr.put((byte)0xD5); bsr.put((byte)0xD6);
+        bsr.put((byte)0xD7); bsr.put((byte)0xD8); bsr.put((byte)0xD9); bsr.put((byte)0xDA); bsr.put((byte)0xDB); bsr.put((byte)0xDC);
+        bsr.put((byte)0xDD); bsr.put((byte)0xDE); bsr.put((byte)0xDF); bsr.put((byte)0xE0); bsr.put((byte)0xE1); bsr.put((byte)0xE2);
+        bsr.put((byte)0xE3); bsr.put((byte)0xE4); bsr.put((byte)0xE5); bsr.put((byte)0xE6); bsr.put((byte)0xE7); bsr.put((byte)0xE8);
+        bsr.put((byte)0xEA); bsr.put((byte)0xE9); bsr.put((byte)0xF1); bsr.put((byte)0xF2); bsr.put((byte)0xF3); bsr.put((byte)0xF4);
+        bsr.put((byte)0xF5); bsr.put((byte)0xF6); bsr.put((byte)0xF7); bsr.put((byte)0xF8); bsr.put((byte)0xF9); bsr.put((byte)0xFA);
+
         //test Soft Halant
         us.put((char)0x0915); us.put((char)0x094d); us.put((char)0x200D);
         bs.put((byte)0xB3); bs.put((byte)0xE8); bs.put((byte)0xE9);
         bsr.put((byte)0xB3); bsr.put((byte)0xE8); bsr.put((byte)0xE9);
-        
+
         //test explicit halant
         us.put((char)0x0915); us.put((char)0x094D); us.put((char)0x200C);
         bs.put((byte)0xB3); bs.put((byte)0xE8); bs.put((byte)0xE8);
         bsr.put((byte)0xB3); bsr.put((byte)0xE8); bsr.put((byte)0xE8);
-        
+
         //test double danda
-        us.put((char)0x0965); 
-        bs.put((byte)0xEA); bs.put((byte)0xEA); 
-        bsr.put((byte)0xEA); bsr.put((byte)0xEA); 
-        
+        us.put((char)0x0965);
+        bs.put((byte)0xEA); bs.put((byte)0xEA);
+        bsr.put((byte)0xEA); bsr.put((byte)0xEA);
+
         //test ASCII
         us.put((char)0x1B); us.put((char)0x24); us.put((char)0x29); us.put((char)0x47); us.put((char)0x0E); us.put((char)0x23);
         us.put((char)0x21); us.put((char)0x23); us.put((char)0x22); us.put((char)0x23); us.put((char)0x23); us.put((char)0x23);
         us.put((char)0x24); us.put((char)0x23); us.put((char)0x25); us.put((char)0x23); us.put((char)0x26); us.put((char)0x23);
         us.put((char)0x27); us.put((char)0x23); us.put((char)0x28); us.put((char)0x23); us.put((char)0x29); us.put((char)0x23);
         us.put((char)0x2A); us.put((char)0x23); us.put((char)0x2B); us.put((char)0x0F); us.put((char)0x2F); us.put((char)0x2A);
-        
+
         bs.put((byte)0x1B); bs.put((byte)0x24); bs.put((byte)0x29); bs.put((byte)0x47); bs.put((byte)0x0E); bs.put((byte)0x23);
         bs.put((byte)0x21); bs.put((byte)0x23); bs.put((byte)0x22); bs.put((byte)0x23); bs.put((byte)0x23); bs.put((byte)0x23);
         bs.put((byte)0x24); bs.put((byte)0x23); bs.put((byte)0x25); bs.put((byte)0x23); bs.put((byte)0x26); bs.put((byte)0x23);
         bs.put((byte)0x27); bs.put((byte)0x23); bs.put((byte)0x28); bs.put((byte)0x23); bs.put((byte)0x29); bs.put((byte)0x23);
         bs.put((byte)0x2A); bs.put((byte)0x23); bs.put((byte)0x2B); bs.put((byte)0x0F); bs.put((byte)0x2F); bs.put((byte)0x2A);
-        
+
         bsr.put((byte)0x1B); bsr.put((byte)0x24); bsr.put((byte)0x29); bsr.put((byte)0x47); bsr.put((byte)0x0E); bsr.put((byte)0x23);
         bsr.put((byte)0x21); bsr.put((byte)0x23); bsr.put((byte)0x22); bsr.put((byte)0x23); bsr.put((byte)0x23); bsr.put((byte)0x23);
         bsr.put((byte)0x24); bsr.put((byte)0x23); bsr.put((byte)0x25); bsr.put((byte)0x23); bsr.put((byte)0x26); bsr.put((byte)0x23);
         bsr.put((byte)0x27); bsr.put((byte)0x23); bsr.put((byte)0x28); bsr.put((byte)0x23); bsr.put((byte)0x29); bsr.put((byte)0x23);
         bsr.put((byte)0x2A); bsr.put((byte)0x23); bsr.put((byte)0x2B); bsr.put((byte)0x0F); bsr.put((byte)0x2F); bsr.put((byte)0x2A);
-        
+
         //test from Lotus
         //Some of the Lotus ISCII code points have been changed or commented out.
         us.put((char)0x0061); us.put((char)0x0915); us.put((char)0x000D); us.put((char)0x000A); us.put((char)0x0996); us.put((char)0x0043);
         us.put((char)0x0930); us.put((char)0x094D); us.put((char)0x200D); us.put((char)0x0901); us.put((char)0x000D); us.put((char)0x000A);
         us.put((char)0x0905); us.put((char)0x0985); us.put((char)0x0043); us.put((char)0x0915); us.put((char)0x0921); us.put((char)0x002B);
-        us.put((char)0x095F); 
+        us.put((char)0x095F);
         bs.put((byte)0x61); bs.put((byte)0xB3);
-        bs.put((byte)0x0D); bs.put((byte)0x0A); 
-        bs.put((byte)0xEF); bs.put((byte)0x42); 
+        bs.put((byte)0x0D); bs.put((byte)0x0A);
+        bs.put((byte)0xEF); bs.put((byte)0x42);
         bs.put((byte)0xEF); bs.put((byte)0x43); bs.put((byte)0xB4); bs.put((byte)0x43);
         bs.put((byte)0xEF); bs.put((byte)0x42); bs.put((byte)0xCF); bs.put((byte)0xE8); bs.put((byte)0xE9); bs.put((byte)0xA1); bs.put((byte)0x0D); bs.put((byte)0x0A); bs.put((byte)0xEF); bs.put((byte)0x42);
         bs.put((byte)0xA4); bs.put((byte)0xEF); bs.put((byte)0x43); bs.put((byte)0xA4); bs.put((byte)0x43); bs.put((byte)0xEF);
@@ -3329,59 +3332,59 @@ public class TestCharset extends TestFmwk {
         bsr.put((byte)0x42); bsr.put((byte)0xB3); bsr.put((byte)0xBF); bsr.put((byte)0x2B); bsr.put((byte)0xEF); bsr.put((byte)0x42);
         bsr.put((byte)0xCE);
         //end of test from Lotus
-        
+
         //tamil range
         us.put((char)0x0B86); us.put((char)0x0B87); us.put((char)0x0B88);
         bs.put((byte)0xEF); bs.put((byte)0x44); bs.put((byte)0xA5); bs.put((byte)0xA6); bs.put((byte)0xA7);
         bsr.put((byte)0xEF); bsr.put((byte)0x44); bsr.put((byte)0xA5); bsr.put((byte)0xA6); bsr.put((byte)0xA7);
-        
+
         //telugu range
         us.put((char)0x0C05); us.put((char)0x0C02); us.put((char)0x0C03); us.put((char)0x0C31);
         bs.put((byte)0xEF); bs.put((byte)0x45); bs.put((byte)0xA4); bs.put((byte)0xA2); bs.put((byte)0xA3); bs.put((byte)0xD0);
         bsr.put((byte)0xEF); bsr.put((byte)0x45); bsr.put((byte)0xA4); bsr.put((byte)0xA2); bsr.put((byte)0xA3); bsr.put((byte)0xD0);
-        
+
         //kannada range
         us.put((char)0x0C85); us.put((char)0x0C82); us.put((char)0x0C83);
         bs.put((byte)0xEF); bs.put((byte)0x48); bs.put((byte)0xA4); bs.put((byte)0xA2); bs.put((byte)0xA3);
-        bsr.put((byte)0xEF); bsr.put((byte)0x48); bsr.put((byte)0xA4); bsr.put((byte)0xA2); bsr.put((byte)0xA3);  
-        
+        bsr.put((byte)0xEF); bsr.put((byte)0x48); bsr.put((byte)0xA4); bsr.put((byte)0xA2); bsr.put((byte)0xA3);
+
         //test Abbr sign and Anudatta
         us.put((char)0x0970); us.put((char)0x0952); us.put((char)0x0960); us.put((char)0x0944); us.put((char)0x090C); us.put((char)0x0962);
         us.put((char)0x0961); us.put((char)0x0963); us.put((char)0x0950); us.put((char)0x093D); us.put((char)0x0958); us.put((char)0x0959);
         us.put((char)0x095A); us.put((char)0x095B); us.put((char)0x095C); us.put((char)0x095D); us.put((char)0x095E); us.put((char)0x0020);
-        us.put((char)0x094D); us.put((char)0x0930); us.put((char)0x0000); us.put((char)0x00A0); 
+        us.put((char)0x094D); us.put((char)0x0930); us.put((char)0x0000); us.put((char)0x00A0);
         bs.put((byte)0xEF); bs.put((byte)0x42); bs.put((byte)0xF0); bs.put((byte)0xBF); bs.put((byte)0xF0); bs.put((byte)0xB8);
         bs.put((byte)0xAA); bs.put((byte)0xE9); bs.put((byte)0xDF); bs.put((byte)0xE9); bs.put((byte)0xA6); bs.put((byte)0xE9);
         bs.put((byte)0xDB); bs.put((byte)0xE9); bs.put((byte)0xA7); bs.put((byte)0xE9); bs.put((byte)0xDC); bs.put((byte)0xE9);
         bs.put((byte)0xA1); bs.put((byte)0xE9); bs.put((byte)0xEA); bs.put((byte)0xE9); bs.put((byte)0xB3); bs.put((byte)0xE9);
         bs.put((byte)0xB4); bs.put((byte)0xE9); bs.put((byte)0xB5); bs.put((byte)0xE9); bs.put((byte)0xBA); bs.put((byte)0xE9);
         bs.put((byte)0xBF); bs.put((byte)0xE9); bs.put((byte)0xC0); bs.put((byte)0xE9); bs.put((byte)0xC9); bs.put((byte)0xE9);
-        bs.put((byte)0x20); bs.put((byte)0xE8); bs.put((byte)0xCF); bs.put((byte)0x00); bs.put((byte)0xA0); 
-        //bs.put((byte)0xEF); bs.put((byte)0x30); 
+        bs.put((byte)0x20); bs.put((byte)0xE8); bs.put((byte)0xCF); bs.put((byte)0x00); bs.put((byte)0xA0);
+        //bs.put((byte)0xEF); bs.put((byte)0x30);
         bsr.put((byte)0xEF); bsr.put((byte)0x42); bsr.put((byte)0xF0); bsr.put((byte)0xBF); bsr.put((byte)0xF0); bsr.put((byte)0xB8);
         bsr.put((byte)0xAA); bsr.put((byte)0xE9); bsr.put((byte)0xDF); bsr.put((byte)0xE9); bsr.put((byte)0xA6); bsr.put((byte)0xE9);
         bsr.put((byte)0xDB); bsr.put((byte)0xE9); bsr.put((byte)0xA7); bsr.put((byte)0xE9); bsr.put((byte)0xDC); bsr.put((byte)0xE9);
         bsr.put((byte)0xA1); bsr.put((byte)0xE9); bsr.put((byte)0xEA); bsr.put((byte)0xE9); bsr.put((byte)0xB3); bsr.put((byte)0xE9);
         bsr.put((byte)0xB4); bsr.put((byte)0xE9); bsr.put((byte)0xB5); bsr.put((byte)0xE9); bsr.put((byte)0xBA); bsr.put((byte)0xE9);
         bsr.put((byte)0xBF); bsr.put((byte)0xE9); bsr.put((byte)0xC0); bsr.put((byte)0xE9); bsr.put((byte)0xC9); bsr.put((byte)0xE9);
-        bsr.put((byte)0xD9); bsr.put((byte)0xE8); bsr.put((byte)0xCF); bsr.put((byte)0x00); bsr.put((byte)0xA0);  
-        
+        bsr.put((byte)0xD9); bsr.put((byte)0xE8); bsr.put((byte)0xCF); bsr.put((byte)0x00); bsr.put((byte)0xA0);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
         bsr.limit(bsr.position());
         bsr.position(0);
-        
+
         //round trip test
         try {
             smBufDecode(decoder, "ISCII-part1", bsr, us, false, true);
-            smBufEncode(encoder, "ISCII-part2", us, bs); 
+            smBufEncode(encoder, "ISCII-part2", us, bs);
             smBufDecode(decoder, "ISCII-part3", bs, us, false, true);
         } catch (Exception ex) {
             errln("ISCII round trip test failed.");
         }
-        
+
         //Test new characters in the ISCII charset
         encoder = provider.charsetForName("ISCII,version=0").newEncoder();
         decoder = provider.charsetForName("ISCII,version=0").newDecoder();
@@ -3398,191 +3401,191 @@ public class TestCharset extends TestFmwk {
         bs = ByteBuffer.allocate(b_pts.length);
         us.put(u_pts);
         bs.put(b_pts);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
-            smBufDecode(decoder, "ISCII-update", bs, us, true, true);         
+            smBufDecode(decoder, "ISCII-update", bs, us, true, true);
             bs.position(0);
             us.position(0);
             smBufEncode(encoder, "ISCII-update", us, bs, true, true);
         } catch (Exception ex) {
             errln("Error occurred while encoding/decoding ISCII with the new characters.");
         }
-        
+
         //The rest of the code in this method is to provide better code coverage
         CharBuffer ccus = CharBuffer.allocate(0x10);
         ByteBuffer ccbs = ByteBuffer.allocate(0x10);
-        
+
         //start of charset decoder code coverage code
         //test overflow buffer
         ccbs.put((byte)0x49);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(0);
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "ISCII-CC-DE-1", ccbs, ccus, true, false);
             errln("Exception while decoding ISCII should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test atr overflow buffer
         ccbs.put((byte)0xEF); ccbs.put((byte)0x40); ccbs.put((byte)0xEF); ccbs.put((byte)0x20);
         ccus.put((char)0x00);
-        
+
         ccbs.limit(ccbs.position());
         ccbs.position(0);
         ccus.limit(ccus.position());
         ccus.position(0);
-        
+
         try {
             smBufDecode(decoder, "ISCII-CC-DE-2", ccbs, ccus, true, false);
             errln("Exception while decoding ISCII should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         //end of charset decoder code coverage code
-        
+
         ccbs.clear();
         ccus.clear();
-      
+
         //start of charset encoder code coverage code
         //test ascii overflow buffer
         ccus.put((char)0x41);
-        
+
         ccus.limit(ccus.position());
         ccus.position(0);
         ccbs.limit(0);
         ccbs.position(0);
-           
+
         try {
             smBufEncode(encoder, "ISCII-CC-EN-1", ccus, ccbs, true, false);
             errln("Exception while encoding ISCII should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test ascii overflow buffer
         ccus.put((char)0x0A); ccus.put((char)0x0043);
         ccbs.put((byte)0x00); ccbs.put((byte)0x00);
-        
+
         ccus.limit(ccus.position());
         ccus.position(0);
         ccbs.limit(ccbs.position());
         ccbs.position(0);
-           
+
         try {
             smBufEncode(encoder, "ISCII-CC-EN-2", ccus, ccbs, true, false);
             errln("Exception while encoding ISCII should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test surrogate malform
         ccus.put((char)0x06E3);
         ccbs.put((byte)0x00);
-        
+
         ccus.limit(ccus.position());
         ccus.position(0);
         ccbs.limit(ccbs.position());
         ccbs.position(0);
-           
+
         try {
             smBufEncode(encoder, "ISCII-CC-EN-3", ccus, ccbs, true, false);
             errln("Exception while encoding ISCII should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test surrogate malform
         ccus.put((char)0xD801); ccus.put((char)0xDD01);
         ccbs.put((byte)0x00);
-        
+
         ccus.limit(ccus.position());
         ccus.position(0);
         ccbs.limit(ccbs.position());
         ccbs.position(0);
-           
+
         try {
             smBufEncode(encoder, "ISCII-CC-EN-4", ccus, ccbs, true, false);
             errln("Exception while encoding ISCII should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test trail surrogate malform
-        ccus.put((char)0xDD01); 
+        ccus.put((char)0xDD01);
         ccbs.put((byte)0x00);
-        
+
         ccus.limit(ccus.position());
         ccus.position(0);
         ccbs.limit(ccbs.position());
         ccbs.position(0);
-           
+
         try {
             smBufEncode(encoder, "ISCII-CC-EN-5", ccus, ccbs, true, false);
             errln("Exception while encoding ISCII should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccbs.clear();
         ccus.clear();
-        
+
         //test lead surrogates malform
-        ccus.put((char)0xD801); ccus.put((char)0xD802); 
+        ccus.put((char)0xD801); ccus.put((char)0xD802);
         ccbs.put((byte)0x00);
-        
+
         ccus.limit(ccus.position());
         ccus.position(0);
         ccbs.limit(ccbs.position());
         ccbs.position(0);
-           
+
         try {
             smBufEncode(encoder, "ISCII-CC-EN-6", ccus, ccbs, true, false);
             errln("Exception while encoding ISCII should have been thrown.");
         }
         catch (Exception ex) {
         }
-        
+
         ccus.clear();
         ccbs.clear();
-        
+
         //test overflow buffer
-        ccus.put((char)0x0901); 
+        ccus.put((char)0x0901);
         ccbs.put((byte)0x00);
-        
+
         ccus.limit(ccus.position());
         ccus.position(0);
         ccbs.limit(ccbs.position());
         ccbs.position(0);
-           
+
         cs = provider.charsetForName("ISCII,version=0");
         encoder = cs.newEncoder();
-        
+
         try {
             smBufEncode(encoder, "ISCII-CC-EN-7", ccus, ccbs, true, false);
             errln("Exception while encoding ISCII should have been thrown.");
@@ -3591,24 +3594,24 @@ public class TestCharset extends TestFmwk {
         }
         //end of charset encoder code coverage code
     }
-    
+
     //Test for the IMAP Charset
     @Test
     public void TestCharsetIMAP() {
         CharsetProvider provider = new CharsetProviderICU();
-        Charset cs = provider.charsetForName("IMAP-mailbox-name");        
+        Charset cs = provider.charsetForName("IMAP-mailbox-name");
         CharsetEncoder encoder = cs.newEncoder();
         CharsetDecoder decoder = cs.newDecoder();
-        
+
         CharBuffer us = CharBuffer.allocate(0x20);
         ByteBuffer bs = ByteBuffer.allocate(0x20);
-        
+
         us.put((char)0x00A3); us.put((char)0x2020); us.put((char)0x41);
-        
+
         bs.put((byte)0x26); bs.put((byte)0x41); bs.put((byte)0x4B); bs.put((byte)0x4D); bs.put((byte)0x67); bs.put((byte)0x49);
         bs.put((byte)0x41); bs.put((byte)0x2D); bs.put((byte)0x41);
-        
-        
+
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
@@ -3616,350 +3619,350 @@ public class TestCharset extends TestFmwk {
 
         smBufDecode(decoder, "IMAP", bs, us);
         smBufEncode(encoder, "IMAP", us, bs);
-        
+
         //the rest of the code in this method is for better code coverage
         us.clear();
         bs.clear();
-        
+
         //start of charset encoder code coverage
         //test buffer overflow
-        us.put((char)0x0026); us.put((char)0x17A9); 
+        us.put((char)0x0026); us.put((char)0x17A9);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-1", us, bs, true, false);
             errln("Exception while encoding IMAP (1) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test buffer overflow
         us.put((char)0x17A9); us.put((char)0x0941);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-2", us, bs, true, false);
             errln("Exception while encoding IMAP (2) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test buffer overflow
         us.put((char)0x17A9); us.put((char)0x0941);
-        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);   
-        
+        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-3", us, bs, true, false);
             errln("Exception while encoding IMAP (3) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test buffer overflow
         us.put((char)0x17A9); us.put((char)0x0941); us.put((char)0x0955);
-        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);      
+        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
         bs.put((byte)0x00);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-4", us, bs, true, false);
             errln("Exception while encoding IMAP (4) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test buffer overflow
         us.put((char)0x17A9); us.put((char)0x0941); us.put((char)0x0955);
-        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);  
-        bs.put((byte)0x00); bs.put((byte)0x00); 
-        
+        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
+        bs.put((byte)0x00); bs.put((byte)0x00);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-5", us, bs, true, false);
             errln("Exception while encoding IMAP (5) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test buffer overflow
         us.put((char)0x17A9); us.put((char)0x0941); us.put((char)0x0955); us.put((char)0x0970);
-        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);  
+        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-6", us, bs, true, false);
             errln("Exception while encoding IMAP (6) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test buffer overflow
         us.put((char)0x17A9); us.put((char)0x0941);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);  bs.put((byte)0x00); bs.put((byte)0x00);
-        bs.put((byte)0x00); 
-        
+        bs.put((byte)0x00);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-7", us, bs, true, true);
             errln("Exception while encoding IMAP (7) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test flushing
-        us.put((char)0x17A9); us.put((char)0x0941); 
+        us.put((char)0x17A9); us.put((char)0x0941);
         bs.put((byte)0x26); bs.put((byte)0x46); bs.put((byte)0x36); bs.put((byte)0x6b);  bs.put((byte)0x4a); bs.put((byte)0x51);
         bs.put((byte)0x51); bs.put((byte)0x2d);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-8", us, bs, true, true);
         } catch(Exception ex) {
             errln("Exception while encoding IMAP (8) should not have been thrown.");
         }
-        
+
         us = CharBuffer.allocate(0x08);
         bs = ByteBuffer.allocate(0x08);
-        
+
         //test flushing buffer overflow
         us.put((char)0x0061);
         bs.put((byte)0x61); bs.put((byte)0x00);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "IMAP-EN-9", us, bs, true, true);
         } catch(Exception ex) {
             errln("Exception while encoding IMAP (9) should not have been thrown.");
         }
         //end of charset encoder code coverage
-        
+
         us = CharBuffer.allocate(0x10);
         bs = ByteBuffer.allocate(0x10);
-        
+
         //start of charset decoder code coverage
         //test malform case 2
-        us.put((char)0x0000); us.put((char)0x0000); 
-        bs.put((byte)0x26); bs.put((byte)0x41); bs.put((byte)0x43); bs.put((byte)0x41);  
-        
+        us.put((char)0x0000); us.put((char)0x0000);
+        bs.put((byte)0x26); bs.put((byte)0x41); bs.put((byte)0x43); bs.put((byte)0x41);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufDecode(decoder, "IMAP-DE-1", bs, us, true, false);
             errln("Exception while decoding IMAP (1) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test malform case 5
         us.put((char)0x0000); us.put((char)0x0000); us.put((char)0x0000);
-        bs.put((byte)0x26); bs.put((byte)0x41); bs.put((byte)0x41); bs.put((byte)0x41); 
-        bs.put((byte)0x41); bs.put((byte)0x49); bs.put((byte)0x41);  
-        
+        bs.put((byte)0x26); bs.put((byte)0x41); bs.put((byte)0x41); bs.put((byte)0x41);
+        bs.put((byte)0x41); bs.put((byte)0x49); bs.put((byte)0x41);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufDecode(decoder, "IMAP-DE-2", bs, us, true, false);
             errln("Exception while decoding IMAP (2) should have been thrown.");
         } catch(Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test malform case 7
         us.put((char)0x0000); us.put((char)0x0000); us.put((char)0x0000); us.put((char)0x0000);
-        bs.put((byte)0x26); bs.put((byte)0x41); bs.put((byte)0x41); bs.put((byte)0x41); 
-        bs.put((byte)0x41); bs.put((byte)0x41); bs.put((byte)0x41); bs.put((byte)0x42); 
-        bs.put((byte)0x41);  
-        
+        bs.put((byte)0x26); bs.put((byte)0x41); bs.put((byte)0x41); bs.put((byte)0x41);
+        bs.put((byte)0x41); bs.put((byte)0x41); bs.put((byte)0x41); bs.put((byte)0x42);
+        bs.put((byte)0x41);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufDecode(decoder, "IMAP-DE-3", bs, us, true, false);
             errln("Exception while decoding IMAP (3) should have been thrown.");
         } catch(Exception ex) {
         }
-        //end of charset decoder coder coverage  
+        //end of charset decoder coder coverage
     }
-    
+
     //Test for charset UTF32LE to provide better code coverage
     @Test
     public void TestCharsetUTF32LE() {
         CoderResult result = CoderResult.UNDERFLOW;
         CharsetProvider provider = new CharsetProviderICU();
-        Charset cs = provider.charsetForName("UTF-32LE");        
+        Charset cs = provider.charsetForName("UTF-32LE");
         CharsetEncoder encoder = cs.newEncoder();
         //CharsetDecoder decoder = cs.newDecoder();
-        
+
         CharBuffer us = CharBuffer.allocate(0x10);
         ByteBuffer bs = ByteBuffer.allocate(0x10);
-        
-        
+
+
         //test malform surrogate
         us.put((char)0xD901);
         bs.put((byte)0x00);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF32LE-EN-1", us, bs, true, false);
             errln("Exception while encoding UTF32LE (1) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         bs.clear();
         us.clear();
-        
+
         //test malform surrogate
         us.put((char)0xD901); us.put((char)0xD902);
         bs.put((byte)0x00);
-        
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         result = encoder.encode(us, bs, true);
-        
+
         if (!result.isError() && !result.isOverflow()) {
             errln("Error while encoding UTF32LE (2) should have occurred.");
         }
-        
+
         bs.clear();
         us.clear();
-        
+
         //test overflow trail surrogate
         us.put((char)0xDD01); us.put((char)0xDD0E); us.put((char)0xDD0E);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
-        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); 
-        
+        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         result = encoder.encode(us, bs, true);
-        
+
         if (!result.isError() && !result.isOverflow()) {
             errln("Error while encoding UTF32LE (3) should have occurred.");
         }
-        
+
         bs.clear();
         us.clear();
-        
+
         //test malform lead surrogate
         us.put((char)0xD90D); us.put((char)0xD90E);
-        bs.put((byte)0x00); 
-        
+        bs.put((byte)0x00);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF32LE-EN-4", us, bs, true, false);
             errln("Exception while encoding UTF32LE (4) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         bs.clear();
         us.clear();
-        
+
         //test overflow buffer
         us.put((char)0x0061);
-        bs.put((byte)0x00); 
-        
+        bs.put((byte)0x00);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF32LE-EN-5", us, bs, true, false);
             errln("Exception while encoding UTF32LE (5) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         bs.clear();
         us.clear();
-        
+
         //test malform trail surrogate
         us.put((char)0xDD01);
-        bs.put((byte)0x00); 
-        
+        bs.put((byte)0x00);
+
         bs.limit(bs.position());
         bs.position(0);
         us.limit(us.position());
         us.position(0);
-        
+
         try {
             smBufEncode(encoder, "UTF32LE-EN-6", us, bs, true, false);
             errln("Exception while encoding UTF32LE (6) should have been thrown.");
@@ -3972,163 +3975,163 @@ public class TestCharset extends TestFmwk {
     public void TestCharsetUTF16LE() {
         CoderResult result = CoderResult.UNDERFLOW;
         CharsetProvider provider = new CharsetProviderICU();
-        Charset cs = provider.charsetForName("UTF-16LE");        
+        Charset cs = provider.charsetForName("UTF-16LE");
         CharsetEncoder encoder = cs.newEncoder();
         //CharsetDecoder decoder = cs.newDecoder();
-        
+
         // Test for malform and change fromUChar32 for next call
         char u_pts1[] = {
-                (char)0xD805, 
+                (char)0xD805,
                 (char)0xDC01, (char)0xDC02, (char)0xDC03,
                 (char)0xD901, (char)0xD902
                 };
         byte b_pts1[] = {
-                (byte)0x00, 
+                (byte)0x00,
                 (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00
                 };
-        
+
         CharBuffer us = CharBuffer.allocate(u_pts1.length);
         ByteBuffer bs = ByteBuffer.allocate(b_pts1.length);
-        
+
         us.put(u_pts1);
         bs.put(b_pts1);
-        
+
         us.limit(1);
         us.position(0);
         bs.limit(1);
         bs.position(0);
-       
+
         result = encoder.encode(us, bs, true);
-        
+
         if (!result.isMalformed()) {
-            // LE should not output BOM, so this should be malformed 
+            // LE should not output BOM, so this should be malformed
             errln("Malformed while encoding UTF-16LE (1) should have occured.");
         }
-        
+
         // Test for malform surrogate from previous buffer
         us.limit(4);
         us.position(1);
         bs.limit(7);
         bs.position(1);
-        
+
         result = encoder.encode(us, bs, true);
-        
+
         if (!result.isMalformed()) {
             errln("Error while encoding UTF-16LE (2) should have occured.");
-        }       
-        
+        }
+
         // Test for malform trail surrogate
         encoder.reset();
-        
+
         us.limit(1);
         us.position(0);
         bs.limit(1);
         bs.position(0);
-       
-        result = encoder.encode(us, bs, true);    
-        
+
+        result = encoder.encode(us, bs, true);
+
         us.limit(6);
         us.position(4);
         bs.limit(4);
         bs.position(1);
-        
+
         result = encoder.encode(us, bs, true);
-        
+
         if (!result.isMalformed()) {
             errln("Error while encoding UTF-16LE (3) should have occured.");
-        }          
+        }
     }
-    
+
     //provide better code coverage for the generic charset UTF32
     @Test
     public void TestCharsetUTF32() {
         CoderResult result = CoderResult.UNDERFLOW;
         CharsetProvider provider = new CharsetProviderICU();
-        Charset cs = provider.charsetForName("UTF-32");        
+        Charset cs = provider.charsetForName("UTF-32");
         CharsetDecoder decoder = cs.newDecoder();
         CharsetEncoder encoder = cs.newEncoder();
-        
+
         //start of decoding code coverage
         char us_array[] = {
                 0x0000, 0x0000, 0x0000, 0x0000,
             };
-        
+
         byte bs_array1[] = {
                 (byte)0x00, (byte)0x00, (byte)0xFE, (byte)0xFF,
                 (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x43,
                 (byte)0xFF, (byte)0xFE, (byte)0x00, (byte)0x00,
                 (byte)0x43, (byte)0x04, (byte)0x00, (byte)0x00,
             };
-        
+
         byte bs_array2[] = {
                 (byte)0xFF, (byte)0xFE, (byte)0x00, (byte)0x00,
                 (byte)0x43, (byte)0x04, (byte)0x00, (byte)0x00,
             };
-        
+
         CharBuffer us = CharBuffer.allocate(us_array.length);
         ByteBuffer bs = ByteBuffer.allocate(bs_array1.length);
-        
+
         us.put(us_array);
         bs.put(bs_array1);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-            
+
         try {
             smBufDecode(decoder, "UTF32-DE-1", bs, us, true, false);
             errln("Malform exception while decoding UTF32 charset (1) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         decoder = cs.newDecoder();
-        
+
         bs = ByteBuffer.allocate(bs_array2.length);
         bs.put(bs_array2);
-        
+
         us.limit(4);
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-            
+
         try {
             smBufDecode(decoder, "UTF32-DE-2", bs, us, true, false);
         } catch (Exception ex) {
             // should recognize little endian BOM
             errln("Exception while decoding UTF32 charset (2) should not have been thrown.");
         }
-        
+
         //Test malform exception
         bs.clear();
         us.clear();
-        
+
         bs.put((byte)0x00); bs.put((byte)0xFE); bs.put((byte)0xFF); bs.put((byte)0x00); bs.put((byte)0x00);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF32-DE-3", bs, us, true, false);
             errln("Malform exception while decoding UTF32 charset (3) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         //Test BOM testing
         bs.clear();
         us.clear();
-        
-        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xFF); bs.put((byte)0xFE); 
+
+        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xFF); bs.put((byte)0xFE);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF32-DE-4", bs, us, true, false);
         } catch (Exception ex) {
@@ -4136,134 +4139,134 @@ public class TestCharset extends TestFmwk {
             errln("Exception while decoding UTF32 charset (4) should not have been thrown.");
         }
         //end of decoding code coverage
-        
+
         //start of encoding code coverage
         us = CharBuffer.allocate(0x10);
         bs = ByteBuffer.allocate(0x10);
-        
+
         //test wite BOM overflow error
         us.put((char)0xDC01);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         result = encoder.encode(us, bs, true);
         // must try to output BOM first for UTF-32 (not UTF-32BE or UTF-32LE)
         if (!result.isOverflow()) {
-            errln("Buffer overflow error while encoding UTF32 charset (1) should have occurred."); 
+            errln("Buffer overflow error while encoding UTF32 charset (1) should have occurred.");
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test malform surrogate and store value in fromChar32
         us.put((char)0xD801); us.put((char)0xD802);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         result = encoder.encode(us, bs, true);
         if (!result.isMalformed()) {
             errln("Malformed error while encoding UTF32 charset (2) should have occurred.");
-        }    
-        
+        }
+
         us.clear();
         bs.clear();
-        
+
         //test malform surrogate
         us.put((char)0x0000); us.put((char)0xD902);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         result = encoder.encode(us, bs, true);
         if (!result.isOverflow()) {
             errln("Overflow error while encoding UTF32 charset (3) should have occurred.");
-        } 
-        
+        }
+
         us.clear();
         bs.clear();
-        
+
         //test malform surrogate
         encoder.reset();
         us.put((char)0xD801);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
-   
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         result = encoder.encode(us, bs, true);
         if (!result.isMalformed()) {
             errln("Malform error while encoding UTF32 charset (4) should have occurred.");
-        } 
-        
+        }
+
         us.clear();
         bs.clear();
-        
+
         //test overflow surrogate
         us.put((char)0x0000); us.put((char)0xDDE1); us.put((char)0xD915); us.put((char)0xDDF2);
-        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); 
-   
+        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         result = encoder.encode(us, bs, true);
         if (!result.isOverflow()) {
             errln("Overflow error while encoding UTF32 charset (5) should have occurred.");
-        } 
-        
+        }
+
         us.clear();
         bs.clear();
-        
+
         //test malform surrogate
         encoder.reset();
         us.put((char)0xDDE1);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
-   
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         result = encoder.encode(us, bs, true);
         if (!result.isMalformed()) {
             errln("Malform error while encoding UTF32 charset (6) should have occurred.");
-        } 
+        }
         //end of encoding code coverage
     }
-    
+
     //this method provides better code coverage decoding UTF32 LE/BE
     @Test
     public void TestDecodeUTF32LEBE() {
         CoderResult result = CoderResult.UNDERFLOW;
-        CharsetProvider provider = new CharsetProviderICU();       
+        CharsetProvider provider = new CharsetProviderICU();
         CharsetDecoder decoder;
         CharBuffer us = CharBuffer.allocate(0x10);
         ByteBuffer bs = ByteBuffer.allocate(0x10);
-        
+
         //decode UTF32LE
         decoder = provider.charsetForName("UTF-32LE").newDecoder();
         //test overflow buffer
         bs.put((byte)0x41); bs.put((byte)0xFF); bs.put((byte)0x01); bs.put((byte)0x00);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-32LE", bs, us, true, false);
             errln("Overflow exception while decoding UTF32LE (1) should have been thrown.");
@@ -4282,165 +4285,165 @@ public class TestCharset extends TestFmwk {
         } else {
             errln("Overflow buffer error while decoding UTF32LE should have occurred.");
         }
-        
+
         us.clear();
         bs.clear();
         //test malform buffer
         bs.put((byte)0x02); bs.put((byte)0xD9); bs.put((byte)0x00); bs.put((byte)0x00);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-32LE", bs, us, true, false);
             errln("Malform exception while decoding UTF32LE (2) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
         //test malform buffer
         bs.put((byte)0xFF); bs.put((byte)0xFE); bs.put((byte)0x00); bs.put((byte)0x00);
-        bs.put((byte)0xFF); bs.put((byte)0xDF); bs.put((byte)0x10); 
+        bs.put((byte)0xFF); bs.put((byte)0xDF); bs.put((byte)0x10);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             // must flush in order to exhibit malformed behavior
             smBufDecode(decoder, "UTF-32LE", bs, us, true, true);
             errln("Malform exception while decoding UTF32LE (3) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
         //test malform buffer
         bs.put((byte)0xFF); bs.put((byte)0xFE); bs.put((byte)0x00); bs.put((byte)0x00);
         bs.put((byte)0x02); bs.put((byte)0xD9); bs.put((byte)0x00); bs.put((byte)0x00);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-32LE", bs, us, true, false);
             errln("Malform exception while decoding UTF32LE (4) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         us.clear();
         bs.clear();
         //test overflow buffer
         bs.put((byte)0xFF); bs.put((byte)0xFE); bs.put((byte)0x00); bs.put((byte)0x00);
         bs.put((byte)0xDD); bs.put((byte)0xFF); bs.put((byte)0x10); bs.put((byte)0x00);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-32LE", bs, us, true, false);
             errln("Overflow exception while decoding UTF32LE (5) should have been thrown.");
         } catch (Exception ex) {
         }
         //end of decode UTF32LE
-        
+
         bs.clear();
         us.clear();
-        
+
         //decode UTF32BE
         decoder = provider.charsetForName("UTF-32BE").newDecoder();
         //test overflow buffer
         bs.put((byte)0x00); bs.put((byte)0x01); bs.put((byte)0xFF); bs.put((byte)0x41);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-32BE", bs, us, true, false);
             errln("Overflow exception while decoding UTF32BE (1) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         bs.clear();
         us.clear();
         //test malform buffer
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xD9); bs.put((byte)0x02);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-32BE", bs, us, true, false);
             errln("Malform exception while decoding UTF32BE (2) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         bs.clear();
         us.clear();
         //test malform buffer
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xFE); bs.put((byte)0xFF);
         bs.put((byte)0x10); bs.put((byte)0xFF); bs.put((byte)0xDF);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             // must flush to exhibit malformed behavior
             smBufDecode(decoder, "UTF-32BE", bs, us, true, true);
             errln("Malform exception while decoding UTF32BE (3) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         bs.clear();
         us.clear();
         //test overflow buffer
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xFE); bs.put((byte)0xFF);
         bs.put((byte)0x00); bs.put((byte)0x10); bs.put((byte)0xFF); bs.put((byte)0xDD);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             smBufDecode(decoder, "UTF-32BE", bs, us, true, false);
             errln("Overflow exception while decoding UTF32BE (4) should have been thrown.");
         } catch (Exception ex) {
         }
-        
+
         bs.clear();
         us.clear();
         //test malform buffer
-        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xFE); 
+        bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0xFE);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         try {
             // must flush to exhibit malformed behavior
             smBufDecode(decoder, "UTF-32BE", bs, us, true, true);
@@ -4449,60 +4452,60 @@ public class TestCharset extends TestFmwk {
         }
         //end of decode UTF32BE
     }
-    
+
     //provide better code coverage for UTF8
     @Test
     public void TestCharsetUTF8() {
         CoderResult result = CoderResult.UNDERFLOW;
-        CharsetProvider provider = new CharsetProviderICU();       
+        CharsetProvider provider = new CharsetProviderICU();
         CharsetDecoder decoder = provider.charsetForName("UTF-8").newDecoder();
         CharsetEncoder encoder = provider.charsetForName("UTF-8").newEncoder();
-        
+
         CharBuffer us = CharBuffer.allocate(0x10);
         ByteBuffer bs = ByteBuffer.allocate(0x10);
         ByteBuffer bs2;
         CharBuffer us2;
         int limit_us;
         int limit_bs;
-        
+
         //encode and decode using read only buffer
         encoder.reset();
         decoder.reset();
         us.put((char)0x0041); us.put((char)0x0081); us.put((char)0xEF65); us.put((char)0xD902);
         bs.put((byte)0x41); bs.put((byte)0xc2); bs.put((byte)0x81); bs.put((byte)0xee); bs.put((byte)0xbd); bs.put((byte)0xa5);
-        bs.put((byte)0x00); 
+        bs.put((byte)0x00);
         limit_us = us.position();
         limit_bs = bs.position();
-        
+
         us.limit(limit_us);
         us.position(0);
         bs.limit(limit_bs);
         bs.position(0);
         bs2 = bs.asReadOnlyBuffer();
         us2 = us.asReadOnlyBuffer();
-        
+
         result = decoder.decode(bs2, us, true);
         if (!result.isUnderflow() || !equals(us, us2)) {
             errln("Error while decoding UTF-8 (1) should not have occured.");
         }
-        
+
         us2.limit(limit_us);
         us2.position(0);
         bs.limit(limit_bs);
         bs.position(0);
-        
-        result = encoder.encode(us2, bs, true); 
+
+        result = encoder.encode(us2, bs, true);
         if (!result.isUnderflow() || !equals(bs, bs2)) {
             errln("Error while encoding UTF-8 (1) should not have occured.");
-        }  
-        
+        }
+
         us.clear();
         bs.clear();
-        
+
         //test overflow buffer while encoding
         //readonly buffer
         encoder.reset();
-        us.put((char)0x0081); us.put((char)0xEF65); 
+        us.put((char)0x0081); us.put((char)0xEF65);
         bs.put((byte)0x00); bs.put((byte)0x00); bs.put((byte)0x00);
         limit_us = us.position();
         us2 = us.asReadOnlyBuffer();
@@ -4514,9 +4517,9 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (2).");
         }
-        
+
         encoder.reset();
-        
+
         us2.limit(limit_us);
         us2.position(1);
         bs.limit(1);
@@ -4525,9 +4528,9 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (3).");
         }
-        
+
         encoder.reset();
-        
+
         us2.limit(limit_us);
         us2.position(1);
         bs.limit(2);
@@ -4536,9 +4539,9 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (4).");
         }
-        
+
         encoder.reset();
-        
+
         us2.limit(limit_us);
         us2.position(0);
         bs.limit(2);
@@ -4546,11 +4549,11 @@ public class TestCharset extends TestFmwk {
         result = encoder.encode(us2, bs, true);
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (5).");
-        }   
-        
+        }
+
         //not readonly buffer
         encoder.reset();
-        
+
         us.limit(limit_us);
         us.position(0);
         bs.limit(1);
@@ -4559,9 +4562,9 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (6).");
         }
-        
+
         encoder.reset();
-        
+
         us.limit(limit_us);
         us.position(0);
         bs.limit(3);
@@ -4570,9 +4573,9 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (7).");
         }
-        
+
         encoder.reset();
-        
+
         us.limit(limit_us);
         us.position(1);
         bs.limit(2);
@@ -4580,10 +4583,10 @@ public class TestCharset extends TestFmwk {
         result = encoder.encode(us, bs, true);
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (8).");
-        }   
-        
+        }
+
         encoder.reset();
-        
+
         us.limit(limit_us + 1);
         us.position(1);
         bs.limit(3);
@@ -4591,11 +4594,11 @@ public class TestCharset extends TestFmwk {
         result = encoder.encode(us, bs, true);
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (9).");
-        }  
-        
+        }
+
         us.clear();
         bs.clear();
-        
+
         //test encoding 4 byte characters
         encoder.reset();
         us.put((char)0xD902); us.put((char)0xDD02); us.put((char)0x0041);
@@ -4610,9 +4613,9 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (10).");
         }
-        
+
         encoder.reset();
-        
+
         us2.limit(limit_us);
         us2.position(0);
         bs.limit(2);
@@ -4621,9 +4624,9 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (11).");
         }
-        
+
         encoder.reset();
-        
+
         us2.limit(limit_us);
         us2.position(0);
         bs.limit(3);
@@ -4632,9 +4635,9 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (12).");
         }
-        
+
         encoder.reset();
-        
+
         us2.limit(limit_us);
         us2.position(0);
         bs.limit(4);
@@ -4643,35 +4646,35 @@ public class TestCharset extends TestFmwk {
         if (!result.isOverflow()) {
             errln("Overflow Error should have occured while encoding UTF-8 (13).");
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //decoding code coverage
         //test malform error
         decoder.reset();
         bs.put((byte)0xC0); bs.put((byte)0xC0);
         us.put((char)0x0000);
         bs2 = bs.asReadOnlyBuffer();
-        
+
         us.limit(1);
         us.position(0);
         bs2.limit(1);
         bs2.position(0);
-        
+
         result = decoder.decode(bs2, us, true);
         result = decoder.flush(us);
         if (!result.isMalformed()) {
             errln("Malform error should have occurred while decoding UTF-8 (1).");
-        }    
-        
+        }
+
         us.limit(1);
         us.position(0);
         bs2.limit(1);
         bs2.position(0);
-        
+
         decoder.reset();
-        
+
         result = decoder.decode(bs2, us, true);
         us.limit(1);
         us.position(0);
@@ -4680,11 +4683,11 @@ public class TestCharset extends TestFmwk {
         result = decoder.decode(bs2, us, true);
         if (!result.isMalformed()) {
             errln("Malform error should have occurred while decoding UTF-8 (2).");
-        }  
-        
+        }
+
         us.clear();
         bs.clear();
-        
+
         //test overflow buffer
         bs.put((byte)0x01); bs.put((byte)0x41);
         us.put((char)0x0000);
@@ -4693,15 +4696,15 @@ public class TestCharset extends TestFmwk {
         us.position(0);
         bs2.limit(2);
         bs2.position(0);
-        
+
         result = decoder.decode(bs2, us, true);
         if (!result.isOverflow()) {
             errln("Overflow error should have occurred while decoding UTF-8 (3).");
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         //test malform string
         decoder.reset();
         bs.put((byte)0xF5); bs.put((byte)0xB4); bs.put((byte)0x8A); bs.put((byte)0x8C);
@@ -4711,14 +4714,14 @@ public class TestCharset extends TestFmwk {
         us.position(0);
         bs2.limit(4);
         bs2.position(0);
-        
+
         result = decoder.decode(bs2, us, true);
         if (!result.isMalformed()) {
             errln("Malform error should have occurred while decoding UTF-8 (4).");
         }
-        
+
         bs.clear();
-        
+
         //test overflow
         decoder.reset();
         bs.put((byte)0xF3); bs.put((byte)0xB4); bs.put((byte)0x8A); bs.put((byte)0x8C);
@@ -4727,38 +4730,38 @@ public class TestCharset extends TestFmwk {
         us.position(0);
         bs2.limit(4);
         bs2.position(0);
-        
+
         result = decoder.decode(bs2, us, true);
         if (!result.isOverflow()) {
             errln("Overflow error should have occurred while decoding UTF-8 (5).");
         }
-        
+
         //test overflow
         decoder.reset();
         us.limit(2);
         us.position(0);
         bs2.limit(5);
         bs2.position(0);
-        
+
         result = decoder.decode(bs2, us, true);
         if (!result.isOverflow()) {
             errln("Overflow error should have occurred while decoding UTF-8 (5).");
         }
-        
+
         //test overflow
         decoder.reset();
         us.limit(1);
         us.position(0);
         bs.limit(5);
         bs.position(0);
-        
+
         result = decoder.decode(bs, us, true);
         if (!result.isOverflow()) {
             errln("Overflow error should have occurred while decoding UTF-8 (6).");
         }
-      
+
         bs.clear();
-        
+
         //test overflow
         decoder.reset();
         bs.put((byte)0x41); bs.put((byte)0x42);
@@ -4766,50 +4769,50 @@ public class TestCharset extends TestFmwk {
         us.position(0);
         bs.limit(2);
         bs.position(0);
-        
+
         result = decoder.decode(bs, us, true);
         if (!result.isOverflow()) {
             errln("Overflow error should have occurred while decoding UTF-8 (7).");
         }
-        
+
     }
-    
+
     //provide better code coverage for Charset UTF16
     @Test
     public void TestCharsetUTF16() {
         CoderResult result = CoderResult.UNDERFLOW;
-        CharsetProvider provider = new CharsetProviderICU();       
+        CharsetProvider provider = new CharsetProviderICU();
         CharsetDecoder decoder = provider.charsetForName("UTF-16").newDecoder();
         CharsetEncoder encoder = provider.charsetForName("UTF-16").newEncoder();
-        
+
         CharBuffer us = CharBuffer.allocate(0x10);
         ByteBuffer bs = ByteBuffer.allocate(0x10);
-        
+
         //test flush buffer and malform string
-        bs.put((byte)0xFF); 
+        bs.put((byte)0xFF);
         us.put((char)0x0000);
-        
+
         us.limit(us.position());
         us.position(0);
         bs.limit(bs.position());
         bs.position(0);
-        
+
         result = decoder.decode(bs, us, true);
         result = decoder.flush(us);
         if (!result.isMalformed()) {
             errln("Malform error while decoding UTF-16 should have occurred.");
         }
-        
+
         us.clear();
         bs.clear();
-        
+
         us.put((char)0xD902); us.put((char)0xDD01); us.put((char)0x0041);
-        
+
         us.limit(1);
         us.position(0);
         bs.limit(4);
         bs.position(0);
-        
+
         result = encoder.encode(us, bs, true);
         us.limit(3);
         us.position(0);
@@ -4818,35 +4821,35 @@ public class TestCharset extends TestFmwk {
         result = encoder.encode(us, bs, true);
         if (!result.isOverflow()) {
             errln("Overflow buffer while encoding UTF-16 should have occurred.");
-        }   
-        
+        }
+
         us.clear();
         bs.clear();
-        
+
         //test overflow buffer
         decoder.reset();
         decoder = provider.charsetForName("UTF-16BE").newDecoder();
-        
+
         bs.put((byte)0xFF); bs.put((byte)0xFE); bs.put((byte)0x41);
-        
+
         us.limit(0);
         us.position(0);
         bs.limit(3);
         bs.position(0);
-        
+
         result = decoder.decode(bs, us, true);
         if (!result.isOverflow()) {
             errln("Overflow buffer while decoding UTF-16 should have occurred.");
-        }        
+        }
     }
-    
+
     //provide better code coverage for Charset ISO-2022-KR
     @Test
     public void TestCharsetISO2022KR() {
         CoderResult result = CoderResult.UNDERFLOW;
-        CharsetProvider provider = new CharsetProviderICU();       
+        CharsetProvider provider = new CharsetProviderICU();
         CharsetDecoder decoder = provider.charsetForName("ISO-2022-KR").newDecoder();
-        
+
         byte bytearray[] = {
                 (byte)0x1b, (byte)0x24, (byte)0x29, (byte)0x43, (byte)0x41, (byte)0x42,
         };
@@ -4855,21 +4858,21 @@ public class TestCharset extends TestFmwk {
         };
         ByteBuffer bb = ByteBuffer.wrap(bytearray);
         CharBuffer cb = CharBuffer.wrap(chararray);
-        
+
         result = decoder.decode(bb, cb, true);
-        
+
         if (!result.isOverflow()) {
             errln("Overflow buffer while decoding ISO-2022-KR should have occurred.");
         }
     }
-    
+
     //provide better code coverage for Charset ISO-2022-JP
     @Test
     public void TestCharsetISO2022JP() {
         CoderResult result = CoderResult.UNDERFLOW;
-        CharsetProvider provider = new CharsetProviderICU();       
+        CharsetProvider provider = new CharsetProviderICU();
         CharsetDecoder decoder = provider.charsetForName("ISO-2022-JP-2").newDecoder();
-        
+
         byte bytearray[] = {
                 (byte)0x1b, (byte)0x24, (byte)0x28, (byte)0x44, (byte)0x0A, (byte)0x41,
         };
@@ -4878,53 +4881,53 @@ public class TestCharset extends TestFmwk {
         };
         ByteBuffer bb = ByteBuffer.wrap(bytearray);
         CharBuffer cb = CharBuffer.wrap(chararray);
-        
+
         result = decoder.decode(bb, cb, true);
-        
+
         if (!result.isOverflow()) {
             errln("Overflow buffer while decoding ISO-2022-KR should have occurred.");
         }
     }
-    
+
     //provide better code coverage for Charset ASCII
     @Test
     public void TestCharsetASCII() {
         CoderResult result = CoderResult.UNDERFLOW;
-        CharsetProvider provider = new CharsetProviderICU();       
+        CharsetProvider provider = new CharsetProviderICU();
         CharsetDecoder decoder = provider.charsetForName("US-ASCII").newDecoder();
-        
+
         byte bytearray[] = {
                 (byte)0x41
         };
         char chararray[] = {
                 (char)0x0041
         };
-        
+
         ByteBuffer bb = ByteBuffer.wrap(bytearray);
         CharBuffer cb = CharBuffer.wrap(chararray);
-        
+
         result = decoder.decode(bb, cb, true);
         result = decoder.flush(cb);
-        
+
         if (result.isError()) {
             errln("Error occurred while decoding US-ASCII.");
         }
     }
-    
+
     // provide better code coverage for Charset Callbacks
     /* Different aspects of callbacks are being tested including using different context available */
     @Test
     public void TestCharsetCallbacks() {
         CoderResult result = CoderResult.UNDERFLOW;
-        CharsetProvider provider = new CharsetProviderICU();       
+        CharsetProvider provider = new CharsetProviderICU();
         CharsetEncoder encoder = provider.charsetForName("iso-2022-jp").newEncoder();
         CharsetDecoder decoder = provider.charsetForName("iso-2022-jp").newDecoder();
-        
+
         String context3[] = {
                 "i",
                 "J"
         };
-        
+
         // Testing encoder escape callback
         String context1[] = {
                 "J",
@@ -4937,46 +4940,46 @@ public class TestCharset extends TestFmwk {
         };
         ByteBuffer bb = ByteBuffer.allocate(20);
         CharBuffer cb = CharBuffer.wrap(chararray);
-        
+
         ((CharsetEncoderICU)encoder).setFromUCallback(CoderResult.OVERFLOW, CharsetCallback.FROM_U_CALLBACK_ESCAPE, null);  // This callback is not valid.
         for (int i = 0; i < context1.length; i++) {
             encoder.reset();
             cb.position(0);
             bb.position(0);
             ((CharsetEncoderICU)encoder).setFromUCallback(CoderResult.unmappableForLength(1), CharsetCallback.FROM_U_CALLBACK_ESCAPE, context1[i]); // This callback is valid.
-            
+
             result = encoder.encode(cb, bb, true);
             if (result.isError()) {
                 errln("Error occurred while testing of callbacks for ISO-2022-JP encoder.");
             }
         }
-        
+
         // Testing encoder skip callback
         for (int i = 0; i < context3.length; i++) {
             encoder.reset();
             cb.position(0);
             bb.position(0);
-            ((CharsetEncoderICU)encoder).setFromUCallback(CoderResult.unmappableForLength(1), CharsetCallback.FROM_U_CALLBACK_SKIP, context3[i]); 
-            
+            ((CharsetEncoderICU)encoder).setFromUCallback(CoderResult.unmappableForLength(1), CharsetCallback.FROM_U_CALLBACK_SKIP, context3[i]);
+
             result = encoder.encode(cb, bb, true);
             if (result.isError() && i == 0) {
                 errln("Error occurred while testing of callbacks for ISO-2022-JP encoder.");
             }
         }
-        
+
         // Testing encoder sub callback
         for (int i = 0; i < context3.length; i++) {
             encoder.reset();
             cb.position(0);
             bb.position(0);
-            ((CharsetEncoderICU)encoder).setFromUCallback(CoderResult.unmappableForLength(1), CharsetCallback.FROM_U_CALLBACK_SUBSTITUTE, context3[i]); 
-            
+            ((CharsetEncoderICU)encoder).setFromUCallback(CoderResult.unmappableForLength(1), CharsetCallback.FROM_U_CALLBACK_SUBSTITUTE, context3[i]);
+
             result = encoder.encode(cb, bb, true);
             if (result.isError() && i == 0) {
                 errln("Error occurred while testing of callbacks for ISO-2022-JP encoder.");
             }
         }
-        
+
         // Testing decoder escape callback
         String context2[] = {
                 "X",
@@ -4989,20 +4992,20 @@ public class TestCharset extends TestFmwk {
         };
         bb = ByteBuffer.wrap(bytearray);
         cb = CharBuffer.allocate(20);
-        
+
         ((CharsetDecoderICU)decoder).setToUCallback(CoderResult.OVERFLOW, CharsetCallback.TO_U_CALLBACK_ESCAPE, null);  // This callback is not valid.
         for (int i = 0; i < context2.length; i++) {
             decoder.reset();
             cb.position(0);
             bb.position(0);
             ((CharsetDecoderICU)decoder).setToUCallback(CoderResult.malformedForLength(1), CharsetCallback.TO_U_CALLBACK_ESCAPE, context2[i]); // This callback is valid.
-            
+
             result = decoder.decode(bb, cb, true);
             if (result.isError()) {
                 errln("Error occurred while testing of callbacks for ISO-2022-JP decoder.");
             }
         }
-        
+
         // Testing decoder skip callback
         for (int i = 0; i < context3.length; i++) {
             decoder.reset();
@@ -5015,7 +5018,7 @@ public class TestCharset extends TestFmwk {
             }
         }
     }
-    
+
     // Testing invalid input exceptions
     @Test
     public void TestInvalidInput() {
@@ -5023,20 +5026,20 @@ public class TestCharset extends TestFmwk {
         Charset charset = provider.charsetForName("iso-2022-jp");
         CharsetEncoder encoder = charset.newEncoder();
         CharsetDecoder decoder = charset.newDecoder();
-        
+
         try {
             encoder.encode(CharBuffer.allocate(10), null, true);
             errln("Illegal argument exception should have been thrown due to null target.");
         } catch (Exception ex) {
         }
-        
+
         try {
             decoder.decode(ByteBuffer.allocate(10), null, true);
             errln("Illegal argument exception should have been thrown due to null target.");
         } catch (Exception ex) {
         }
     }
-    
+
     // Test java canonical names
     @Test
     public void TestGetICUJavaCanonicalNames() {
@@ -5046,9 +5049,9 @@ public class TestCharset extends TestFmwk {
         if (javaCName == null || icuCName == null) {
             errln("Unable to get Java or ICU canonical name from ambiguous alias");
         }
-        
+
     }
-    
+
     // Port over from ICU4C for test conversion tables (mbcs version 5.x)
     // Provide better code coverage in CharsetMBCS, CharsetDecoderICU, and CharsetEncoderICU.
     @Test
@@ -5060,47 +5063,47 @@ public class TestCharset extends TestFmwk {
                             this.getClass().getClassLoader());
         CharsetEncoder encoder = charset.newEncoder();
         CharsetDecoder decoder = charset.newDecoder();
-        
+
         byte bytearray[] = {
                 0x01, 0x02, 0x03, 0x0a,
                 0x01, 0x02, 0x03, 0x0b,
                 0x01, 0x02, 0x03, 0x0d,
         };
-        
+
         // set the callback for overflow errors
         ((CharsetDecoderICU)decoder).setToUCallback(CoderResult.OVERFLOW, CharsetCallback.TO_U_CALLBACK_STOP, null);
-        
+
         ByteBuffer bb = ByteBuffer.wrap(bytearray);
         CharBuffer cb = CharBuffer.allocate(10);
-        
+
         bb.limit(4);
         cb.limit(1); // Overflow should occur and is expected
         result = decoder.decode(bb, cb, false);
         if (result.isError()) {
             errln("Error occurred while decoding: " + charsetName + " with error: " + result);
         }
-        
+
         bb.limit(8);
         result = decoder.decode(bb, cb, false);
         if (result.isError()) {
             errln("Error occurred while decoding: " + charsetName + " with error: " + result);
         }
-        
+
         bb.limit(12);
         result = decoder.decode(bb, cb, true);
         if (result.isError()) {
             errln("Error occurred while decoding: " + charsetName + " with error: " + result);
         }
-        
+
         char chararray[] = {
                 0xDBC4,0xDE34,0xD900,0xDC05,/* \U00101234\U00050005 */
                 0xD940,     /* first half of \U00060006 or \U00060007 */
                 0xDC07/* second half of \U00060007 */
         };
-        
+
         cb = CharBuffer.wrap(chararray);
         bb = ByteBuffer.allocate(10);
-        
+
         bb.limit(2);
         cb.limit(4);
         result = encoder.encode(cb, bb, false);
@@ -5118,7 +5121,7 @@ public class TestCharset extends TestFmwk {
             errln("Error should have occurred while encoding: " + charsetName);
         }
     }
-    
+
     /* Round trip test of SCSU converter*/
     @Test
     public void TestSCSUConverter(){
@@ -5126,8 +5129,8 @@ public class TestCharset extends TestFmwk {
             0x41,(byte) 0xdf, 0x12,(byte) 0x81, 0x03, 0x5f, 0x10, (byte)0xdf, 0x1b, 0x03,
             (byte)0xdf, 0x1c,(byte) 0x88,(byte) 0x80, 0x0b, (byte)0xbf,(byte) 0xff,(byte) 0xff, 0x0d, 0x0a,
             0x41, 0x10, (byte)0xdf, 0x12, (byte)0x81, 0x03, 0x5f, 0x10, (byte)0xdf, 0x13,
-            (byte)0xdf, 0x14,(byte) 0x80, 0x15, (byte)0xff 
-        }; 
+            (byte)0xdf, 0x14,(byte) 0x80, 0x15, (byte)0xff
+        };
 
         char allFeaturesUTF16[]={
             0x0041, 0x00df, 0x0401, 0x015f, 0x00df, 0x01df, 0xf000, 0xdbff,
@@ -5135,7 +5138,7 @@ public class TestCharset extends TestFmwk {
             0x01df, 0xf000, 0xdbff, 0xdfff
         };
 
-        
+
         char germanUTF16[]={
             0x00d6, 0x006c, 0x0020, 0x0066, 0x006c, 0x0069, 0x0065, 0x00df, 0x0074
         };
@@ -5171,7 +5174,7 @@ public class TestCharset extends TestFmwk {
         };
 
         // SCSUEncoder produces a slightly longer result (179B vs. 178B) because of one different choice:
-         //it uses an SQn once where a longer look-ahead could have shown that SCn is more efficient 
+         //it uses an SQn once where a longer look-ahead could have shown that SCn is more efficient
         byte japaneseSCSU[]={
             0x08, 0x00, 0x1b, 0x4c,(byte) 0xea, 0x16, (byte)0xca, (byte)0xd3,(byte) 0x94, 0x0f, 0x53, (byte)0xef, 0x61, 0x1b, (byte)0xe5,(byte) 0x84,
             (byte)0xc4, 0x0f, (byte)0x53,(byte) 0xef, 0x61, 0x1b, (byte)0xe5, (byte)0x84, (byte)0xc4, 0x16, (byte)0xca, (byte)0xd3, (byte)0x94, 0x08, 0x02, 0x0f,
@@ -5186,28 +5189,28 @@ public class TestCharset extends TestFmwk {
             (byte)0xea, 0x06,(byte) 0xd3,(byte) 0xe6, 0x0f,(byte) 0x8a, 0x00, 0x30, 0x44, 0x65,(byte) 0xb9, (byte)0xe4, (byte)0xfe,(byte) 0xe7,(byte) 0xc2, 0x06,
             (byte)0xcb, (byte)0x82
         };
-        
+
         CharsetProviderICU cs = new CharsetProviderICU();
         CharsetICU charset = (CharsetICU)cs.charsetForName("scsu");
         CharsetDecoder decode = charset.newDecoder();
         CharsetEncoder encode = charset.newEncoder();
-        
+
         //String[] codePoints = {"allFeatures", "german","russian","japanese"};
         byte[][] fromUnicode={allFeaturesSCSU,germanSCSU,russianSCSU,japaneseSCSU};
         char[][] toUnicode = {allFeaturesUTF16, germanUTF16,russianUTF16,japaneseUTF16};
-        
+
         for(int i=0;i<4;i++){
             ByteBuffer decoderBuffer = ByteBuffer.wrap(fromUnicode[i]);
             CharBuffer encoderBuffer = CharBuffer.wrap(toUnicode[i]);
-                           
+
             try{
-                // Decoding 
+                // Decoding
                 CharBuffer decoderResult = decode.decode(decoderBuffer);
                 encoderBuffer.position(0);
                 if(!decoderResult.equals(encoderBuffer)){
                     errln("Error occured while decoding "+ charset.name());
                 }
-                // Encoding 
+                // Encoding
                 ByteBuffer encoderResult = encode.encode(encoderBuffer);
                 // RoundTrip Test
                 ByteBuffer roundTrip = encoderResult;
@@ -5231,12 +5234,12 @@ public class TestCharset extends TestFmwk {
                 errln("Exception while converting SCSU thrown: " + e);
             }
         }
-        
+
         /* Provide better code coverage */
         /* testing illegal codepoints */
         CoderResult illegalResult = CoderResult.UNDERFLOW;
         CharBuffer illegalDecoderTrgt = CharBuffer.allocate(10);
-        
+
         byte[] illegalDecoderSrc1 = { (byte)0x41, (byte)0xdf, (byte)0x0c };
         decode.reset();
         illegalResult = decode.decode(ByteBuffer.wrap(illegalDecoderSrc1), illegalDecoderTrgt, true);
@@ -5320,7 +5323,7 @@ public class TestCharset extends TestFmwk {
                 }
             }
         }
-        
+
         /* Monkey test */
         {
             char[] monkeyIn = {
@@ -5367,9 +5370,9 @@ public class TestCharset extends TestFmwk {
             decode.reset();
             CharBuffer monkeyCB = CharBuffer.wrap(monkeyIn);
             try {
-                ByteBuffer monkeyBB = encode.encode(monkeyCB); 
+                ByteBuffer monkeyBB = encode.encode(monkeyCB);
                 /* CharBuffer monkeyEndResult =*/ decode.decode(monkeyBB);
-                
+
             } catch (Exception ex) {
                 errln("Exception thrown while encoding/decoding monkey test in SCSU: " + ex);
             }
@@ -5381,7 +5384,7 @@ public class TestCharset extends TestFmwk {
             };
             encode.reset();
             CharBuffer malformedSrc = CharBuffer.wrap(malformedSequence);
-            
+
             try {
                 encode.encode(malformedSrc);
                 errln("Malformed error should have thrown an exception.");
@@ -5403,34 +5406,34 @@ public class TestCharset extends TestFmwk {
                     errln("Buffer overflow exception should have been thrown.");
                 }
             }
-            
+
         }
-    } 
-    
+    }
+
     /* Test for BOCU1 converter*/
     @Test
     public void TestBOCU1Converter(){
         char expected[]={
-                  0xFEFF, 0x0061, 0x0062, 0x0020, // 0 
+                  0xFEFF, 0x0061, 0x0062, 0x0020, // 0
                   0x0063, 0x0061, 0x000D, 0x000A,
 
-                  0x0020, 0x0000, 0x00DF, 0x00E6, // 8 
+                  0x0020, 0x0000, 0x00DF, 0x00E6, // 8
                   0x0930, 0x0020, 0x0918, 0x0909,
 
-                  0x3086, 0x304D, 0x0020, 0x3053, // 16 
-                  0x4000, 0x4E00, 0x7777, 0x0020, 
+                  0x3086, 0x304D, 0x0020, 0x3053, // 16
+                  0x4000, 0x4E00, 0x7777, 0x0020,
 
-                  0x9FA5, 0x4E00, 0xAC00, 0xBCDE, // 24 
+                  0x9FA5, 0x4E00, 0xAC00, 0xBCDE, // 24
                   0x0020, 0xD7A3, 0xDC00, 0xD800,
 
-                  0xD800, 0xDC00, 0xD845, 0xDDDD, // 32 
+                  0xD800, 0xDC00, 0xD845, 0xDDDD, // 32
                   0xDBBB, 0xDDEE, 0x0020, 0xDBFF,
 
-                  0xDFFF, 0x0001, 0x0E40, 0x0020, // 40 
-                  0x0009  
+                  0xDFFF, 0x0001, 0x0E40, 0x0020, // 40
+                  0x0009
         };
-        
-        byte sampleText[]={ // from cintltst/bocu1tst.c/TestBOCU1 text 1 
+
+        byte sampleText[]={ // from cintltst/bocu1tst.c/TestBOCU1 text 1
             (byte) 0xFB,
             (byte) 0xEE,
             0x28, // from source offset 0
@@ -5460,31 +5463,31 @@ public class TestCharset extends TestFmwk {
             (byte) 0xFC, 0x10, 0x3E, (byte) 0xFE, 0x16, 0x3A, (byte) 0x8C,
             0x20, (byte) 0xFC, 0x03, (byte) 0xAC,
 
-            0x01, /// from 41 
-            (byte) 0xDE, (byte) 0x83, 0x20, 0x09 
+            0x01, /// from 41
+            (byte) 0xDE, (byte) 0x83, 0x20, 0x09
         };
-        
+
         CharsetProviderICU cs = new CharsetProviderICU();
         CharsetICU charset = (CharsetICU)cs.charsetForName("BOCU-1");
         CharsetDecoder decode = charset.newDecoder();
         CharsetEncoder encode = charset.newEncoder();
-       
+
         ByteBuffer decoderBuffer = ByteBuffer.wrap(sampleText);
         CharBuffer encoderBuffer = CharBuffer.wrap(expected);
         try{
-            // Decoding 
+            // Decoding
             CharBuffer decoderResult = decode.decode(decoderBuffer);
-            
+
             encoderBuffer.position(0);
             if(!decoderResult.equals(encoderBuffer)){
                 errln("Error occured while decoding "+ charset.name());
             }
-            // Encoding 
+            // Encoding
             ByteBuffer encoderResult = encode.encode(encoderBuffer);
             // RoundTrip Test
             ByteBuffer roundTrip = encoderResult;
             CharBuffer roundTripResult = decode.decode(roundTrip);
-            
+
             encoderBuffer.position(0);
             if(!roundTripResult.equals(encoderBuffer)){
                 errln("Error occured while encoding "+ charset.name());
@@ -5493,7 +5496,7 @@ public class TestCharset extends TestFmwk {
             errln("Exception while converting BOCU-1 thrown: " + e);
         }
     }
-    
+
     /* Test that ICU4C and ICU4J get the same ICU canonical name when given the same alias. */
     @Test
     public void TestICUCanonicalNameConsistency() {
@@ -5511,7 +5514,7 @@ public class TestCharset extends TestFmwk {
             }
         }
     }
-    
+
     /* Increase code coverage for CharsetICU and CharsetProviderICU*/
     @Test
     public void TestCharsetICUCodeCoverage() {
@@ -5541,7 +5544,7 @@ public class TestCharset extends TestFmwk {
         }
         errln("IllegalArgumentException should have been thrown.");
     }
-    
+
     @Test
     public void TestCharsetLMBCS() {
         String []lmbcsNames = {
@@ -5558,16 +5561,16 @@ public class TestCharset extends TestFmwk {
                 "LMBCS-18",
                 "LMBCS-19"
         };
-        
+
         char[] src = {
                 0x0192, 0x0041, 0x0061, 0x00D0, 0x00F6, 0x0100, 0x0174, 0x02E4, 0x03F5, 0x03FB,
                 0x05D3, 0x05D4, 0x05EA, 0x0684, 0x0685, 0x1801, 0x11B3, 0x11E8, 0x1F9A, 0x2EB4,
                 0x3157, 0x3336, 0x3304, 0xD881, 0xDC88
         };
         CharBuffer cbInput = CharBuffer.wrap(src);
-        
+
         CharsetProviderICU provider = new CharsetProviderICU();
-        
+
         for (int i = 0; i < lmbcsNames.length; i++) {
             Charset charset = provider.charsetForName(lmbcsNames[i]);
             if (charset == null) {
@@ -5576,12 +5579,12 @@ public class TestCharset extends TestFmwk {
             }
             CharsetEncoder encoder = charset.newEncoder();
             CharsetDecoder decoder = charset.newDecoder();
-            
+
             try {
                 cbInput.position(0);
                 ByteBuffer bbTmp = encoder.encode(cbInput);
                 CharBuffer cbOutput = decoder.decode(bbTmp);
-                
+
                 if (!equals(cbInput, cbOutput)) {
                     errln("Roundtrip test failed for charset: " + lmbcsNames[i]);
                 }
@@ -5592,9 +5595,9 @@ public class TestCharset extends TestFmwk {
                 }
                 errln("Exception thrown: " + ex + " while using charset: " + lmbcsNames[i]);
             }
-            
+
         }
-        
+
         // Test malformed
         CoderResult malformedResult = CoderResult.UNDERFLOW;
         byte[] malformedBytes = {
@@ -5608,19 +5611,19 @@ public class TestCharset extends TestFmwk {
         CharsetDecoder malformedDecoderTest = provider.charsetForName("LMBCS-1").newDecoder();
         for (int n = 0; n < malformedLimits.length; n++) {
             malformedDecoderTest.reset();
-            
+
             malformedSrc.position(0);
             malformedSrc.limit(malformedLimits[n]);
-            
+
             malformedTrgt.clear();
-            
+
             malformedResult = malformedDecoderTest.decode(malformedSrc,malformedTrgt, true);
             if (!malformedResult.isMalformed()) {
                 errln("Malformed error should have resulted.");
             }
         }
     }
-    
+
     /*
      * This is a port of ICU4C TestAmbiguousConverter in cintltst.
      * Since there is no concept of ambiguous converters in ICU4J
@@ -5633,11 +5636,11 @@ public class TestCharset extends TestFmwk {
         };
         ByteBuffer src = ByteBuffer.wrap(inBytes);
         CharBuffer trgt = CharBuffer.allocate(20);
-        
+
         CoderResult result = CoderResult.UNDERFLOW;
         CharsetProviderICU provider = new CharsetProviderICU();
         String[] names = CharsetProviderICU.getAllNames();
-        
+
         for (int i = 0; i < names.length; i++) {
             Charset charset = provider.charsetForName(names[i]);
             if (charset == null) {
@@ -5645,10 +5648,10 @@ public class TestCharset extends TestFmwk {
                 continue;
             }
             CharsetDecoder decoder = charset.newDecoder();
-            
+
             src.position(0);
             trgt.clear();
-            
+
             result = decoder.decode(src, trgt, true);
             if (result.isError()) {
                 /* We don't care about any failures. */
@@ -5656,7 +5659,7 @@ public class TestCharset extends TestFmwk {
             }
         }
     }
-    
+
     @Test
     public void TestIsFixedWidth(){
         String[] fixedWidth = {
@@ -5664,7 +5667,7 @@ public class TestCharset extends TestFmwk {
                 "UTF32",
                 "ibm-5478_P100-1995"
         };
-        
+
         String[] notFixedWidth = {
                 "GB18030",
                 "UTF8",
@@ -5673,24 +5676,24 @@ public class TestCharset extends TestFmwk {
         };
         CharsetProvider provider = new CharsetProviderICU();
         Charset charset;
-        
+
         for (int i = 0; i < fixedWidth.length; i++) {
             charset = provider.charsetForName(fixedWidth[i]);
-            
+
             if (!((CharsetICU)charset).isFixedWidth()) {
                 errln(fixedWidth[i] + " is a fixedWidth charset but returned false.");
             }
         }
-        
+
         for (int i = 0; i < notFixedWidth.length; i++) {
             charset = provider.charsetForName(notFixedWidth[i]);
-            
+
             if (((CharsetICU)charset).isFixedWidth()) {
                 errln(notFixedWidth[i] + " is NOT a fixedWidth charset but returned true.");
             }
         }
     }
-    
+
     @Test
     public void TestBytesLengthForString() {
         CharsetProviderICU provider = new CharsetProviderICU();
@@ -5701,7 +5704,7 @@ public class TestCharset extends TestFmwk {
                 "ISCII,version=0",
                 "ISO_2022,locale=ko,version=0"
         };
-        
+
         int[] expected = {
                 40,
                 20,
@@ -5709,21 +5712,21 @@ public class TestCharset extends TestFmwk {
                 80,
                 160
         };
-        
+
         int stringLength = 10;
         int length;
         int maxCharSize;
-        
+
         for (int i = 0; i < charsets.length; i++) {
             maxCharSize = (int)provider.charsetForName(charsets[i]).newEncoder().maxBytesPerChar();
             length = CharsetEncoderICU.getMaxBytesForString(stringLength, maxCharSize);
-            
+
             if (length != expected[i]) {
                 errln("For charset " + charsets[i] + " with string length " + stringLength + ", expected max byte length is " + expected[i] + " but got " + length);
             }
         }
     }
-    
+
     /*
      * When converting slices of a larger CharBuffer, Charset88591 and CharsetASCII does not handle the buffer correctly when
      * an unmappable character occurs.
@@ -5733,30 +5736,30 @@ public class TestCharset extends TestFmwk {
     public void TestCharsetASCII8859BufferHandling() {
         String firstLine = "C077693790=|MEMO=|00=|022=|Blanche st and the driveway grate was fault and rotated under my car=|\r\n";
         String secondLine = "C077693790=|MEMO=|00=|023=|puncturing the fuel tank. I spoke to the store operator (Ram Reddi –=|\r\n";
-        
+
         String charsetNames[] = {
                 "ASCII",
                 "ISO-8859-1"
         };
-        
+
         CoderResult result = CoderResult.UNDERFLOW;
-        
+
         CharsetEncoder encoder;
-        
+
         ByteBuffer outBuffer = ByteBuffer.allocate(500);
         CharBuffer charBuffer = CharBuffer.allocate(firstLine.length() + secondLine.length());
         charBuffer.put(firstLine);
         charBuffer.put(secondLine);
         charBuffer.flip();
-        
+
         for (int i = 0; i < charsetNames.length; i++) {
             encoder =  CharsetICU.forNameICU(charsetNames[i]).newEncoder();
-            
+
             charBuffer.position(firstLine.length());
             CharBuffer charBufferSlice = charBuffer.slice();
             charBufferSlice.limit(secondLine.length() - 2);
-    
-    
+
+
             try {
                 result = encoder.encode(charBufferSlice, outBuffer, false);
                 if (!result.isUnmappable()) {
@@ -5767,7 +5770,7 @@ public class TestCharset extends TestFmwk {
             }
         }
     }
-    
+
     /*
      * When converting with the String method getBytes(), buffer overflow exception is thrown because
      * of the way ICU4J is calculating the max bytes per char. This should be changed only on the ICU4J
@@ -5778,15 +5781,15 @@ public class TestCharset extends TestFmwk {
     public void TestBufferOverflowErrorUsingJavagetBytes() {
         String charsetName = "ibm-5035";
         String testCase = "\u7d42";
-        
+
         try {
             testCase.getBytes(charsetName);
         } catch (Exception ex) {
             errln("Error calling getBytes(): " + ex);
         }
-        
+
     }
-    
+
     @Test
     public void TestDefaultIgnorableCallback() {
         String cnv_name = "euc-jp-2007";
@@ -5812,7 +5815,7 @@ public class TestCharset extends TestFmwk {
                 errln("Error received converting +" + Integer.toHexString(set_ignorable.charAt(i)));
             }
         }
-        
+
         // test non-ignorable code points are not ignored
         size = set_not_ignorable.size();
         for (int i = 0; i < size; i++) {
index ac38eee83a6cc697382a16266be22f8c5327b8b2..f259bdb2fca791dd879b5fc0ec38413551bbd8e8 100644 (file)
@@ -9,13 +9,13 @@
 
 /**
  * Test for CharsetSelector
- * 
+ *
  * This is a port of ucnvseltst.c from ICU4C
- * 
+ *
  * Tests related to serialization are not ported in this version. In addition,
  * the TestConversionUTF8 method is not going to be ported, as UTF8 is seldom used
  * in Java.
- * 
+ *
  * @author Shaopeng Jia
  */
 
@@ -27,6 +27,8 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.charset.CharsetICU;
 import com.ibm.icu.charset.CharsetProviderICU;
@@ -35,6 +37,7 @@ import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.UTF16;
 import com.ibm.icu.text.UnicodeSet;
 
+@RunWith(JUnit4.class)
 public class TestSelection extends TestFmwk {
     @Test
     public void TestConversionUTF16() {
@@ -141,7 +144,7 @@ public class TestSelection extends TestFmwk {
             logln("IllegalArgumentException was thrown by CharsetSelector with a bogus mappingType.");
         }
     }
-    
+
     private String[] texts = {
             "Cos\'\u00E8 Unicode?\n\nUnicode assegna un numero univoco a ogni carattere,\nindipendentemente dalla piattaforma," +
             "\nindipendentemente dall\'applicazione,\nindipendentemente dalla lingua.\n\nI computer, in buona sostanza," +
@@ -170,7 +173,7 @@ public class TestSelection extends TestFmwk {
             "o di un sito web siano fruibili con piattaforme, lingue e paesi diversi, evitando la necessit\u00E0 di " +
             "reingenierizzare il prodotto per ogni situazione specifica. Permette, inoltre, il trasporto del testo " +
             "fra sistemi diversi senza che abbia luogo alcuna corruzione dei dati.\n",
-            
+
             "\u0427\u0442\u043E \u0442\u0430\u043A\u043E\u0435 Unicode? Unicode - \u044D\u0442\u043E" +
             " \u0443\u043D\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u043A\u043E\u0434" +
             " \u0434\u043B\u044F \u043B\u044E\u0431\u043E\u0433\u043E \u0441\u0438\u043C\u0432\u043E\u043B\u0430," +
@@ -332,7 +335,7 @@ public class TestSelection extends TestFmwk {
             "\u0440\u0430\u0437\u043B\u0438\u0447\u043D\u044B\u043C\u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u0430\u043C\u0438 " +
             "\u043F\u0440\u0435\u0434\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442 \u044D\u0442\u0438 " +
             "\u0434\u0430\u043D\u043D\u044B\u0435 \u043E\u0442 \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0435",
-            
+
             "\u0645\u0627 \u0647\u064A \u0627\u0644\u0634\u0641\u0631\u0629 \u0627\u0644\u0645\u0648\u062D\u062F\u0629 " +
             "\"\u064A\u0648\u0646\u0650\u0643\u0648\u062F\" \u061F\n\n\u0623\u0633\u0627\u0633\u064B\u0627\u060C " +
             "\u062A\u062A\u0639\u0627\u0645\u0644 \u0627\u0644\u062D\u0648\u0627\u0633\u064A\u0628 \u0641\u0642\u0637 \u0645\u0639 " +
@@ -431,7 +434,7 @@ public class TestSelection extends TestFmwk {
             "\u0643\u062A\u0627\u0628\u0629 \u0627\u0644\u0628\u0631\u0646\u0627\u0645\u062C \u0645\u0631\u0629 " +
             "\u0648\u0627\u062D\u062F\u0629\u060C \u0648\u0627\u0633\u062A\u062E\u062F\u0627\u0645\u0647 \u0639\u0644\u0649 " +
             "\u0623\u064A \u0646\u0648\u0639 \u0645\u0646 \u0627\u0644\u0623\u062C\u0647\u0632\u0629",
-              
+
             "\u4EC0\u9EBD\u662FUnicode(\u7D71\u4E00\u78BC/\u6A19\u6E96\u842C\u570B\u78BC)?\n\n" +
             "Unicode\u7D66\u6BCF\u500B\u5B57\u5143\u63D0\u4F9B\u4E86\u4E00\u500B\u552F\u4E00\u7684\u6578\u4F4D\uFF0C\n" +
             "\u4E0D\u8AD6\u662F\u4EC0\u9EBD\u5E73\u81FA\uFF0C\n\u4E0D\u8AD6\u662F\u4EC0\u9EBD\u7A0B\u5F0F\uFF0C\n" +
@@ -470,7 +473,7 @@ public class TestSelection extends TestFmwk {
             "\u570B\u5BB6\uFF0C\u800C\u4E0D\u9700\u8981\u91CD\u5EFA\u3002\u5B83\u53EF\u5C07\u8CC7\u6599\u50B3\u8F38" +
             "\u5230\u8A31\u591A\u4E0D\u540C\u7684\u7CFB\u7D71\uFF0C\u800C\u7121\u640D\u58DE\u3002\n\u95DC\u65BCUnicode" +
             "\u5B78\u8853\u5B78\u6703\n\nUnicode\u5B78\u8853\u5B78\u6703",
-           
+
             "\u00C7\'\u00EBsht\u00EB UNICODE?\n\nUnicode siguron nj\u00EB num\u00EBr t\u00EB vet\u00EBm p\u00EBr \u00E7do " +
             "g\u00EBrm\u00EB,\np\u00EBr cil\u00EBndo platform\u00EB,\np\u00EBr cilindo program,\np\u00EBr cil\u00EBndo " +
             "gjuh\u00EB.\n\nN\u00EB themel, kompjuterat veprojn\u00EB me an\u00EBn e numrave. Ata ruajn\u00EB g\u00EBrmat " +
@@ -502,7 +505,7 @@ public class TestSelection extends TestFmwk {
             "softuer ose nj\u00EB faqe interneti t\u00EB p\u00EBrdoret p\u00EBr shum\u00EB platforma, gjuh\u00EB dhe vende " +
             "pa re-inxhinierim. Ai lejon t\u00EB dh\u00EBnat t\u00EB kalohen p\u00EBrmes shum\u00EB sistemeve t\u00EB ndryshme " +
             "pa korruptim.",
-                
+
             "\u092F\u0942\u0928\u093F\u0915\u094B\u0921 \u0915\u094D\u092F\u093E \u0939\u0948?\n\n\u092F\u0942\u0928\u093F\u0915" +
             "\u094B\u0921 \u092A\u094D\u0930\u0924\u094D\u092F\u0947\u0915 \u0905\u0915\u094D\u0937\u0930 \u0915\u0947 " +
             "\u0932\u093F\u090F \u090F\u0915 \u0935\u093F\u0936\u0947\u0937 \u0928\u092E\u094D\u092C\u0930 \u092A\u094D" +
@@ -611,7 +614,7 @@ public class TestSelection extends TestFmwk {
             "\u0940 \u092C\u093E\u0927\u093E \u0915\u0947 \u0935\u093F\u092D\u093F\u0928\u094D\u0928 \u092A\u094D" +
             "\u0930\u0923\u093E\u0932\u093F\u092F\u094B\u0902 \u0938\u0947 \u0939\u094B\u0915\u0930 \u0932\u0947 " +
             "\u091C\u093E\u092F\u093E \u091C\u093E \u0938\u0915\u0924\u093E \u0939\u0948\u0964\n",
-            
+
             "\u0E1A\u0E40\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E02\u0E2D\u0E07\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02. \u0E04" +
             "\u0E2D\u0E21\u0E1E\u0E34\u0E27\u0E40\u0E15\u0E2D\u0E23\u0E4C\u0E08\u0E31\u0E14\u0E40\u0E01\u0E47\u0E1A" +
             "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E41\u0E25\u0E30\u0E2D\u0E31\u0E01\u0E02\u0E23\u0E30" +
@@ -683,7 +686,7 @@ public class TestSelection extends TestFmwk {
             "\u0E48\u0E07\u0E43\u0E19\u0E41\u0E19\u0E27\u0E42\u0E19\u0E49\u0E21\u0E17\u0E32\u0E07\u0E40\u0E17\u0E04\u0E42" +
             "\u0E19\u0E42\u0E25\u0E22\u0E35\u0E0B\u0E2D\u0E1F\u0E15\u0E4C\u0E41\u0E27\u0E23\u0E4C\u0E23\u0E30\u0E14\u0E31" +
             "\u0E1A\u0E42\u0E25\u0E01\u0E17\u0E35\u0E48\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E33\u0E04\n",
-            
+
             "\u4EC0\u4E48\u662FUnicode(\u7EDF\u4E00\u7801)?\n\nUnicode\u7ED9\u6BCF\u4E2A\u5B57\u7B26\u63D0\u4F9B\u4E86" +
             "\u4E00\u4E2A\u552F\u4E00\u7684\u6570\u5B57\uFF0C\n\u4E0D\u8BBA\u662F\u4EC0\u4E48\u5E73\u53F0\uFF0C\n\u4E0D" +
             "\u8BBA\u662F\u4EC0\u4E48\u7A0B\u5E8F\uFF0C\n\u4E0D\u8BBA\u662F\u4EC0\u4E48\u8BED\u8A00\u3002\n\n\u57FA\u672C" +
@@ -727,7 +730,7 @@ public class TestSelection extends TestFmwk {
             "\u8D44\u91D1\u3002Unicode\u5B66\u672F\u5B66\u4F1A\u7684\u4F1A\u5458\u8D44\u683C\u5F00\u653E\u7ED9\u4E16\u754C" +
             "\u4E0A\u4EFB\u4F55\u652F\u6301Unicode\u6807\u51C6\u548C\u5E0C\u671B\u534F\u52A9\u5176\u6269\u5C55\u548C\u6267" +
             "\u884C\u7684\u7EC4\u7EC7\u53CA\u4E2A\u4EBA\u3002\n",
-            
+
             "Mik\u00E4 Unicode on?\n\nUnicode m\u00E4\u00E4ritt\u00E4\u00E4 jokaiselle merkille yksil\u00F6llisen arvon." +
             "\nRiippumatta k\u00E4ytt\u00F6j\u00E4rjestelm\u00E4st\u00E4\nRiippumatta ohjelmistosta\nRiippumatta kielest" +
             "\u00E4\n\nTietokoneiden toiminta perustuu numeroiden k\u00E4sittelylle. My\u00F6s kirjaimet ja muut merkit " +
@@ -754,7 +757,7 @@ public class TestSelection extends TestFmwk {
             "\u00E4inen sovellus tai sivusto voidaan tarjota useille eri k\u00E4ytt\u00F6j\u00E4rjestelmille ja monilla " +
             "eri kielill\u00E4 maailmanlaajuisesti, ilman uudelleenohjelmoinnin tarvetta. Tieto kulkee j\u00E4rjestelmien " +
             "v\u00E4lill\u00E4 vailla tuhoutumisen tai v\u00E4\u00E4ristymisen vaaraa.\nUnicode-konsortio",
-            
+
             "Co je Unicode?\n\nUnicode p\u0159i\u0159azuje ka\u017Ed\u00E9mu znaku jedine\u010Dn\u00E9 \u010D\u00EDslo,\nnez" +
             "\u00E1visle na platform\u011B,\nnez\u00E1visle na programu,\nnez\u00E1visle na jazyce.\n\nPo\u010D\u00EDta\u010De," +
             " ze sv\u00E9 podstaty, pracuj\u00ED pouze s \u010D\u00EDsly. P\u00EDsmena a dal\u0161\u00ED znaky ukl\u00E1daj\u00ED" +
@@ -785,7 +788,7 @@ public class TestSelection extends TestFmwk {
             "softwarov\u00FD produkt nebo jedin\u00E1 webov\u00E1 str\u00E1nka byla zam\u011B\u0159ena na mnoho platforem, " +
             "jazyk\u016F a zem\u00ED beze zm\u011Bn n\u00E1vrhu. To dovoluje p\u0159en\u00E1\u0161et data p\u0159es mnoho " +
             "r\u016Fzn\u00FDch syst\u00E9m\u016F bez poru\u0161en\u00ED.",
-            
+
             "?\n\n\u05D9\u05D5\u05E0\u05D9\u05E7\u05D5\u05D3 \u05DE\u05E7\u05E6\u05D4 \u05DE\u05E1\u05E4\u05E8 \u05D9\u05D9" +
             "\u05D7\u05D5\u05D3\u05D9 \u05DC\u05DB\u05DC \u05EA\u05D5,\n\u05DC\u05D0 \u05DE\u05E9\u05E0\u05D4 \u05E2\u05DC " +
             "\u05D0\u05D9\u05D6\u05D5 \u05E4\u05DC\u05D8\u05E4\u05D5\u05E8\u05DE\u05D4,\n\u05DC\u05D0 \u05DE\u05E9\u05E0\u05D4" +
index 06bd1ccfcdba4db968f76efe73694beac06eba1f..6cc274a563d600c1ae4d8353d9b7d575f1d9d501 100644 (file)
@@ -18,6 +18,8 @@ import java.util.Set;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.util.CollectionUtilities;
@@ -43,6 +45,7 @@ import com.ibm.icu.util.ULocale;
 /**
  * @author Mark Davis
  */
+@RunWith(JUnit4.class)
 public class AlphabeticIndexTest extends TestFmwk {
     /**
      *
index d467c6d4bc4351323279536a7cafda0a0b607398..c7b6589ef1ffdfb2b5c72be8417dd547d2663e6a 100644 (file)
@@ -23,6 +23,8 @@ import java.util.MissingResourceException;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -38,6 +40,7 @@ import com.ibm.icu.text.UnicodeSet;
 import com.ibm.icu.util.ULocale;
 import com.ibm.icu.util.VersionInfo;
 
+@RunWith(JUnit4.class)
 public class CollationAPITest extends TestFmwk {
     /**
      * This tests the collation key related APIs.
index a822e0d659a6057061734ff28da27b42f4f5ce0f..4c6de0cf3b302a558760579c79f3d085a6928814 100644 (file)
@@ -7,30 +7,33 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationTurkishTest
  * Source File: $ICU4CRoot/source/test/intltest/trcoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
+
+@RunWith(JUnit4.class)
 public class CollationChineseTest extends TestFmwk{
-    public CollationChineseTest() 
+    public CollationChineseTest()
     {
     }
-    
+
     @Test
-    public void TestPinYin() 
+    public void TestPinYin()
     {
-        String seq[] 
+        String seq[]
             = {"\u963f", "\u554a", "\u54ce", "\u6371", "\u7231", "\u9f98",
                "\u4e5c", "\u8baa", "\u4e42", "\u53c8"};
         RuleBasedCollator collator = null;
@@ -45,4 +48,4 @@ public class CollationChineseTest extends TestFmwk{
             CollationTest.doTest(this, collator, seq[i], seq[i + 1], -1);
         }
     }
-}
\ No newline at end of file
+}
index 25d03421f9d312e7a79d853b8c9f6ef95ce51dbd..2797b1c26aaac6961f0b5e897991269e0f68c219 100644 (file)
@@ -6,13 +6,15 @@
  * others. All Rights Reserved.                                                *
  *******************************************************************************
  */
+
 package com.ibm.icu.dev.test.collator;
 
 import java.util.Locale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
@@ -21,20 +23,21 @@ import com.ibm.icu.text.RuleBasedCollator;
 
 
 /**
- * 
- * CollationCreationMethodTest checks to ensure that the collators act the same whether they are created by choosing a 
+ *
+ * CollationCreationMethodTest checks to ensure that the collators act the same whether they are created by choosing a
  * locale and loading the data from file, or by using rules.
- * 
+ *
  * @author Brian Rower - IBM - August 2008
  *
  */
-public class CollationCreationMethodTest extends TestFmwk 
+@RunWith(JUnit4.class)
+public class CollationCreationMethodTest extends TestFmwk
 {
     @Test
     public void TestRuleVsLocaleCreationMonkey()
     {
         //create a RBC from a collator reader by reading in a locale collation file
-        //also create one simply from a rules string (which should be 
+        //also create one simply from a rules string (which should be
         //pulled from the locale collation file)
         //and then do crazy monkey testing on it to make sure they are the same.
         int x,y,z;
@@ -60,8 +63,8 @@ public class CollationCreationMethodTest extends TestFmwk
                 localeCollator = (RuleBasedCollator)Collator.getInstance(locale);
                 logln("Rules for " + locale + " are: " + localeCollator.getRules());
                 ruleCollator = new RuleBasedCollator(localeCollator.getRules());
-            } 
-            catch (Exception e) 
+            }
+            catch (Exception e)
             {
                 warnln("ERROR: in creation of collator of locale " + locale.getDisplayName() + ": " + e);
                 return;
@@ -76,7 +79,7 @@ public class CollationCreationMethodTest extends TestFmwk
 
                 key1 = localeCollator.getCollationKey(randString1);
                 key2 = ruleCollator.getCollationKey(randString1);
-               
+
                 report(locale.getDisplayName(), randString1, key1, key2);
             }
         }
@@ -108,9 +111,9 @@ public class CollationCreationMethodTest extends TestFmwk
         return s;
     }
 
-    private void report(String localeName, String string1, CollationKey k1, CollationKey k2) 
+    private void report(String localeName, String string1, CollationKey k1, CollationKey k2)
     {
-        if (!k1.equals(k2)) 
+        if (!k1.equals(k2))
         {
             StringBuilder msg = new StringBuilder();
             msg.append("With ").append(localeName).append(" collator\n and input string: ").append(string1).append('\n');
index 00b1406bae772c0bb71303c19b5ffe0a34e6d88e..b1366b072dc136d7d979ab056acbc95de1beebe4 100644 (file)
@@ -7,22 +7,25 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationCurrencyTest
  * Source File: $ICU4CRoot/source/test/intltest/currcoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
+
+@RunWith(JUnit4.class)
 public class CollationCurrencyTest extends TestFmwk {
     @Test
     public void TestCurrency() {
@@ -59,16 +62,16 @@ public class CollationCurrencyTest extends TestFmwk {
             { 0x20AE }, /*20AE; L; [14 62, 03, 03]    # [0841.0020.0002] # TUGRIK SIGN*/
             { 0x20AF } /*20AF; L; [14 64, 03, 03]    # [0842.0020.0002] # DRACHMA SIGN*/
         };
-    
+
         int i, j;
         int expectedResult = 0;
         RuleBasedCollator c = (RuleBasedCollator)Collator.getInstance(Locale.ENGLISH);
-        
+
         // Compare each currency symbol against all the
         // currency symbols, including itself
         String source;
         String target;
-        
+
         for (i = 0; i < currency.length; i += 1) {
             for (j = 0; j < currency.length; j += 1) {
                 source = new String(currency[i]);
@@ -84,14 +87,14 @@ public class CollationCurrencyTest extends TestFmwk {
 
                 int compareResult = c.compare(source, target);
                 CollationKey sourceKey = null;
-            
+
                 sourceKey = c.getCollationKey(source);
 
                 if (sourceKey == null) {
                     errln("Couldn't get collationKey for source");
                     continue;
                 }
-            
+
                 CollationKey targetKey = null;
                 targetKey = c.getCollationKey(target);
                 if (targetKey == null) {
@@ -105,7 +108,7 @@ public class CollationCurrencyTest extends TestFmwk {
             }
         }
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ) {
         if (expectedResult < -1 || expectedResult > 1) {
@@ -118,13 +121,13 @@ public class CollationCurrencyTest extends TestFmwk {
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()) {
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -134,7 +137,7 @@ public class CollationCurrencyTest extends TestFmwk {
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -147,7 +150,7 @@ public class CollationCurrencyTest extends TestFmwk {
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -158,7 +161,7 @@ public class CollationCurrencyTest extends TestFmwk {
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index a332bf8bd09d5905646f9911cef1769893db1f04..c785d3e46832916b6dfd7fd8c67d01a434b70f23 100644 (file)
@@ -7,18 +7,20 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationDummyTest
  * Source File: $ICU4CRoot/source/test/intltest/allcoll.cpp
  *              $ICU4CRoot/source/test/cintltst/callcoll.c
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationElementIterator;
@@ -26,7 +28,8 @@ import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.Normalizer;
 import com.ibm.icu.text.RuleBasedCollator;
+
+@RunWith(JUnit4.class)
 public class CollationDummyTest extends TestFmwk {
     //testSourceCases[][] and testTargetCases[][], testCases[][] are ported from the file callcoll.c in icu4c
     private static char[][] testSourceCases = {
@@ -39,34 +42,34 @@ public class CollationDummyTest extends TestFmwk {
         {0x66, 0x69, 0x76, 0x65},
         {0x31},
         {0x31},
-        {0x31},                                            //  10 
+        {0x31},                                            //  10
         {0x32},
         {0x32},
         {0x48, 0x65, 0x6c, 0x6c, 0x6f},
         {0x61, 0x3c, 0x62},
         {0x61, 0x3c, 0x62},
         {0x61, 0x63, 0x63},
-        {0x61, 0x63, 0x48, 0x63},  //  simple test 
+        {0x61, 0x63, 0x48, 0x63},  //  simple test
         {0x70, 0x00EA, 0x63, 0x68, 0x65},
         {0x61, 0x62, 0x63},
-        {0x61, 0x62, 0x63},                                  //  20 
+        {0x61, 0x62, 0x63},                                  //  20
         {0x61, 0x62, 0x63},
         {0x61, 0x62, 0x63},
         {0x61, 0x62, 0x63},
         {0x61, 0x00E6, 0x63},
-        {0x61, 0x63, 0x48, 0x63},  //  primary test 
+        {0x61, 0x63, 0x48, 0x63},  //  primary test
         {0x62, 0x6c, 0x61, 0x63, 0x6b},
         {0x66, 0x6f, 0x75, 0x72},
         {0x66, 0x69, 0x76, 0x65},
         {0x31},
-        {0x61, 0x62, 0x63},                                        //  30 
-        {0x61, 0x62, 0x63},                                  
+        {0x61, 0x62, 0x63},                                        //  30
+        {0x61, 0x62, 0x63},
         {0x61, 0x62, 0x63, 0x48},
         {0x61, 0x62, 0x63},
-        {0x61, 0x63, 0x48, 0x63},                              //  34 
+        {0x61, 0x63, 0x48, 0x63},                              //  34
         {0x61, 0x63, 0x65, 0x30},
         {0x31, 0x30},
-        {0x70, 0x00EA,0x30}                                    // 37     
+        {0x70, 0x00EA,0x30}                                    // 37
     };
 
     private static char[][] testTargetCases = {
@@ -79,36 +82,36 @@ public class CollationDummyTest extends TestFmwk {
         {0x35},
         {0x6f, 0x6e, 0x65},
         {0x6e, 0x6e, 0x65},
-        {0x70, 0x6e, 0x65},                                  //  10 
+        {0x70, 0x6e, 0x65},                                  //  10
         {0x74, 0x77, 0x6f},
         {0x75, 0x77, 0x6f},
         {0x68, 0x65, 0x6c, 0x6c, 0x4f},
         {0x61, 0x3c, 0x3d, 0x62},
         {0x61, 0x62, 0x63},
         {0x61, 0x43, 0x48, 0x63},
-        {0x61, 0x43, 0x48, 0x63},  //  simple test 
+        {0x61, 0x43, 0x48, 0x63},  //  simple test
         {0x70, 0x00E9, 0x63, 0x68, 0x00E9},
         {0x61, 0x62, 0x63},
-        {0x61, 0x42, 0x43},                                  //  20 
+        {0x61, 0x42, 0x43},                                  //  20
         {0x61, 0x62, 0x63, 0x68},
         {0x61, 0x62, 0x64},
         {0x00E4, 0x62, 0x63},
         {0x61, 0x00C6, 0x63},
-        {0x61, 0x43, 0x48, 0x63},  //  primary test 
+        {0x61, 0x43, 0x48, 0x63},  //  primary test
         {0x62, 0x6c, 0x61, 0x63, 0x6b, 0x2d, 0x62, 0x69, 0x72, 0x64},
         {0x34},
         {0x35},
         {0x6f, 0x6e, 0x65},
         {0x61, 0x62, 0x63},
-        {0x61, 0x42, 0x63},                                  //  30 
+        {0x61, 0x42, 0x63},                                  //  30
         {0x61, 0x62, 0x63, 0x68},
         {0x61, 0x62, 0x64},
-        {0x61, 0x43, 0x48, 0x63},                                //  34 
+        {0x61, 0x43, 0x48, 0x63},                                //  34
         {0x61, 0x63, 0x65, 0x30},
         {0x31, 0x30},
-        {0x70, 0x00EB,0x30}                                    // 37 
+        {0x70, 0x00EB,0x30}                                    // 37
     };
-    
+
     private static char[][] testCases = {
         {0x61},
         {0x41},
@@ -124,7 +127,7 @@ public class CollationDummyTest extends TestFmwk {
         {0x63},
         {0x7a}
     };
-    
+
     int[] results = {
         -1,
         -1, //Collator::GREATER,
@@ -135,7 +138,7 @@ public class CollationDummyTest extends TestFmwk {
         -1,
         1,
         1,
-        -1,                                     //  10 
+        -1,                                     //  10
         1,
         -1,
         1,
@@ -143,44 +146,44 @@ public class CollationDummyTest extends TestFmwk {
         -1,
         -1,
         -1,
-    //  test primary > 17 
+    //  test primary > 17
         0,
         0,
-        0,                                    //  20 
+        0,                                    //  20
         -1,
         -1,
         0,
         0,
         0,
         -1,
-    //  test secondary > 26 
+    //  test secondary > 26
         0,
         0,
         0,
         0,
-        0,                                    //  30 
+        0,                                    //  30
         0,
         -1,
-        0,                                     //  34 
+        0,                                     //  34
         0,
         0,
-        -1 
+        -1
     };
-    
+
     final int MAX_TOKEN_LEN = 16;
-    
+
     private RuleBasedCollator myCollation;
-    
+
     public CollationDummyTest() {
     }
-    
+
     @Before
     public void init() throws Exception {
         String ruleset = "& C < ch, cH, Ch, CH & Five, 5 & Four, 4 & one, 1 & Ampersand; '&' & Two, 2 ";
         // String ruleset = "& Four, 4";
         myCollation = new RuleBasedCollator(ruleset);
     }
-    
+
     // perform test with strength tertiary
     @Test
     public void TestTertiary() {
@@ -194,7 +197,7 @@ public class CollationDummyTest extends TestFmwk {
     // perform test with strength PRIMARY
     @Test
     public void TestPrimary() {
-       // problem in strcollinc for unfinshed contractions 
+       // problem in strcollinc for unfinshed contractions
        myCollation.setStrength(Collator.PRIMARY);
         for (int i = 17; i < 26 ; i++) {
             doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]);
@@ -250,17 +253,17 @@ public class CollationDummyTest extends TestFmwk {
             errln("Comparing two strings with only secondary differences in C failed.\n");
             return;
         }
-        
-        // To compare them with just primary differences 
+
+        // To compare them with just primary differences
         coll.setStrength(Collator.PRIMARY);
         result = coll.compare(source, target);
-        // result is 0 
+        // result is 0
         if (result != 0) {
             errln("Comparing two strings with no differences in C failed.\n");
             return;
-        } 
-          
-        // Now, do the same comparison with keys 
+        }
+
+        // Now, do the same comparison with keys
         CollationKey sourceKeyOut, targetKeyOut;
         sourceKeyOut = coll.getCollationKey(source);
         targetKeyOut = coll.getCollationKey(target);
@@ -270,38 +273,38 @@ public class CollationDummyTest extends TestFmwk {
             return;
         }
     }
-    
+
     //TestSurrogates() is ported from cintltst/callcoll.c
-    
+
     /**
     * Tests surrogate support.
     */
     @Test
-    public void TestSurrogates() 
+    public void TestSurrogates()
     {
         String rules = "&z<'\ud800\udc00'<'\ud800\udc0a\u0308'<A";
         String source[] = {"z",
                            "\uD800\uDC00",
                            "\ud800\udc0a\u0308",
-                           "\ud800\udc02"    
+                           "\ud800\udc02"
         };
-        
+
         String target[] = {"\uD800\uDC00",
                            "\ud800\udc0a\u0308",
                            "A",
-                           "\ud800\udc03"    
+                           "\ud800\udc03"
         };
-    
-        // this test is to verify the supplementary sort key order in the english 
+
+        // this test is to verify the supplementary sort key order in the english
         // collator
         Collator enCollation;
         try {
             enCollation = Collator.getInstance(Locale.ENGLISH);
         } catch (Exception e) {
             errln("ERROR: Failed to create the collator for ENGLISH");
-            return;       
+            return;
         }
-        
+
         myCollation.setStrength(Collator.TERTIARY);
         int count = 0;
         // logln("start of english collation supplementary characters test\n");
@@ -310,7 +313,7 @@ public class CollationDummyTest extends TestFmwk {
             count ++;
         }
         doTest(enCollation, source[count], target[count], 1);
-            
+
         // logln("start of tailored collation supplementary characters test\n");
         count = 0;
         Collator newCollation;
@@ -318,16 +321,16 @@ public class CollationDummyTest extends TestFmwk {
             newCollation = new RuleBasedCollator(rules);
         } catch (Exception e) {
             errln("ERROR: Failed to create the collator for rules");
-            return;       
+            return;
         }
-        
-        // tests getting collation elements for surrogates for tailored rules 
+
+        // tests getting collation elements for surrogates for tailored rules
         while (count < 4) {
             doTest(newCollation, source[count], target[count], -1);
             count ++;
         }
-    
-        // tests that \uD801\uDC01 still has the same value, not changed 
+
+        // tests that \uD801\uDC01 still has the same value, not changed
         CollationKey enKey = enCollation.getCollationKey(source[3]);
         CollationKey newKey = newCollation.getCollationKey(source[3]);
         int keyResult = enKey.compareTo(newKey);
@@ -358,68 +361,68 @@ public class CollationDummyTest extends TestFmwk {
         char[] source = new char[1];
         char ch;
         int expected[] = {0};
-    
+
         try {
             enColl = Collator.getInstance(Locale.ENGLISH);
         } catch (Exception e) {
             errln("ERROR: Failed to create the collator for ENGLISH");
             return;
         }
-        
+
         try{
             myColl = new RuleBasedCollator(rule);
         } catch(Exception e){
             errln("Fail to create RuleBasedCollator with rules:" + rule);
             return;
-        }  
+        }
         enColl.setStrength(Collator.PRIMARY);
         myColl.setStrength(Collator.PRIMARY);
-        
+
         ((RuleBasedCollator)enColl).setAlternateHandlingShifted(true);
         ((RuleBasedCollator)myColl).setAlternateHandlingShifted(true);
-        
+
         if(((RuleBasedCollator)enColl).isAlternateHandlingShifted() != true) {
             errln("ERROR: ALTERNATE_HANDLING value can not be set to SHIFTED\n");
         }
-        
-        // space is supposed to be a variable 
-        CollationKey key = enColl.getCollationKey(" ");   
-        byte[] result = key.toByteArray(); 
-        
+
+        // space is supposed to be a variable
+        CollationKey key = enColl.getCollationKey(" ");
+        byte[] result = key.toByteArray();
+
         for(int i = 0; i < result.length; i++) {
             if(result[i]!= expected[i]) {
-                errln("ERROR: SHIFTED alternate does not return 0 for primary of space\n");  
-                break;  
+                errln("ERROR: SHIFTED alternate does not return 0 for primary of space\n");
+                break;
             }
         }
-        
+
         ch = 'a';
         while (ch < 'z') {
             source[0] = ch;
             key = myColl.getCollationKey(new String(source));
             result = key.toByteArray();
-            
+
             for(int i = 0; i < result.length; i++) {
                 if(result[i]!= expected[i]) {
-                    errln("ERROR: SHIFTED alternate does not return 0 for primary of space\n");  
-                    break;  
+                    errln("ERROR: SHIFTED alternate does not return 0 for primary of space\n");
+                    break;
                 }
             }
             ch ++;
         }
     }
-    
+
     @Test
     public void TestJB1401() {
         Collator     myCollator = null;
         char[] NFD_UnsafeStartChars = {
-            0x0f73,          // Tibetan Vowel Sign II 
-            0x0f75,          // Tibetan Vowel Sign UU 
-            0x0f81,          // Tibetan Vowel Sign Reversed II 
+            0x0f73,          // Tibetan Vowel Sign II
+            0x0f75,          // Tibetan Vowel Sign UU
+            0x0f81,          // Tibetan Vowel Sign Reversed II
             0
         };
         int i;
-    
+
         try{
             myCollator = Collator.getInstance(Locale.ENGLISH);
         } catch(Exception e) {
@@ -433,11 +436,11 @@ public class CollationDummyTest extends TestFmwk {
             // in original form, NFD, and then NFC form.
             char c = NFD_UnsafeStartChars[i];
             if (c==0) {break;}
-            
+
             String x = "\u00C0" + c;       // \u00C0 is A Grave
             String y;
             String z;
-    
+
             try{
                 y = Normalizer.decompose(x, false);
                 z = Normalizer.decompose(y, true);
@@ -445,15 +448,15 @@ public class CollationDummyTest extends TestFmwk {
                 errln("ERROR: Failed to normalize test of character" + c);
                 return;
             }
-       
+
             // Collation test.  All three strings should be equal.
             // doTest does both strcoll and sort keys, with params in both orders.
             doTest(myCollator, x, y, 0);
             doTest(myCollator, x, z, 0);
-            doTest(myCollator, y, z, 0); 
-    
+            doTest(myCollator, y, z, 0);
+
             // Run collation element iterators over the three strings.  Results should be same for each.
-             
+
             {
                 CollationElementIterator ceiX, ceiY, ceiZ;
                 int ceX, ceY, ceZ;
@@ -466,7 +469,7 @@ public class CollationDummyTest extends TestFmwk {
                     errln("ERROR: getCollationElementIterator failed");
                     return;
                 }
-    
+
                 for (j=0;; j++) {
                     try{
                         ceX = ceiX.next();
@@ -476,7 +479,7 @@ public class CollationDummyTest extends TestFmwk {
                         errln("ERROR: CollationElementIterator.next failed for iteration " + j);
                         break;
                     }
-                  
+
                     if (ceX != ceY || ceY != ceZ) {
                         errln("ERROR: ucol_next failed for iteration " + j);
                         break;
@@ -488,10 +491,10 @@ public class CollationDummyTest extends TestFmwk {
             }
         }
     }
-    
+
     // main test method called with different strengths,
     // tests comparison of custum collation with different strengths
-    
+
     private void doTest(Collator collation, char[] source, char[] target, int result) {
         String s = new String(source);
         String t = new String(target);
@@ -504,10 +507,10 @@ public class CollationDummyTest extends TestFmwk {
             doTestVariant(collation, t, s, 0);
         }
     }
-    
+
     // main test method called with different strengths,
     // tests comparison of custum collation with different strengths
-    
+
     private void doTest(Collator collation,String s, String t, int result) {
         doTestVariant(collation, s, t, result);
         if(result == -1) {
@@ -518,7 +521,7 @@ public class CollationDummyTest extends TestFmwk {
             doTestVariant(collation, t, s, 0);
         }
     }
-    
+
     private void doTestVariant(Collator collation, String source, String target, int result) {
         int compareResult = collation.compare(source, target);
         CollationKey srckey , tgtkey;
@@ -532,4 +535,4 @@ public class CollationDummyTest extends TestFmwk {
             errln("Collation key comparison failed in variant test\n");
         }
     }
-}
\ No newline at end of file
+}
index f2221edf39f4262f5dbf40239465ae0320db3eb8..8f4608ba192cdb31d69dc80c3cb600c28c45b802 100644 (file)
@@ -7,22 +7,25 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationEnglishTest
  * Source File: $ICU4CRoot/source/test/intltest/encoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
+
+@RunWith(JUnit4.class)
 public class CollationEnglishTest extends TestFmwk{
     private static char[][] testSourceCases = {
         {0x0061 /* 'a' */, 0x0062 /* 'b' */},
@@ -30,12 +33,12 @@ public class CollationEnglishTest extends TestFmwk{
         {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x0020 /* ' ' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */},
         {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x002D /* '-' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */},
         {0x0048 /* 'H' */, 0x0065 /* 'e' */, 0x006C /* 'l' */, 0x006C /* 'l' */, 0x006F /* 'o' */},
-        {0x0041 /* 'A' */, 0x0042 /* 'B' */, 0x0043 /* 'C' */}, 
+        {0x0041 /* 'A' */, 0x0042 /* 'B' */, 0x0043 /* 'C' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */},
         {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x002D /* '-' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */},
         {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x002D /* '-' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */},
-        {0x0070 /* 'p' */, 0x00EA, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x0065 /* 'e' */},                                            
+        {0x0070 /* 'p' */, 0x00EA, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x0065 /* 'e' */},
         {0x0070 /* 'p' */, 0x00E9, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x00E9},
         {0x00C4, 0x0042 /* 'B' */, 0x0308, 0x0043 /* 'C' */, 0x0308},
         {0x0061 /* 'a' */, 0x0308, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
@@ -44,9 +47,9 @@ public class CollationEnglishTest extends TestFmwk{
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0041 /* 'A' */},
         {0x0041 /* 'A' */},
-        {0x0061 /* 'a' */, 0x0062 /* 'b' */},                                                                
+        {0x0061 /* 'a' */, 0x0062 /* 'b' */},
         {0x0074 /* 't' */, 0x0063 /* 'c' */, 0x006F /* 'o' */, 0x006D /* 'm' */, 0x0070 /* 'p' */, 0x0061 /* 'a' */, 0x0072 /* 'r' */, 0x0065 /* 'e' */, 0x0070 /* 'p' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0069 /* 'i' */, 0x006E /* 'n' */},
-        {0x0061 /* 'a' */, 0x0062 /* 'b' */}, 
+        {0x0061 /* 'a' */, 0x0062 /* 'b' */},
         {0x0061 /* 'a' */, 0x0023 /* '#' */, 0x0062 /* 'b' */},
         {0x0061 /* 'a' */, 0x0023 /* '#' */, 0x0062 /* 'b' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
@@ -54,7 +57,7 @@ public class CollationEnglishTest extends TestFmwk{
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},
         {0x00E6, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},
-        {0x00E4, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},                                            
+        {0x00E4, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
@@ -64,7 +67,7 @@ public class CollationEnglishTest extends TestFmwk{
         {0x0061 /* 'a' */, 0x0308, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0074 /* 't' */, 0x0068 /* 'h' */, 0x0069 /* 'i' */, 0x0302, 0x0073 /* 's' */},
         {0x0070 /* 'p' */, 0x00EA, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x0065 /* 'e' */},
-        {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},                                                         
+        {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x00E6, 0x0063 /* 'c' */},
@@ -72,10 +75,10 @@ public class CollationEnglishTest extends TestFmwk{
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x00E6, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
-        {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},               
+        {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0070 /* 'p' */, 0x00E9, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x00E9}                                            // 49
     };
-    
+
     private static char[][] testTargetCases = {
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */},
@@ -86,7 +89,7 @@ public class CollationEnglishTest extends TestFmwk{
         {0x0041 /* 'A' */, 0x0042 /* 'B' */, 0x0043 /* 'C' */},
         {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */, 0x0073 /* 's' */},
         {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */, 0x0073 /* 's' */},
-        {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */},                             
+        {0x0062 /* 'b' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0063 /* 'c' */, 0x006B /* 'k' */, 0x0062 /* 'b' */, 0x0069 /* 'i' */, 0x0072 /* 'r' */, 0x0064 /* 'd' */},
         {0x0070 /* 'p' */, 0x00E9, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x00E9},
         {0x0070 /* 'p' */, 0x00E9, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x0065 /* 'e' */, 0x0072 /* 'r' */},
         {0x00C4, 0x0042 /* 'B' */, 0x0308, 0x0043 /* 'C' */, 0x0308},
@@ -96,7 +99,7 @@ public class CollationEnglishTest extends TestFmwk{
         {0x0041 /* 'A' */, 0x00E1, 0x0063 /* 'c' */, 0x0064 /* 'd' */},
         {0x0041 /* 'A' */, 0x00E1, 0x0063 /* 'c' */, 0x0064 /* 'd' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
-        {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},                                                             
+        {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0054 /* 'T' */, 0x0043 /* 'C' */, 0x006F /* 'o' */, 0x006D /* 'm' */, 0x0070 /* 'p' */, 0x0061 /* 'a' */, 0x0072 /* 'r' */, 0x0065 /* 'e' */, 0x0050 /* 'P' */, 0x006C /* 'l' */, 0x0061 /* 'a' */, 0x0069 /* 'i' */, 0x006E /* 'n' */},
         {0x0061 /* 'a' */, 0x0042 /* 'B' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0023 /* '#' */, 0x0042 /* 'B' */},
@@ -106,7 +109,7 @@ public class CollationEnglishTest extends TestFmwk{
         {0x00C4, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},
         {0x00E4, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},
         {0x00C4, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},
-        {0x00C4, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},                                             
+        {0x00C4, 0x0062 /* 'b' */, 0x0063 /* 'c' */, 0x0064 /* 'd' */, 0x0061 /* 'a' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0023 /* '#' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x003D /* '=' */, 0x0063 /* 'c' */},
@@ -116,7 +119,7 @@ public class CollationEnglishTest extends TestFmwk{
         {0x00E4, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0074 /* 't' */, 0x0068 /* 'h' */, 0x00EE, 0x0073 /* 's' */},
         {0x0070 /* 'p' */, 0x00E9, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x00E9},
-        {0x0061 /* 'a' */, 0x0042 /* 'B' */, 0x0043 /* 'C' */},                                                          
+        {0x0061 /* 'a' */, 0x0042 /* 'B' */, 0x0043 /* 'C' */},
         {0x0061 /* 'a' */, 0x0062 /* 'b' */, 0x0064 /* 'd' */},
         {0x00E4, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x00C6, 0x0063 /* 'c' */},
@@ -124,13 +127,13 @@ public class CollationEnglishTest extends TestFmwk{
         {0x00E4, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x00C6, 0x0063 /* 'c' */},
         {0x0061 /* 'a' */, 0x0042 /* 'B' */, 0x0064 /* 'd' */},
-        {0x00E4, 0x0062 /* 'b' */, 0x0063 /* 'c' */},          
+        {0x00E4, 0x0062 /* 'b' */, 0x0063 /* 'c' */},
         {0x0070 /* 'p' */, 0x00EA, 0x0063 /* 'c' */, 0x0068 /* 'h' */, 0x0065 /* 'e' */}
     };                                           // 49
 
     private static int[] results = {
     //-1:LESS; 0:EQUAL; 1:GREATER
-        -1, 
+        -1,
         -1, /*Collator::GREATER,*/
         -1,
         1,
@@ -181,7 +184,7 @@ public class CollationEnglishTest extends TestFmwk{
         -1,
         0,
         -1,
-        -1, 
+        -1,
         -1                                                                  // 49
     };
 
@@ -238,17 +241,17 @@ public class CollationEnglishTest extends TestFmwk{
         { 0x0152},
         {0x006F /* 'o' */, 0x0066 /* 'f' */},
     };
-    
+
     private Collator myCollation = null;
-    
+
     public CollationEnglishTest() {
     }
-    
+
     @Before
     public void init()throws Exception {
         myCollation = Collator.getInstance(Locale.ENGLISH);
     }
-    
+
     //performs test with strength PRIMARY
     @Test
     public void TestPrimary() {
@@ -256,9 +259,9 @@ public class CollationEnglishTest extends TestFmwk{
         myCollation.setStrength(Collator.PRIMARY);
         for (i = 38; i < 43 ; i++) {
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
-        }  
+        }
     }
-    
+
     //perform test with strength SECONDARY
     @Test
     public void TestSecondary() {
@@ -284,7 +287,7 @@ public class CollationEnglishTest extends TestFmwk{
             }
         }
     }
-    
+
     //perform test with strength TERTIARY
     @Test
     public void TestTertiary() {
@@ -294,7 +297,7 @@ public class CollationEnglishTest extends TestFmwk{
         for (i = 0; i < 38 ; i++)
         {
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
-        } 
+        }
 
         int j = 0;
         for (i = 0; i < 10; i++)
@@ -321,10 +324,10 @@ public class CollationEnglishTest extends TestFmwk{
             }
         }
     }
-    
+
    // main test routine, tests rules defined by the "en" locale
     private void doTest(char[] source, char[] target, int result){
-        
+
         String s = new String(source);
         String t = new String(target);
         int compareResult = myCollation.compare(s, t);
@@ -333,9 +336,9 @@ public class CollationEnglishTest extends TestFmwk{
         sortKey2 = myCollation.getCollationKey(t);
         int keyResult = sortKey1.compareTo(sortKey2);
         reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
-        
+
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ){
         if (expectedResult < -1 || expectedResult > 1)
@@ -349,13 +352,13 @@ public class CollationEnglishTest extends TestFmwk{
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()){
-            return;    
+            return;
         }else{
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -365,7 +368,7 @@ public class CollationEnglishTest extends TestFmwk{
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -378,7 +381,7 @@ public class CollationEnglishTest extends TestFmwk{
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -389,7 +392,7 @@ public class CollationEnglishTest extends TestFmwk{
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
  }
index 14ad7e43c5aa39686ea8f5d4f6c2f401527a1aa1..7e4023cfcd7445745d22ea31a292107871014f6e 100644 (file)
@@ -7,21 +7,24 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationFinnishTest
  * Source File: $ICU4CRoot/source/test/intltest/ficoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.util.ULocale;
+
+@RunWith(JUnit4.class)
 public class CollationFinnishTest extends TestFmwk {
     private static char[][] testSourceCases = {
         {0x77, 0x61, 0x74},
@@ -49,26 +52,26 @@ public class CollationFinnishTest extends TestFmwk {
     };
 
     private Collator myCollation = null;
-    
+
     public CollationFinnishTest() {
     }
-    
+
     @Before
     public void init()throws Exception{
         myCollation = Collator.getInstance(new ULocale("fi_FI@collation=standard"));
     }
-     
-    
+
+
     // perform tests with strength PRIMARY
     @Test
     public void TestPrimary() {
         int i = 0;
         myCollation.setStrength(Collator.PRIMARY);
         for(i = 4; i < 5; i++) {
-            doTest(testSourceCases[i], testTargetCases[i], results[i]);    
-        }         
+            doTest(testSourceCases[i], testTargetCases[i], results[i]);
+        }
     }
-    
+
     // perform test with strength TERTIARY
     @Test
     public void TestTertiary() {
@@ -76,9 +79,9 @@ public class CollationFinnishTest extends TestFmwk {
         myCollation.setStrength(Collator.TERTIARY);
         for(i = 0; i < 4; i++ ) {
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
-        }    
+        }
     }
-    
+
     // main test routine, tests rules specific to the finish locale
     private void doTest(char[] source, char[] target, int result) {
         String s = new String(source);
@@ -90,7 +93,7 @@ public class CollationFinnishTest extends TestFmwk {
         int keyResult = sortKey1.compareTo(sortKey2);
         reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ) {
         if (expectedResult < -1 || expectedResult > 1) {
@@ -103,13 +106,13 @@ public class CollationFinnishTest extends TestFmwk {
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()) {
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -119,7 +122,7 @@ public class CollationFinnishTest extends TestFmwk {
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -132,7 +135,7 @@ public class CollationFinnishTest extends TestFmwk {
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -143,7 +146,7 @@ public class CollationFinnishTest extends TestFmwk {
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }               
+            }
         }
     }
 }
index 9e383d49b928cf2a0f148fa256451742a1d28bb2..d3d77f9bd66151ba4dab3406041707d12ddfaa56 100644 (file)
@@ -7,23 +7,26 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationFrenchTest
  * Source File: $ICU4CRoot/source/test/intltest/frcoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
+
+@RunWith(JUnit4.class)
 public class CollationFrenchTest extends TestFmwk{
     private static char[][] testSourceCases = {
         {0x0061/*'a'*/, 0x0062/*'b'*/, 0x0063/*'c'*/},
@@ -78,7 +81,7 @@ public class CollationFrenchTest extends TestFmwk{
     /*02*/    {0x0065/*'e'*/, 0x0300, 0x0301, 0x0065/*'e'*/},
     /*03*/    {0x0065/*'e'*/, 0x0300, 0x0065/*'e'*/},
     /*04*/    {0x0065/*'e'*/, 0x0301, 0x0300, 0x0065/*'e'*/},
-    /*05*/    {0x0065/*'e'*/, 0x0065/*'e'*/, 0x0301}, 
+    /*05*/    {0x0065/*'e'*/, 0x0065/*'e'*/, 0x0301},
     /*06*/    {0x0065/*'e'*/, 0x0301, 0x0065/*'e'*/, 0x0301},
     /*07*/    {0x0065/*'e'*/, 0x0300, 0x0301, 0x0065/*'e'*/, 0x0301},
     /*08*/    {0x0065/*'e'*/, 0x0300, 0x0065/*'e'*/, 0x0301},
@@ -112,29 +115,29 @@ public class CollationFrenchTest extends TestFmwk{
         {0x0065/*'e'*/, 0x0061/*'a'*/},
         {0x0078/*'x'*/}
     };
-    
-    
+
+
     private Collator myCollation = null;
-    
+
     public CollationFrenchTest() {
     }
-    
+
     @Before
     public void init()throws Exception {
         myCollation = Collator.getInstance(Locale.CANADA_FRENCH);
     }
-     
+
     // perform tests with strength TERTIARY
     @Test
     public void TestTertiary() {
         int i = 0;
         myCollation.setStrength(Collator.TERTIARY);
-        
+
         for (i = 0; i < 12 ; i++) {
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
         }
     }
-    
+
     // perform tests with strength SECONDARY
     @Test
     public void TestSecondary() {
@@ -144,7 +147,7 @@ public class CollationFrenchTest extends TestFmwk{
         int expected;
 
         myCollation.setStrength(Collator.SECONDARY);
-        
+
         for (i = 0; i < testAcute.length; i++) {
             for (j = 0; j < testAcute.length; j++) {
                 if (i <  j) {
@@ -170,7 +173,7 @@ public class CollationFrenchTest extends TestFmwk{
             }
         }
     }
-    
+
     @Test
     public void TestContinuationReordering()
     {
@@ -178,7 +181,7 @@ public class CollationFrenchTest extends TestFmwk{
         try {
             RuleBasedCollator collator = new RuleBasedCollator(rule);
             collator.setFrenchCollation(true);
-            CollationKey key1 
+            CollationKey key1
                         = collator.getCollationKey("a\u0325\u2f00\u2f01b\u0325");
             CollationKey key2
                         = collator.getCollationKey("a\u0325\u2f01\u2f01b\u0325");
@@ -189,7 +192,7 @@ public class CollationFrenchTest extends TestFmwk{
             errln(e.toString());
         }
     }
-     
+
     // main test routine, test rules specific to the french locale
     private void doTest(char[] source, char[] target, int result) {
         String s = new String(source);
@@ -199,9 +202,9 @@ public class CollationFrenchTest extends TestFmwk{
         sortKey1 = myCollation.getCollationKey(s);
         sortKey2 = myCollation.getCollationKey(t);
         int keyResult = sortKey1.compareTo(sortKey2);
-        reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);  
+        reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ) {
         if (expectedResult < -1 || expectedResult > 1) {
@@ -214,13 +217,13 @@ public class CollationFrenchTest extends TestFmwk{
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()) {
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -230,7 +233,7 @@ public class CollationFrenchTest extends TestFmwk{
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -243,7 +246,7 @@ public class CollationFrenchTest extends TestFmwk{
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -254,7 +257,7 @@ public class CollationFrenchTest extends TestFmwk{
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }               
+            }
         }
     }
-} 
+}
index cbb089321e07b57d5cbf6496f4a867736cf383d4..bb001e6626ab7193e6f268a2920d0dfe4ea1778c 100644 (file)
@@ -7,7 +7,7 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : collate/CollationMonkeyTest
  * Source File: $ICU4CRoot/source/test/intltest/mnkytst.cpp
  **/
@@ -18,6 +18,8 @@ import java.util.Locale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
@@ -25,16 +27,17 @@ import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
 
 /**
- * CollationFrozenMonkeyTest is a third level test class.  This tests the random 
- * substrings of the default test strings to verify if the compare and 
+ * CollationFrozenMonkeyTest is a third level test class.  This tests the random
+ * substrings of the default test strings to verify if the compare and
  * sort key algorithm works correctly on frozen collators.  For example, any string is always
  * less than the string itself appended with any character.
  */
 
+@RunWith(JUnit4.class)
 public class CollationFrozenMonkeyTest extends TestFmwk {
-    
+
     private String source = "-abcdefghijklmnopqrstuvwxyz#&^$@";
-    
+
     @Test
     public void TestCollationKey() {
         if(source.length() == 0) {
@@ -47,15 +50,15 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
         try {
             Collator myCollator = Collator.getInstance(new Locale("en", "CA"));
             myCollator.freeze();
-            
+
             myPrimaryCollator = myCollator.cloneAsThawed();
             myPrimaryCollator.setStrength(Collator.PRIMARY);
             myPrimaryCollator.freeze();
-            
+
             mySecondaryCollator = myPrimaryCollator.cloneAsThawed();
             mySecondaryCollator.setStrength(Collator.SECONDARY);
             mySecondaryCollator.freeze();
-            
+
             myTertiaryCollator = mySecondaryCollator.cloneAsThawed();
             myTertiaryCollator.setStrength(Collator.TERTIARY);
             myTertiaryCollator.freeze();
@@ -63,7 +66,7 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             warnln("ERROR: in creation of collator of ENGLISH locale");
             return;
         }
-        
+
         Random rand = createRandom(); // use test framework's random seed
         int s = rand.nextInt(0x7fff) % source.length();
         int t = rand.nextInt(0x7fff) % source.length();
@@ -71,30 +74,30 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
         int tlen = Math.abs(rand.nextInt(0x7fff) % source.length() - source.length()) % source.length();
         String subs = source.substring(Math.min(s, slen), Math.min(s + slen, source.length()));
         String subt = source.substring(Math.min(t, tlen), Math.min(t + tlen, source.length()));
-    
+
         CollationKey collationKey1, collationKey2;
-    
+
         collationKey1 = myTertiaryCollator.getCollationKey(subs);
         collationKey2 = myTertiaryCollator.getCollationKey(subt);
         int result = collationKey1.compareTo(collationKey2);  // Tertiary
         int revResult = collationKey2.compareTo(collationKey1);  // Tertiary
         report( subs, subt, result, revResult);
-    
+
         collationKey1 = mySecondaryCollator.getCollationKey(subs);
         collationKey2 = mySecondaryCollator.getCollationKey(subt);
         result = collationKey1.compareTo(collationKey2);  // Secondary
         revResult = collationKey2.compareTo(collationKey1);   // Secondary
         report( subs, subt, result, revResult);
-    
+
         collationKey1 = myPrimaryCollator.getCollationKey(subs);
         collationKey2 = myPrimaryCollator.getCollationKey(subt);
         result = collationKey1.compareTo(collationKey2);  // Primary
         revResult = collationKey2.compareTo(collationKey1);   // Primary
         report(subs, subt, result, revResult);
-    
+
         String msg = "";
         String addOne = subs + String.valueOf(0xE000);
-    
+
         collationKey1 = myPrimaryCollator.getCollationKey(subs);
         collationKey2 = myPrimaryCollator.getCollationKey(addOne);
         result = collationKey1.compareTo(collationKey2);
@@ -106,7 +109,7 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             msg += ") Failed.";
             errln(msg);
         }
-    
+
         msg = "";
         result = collationKey2.compareTo(collationKey1);
         if (result != 1) {
@@ -118,7 +121,7 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             errln(msg);
         }
     }
-    
+
     // perform monkey tests using Collator.compare
     @Test
     public void TestCompare() {
@@ -126,22 +129,22 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             errln("CollationMonkeyTest.TestCompare(): source is empty - ICU_DATA not set or data missing?");
             return;
         }
-        
+
         Collator myPrimaryCollator;
         Collator mySecondaryCollator;
         Collator myTertiaryCollator;
         try {
             Collator myCollator = Collator.getInstance(new Locale("en", "CA"));
             myCollator.freeze();
-            
+
             myPrimaryCollator = myCollator.cloneAsThawed();
             myPrimaryCollator.setStrength(Collator.PRIMARY);
             myPrimaryCollator.freeze();
-            
+
             mySecondaryCollator = myPrimaryCollator.cloneAsThawed();
             mySecondaryCollator.setStrength(Collator.SECONDARY);
             mySecondaryCollator.freeze();
-            
+
             myTertiaryCollator = mySecondaryCollator.cloneAsThawed();
             myTertiaryCollator.setStrength(Collator.TERTIARY);
             myTertiaryCollator.freeze();
@@ -149,12 +152,12 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             warnln("ERROR: in creation of collator of ENGLISH locale");
             return;
         }
-        
-        
+
+
         /* Seed the random-number generator with current time so that
          * the numbers will be different every time we run.
          */
-        
+
         Random rand = createRandom(); // use test framework's random seed
         int s = rand.nextInt(0x7fff) % source.length();
         int t = rand.nextInt(0x7fff) % source.length();
@@ -162,22 +165,22 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
         int tlen = Math.abs(rand.nextInt(0x7fff) % source.length() - source.length()) % source.length();
         String subs = source.substring(Math.min(s, slen), Math.min(s + slen, source.length()));
         String subt = source.substring(Math.min(t, tlen), Math.min(t + tlen, source.length()));
-    
+
         int result = myTertiaryCollator.compare(subs, subt);  // Tertiary
         int revResult = myTertiaryCollator.compare(subt, subs);  // Tertiary
         report(subs, subt, result, revResult);
-    
+
         result = mySecondaryCollator.compare(subs, subt);  // Secondary
         revResult = mySecondaryCollator.compare(subt, subs);  // Secondary
         report(subs, subt, result, revResult);
-    
+
         result = myPrimaryCollator.compare(subs, subt);  // Primary
         revResult = myPrimaryCollator.compare(subt, subs);  // Primary
         report(subs, subt, result, revResult);
-    
+
         String msg = "";
         String addOne = subs + String.valueOf(0xE000);
-    
+
         result = myPrimaryCollator.compare(subs, addOne);
         if (result != -1) {
             msg += "Test : ";
@@ -187,7 +190,7 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             msg += " Failed.";
             errln(msg);
         }
-    
+
         msg = "";
         result = myPrimaryCollator.compare(addOne, subs);
         if (result != 1) {
@@ -199,31 +202,31 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             errln(msg);
         }
     }
-    
+
     void report(String s, String t, int result, int revResult) {
         if (revResult != -result) {
             String msg = "";
-            msg += s; 
+            msg += s;
             msg += " and ";
             msg += t;
             msg += " round trip comparison failed";
-            msg += " (result " + result + ", reverse Result " + revResult + ")"; 
+            msg += " (result " + result + ", reverse Result " + revResult + ")";
             errln(msg);
         }
     }
-    
+
     @Test
     public void TestRules() {
         String testSourceCases[] = {
-            "\u0061\u0062\u007a", 
-            "\u0061\u0062\u007a", 
+            "\u0061\u0062\u007a",
+            "\u0061\u0062\u007a",
         };
-    
+
         String testTargetCases[] = {
             "\u0061\u0062\u00e4",
             "\u0061\u0062\u0061\u0308",
         };
-        
+
         int i=0;
         logln("Demo Test 1 : Create a new table collation with rules \"& z < 0x00e4\"");
         Collator col = Collator.getInstance(new Locale("en", "US"));
@@ -237,7 +240,7 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             warnln( "Demo Test 1 Table Collation object creation failed.");
             return;
         }
-        
+
         for(i=0; i<2; i++){
             doTest(myCollation, testSourceCases[i], testTargetCases[i], -1);
         }
@@ -254,11 +257,11 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
             doTest(myCollation, testSourceCases[i], testTargetCases[i], -1);
         }
     }
-    
+
     void doTest(RuleBasedCollator myCollation, String mysource, String target, int result) {
         int compareResult = myCollation.compare(source, target);
         CollationKey sortKey1, sortKey2;
-        
+
         try {
             sortKey1 = myCollation.getCollationKey(source);
             sortKey2 = myCollation.getCollationKey(target);
@@ -269,7 +272,7 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
         int keyResult = sortKey1.compareTo(sortKey2);
         reportCResult( mysource, target, sortKey1, sortKey2, compareResult, keyResult, compareResult, result );
     }
-    
+
     public void reportCResult(String src, String target, CollationKey sourceKey, CollationKey targetKey,
                               int compareResult, int keyResult, int incResult, int expectedResult ) {
         if (expectedResult < -1 || expectedResult > 1) {
@@ -280,7 +283,7 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
         boolean ok2 = (keyResult == expectedResult);
         boolean ok3 = (incResult == expectedResult);
         if (ok1 && ok2 && ok3 && !isVerbose()) {
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
@@ -315,7 +318,7 @@ public class CollationFrozenMonkeyTest extends TestFmwk {
                 logln(msg1 + src + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + src + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index e9917ea67086f6b08b92a4950c02f51b306d26be..8b97d1351af3a9ba098197a2a1f189d3731d1c56 100644 (file)
@@ -7,23 +7,26 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationGermanTest
  * Source File: $ICU4CRoot/source/test/intltest/decoll.cpp
  **/
+
  package com.ibm.icu.dev.test.collator;
+
  import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
- public class CollationGermanTest extends TestFmwk{
+
+@RunWith(JUnit4.class)
+public class CollationGermanTest extends TestFmwk{
     private static char[][] testSourceCases = {
         {0x47, 0x72, 0x00F6, 0x00DF, 0x65},
         {0x61, 0x62, 0x63},
@@ -70,12 +73,12 @@ import com.ibm.icu.text.Collator;
         { -1,        -1 },
         { 0,          1 }
     };
-    
+
     private Collator myCollation = null;
-    
+
     public CollationGermanTest() {
     }
-    
+
     @Before
     public void init() throws Exception {
         myCollation = Collator.getInstance(Locale.GERMAN);
@@ -100,13 +103,13 @@ import com.ibm.icu.text.Collator;
             doTest(testSourceCases[i], testTargetCases[i], results[i][1]);
         }
     }
-    
+
     // perform test with strength SECONDARY
     //This method in icu4c has no implementation.
     @Test
     public void TestSecondary(){
     }
-    
+
     // perform test with strength PRIMARY
     @Test
     public void TestPrimary(){
@@ -122,8 +125,8 @@ import com.ibm.icu.text.Collator;
             doTest(testSourceCases[i], testTargetCases[i], results[i][0]);
         }
     }
-    
-    
+
+
     //main test routine, tests rules specific to germa locale
     private void doTest(char[] source, char[] target, int result){
         String s = new String(source);
@@ -134,9 +137,9 @@ import com.ibm.icu.text.Collator;
         sortKey2 = myCollation.getCollationKey(t);
         int keyResult = sortKey1.compareTo(sortKey2);
         reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
-        
+
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ){
         if (expectedResult < -1 || expectedResult > 1)
@@ -150,13 +153,13 @@ import com.ibm.icu.text.Collator;
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()){
-            return;    
+            return;
         }else{
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -166,7 +169,7 @@ import com.ibm.icu.text.Collator;
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -179,7 +182,7 @@ import com.ibm.icu.text.Collator;
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -190,7 +193,7 @@ import com.ibm.icu.text.Collator;
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index a746f94b62a12cc17e4d2d270d9215c8ce0229e7..15ff81d10e99baba03a1ca1cb8e78ed20b2fc69e 100644 (file)
@@ -7,7 +7,7 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : collate/CollationIteratorTest
  * Source File: $ICU4CRoot/source/test/intltest/itercoll.cpp
  **/
@@ -20,6 +20,8 @@ import java.util.Arrays;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UCharacter;
@@ -29,11 +31,12 @@ import com.ibm.icu.text.RuleBasedCollator;
 import com.ibm.icu.text.UCharacterIterator;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class CollationIteratorTest extends TestFmwk {
-    
+
     String test1 = "What subset of all possible test cases?";
     String test2 = "has the highest probability of detecting";
-   
+
     /*
      * @bug 4157299
      */
@@ -46,7 +49,7 @@ public class CollationIteratorTest extends TestFmwk {
             warnln("Couldn't create a RuleBasedCollator.");
             return;
         }
-    
+
         String source = "abcd";
         CollationElementIterator i = c.getCollationElementIterator(source);
         int e0 = 0;
@@ -56,27 +59,27 @@ public class CollationIteratorTest extends TestFmwk {
             errln("call to i.next() failed.");
             return;
         }
-            
+
         try {
             i.setOffset(3);        // go to the expanding character
         } catch (Exception e) {
             errln("call to i.setOffset(3) failed.");
             return;
         }
-        
+
         try {
             i.next();                // but only use up half of it
         } catch (Exception e) {
             errln("call to i.next() failed.");
             return;
         }
-            
+
         try {
             i.setOffset(0);        // go back to the beginning
         } catch (Exception e) {
             errln("call to i.setOffset(0) failed. ");
         }
-        
+
         int e = 0;
         try {
             e = i.next();    // and get this one again
@@ -84,12 +87,12 @@ public class CollationIteratorTest extends TestFmwk {
             errln("call to i.next() failed. ");
             return;
         }
-        
+
         if (e != e0) {
             errln("got 0x" + Integer.toHexString(e) + ", expected 0x" + Integer.toHexString(e0));
         }
     }
-    
+
     /** @bug 4108762
      * Test for getMaxExpansion()
      */
@@ -106,37 +109,37 @@ public class CollationIteratorTest extends TestFmwk {
         }
         char ch = 0;
         String str = String.valueOf(ch);
-    
+
         CollationElementIterator iter = coll.getCollationElementIterator(str);
-    
+
         while (ch < 0xFFFF) {
             int count = 1;
             ch ++;
             str = String.valueOf(ch);
             iter.setText(str);
             int order = iter.previous();
-    
-            // thai management 
+
+            // thai management
             if (order == 0) {
                 order = iter.previous();
             }
-    
+
             while (iter.previous() != CollationElementIterator.NULLORDER) {
-                count ++; 
+                count ++;
             }
-    
+
             if (iter.getMaxExpansion(order) < count) {
                 errln("Failure at codepoint " + ch + ", maximum expansion count < " + count);
             }
         }
-        
-        // testing for exact max expansion 
+
+        // testing for exact max expansion
         ch = 0;
         while (ch < 0x61) {
             str = String.valueOf(ch);
             iter.setText(str);
             int order = iter.previous();
-            
+
             if (iter.getMaxExpansion(order) != 1) {
                 errln("Failure at codepoint 0x" + Integer.toHexString(ch)
                       + " maximum expansion count == 1");
@@ -148,7 +151,7 @@ public class CollationIteratorTest extends TestFmwk {
         str = String.valueOf(ch);
         iter.setText(str);
         int temporder = iter.previous();
-            
+
         if (iter.getMaxExpansion(temporder) != 3) {
             errln("Failure at codepoint 0x" + Integer.toHexString(ch)
                                   + " maximum expansion count == 3");
@@ -158,7 +161,7 @@ public class CollationIteratorTest extends TestFmwk {
         str = String.valueOf(ch);
         iter.setText(str);
         temporder = iter.previous();
-            
+
         if (iter.getMaxExpansion(temporder) != 1) {
             errln("Failure at codepoint 0x" + Integer.toHexString(ch)
                                   + " maximum expansion count == 1");
@@ -167,7 +170,7 @@ public class CollationIteratorTest extends TestFmwk {
         str = UCharacter.toString(unassigned);
         iter.setText(str);
         temporder = iter.previous();
-            
+
         if (iter.getMaxExpansion(temporder) != 2) {
             errln("Failure at codepoint 0x" + Integer.toHexString(ch)
                                   + " maximum expansion count == 2");
@@ -179,7 +182,7 @@ public class CollationIteratorTest extends TestFmwk {
         str = String.valueOf(ch);
         iter.setText(str);
         temporder = iter.previous();
-            
+
         if (iter.getMaxExpansion(temporder) > 3) {
             errln("Failure at codepoint 0x" + Integer.toHexString(ch)
                                           + " maximum expansion count < 3");
@@ -195,15 +198,15 @@ public class CollationIteratorTest extends TestFmwk {
             return;
         }
         iter = coll.getCollationElementIterator(str);
-        
+
         temporder = iter.previous();
-            
+
         if (iter.getMaxExpansion(temporder) != 6) {
             errln("Failure at codepoint 0x" + Integer.toHexString(ch)
                                          + " maximum expansion count == 6");
         }
     }
-    
+
     /**
      * Test for getOffset() and setOffset()
      */
@@ -211,7 +214,7 @@ public class CollationIteratorTest extends TestFmwk {
     public void TestOffset(/* char* par */) {
         RuleBasedCollator en_us;
         try {
-            en_us = (RuleBasedCollator)Collator.getInstance(Locale.US);    
+            en_us = (RuleBasedCollator)Collator.getInstance(Locale.US);
         } catch (Exception e) {
             warnln("ERROR: in creation of collator of ENGLISH locale");
             return;
@@ -226,32 +229,32 @@ public class CollationIteratorTest extends TestFmwk {
         }
         iter.setOffset(test1.length());
         if (iter.next() != CollationElementIterator.NULLORDER) {
-            errln("Error: After setting offset to the end of the string, we " 
+            errln("Error: After setting offset to the end of the string, we "
                   + "should be at the end of the forwards iteration");
         }
-    
+
         // Run all the way through the iterator, then get the offset
         int[] orders = CollationTest.getOrders(iter);
         logln("orders.length = " + orders.length);
-        
+
         int offset = iter.getOffset();
-    
+
         if (offset != test1.length()) {
             String msg1 = "offset at end != length: ";
             String msg2 = " vs ";
             errln(msg1 + offset + msg2 + test1.length());
         }
-    
+
         // Now set the offset back to the beginning and see if it works
         CollationElementIterator pristine = en_us.getCollationElementIterator(test1);
-        
+
         try {
             iter.setOffset(0);
         } catch(Exception e) {
             errln("setOffset failed.");
         }
         assertEqual(iter, pristine);
-    
+
         // setting offset in the middle of a contraction
         String contraction = "change";
         RuleBasedCollator tailored = null;
@@ -297,8 +300,8 @@ public class CollationIteratorTest extends TestFmwk {
         }
         // TODO: try iterating halfway through a messy string.
     }
-    
-    
+
+
 
     void assertEqual(CollationElementIterator i1, CollationElementIterator i2) {
         int c1, c2, count = 0;
@@ -306,7 +309,7 @@ public class CollationIteratorTest extends TestFmwk {
             c1 = i1.next();
             c2 = i2.next();
             if (c1 != c2) {
-                errln("    " + count + ": strength(0x" + 
+                errln("    " + count + ": strength(0x" +
                     Integer.toHexString(c1) + ") != strength(0x" + Integer.toHexString(c2) + ")");
                 break;
             }
@@ -315,21 +318,21 @@ public class CollationIteratorTest extends TestFmwk {
         CollationTest.backAndForth(this, i1);
         CollationTest.backAndForth(this, i2);
     }
-    
+
     /**
      * Test for CollationElementIterator.previous()
      *
      * @bug 4108758 - Make sure it works with contracting characters
-     * 
+     *
      */
     @Test
     public void TestPrevious(/* char* par */) {
         RuleBasedCollator en_us = (RuleBasedCollator)Collator.getInstance(Locale.US);
         CollationElementIterator iter = en_us.getCollationElementIterator(test1);
-    
+
         // A basic test to see if it's working at all
         CollationTest.backAndForth(this, iter);
-    
+
         // Test with a contracting character sequence
         String source;
         RuleBasedCollator c1 = null;
@@ -339,11 +342,11 @@ public class CollationIteratorTest extends TestFmwk {
             errln("Couldn't create a RuleBasedCollator with a contracting sequence.");
             return;
         }
-    
+
         source = "abchdcba";
         iter = c1.getCollationElementIterator(source);
         CollationTest.backAndForth(this, iter);
-    
+
         // Test with an expanding character sequence
         RuleBasedCollator c2 = null;
         try {
@@ -352,11 +355,11 @@ public class CollationIteratorTest extends TestFmwk {
             errln("Couldn't create a RuleBasedCollator with an expanding sequence.");
             return;
         }
-    
+
         source = "abcd";
         iter = c2.getCollationElementIterator(source);
         CollationTest.backAndForth(this, iter);
-    
+
         // Now try both
         RuleBasedCollator c3 = null;
         try {
@@ -365,11 +368,11 @@ public class CollationIteratorTest extends TestFmwk {
             errln("Couldn't create a RuleBasedCollator with both an expanding and a contracting sequence.");
             return;
         }
-        
+
         source = "abcdbchdc";
         iter = c3.getCollationElementIterator(source);
         CollationTest.backAndForth(this, iter);
-    
+
         source= "\u0e41\u0e02\u0e41\u0e02\u0e27abc";
         Collator c4 = null;
         try {
@@ -378,10 +381,10 @@ public class CollationIteratorTest extends TestFmwk {
             errln("Couldn't create a collator");
             return;
         }
-        
+
         iter = ((RuleBasedCollator)c4).getCollationElementIterator(source);
         CollationTest.backAndForth(this, iter);
-       
+
         source= "\u0061\u30CF\u3099\u30FC";
         Collator c5 = null;
         try {
@@ -391,12 +394,12 @@ public class CollationIteratorTest extends TestFmwk {
             return;
         }
         iter = ((RuleBasedCollator)c5).getCollationElementIterator(source);
-        
+
         CollationTest.backAndForth(this, iter);
     }
-    
-    
-    
+
+
+
     /**
      * Test for setText()
      */
@@ -405,11 +408,11 @@ public class CollationIteratorTest extends TestFmwk {
         RuleBasedCollator en_us = (RuleBasedCollator)Collator.getInstance(Locale.US);
         CollationElementIterator iter1 = en_us.getCollationElementIterator(test1);
         CollationElementIterator iter2 = en_us.getCollationElementIterator(test2);
-    
+
         // Run through the second iterator just to exercise it
         int c = iter2.next();
         int i = 0;
-    
+
         while ( ++i < 10 && c != CollationElementIterator.NULLORDER) {
             try {
                 c = iter2.next();
@@ -418,7 +421,7 @@ public class CollationIteratorTest extends TestFmwk {
                 break;
             }
         }
-    
+
         // Now set it to point to the same string as the first iterator
         try {
             iter2.setText(test1);
@@ -427,7 +430,7 @@ public class CollationIteratorTest extends TestFmwk {
             return;
         }
         assertEqual(iter1, iter2);
-        
+
         iter1.reset();
         //now use the overloaded setText(ChracterIterator&, UErrorCode) function to set the text
         CharacterIterator chariter = new StringCharacterIterator(test1);
@@ -438,7 +441,7 @@ public class CollationIteratorTest extends TestFmwk {
             return;
         }
         assertEqual(iter1, iter2);
-        
+
         iter1.reset();
         //now use the overloaded setText(ChracterIterator&, UErrorCode) function to set the text
         UCharacterIterator uchariter = UCharacterIterator.getInstance(test1);
@@ -464,7 +467,7 @@ public class CollationIteratorTest extends TestFmwk {
         source.append("\u0e4d\u0e4e\u0e4f");
         // source.append("\u04e8\u04e9");
         iter = en_us.getCollationElementIterator(source.toString());
-        // A basic test to see if it's working at all 
+        // A basic test to see if it's working at all
         CollationTest.backAndForth(this, iter);
         for (codepoint = 1; codepoint < 0xFFFE;) {
             source.delete(0, source.length());
@@ -474,11 +477,11 @@ public class CollationIteratorTest extends TestFmwk {
                 }
                 codepoint ++;
             }
-            
+
             if (UCharacter.isDefined(codepoint)) {
                 source.append(codepoint);
             }
-            
+
             if (codepoint != 0xFFFF) {
                 codepoint ++;
             }
@@ -486,18 +489,18 @@ public class CollationIteratorTest extends TestFmwk {
                 System.out.println("codepoint " + Integer.toHexString(codepoint));
                 String str = source.substring(230, 232);
                 System.out.println(com.ibm.icu.impl.Utility.escape(str));
-                System.out.println("codepoint " + Integer.toHexString(codepoint) 
+                System.out.println("codepoint " + Integer.toHexString(codepoint)
                                    + "length " + str.length());
                 iter = en_us.getCollationElementIterator(str);
                 CollationTest.backAndForth(this, iter);
             }
             */
             iter = en_us.getCollationElementIterator(source.toString());
-            // A basic test to see if it's working at all 
+            // A basic test to see if it's working at all
             CollationTest.backAndForth(this, iter);
         }
     }
-    
+
     /**
      * Test for CollationElementIterator previous and next for the whole set of
      * unicode characters with normalization on.
@@ -516,7 +519,7 @@ public class CollationIteratorTest extends TestFmwk {
         }
         StringBuffer source = new StringBuffer();
         source.append('\uFDFA');
-        CollationElementIterator iter 
+        CollationElementIterator iter
                         = th_th.getCollationElementIterator(source.toString());
         CollationTest.backAndForth(this, iter);
         for (char codepoint = 0x1; codepoint < 0xfffe;) {
@@ -527,35 +530,35 @@ public class CollationIteratorTest extends TestFmwk {
                 }
                 codepoint ++;
             }
-            
+
             if (UCharacter.isDefined(codepoint)) {
                 source.append(codepoint);
             }
-            
+
             if (codepoint != 0xFFFF) {
                 codepoint ++;
             }
-            
+
             /*if (((int)codepoint) >= 0xfe00) {
                 String str = source.substring(185, 190);
                 System.out.println(com.ibm.icu.impl.Utility.escape(str));
-                System.out.println("codepoint " 
-                                   + Integer.toHexString(codepoint) 
+                System.out.println("codepoint "
+                                   + Integer.toHexString(codepoint)
                                    + "length " + str.length());
                 iter = th_th.getCollationElementIterator(str);
                 CollationTest.backAndForth(this, iter);
             */
             iter = th_th.getCollationElementIterator(source.toString());
-            // A basic test to see if it's working at all 
+            // A basic test to see if it's working at all
             CollationTest.backAndForth(this, iter);
         }
     }
-    
+
     /**
     * Testing the discontiguous contractions
     */
     @Test
-    public void TestDiscontiguous() 
+    public void TestDiscontiguous()
     {
         String rulestr ="&z < AB < X\u0300 < ABC < X\u0300\u0315";
         String src[] = {"ADB", "ADBC", "A\u0315B", "A\u0315BC",
@@ -566,11 +569,11 @@ public class CollationIteratorTest extends TestFmwk {
                         // blocking combining character
                         "X\u0314\u0300", "X\u0314\u0300\u0315",
                         // contraction prefix
-                        "ABDC", "AB\u0315C","X\u0300D\u0315", 
+                        "ABDC", "AB\u0315C","X\u0300D\u0315",
                         "X\u0300\u0319\u0315", "X\u0300\u031A\u0315",
                         // ends not with a contraction character
-                        "X\u0319\u0300D", "X\u0319\u0300\u0315D", 
-                        "X\u0300D\u0315D", "X\u0300\u0319\u0315D", 
+                        "X\u0319\u0300D", "X\u0319\u0300\u0315D",
+                        "X\u0300D\u0315D", "X\u0300\u0319\u0315D",
                         "X\u0300\u031A\u0315D"
         };
         String tgt[] = {// non blocking combining character
@@ -582,20 +585,20 @@ public class CollationIteratorTest extends TestFmwk {
                         // blocking combining character
                         "X \u0314 \u0300", "X \u0314 \u0300\u0315",
                         // contraction prefix
-                        "AB DC", "AB \u0315 C","X\u0300 D \u0315", 
+                        "AB DC", "AB \u0315 C","X\u0300 D \u0315",
                         "X\u0300\u0315 \u0319", "X\u0300 \u031A \u0315",
                         // ends not with a contraction character
-                        "X\u0300 \u0319D", "X\u0300\u0315 \u0319D", 
-                        "X\u0300 D\u0315D", "X\u0300\u0315 \u0319D", 
+                        "X\u0300 \u0319D", "X\u0300\u0315 \u0319D",
+                        "X\u0300 D\u0315D", "X\u0300\u0315 \u0319D",
                         "X\u0300 \u031A\u0315D"
         };
         int count = 0;
         try {
             RuleBasedCollator coll = new RuleBasedCollator(rulestr);
-            CollationElementIterator iter 
+            CollationElementIterator iter
+                                        = coll.getCollationElementIterator("");
+            CollationElementIterator resultiter
                                         = coll.getCollationElementIterator("");
-            CollationElementIterator resultiter 
-                                        = coll.getCollationElementIterator("");    
             while (count < src.length) {
                 iter.setText(src[count]);
                 int s = 0;
@@ -609,7 +612,7 @@ public class CollationIteratorTest extends TestFmwk {
                     int ce = resultiter.next();
                     while (ce != CollationElementIterator.NULLORDER) {
                         if (ce != iter.next()) {
-                            errln("Discontiguos contraction test mismatch at" 
+                            errln("Discontiguos contraction test mismatch at"
                                   + count);
                             return;
                         }
@@ -649,7 +652,7 @@ public class CollationIteratorTest extends TestFmwk {
             warnln("ERROR: in creation of collator using rules " + rules);
             return;
         }
-        
+
         CollationElementIterator iter = coll.getCollationElementIterator("testing");
         for (int count = 0; count < testdata.length; count ++) {
             iter.setText(testdata[count]);
@@ -683,7 +686,7 @@ public class CollationIteratorTest extends TestFmwk {
             " \u00E6" +              // small letter ae, expands
             " \u1E4D" +              // small letter o with tilde and acute, decomposes
             " ";
-        
+
         int[] rootStandardOffsets = {
             0,  1,2,
             2,  3,4,4,
@@ -698,7 +701,7 @@ public class CollationIteratorTest extends TestFmwk {
             28,
             29
         };
-        
+
         int[] rootSearchOffsets = {
             0,  1,2,
             2,  3,4,4,
@@ -724,7 +727,7 @@ public class CollationIteratorTest extends TestFmwk {
             public String getLocaleString() { return localeString; }
             public int[] getOffsets() { return offsets; }
         }
-        final TSCEItem[] tsceItems = { 
+        final TSCEItem[] tsceItems = {
             new TSCEItem( "root",                  rootStandardOffsets ),
             new TSCEItem( "root@collation=search", rootSearchOffsets   ),
         };
index 8fbf8c0e04db03df4909c6817293921eaf9f2b59..b9745ec93801b390f68a1a12d5e56527e4fca84b 100644 (file)
@@ -7,24 +7,27 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationKanaTest
  * Source File: $ICU4CRoot/source/test/intltest/jacoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
 import com.ibm.icu.util.ULocale;
+
+@RunWith(JUnit4.class)
 public class CollationKanaTest extends TestFmwk{
     private static char[][] testSourceCases = {
         {0xff9E},
@@ -91,16 +94,16 @@ public class CollationKanaTest extends TestFmwk{
         /*4*/ {0x30AD, 0x30A4, 0x3042},
         /*5*/ {0x30AD, 0x30A4, 0x30A2}
     };
-        
+
     private Collator myCollation = null;
-    
+
     public CollationKanaTest() {
     }
-    
+
     @Before
-    public void init()throws Exception { 
+    public void init()throws Exception {
         if(myCollation==null){
-            myCollation = Collator.getInstance(Locale.JAPANESE); 
+            myCollation = Collator.getInstance(Locale.JAPANESE);
         }
     }
 
@@ -109,7 +112,7 @@ public class CollationKanaTest extends TestFmwk{
     public void TestTertiary() {
         int i = 0;
         myCollation.setStrength(Collator.TERTIARY);
-        
+
         for (i = 0; i < 6; i++) {
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
         }
@@ -135,7 +138,7 @@ public class CollationKanaTest extends TestFmwk{
         }
     }
 
-    /* 
+    /*
     * Test Small, Large letters
     */
     @Test
@@ -171,7 +174,7 @@ public class CollationKanaTest extends TestFmwk{
             doTest(testChooonKigooCases[i], testChooonKigooCases[i + 1], -1);
         }
     }
-    
+
     /*
      * Test common Hiragana and Katakana characters (e.g. 0x3099) (ticket:6140)
      */
@@ -186,20 +189,20 @@ public class CollationKanaTest extends TestFmwk{
         RuleBasedCollator rb = (RuleBasedCollator)Collator.getInstance(ULocale.JAPANESE);
         rb.setStrength(Collator.QUATERNARY);
         rb.setAlternateHandlingShifted(false);
-        
+
         result = rb.compare(string1, string2);
-        
+
         key1 = rb.getCollationKey(string1);
         key2 = rb.getCollationKey(string2);
-        
+
         if ( result != 0 || !key1.equals(key2)) {
             errln("Failed Hiragana and Katakana common characters test. Expected results to be equal.");
         }
-        
+
     }
     // main test routine, tests rules specific to "Kana" locale
     private void doTest(char[] source, char[] target, int result){
-        
+
         String s = new String(source);
         String t = new String(target);
         int compareResult = myCollation.compare(s, t);
@@ -208,9 +211,9 @@ public class CollationKanaTest extends TestFmwk{
         sortKey2 = myCollation.getCollationKey(t);
         int keyResult = sortKey1.compareTo(sortKey2);
         reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
-        
+
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ){
         if (expectedResult < -1 || expectedResult > 1) {
@@ -223,13 +226,13 @@ public class CollationKanaTest extends TestFmwk{
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()){
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -239,7 +242,7 @@ public class CollationKanaTest extends TestFmwk{
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -252,7 +255,7 @@ public class CollationKanaTest extends TestFmwk{
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -263,7 +266,7 @@ public class CollationKanaTest extends TestFmwk{
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index 60cc4e3ed344c752732ff2aeac455918a447b682..f008297fd07cb4a84858c25c286abf8ebccca538 100644 (file)
@@ -20,6 +20,8 @@ import java.util.Set;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUData;
@@ -40,6 +42,7 @@ import com.ibm.icu.text.UnicodeSetIterator;
 import com.ibm.icu.util.ULocale;
 import com.ibm.icu.util.UResourceBundle;
 
+@RunWith(JUnit4.class)
 public class CollationMiscTest extends TestFmwk {
     //private static final int NORM_BUFFER_TEST_LEN_ = 32;
     private static final class Tester
index ed6109ef14392646184db49a042dd783cf860e59..e2bb9f4a2cacb2de0df50de81cda1e7ec47666d4 100644 (file)
@@ -7,7 +7,7 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : collate/CollationMonkeyTest
  * Source File: $ICU4CRoot/source/test/intltest/mnkytst.cpp
  **/
@@ -18,6 +18,8 @@ import java.util.Locale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
@@ -25,16 +27,17 @@ import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
 
 /**
- * CollationMonkeyTest is a third level test class.  This tests the random 
- * substrings of the default test strings to verify if the compare and 
+ * CollationMonkeyTest is a third level test class.  This tests the random
+ * substrings of the default test strings to verify if the compare and
  * sort key algorithm works correctly.  For example, any string is always
  * less than the string itself appended with any character.
  */
 
+@RunWith(JUnit4.class)
 public class CollationMonkeyTest extends TestFmwk {
-    
+
     private String source = "-abcdefghijklmnopqrstuvwxyz#&^$@";
-    
+
     @Test
     public void TestCollationKey() {
         if(source.length() == 0) {
@@ -48,7 +51,7 @@ public class CollationMonkeyTest extends TestFmwk {
             warnln("ERROR: in creation of collator of ENGLISH locale");
             return;
         }
-        
+
         Random rand = createRandom(); // use test framework's random seed
         int s = rand.nextInt(0x7fff) % source.length();
         int t = rand.nextInt(0x7fff) % source.length();
@@ -56,33 +59,33 @@ public class CollationMonkeyTest extends TestFmwk {
         int tlen = Math.abs(rand.nextInt(0x7fff) % source.length() - source.length()) % source.length();
         String subs = source.substring(Math.min(s, slen), Math.min(s + slen, source.length()));
         String subt = source.substring(Math.min(t, tlen), Math.min(t + tlen, source.length()));
-    
+
         CollationKey collationKey1, collationKey2;
-    
+
         myCollator.setStrength(Collator.TERTIARY);
         collationKey1 = myCollator.getCollationKey(subs);
         collationKey2 = myCollator.getCollationKey(subt);
         int result = collationKey1.compareTo(collationKey2);  // Tertiary
         int revResult = collationKey2.compareTo(collationKey1);  // Tertiary
         report( subs, subt, result, revResult);
-    
+
         myCollator.setStrength(Collator.SECONDARY);
         collationKey1 = myCollator.getCollationKey(subs);
         collationKey2 = myCollator.getCollationKey(subt);
         result = collationKey1.compareTo(collationKey2);  // Secondary
         revResult = collationKey2.compareTo(collationKey1);   // Secondary
         report( subs, subt, result, revResult);
-    
+
         myCollator.setStrength(Collator.PRIMARY);
         collationKey1 = myCollator.getCollationKey(subs);
         collationKey2 = myCollator.getCollationKey(subt);
         result = collationKey1.compareTo(collationKey2);  // Primary
         revResult = collationKey2.compareTo(collationKey1);   // Primary
         report(subs, subt, result, revResult);
-    
+
         String msg = "";
         String addOne = subs + String.valueOf(0xE000);
-    
+
         collationKey1 = myCollator.getCollationKey(subs);
         collationKey2 = myCollator.getCollationKey(addOne);
         result = collationKey1.compareTo(collationKey2);
@@ -94,7 +97,7 @@ public class CollationMonkeyTest extends TestFmwk {
             msg += ") Failed.";
             errln(msg);
         }
-    
+
         msg = "";
         result = collationKey2.compareTo(collationKey1);
         if (result != 1) {
@@ -106,7 +109,7 @@ public class CollationMonkeyTest extends TestFmwk {
             errln(msg);
         }
     }
-    
+
     // perform monkey tests using Collator.compare
     @Test
     public void TestCompare() {
@@ -114,7 +117,7 @@ public class CollationMonkeyTest extends TestFmwk {
             errln("CollationMonkeyTest.TestCompare(): source is empty - ICU_DATA not set or data missing?");
             return;
         }
-        
+
         Collator myCollator;
         try {
              myCollator = Collator.getInstance(new Locale("en", "US"));
@@ -122,11 +125,11 @@ public class CollationMonkeyTest extends TestFmwk {
             warnln("ERROR: in creation of collator of ENGLISH locale");
             return;
         }
-        
+
         /* Seed the random-number generator with current time so that
          * the numbers will be different every time we run.
          */
-        
+
         Random rand = createRandom(); // use test framework's random seed
         int s = rand.nextInt(0x7fff) % source.length();
         int t = rand.nextInt(0x7fff) % source.length();
@@ -134,25 +137,25 @@ public class CollationMonkeyTest extends TestFmwk {
         int tlen = Math.abs(rand.nextInt(0x7fff) % source.length() - source.length()) % source.length();
         String subs = source.substring(Math.min(s, slen), Math.min(s + slen, source.length()));
         String subt = source.substring(Math.min(t, tlen), Math.min(t + tlen, source.length()));
-    
+
         myCollator.setStrength(Collator.TERTIARY);
         int result = myCollator.compare(subs, subt);  // Tertiary
         int revResult = myCollator.compare(subt, subs);  // Tertiary
         report(subs, subt, result, revResult);
-    
+
         myCollator.setStrength(Collator.SECONDARY);
         result = myCollator.compare(subs, subt);  // Secondary
         revResult = myCollator.compare(subt, subs);  // Secondary
         report(subs, subt, result, revResult);
-    
+
         myCollator.setStrength(Collator.PRIMARY);
         result = myCollator.compare(subs, subt);  // Primary
         revResult = myCollator.compare(subt, subs);  // Primary
         report(subs, subt, result, revResult);
-    
+
         String msg = "";
         String addOne = subs + String.valueOf(0xE000);
-    
+
         result = myCollator.compare(subs, addOne);
         if (result != -1) {
             msg += "Test : ";
@@ -162,7 +165,7 @@ public class CollationMonkeyTest extends TestFmwk {
             msg += " Failed.";
             errln(msg);
         }
-    
+
         msg = "";
         result = myCollator.compare(addOne, subs);
         if (result != 1) {
@@ -174,31 +177,31 @@ public class CollationMonkeyTest extends TestFmwk {
             errln(msg);
         }
     }
-    
+
     void report(String s, String t, int result, int revResult) {
         if (revResult != -result) {
             String msg = "";
-            msg += s; 
+            msg += s;
             msg += " and ";
             msg += t;
             msg += " round trip comparison failed";
-            msg += " (result " + result + ", reverse Result " + revResult + ")"; 
+            msg += " (result " + result + ", reverse Result " + revResult + ")";
             errln(msg);
         }
     }
-    
+
     @Test
     public void TestRules() {
         String testSourceCases[] = {
-            "\u0061\u0062\u007a", 
-            "\u0061\u0062\u007a", 
+            "\u0061\u0062\u007a",
+            "\u0061\u0062\u007a",
         };
-    
+
         String testTargetCases[] = {
             "\u0061\u0062\u00e4",
             "\u0061\u0062\u0061\u0308",
         };
-        
+
         int i=0;
         logln("Demo Test 1 : Create a new table collation with rules \"& z < 0x00e4\"");
         Collator col = Collator.getInstance(new Locale("en", "US"));
@@ -212,7 +215,7 @@ public class CollationMonkeyTest extends TestFmwk {
             warnln( "Demo Test 1 Table Collation object creation failed.");
             return;
         }
-        
+
         for(i=0; i<2; i++){
             doTest(myCollation, testSourceCases[i], testTargetCases[i], -1);
         }
@@ -229,11 +232,11 @@ public class CollationMonkeyTest extends TestFmwk {
             doTest(myCollation, testSourceCases[i], testTargetCases[i], -1);
         }
     }
-    
+
     void doTest(RuleBasedCollator myCollation, String mysource, String target, int result) {
         int compareResult = myCollation.compare(source, target);
         CollationKey sortKey1, sortKey2;
-        
+
         try {
             sortKey1 = myCollation.getCollationKey(source);
             sortKey2 = myCollation.getCollationKey(target);
@@ -244,7 +247,7 @@ public class CollationMonkeyTest extends TestFmwk {
         int keyResult = sortKey1.compareTo(sortKey2);
         reportCResult( mysource, target, sortKey1, sortKey2, compareResult, keyResult, compareResult, result );
     }
-    
+
     public void reportCResult(String src, String target, CollationKey sourceKey, CollationKey targetKey,
                               int compareResult, int keyResult, int incResult, int expectedResult ) {
         if (expectedResult < -1 || expectedResult > 1) {
@@ -255,7 +258,7 @@ public class CollationMonkeyTest extends TestFmwk {
         boolean ok2 = (keyResult == expectedResult);
         boolean ok3 = (incResult == expectedResult);
         if (ok1 && ok2 && ok3 && !isVerbose()) {
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
@@ -290,7 +293,7 @@ public class CollationMonkeyTest extends TestFmwk {
                 logln(msg1 + src + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + src + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index bb2c48fd1cf2c7e4f7cdd6ed48e6b76da13a9ec2..40250eb854f9858591997a00167f68de31e1b412 100644 (file)
@@ -7,11 +7,11 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : collate/CollationRegressionTest
  * Source File: $ICU4CRoot/source/test/intltest/regcoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
 
 import java.text.ParseException;
@@ -20,6 +20,8 @@ import java.util.List;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationElementIterator;
@@ -27,6 +29,7 @@ import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
 
+@RunWith(JUnit4.class)
 public class CollationRegressionTest extends TestFmwk {
     // @bug 4048446
     //
@@ -39,31 +42,31 @@ public class CollationRegressionTest extends TestFmwk {
         RuleBasedCollator en_us = (RuleBasedCollator) Collator.getInstance(Locale.US);
         CollationElementIterator i1 = en_us.getCollationElementIterator(test1);
         CollationElementIterator i2 = en_us.getCollationElementIterator(test1);
-        
+
         if (i1 == null || i2 == null) {
             errln("Could not create CollationElementIterator's");
             return;
         }
-    
+
         while (i1.next() != CollationElementIterator.NULLORDER) {
             //
         }
-    
+
         i1.reset();
         assertEqual(i1, i2);
     }
-    
+
     void assertEqual(CollationElementIterator i1, CollationElementIterator i2) {
         int c1, c2, count = 0;
-    
+
         do {
             c1 = i1.next();
             c2 = i2.next();
-    
+
             if (c1 != c2) {
                 String msg = "";
                 String msg1 = "    ";
-                
+
                 msg += msg1 + count;
                 msg += ": strength(0x" + Integer.toHexString(c1);
                 msg += ") != strength(0x" + Integer.toHexString(c2);
@@ -74,7 +77,7 @@ public class CollationRegressionTest extends TestFmwk {
             count += 1;
         } while (c1 != CollationElementIterator.NULLORDER);
     }
-    
+
     // @bug 4051866
     //
     // Collator -> rules -> Collator round-trip broken for expanding characters
@@ -85,14 +88,14 @@ public class CollationRegressionTest extends TestFmwk {
 
         // Build a collator containing expanding characters
         RuleBasedCollator c1 = null;
-        
+
         try {
             c1 = new RuleBasedCollator(rules);
         } catch (Exception e) {
             errln("Fail to create RuleBasedCollator with rules:" + rules);
             return;
         }
-    
+
         // Build another using the rules from  the first
         RuleBasedCollator c2 = null;
         try {
@@ -101,14 +104,14 @@ public class CollationRegressionTest extends TestFmwk {
             errln("Fail to create RuleBasedCollator with rules:" + rules);
             return;
         }
-    
+
         // Make sure they're the same
         if (!(c1.getRules().equals(c2.getRules())))
         {
             errln("Rules are not equal");
         }
     }
-    
+
     // @bug 4053636
     //
     // Collator thinks "black-bird" == "black"
@@ -120,7 +123,7 @@ public class CollationRegressionTest extends TestFmwk {
             errln("black-bird == black");
         }
     }
-    
+
     // @bug 4054238
     //
     // CollationElementIterator will not work correctly if the associated
@@ -131,45 +134,45 @@ public class CollationRegressionTest extends TestFmwk {
         final char[] chars3 = {0x61, 0x00FC, 0x62, 0x65, 0x63, 0x6b, 0x20, 0x47, 0x72, 0x00F6, 0x00DF, 0x65, 0x20, 0x4c, 0x00FC, 0x62, 0x63, 0x6b, 0};
         final String test3 = new String(chars3);
         RuleBasedCollator c = (RuleBasedCollator) Collator.getInstance(Locale.US);
-    
+
         // NOTE: The Java code uses en_us to create the CollationElementIterators
         // but I'm pretty sure that's wrong, so I've changed this to use c.
         c.setDecomposition(Collator.NO_DECOMPOSITION);
         CollationElementIterator i1 = c.getCollationElementIterator(test3);
         logln("Offset:" + i1.getOffset());
     }
-    
+
     // @bug 4054734
     //
     // Collator::IDENTICAL documented but not implemented
     //
     @Test
     public void Test4054734(/* char* par */) {
-        
+
             //Here's the original Java:
-    
+
             String[] decomp = {
                 "\u0001",   "<",    "\u0002",
                 "\u0001",   "=",    "\u0001",
                 "A\u0001",  ">",    "~\u0002",      // Ensure A and ~ are not compared bitwise
                 "\u00C0",   "=",    "A\u0300",      // Decomp should make these equal
             };
-    
+
         RuleBasedCollator c = (RuleBasedCollator) Collator.getInstance(Locale.US);
         c.setStrength(Collator.IDENTICAL);
         c.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
         compareArray(c, decomp);
     }
-    
+
     void compareArray(Collator c, String[] tests) {
-        
+
         int expectedResult = 0;
-    
+
         for (int i = 0; i < tests.length; i += 3) {
             String source = tests[i];
             String comparison = tests[i + 1];
             String target = tests[i + 2];
-    
+
             if (comparison.equals("<")) {
                 expectedResult = -1;
             } else if (comparison.equals(">")) {
@@ -179,9 +182,9 @@ public class CollationRegressionTest extends TestFmwk {
             } else {
                 errln("Bogus comparison string \"" + comparison + "\"");
             }
-            
+
             int compareResult = 0;
-            
+
             logln("i = " + i);
             logln(source);
             logln(target);
@@ -190,7 +193,7 @@ public class CollationRegressionTest extends TestFmwk {
             } catch (Exception e) {
                 errln(e.toString());
             }
-    
+
             CollationKey sourceKey = null, targetKey = null;
             try {
                 sourceKey = c.getCollationKey(source);
@@ -198,19 +201,19 @@ public class CollationRegressionTest extends TestFmwk {
                 errln("Couldn't get collationKey for source");
                 continue;
             }
-    
+
             try {
                 targetKey = c.getCollationKey(target);
             } catch (Exception e) {
                 errln("Couldn't get collationKey for target");
                 continue;
             }
-    
+
             int keyResult = sourceKey.compareTo(targetKey);
             reportCResult( source, target, sourceKey, targetKey, compareResult, keyResult, compareResult, expectedResult );
         }
     }
-    
+
     void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ){
         if (expectedResult < -1 || expectedResult > 1)
@@ -224,13 +227,13 @@ public class CollationRegressionTest extends TestFmwk {
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()){
-            return;    
+            return;
         }else{
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -240,7 +243,7 @@ public class CollationRegressionTest extends TestFmwk {
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -253,7 +256,7 @@ public class CollationRegressionTest extends TestFmwk {
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -264,7 +267,7 @@ public class CollationRegressionTest extends TestFmwk {
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 
@@ -275,45 +278,45 @@ public class CollationRegressionTest extends TestFmwk {
     @Test
     public void Test4054736(/* char* par */) {
         RuleBasedCollator c = (RuleBasedCollator) Collator.getInstance(Locale.US);
-    
+
         c.setStrength(Collator.SECONDARY);
         c.setDecomposition(Collator.NO_DECOMPOSITION);
-    
+
         final String[] tests = { "\uFB4F", "\u003d", "\u05D0\u05DC" };  // Alef-Lamed vs. Alef, Lamed
         compareArray(c, tests);
     }
-    
+
     // @bug 4058613
     //
-    // Collator::createInstance() causes an ArrayIndexOutofBoundsException for Korean  
+    // Collator::createInstance() causes an ArrayIndexOutofBoundsException for Korean
     //
     @Test
     public void Test4058613(/* char* par */) {
         // Creating a default collator doesn't work when Korean is the default
         // locale
-        
+
         Locale oldDefault = Locale.getDefault();
         Locale.setDefault(new Locale("ko", ""));
-    
+
         Collator c = null;
-        
+
         c = Collator.getInstance(new Locale("en", "US"));
-    
+
         if (c == null) {
             errln("Could not create a Korean collator");
             Locale.setDefault(oldDefault);
             return;
         }
-        
+
         // Since the fix to this bug was to turn off decomposition for Korean collators,
         // ensure that's what we got
         if (c.getDecomposition() != Collator.NO_DECOMPOSITION) {
           errln("Decomposition is not set to NO_DECOMPOSITION for Korean collator");
         }
-    
+
         Locale.setDefault(oldDefault);
     }
-    
+
     // @bug 4059820
     //
     // RuleBasedCollator.getRules does not return the exact pattern as input
@@ -329,13 +332,13 @@ public class CollationRegressionTest extends TestFmwk {
             errln("Failure building a collator.");
             return;
         }
-    
+
         if ( c.getRules().indexOf("c/a") == -1)
         {
             errln("returned rules do not contain 'c/a'");
         }
     }
-    
+
     // @bug 4060154
     //
     // MergeCollation::fixEntry broken for "& H < \u0131, \u0130, i, I"
@@ -343,7 +346,7 @@ public class CollationRegressionTest extends TestFmwk {
     @Test
     public void Test4060154(/* char* par */) {
         String rules ="&f < g, G < h, H < i, I < j, J & H < \u0131, \u0130, i, I";
-    
+
         RuleBasedCollator c = null;
         try {
             c = new RuleBasedCollator(rules);
@@ -352,9 +355,9 @@ public class CollationRegressionTest extends TestFmwk {
             errln("failure building collator:" + e);
             return;
         }
-    
+
         c.setDecomposition(Collator.NO_DECOMPOSITION);
-    
+
         String[] tertiary = {
             "A",        "<",    "B",
             "H",        "<",    "\u0131",
@@ -363,19 +366,19 @@ public class CollationRegressionTest extends TestFmwk {
             "\u0130",   "<",    "i",
             "\u0130",   ">",    "H",
         };
-    
+
         c.setStrength(Collator.TERTIARY);
         compareArray(c, tertiary);
-    
+
         String[] secondary = {
             "H",        "<",    "I",
             "\u0131",   "=",    "\u0130",
         };
-    
+
         c.setStrength(Collator.PRIMARY);
         compareArray(c, secondary);
     }
-    
+
     // @bug 4062418
     //
     // Secondary/Tertiary comparison incorrect in French Secondary
@@ -390,14 +393,14 @@ public class CollationRegressionTest extends TestFmwk {
             return;
         }
         c.setStrength(Collator.SECONDARY);
-    
+
         String[] tests = {
                 "p\u00eache",    "<",    "p\u00e9ch\u00e9",    // Comparing accents from end, p\u00e9ch\u00e9 is greater
         };
-    
+
         compareArray(c, tests);
     }
-    
+
     // @bug 4065540
     //
     // Collator::compare() method broken if either string contains spaces
@@ -409,7 +412,7 @@ public class CollationRegressionTest extends TestFmwk {
             errln("'abcd e' == 'abcd f'");
         }
     }
-    
+
     // @bug 4066189
     //
     // Unicode characters need to be recursively decomposed to get the
@@ -420,21 +423,21 @@ public class CollationRegressionTest extends TestFmwk {
     public void Test4066189(/* char* par */) {
         final  String test1 = "\u1EB1";
         final  String test2 = "\u0061\u0306\u0300";
-    
+
         // NOTE: The java code used en_us to create the
         // CollationElementIterator's. I'm pretty sure that
         // was wrong, so I've change the code to use c1 and c2
         RuleBasedCollator c1 = (RuleBasedCollator) Collator.getInstance(Locale.US);
         c1.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
         CollationElementIterator i1 = c1.getCollationElementIterator(test1);
-    
+
         RuleBasedCollator c2 = (RuleBasedCollator) Collator.getInstance(Locale.US);
         c2.setDecomposition(Collator.NO_DECOMPOSITION);
         CollationElementIterator i2 = c2.getCollationElementIterator(test2);
-    
+
         assertEqual(i1, i2);
     }
-    
+
     // @bug 4066696
     //
     // French secondary collation checking at the end of compare iteration fails
@@ -449,13 +452,13 @@ public class CollationRegressionTest extends TestFmwk {
             return;
         }
         c.setStrength(Collator.SECONDARY);
-    
+
         String[] tests = {
             "\u00e0",   ">",     "\u01fa",       // a-grave <  A-ring-acute
-        };    
+        };
         compareArray(c, tests);
     }
-    
+
     // @bug 4076676
     //
     // Bad canonicalization of same-class combining characters
@@ -466,10 +469,10 @@ public class CollationRegressionTest extends TestFmwk {
         // be reordered, and they should compare as unequal.
         final String s1 = "\u0041\u0301\u0302\u0300";
         final String s2 = "\u0041\u0302\u0300\u0301";
-    
+
         RuleBasedCollator c = (RuleBasedCollator) Collator.getInstance(Locale.US);
         c.setStrength(Collator.TERTIARY);
-    
+
         if (c.compare(s1,s2) == 0) {
             errln("Same-class combining chars were reordered");
         }
@@ -488,20 +491,20 @@ public class CollationRegressionTest extends TestFmwk {
             errln("Failed to create RuleBasedCollator.");
             return;
         }
-    
+
         int result = rbc.compare("a","bb");
-    
+
         if (result >= 0) {
             errln("Compare(a,bb) returned " + result + "; expected -1");
         }
     }
-    
+
     // @bug 4079231
     //
     // RuleBasedCollator::operator==(NULL) throws NullPointerException
     //
     @Test
-    public void Test4079231(/* char* par */) {    
+    public void Test4079231(/* char* par */) {
         RuleBasedCollator en_us = (RuleBasedCollator) Collator.getInstance(Locale.US);
         try {
             if (en_us.equals(null)) {
@@ -511,7 +514,7 @@ public class CollationRegressionTest extends TestFmwk {
             errln("en_us.equals(null) threw " + e.toString());
         }
     }
-    
+
     // @bug 4081866
     //
     // Combining characters in different classes not reordered properly.
@@ -522,10 +525,10 @@ public class CollationRegressionTest extends TestFmwk {
         // so they should be reordered and the strings should compare as equal.
         String s1 = "\u0041\u0300\u0316\u0327\u0315";
         String s2 = "\u0041\u0327\u0316\u0315\u0300";
-    
+
         RuleBasedCollator c = (RuleBasedCollator) Collator.getInstance(Locale.US);
         c.setStrength(Collator.TERTIARY);
-        
+
         // Now that the default collators are set to NO_DECOMPOSITION
         // (as a result of fixing bug 4114077), we must set it explicitly
         // when we're testing reordering behavior.  -- lwerner, 5/5/98
@@ -534,7 +537,7 @@ public class CollationRegressionTest extends TestFmwk {
             errln("Combining chars were not reordered");
         }
     }
-    
+
     // @bug 4087241
     //
     // string comparison errors in Scandinavian collators
@@ -557,7 +560,7 @@ public class CollationRegressionTest extends TestFmwk {
         };
         compareArray(c, tests);
     }
-    
+
     // @bug 4087243
     //
     // CollationKey takes ignorable strings into account when it shouldn't
@@ -571,7 +574,7 @@ public class CollationRegressionTest extends TestFmwk {
         };
         compareArray(c, tests);
     }
-    
+
     // @bug 4092260
     //
     // Mu/micro conflict
@@ -594,7 +597,7 @@ public class CollationRegressionTest extends TestFmwk {
         };
         compareArray(c, tests);
     }
-    
+
     // @bug 4095316
     //
     @Test
@@ -616,7 +619,7 @@ public class CollationRegressionTest extends TestFmwk {
         };
         compareArray(c, tests);
     }
-    
+
     // @bug 4101940
     //
     @Test
@@ -636,7 +639,7 @@ public class CollationRegressionTest extends TestFmwk {
             errln("next did not return NULLORDER");
         }
     }
-    
+
     // @bug 4103436
     //
     // Collator::compare not handling spaces properly
@@ -651,7 +654,7 @@ public class CollationRegressionTest extends TestFmwk {
         };
         compareArray(c, tests);
     }
-    
+
     // @bug 4114076
     //
     // Collation not Unicode conformant with Hangul syllables
@@ -660,7 +663,7 @@ public class CollationRegressionTest extends TestFmwk {
     public void Test4114076(/* char* par */) {
         RuleBasedCollator c = (RuleBasedCollator) Collator.getInstance(Locale.US);
         c.setStrength(Collator.TERTIARY);
-    
+
         //
         // With Canonical decomposition, Hangul syllables should get decomposed
         // into Jamo, but Jamo characters should not be decomposed into
@@ -669,16 +672,16 @@ public class CollationRegressionTest extends TestFmwk {
         String test1[] = {
             "\ud4db", "\u003d", "\u1111\u1171\u11b6"
         };
-    
+
         c.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
         compareArray(c, test1);
-    
+
         // From UTR #15:
         // *In earlier versions of Unicode, jamo characters like ksf
-        //  had compatibility mappings to kf + sf. These mappings were 
+        //  had compatibility mappings to kf + sf. These mappings were
         //  removed in Unicode 2.1.9 to ensure that Hangul syllables are maintained.)
         // That is, the following test is obsolete as of 2.1.9
-    
+
     //obsolete-    // With Full decomposition, it should go all the way down to
     //obsolete-    // conjoining Jamo characters.
     //obsolete-    //
@@ -693,7 +696,7 @@ public class CollationRegressionTest extends TestFmwk {
 
     // @bug 4114077
     //
-    // Collation with decomposition off doesn't work for Europe 
+    // Collation with decomposition off doesn't work for Europe
     //
     @Test
     public void Test4114077(/* char* par */) {
@@ -709,18 +712,18 @@ public class CollationRegressionTest extends TestFmwk {
                                                     //   -> a, ring, acute
             "\u0041\u0300\u0316",             "\u003c", "\u0041\u0316\u0300"        // No reordering --> unequal
         };
-    
+
         c.setDecomposition(Collator.NO_DECOMPOSITION);
         compareArray(c, test1);
-    
+
         String test2[] = {
             "\u0041\u0300\u0316", "\u003d", "\u0041\u0316\u0300"      // Reordering --> equal
         };
-    
+
         c.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
         compareArray(c, test2);
     }
-    
+
     // @bug 4124632
     //
     // Collator::getCollationKey was hanging on certain character sequences
@@ -743,7 +746,7 @@ public class CollationRegressionTest extends TestFmwk {
             errln("CollationKey creation failed.");
         }
     }
-    
+
     // @bug 4132736
     //
     // sort order of french words with multiple accents has errors
@@ -757,14 +760,14 @@ public class CollationRegressionTest extends TestFmwk {
         } catch (Exception e) {
             errln("Failed to create a collator for Locale.CANADA_FRENCH");
         }
-    
+
         String test1[] = {
             "\u0065\u0300\u0065\u0301", "\u003c", "\u0065\u0301\u0065\u0300",
             "\u0065\u0300\u0301",       "\u003c", "\u0065\u0301\u0300",
         };
         compareArray(c, test1);
     }
-    
+
     // @bug 4133509
     //
     // The sorting using java.text.CollationKey is not in the exact order
@@ -777,13 +780,13 @@ public class CollationRegressionTest extends TestFmwk {
             "\u0047\u0072\u0061\u0070\u0068\u0069\u0063\u0073",       "\u003c", "\u0047\u0072\u0061\u0070\u0068\u0069\u0063\u0073\u0045\u006e\u0076\u0069\u0072\u006f\u006e\u006d\u0065\u006e\u0074",
             "\u0053\u0074\u0072\u0069\u006e\u0067",                   "\u003c", "\u0053\u0074\u0072\u0069\u006e\u0067\u0042\u0075\u0066\u0066\u0065\u0072",
         };
-    
+
         compareArray(en_us, test1);
     }
-    
+
     // @bug 4139572
     //
-    // getCollationKey throws exception for spanish text 
+    // getCollationKey throws exception for spanish text
     // Cannot reproduce this bug on 1.2, however it DOES fail on 1.1.6
     //
     @Test
@@ -810,10 +813,10 @@ public class CollationRegressionTest extends TestFmwk {
             errln("Error creating CollationKey for \"Nombre De Ojbeto\"");
         }
     }
-    
+
     // @bug 4141640
     //
-    // Support for Swedish gone in 1.1.6 (Can't create Swedish collator) 
+    // Support for Swedish gone in 1.1.6 (Can't create Swedish collator)
     //
     @Test
     public void Test4141640(/* char* par */) {
@@ -823,7 +826,7 @@ public class CollationRegressionTest extends TestFmwk {
         // in order to prevent this sort of bug from cropping up in the future
         //
         Locale locales[] = Collator.getAvailableLocales();
-        
+
         for (int i = 0; i < locales.length; i += 1)
         {
             Collator c = null;
@@ -838,7 +841,7 @@ public class CollationRegressionTest extends TestFmwk {
             }
         }
     }
-    
+
     private void checkListOrder(String[] sortedList, Collator c) {
         // this function uses the specified Collator to make sure the
         // passed-in list is already sorted into ascending order
@@ -1042,7 +1045,7 @@ public class CollationRegressionTest extends TestFmwk {
         }
 
         RuleBasedCollator collator = new RuleBasedCollator("&a<\u00e0=a\u0300");
-        //commented by Kevin 2003/10/21 
+        //commented by Kevin 2003/10/21
         //for "FULL_DECOMPOSITION is not supported here." in ICU4J DOC
         //collator.setDecomposition(Collator.FULL_DECOMPOSITION);
         collator.setStrength(Collator.IDENTICAL);
@@ -1125,51 +1128,51 @@ public class CollationRegressionTest extends TestFmwk {
         RuleBasedCollator collator = (RuleBasedCollator)Collator.getInstance(Locale.US);
         java.text.StringCharacterIterator stringIter = new java.text.StringCharacterIterator("fox");
         CollationElementIterator iter = collator.getCollationElementIterator(stringIter);
-    
+
         int[] elements_next = new int[3];
         logln("calling next:");
         for (int i = 0; i < 3; ++i) {
             logln("[" + i + "] " + (elements_next[i] = iter.next()));
         }
-    
+
         int[] elements_fwd = new int[3];
         logln("calling set/next:");
         for (int i = 0; i < 3; ++i) {
             iter.setOffset(i);
             logln("[" + i + "] " + (elements_fwd[i] = iter.next()));
         }
-    
+
         for (int i = 0; i < 3; ++i) {
             if (elements_next[i] != elements_fwd[i]) {
-                errln("mismatch at position " + i + 
-                ": " + elements_next[i] + 
+                errln("mismatch at position " + i +
+                ": " + elements_next[i] +
                 " != " + elements_fwd[i]);
             }
         }
     }
-    
+
     // Fixing the infinite loop for surrogates
     @Test
     public void Test8484()
     {
         String s = "\u9FE1\uCEF3\u2798\uAAB6\uDA7C";
         Collator coll = Collator.getInstance();
-        CollationKey collKey = coll.getCollationKey(s); 
+        CollationKey collKey = coll.getCollationKey(s);
         logln("Pass: " + collKey.toString() + " generated OK.");
     }
-    
+
     @Test
     public  void TestBengaliSortKey() throws Exception {
-        char rules[] = { 0x26, 0x9fa, 0x3c, 0x98c, 0x3c, 0x9e1, 0x3c, 0x98f, 0x3c, 0x990, 0x3c, 0x993, 
-                0x3c, 0x994, 0x3c, 0x9bc, 0x3c, 0x982, 0x3c, 0x983, 0x3c, 0x981, 0x3c, 0x9b0, 0x3c, 
-                0x9b8, 0x3c, 0x9b9, 0x3c, 0x9bd, 0x3c, 0x9be, 0x3c, 0x9bf, 0x3c, 0x9c8, 0x3c, 0x9cb, 
+        char rules[] = { 0x26, 0x9fa, 0x3c, 0x98c, 0x3c, 0x9e1, 0x3c, 0x98f, 0x3c, 0x990, 0x3c, 0x993,
+                0x3c, 0x994, 0x3c, 0x9bc, 0x3c, 0x982, 0x3c, 0x983, 0x3c, 0x981, 0x3c, 0x9b0, 0x3c,
+                0x9b8, 0x3c, 0x9b9, 0x3c, 0x9bd, 0x3c, 0x9be, 0x3c, 0x9bf, 0x3c, 0x9c8, 0x3c, 0x9cb,
                 0x3d, 0x9cb };
+
         Collator col = new RuleBasedCollator(String.copyValueOf(rules));
-        
+
         String str1 = "\u09be";
         String str2 = "\u0b70";
-        
+
         int result = col.compare(str1, str2);
         System.out.flush();
 
@@ -1191,7 +1194,7 @@ public class CollationRegressionTest extends TestFmwk {
         }
         System.out.print(": ");
         for(int i=0;i<bytes.length;i++) {
-            sb.append(" 0x"+Integer.toHexString(((int)bytes[i])&0xff));
+            sb.append(" 0x"+Integer.toHexString((bytes[i])&0xff));
         }
         sb.append("\n");
         return sb;
@@ -1290,7 +1293,7 @@ public class CollationRegressionTest extends TestFmwk {
         //
         // Use a custom collator class whose createCollationElementIterator
         // methods increment a count....
-        //     
+        //
         RuleBasedCollator en_us = (RuleBasedCollator) Collator.getInstance(Locale.US);
         My4146160Collator.count = 0;
         My4146160Collator mc = null;
@@ -1300,7 +1303,7 @@ public class CollationRegressionTest extends TestFmwk {
             errln("Failed to create a My4146160Collator.");
             return;
         }
-    
+
         CollationKey key = null;
         try {
             key = mc.getCollationKey("1");
@@ -1308,14 +1311,14 @@ public class CollationRegressionTest extends TestFmwk {
             errln("Failure to get a CollationKey from a My4146160Collator.");
             return;
         }
-    
+
         if (My4146160Collator.count < 1) {
             errln("My4146160Collator.getCollationElementIterator not called for getCollationKey");
         }
-    
+
         My4146160Collator.count = 0;
         mc.compare("1", "2");
-    
+
         if (My4146160Collator.count < 1) {
             errln("My4146160Collator.getCollationElementIterator not called for compare");
         }
@@ -1334,7 +1337,7 @@ public class CollationRegressionTest extends TestFmwk {
         count += 1;
         return super.getCollationElementIterator(text);
     }
-    
+
     public CollationElementIterator getCollationElementIterator(java.text.CharacterIterator text) {
         count += 1;
         return super.getCollationElementIterator(text);
index adf779f432e47278596f63a1b6642f4069ac755a..76377fe417f20cfa33792b446eb997d846dd59f8 100644 (file)
@@ -20,19 +20,22 @@ import java.util.MissingResourceException;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.Collator.CollatorFactory;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class CollationServiceTest extends TestFmwk {
     @Test
     public void TestRegister() {
         // register a singleton
         Collator frcol = Collator.getInstance(ULocale.FRANCE);
         Collator uscol = Collator.getInstance(ULocale.US);
-            
+
         { // try override en_US collator
             Object key = Collator.registerInstance(frcol, ULocale.US);
             Collator ncol = Collator.getInstance(ULocale.US);
@@ -64,7 +67,7 @@ public class CollationServiceTest extends TestFmwk {
             if (!frcol.equals(ncol)) {
                 errln("register of fr collator for fu_FU failed");
             }
-            
+
             ULocale[] locales = Collator.getAvailableULocales();
             boolean found = false;
             for (int i = 0; i < locales.length; ++i) {
@@ -83,7 +86,7 @@ public class CollationServiceTest extends TestFmwk {
                     errln("found " + name + " for fu_FU");
                 }
             }catch(MissingResourceException ex){
-                warnln("Could not load locale data."); 
+                warnln("Could not load locale data.");
             }
             try{
                 String name = Collator.getDisplayName(fu_FU, fu_FU);
@@ -92,7 +95,7 @@ public class CollationServiceTest extends TestFmwk {
                     errln("found " + name + " for fu_FU");
                 }
             }catch(MissingResourceException ex){
-                warnln("Could not load locale data."); 
+                warnln("Could not load locale data.");
             }
 
             if (!Collator.unregister(key)) {
@@ -105,9 +108,9 @@ public class CollationServiceTest extends TestFmwk {
         }
 
         {
-            // coverage after return to default 
+            // coverage after return to default
             ULocale[] locales = Collator.getAvailableULocales();
-    
+
             for (int i = 0; i < locales.length; ++i) {
                 if (locales[i].equals(fu_FU)) {
                     errln("new locale fu_FU not reported as supported locale");
@@ -151,7 +154,7 @@ public class CollationServiceTest extends TestFmwk {
         class TestFactory extends CollatorFactory {
             private Map map;
             private Set ids;
-            
+
             TestFactory(CollatorInfo[] info) {
                 map = new HashMap();
                 for (int i = 0; i < info.length; ++i) {
@@ -160,6 +163,7 @@ public class CollationServiceTest extends TestFmwk {
                 }
             }
 
+            @Override
             public Collator createCollator(ULocale loc) {
                 CollatorInfo ci = (CollatorInfo)map.get(loc);
                 if (ci != null) {
@@ -168,6 +172,7 @@ public class CollationServiceTest extends TestFmwk {
                 return null;
             }
 
+            @Override
             public String getDisplayName(ULocale objectLocale, ULocale displayLocale) {
                 CollatorInfo ci = (CollatorInfo)map.get(objectLocale);
                 if (ci != null) {
@@ -176,6 +181,7 @@ public class CollationServiceTest extends TestFmwk {
                 return null;
             }
 
+            @Override
             public Set getSupportedLocaleIDs() {
                 if (ids == null) {
                     HashSet set = new HashSet();
@@ -190,20 +196,22 @@ public class CollationServiceTest extends TestFmwk {
                 return ids;
             }
         }
-    
+
         class TestFactoryWrapper extends CollatorFactory {
             CollatorFactory delegate;
-    
+
             TestFactoryWrapper(CollatorFactory delegate) {
                 this.delegate = delegate;
             }
-    
+
+            @Override
             public Collator createCollator(ULocale loc) {
                 return delegate.createCollator(loc);
             }
-    
+
             // use CollatorFactory getDisplayName(ULocale, ULocale) for coverage
-    
+
+            @Override
             public Set getSupportedLocaleIDs() {
                 return delegate.getSupportedLocaleIDs();
             }
@@ -222,7 +230,7 @@ public class CollationServiceTest extends TestFmwk {
         Collator gecol = Collator.getInstance(ULocale.GERMANY);
         Collator jpcol = Collator.getInstance(ULocale.JAPAN);
         Collator fucol = Collator.getInstance(fu_FU);
-        
+
         CollatorInfo[] info = {
             new CollatorInfo(ULocale.US, frcol, null),
             new CollatorInfo(ULocale.FRANCE, gecol, null),
@@ -232,7 +240,7 @@ public class CollationServiceTest extends TestFmwk {
         try{
             factory = new TestFactory(info);
         }catch(MissingResourceException ex){
-            warnln("Could not load locale data."); 
+            warnln("Could not load locale data.");
         }
         // coverage
         {
@@ -242,11 +250,11 @@ public class CollationServiceTest extends TestFmwk {
             try{
                 name = Collator.getDisplayName(fu_FU, fu_FU_FOO);
             }catch(MissingResourceException ex){
-                warnln("Could not load locale data."); 
+                warnln("Could not load locale data.");
             }
             logln("*** default name: " + name);
             Collator.unregister(key);
-    
+
             ULocale bar_BAR = new ULocale("bar_BAR");
             Collator col = Collator.getInstance(bar_BAR);
             ULocale valid = col.getLocale(ULocale.VALID_LOCALE);
@@ -257,12 +265,12 @@ public class CollationServiceTest extends TestFmwk {
         }
 
         int n1 = checkAvailable("before registerFactory");
-        
+
         {
             Object key = Collator.registerFactory(factory);
-            
+
             int n2 = checkAvailable("after registerFactory");
-            
+
             Collator ncol = Collator.getInstance(ULocale.US);
             if (!frcol.equals(ncol)) {
                 errln("frcoll for en_US failed");
@@ -272,7 +280,7 @@ public class CollationServiceTest extends TestFmwk {
             if (!jpcol.equals(ncol)) {
                 errln("jpcol for fu_FU_FOO failed, got: " + ncol);
             }
-            
+
             ULocale[] locales = Collator.getAvailableULocales();
             boolean found = false;
             for (int i = 0; i < locales.length; ++i) {
@@ -284,7 +292,7 @@ public class CollationServiceTest extends TestFmwk {
             if (!found) {
                 errln("new locale fu_FU not reported as supported locale");
             }
-            
+
             String name = Collator.getDisplayName(fu_FU);
             if (!"little bunny Foo Foo".equals(name)) {
                 errln("found " + name + " for fu_FU");
@@ -302,7 +310,7 @@ public class CollationServiceTest extends TestFmwk {
             int n3 = checkAvailable("after unregister");
             assertTrue("register increases count", n2>n1);
             assertTrue("unregister restores count", n3==n1);
-            
+
             ncol = Collator.getInstance(fu_FU);
             if (!fucol.equals(ncol)) {
                 errln("collator after unregister does not match original fu_FU");
@@ -321,12 +329,12 @@ public class CollationServiceTest extends TestFmwk {
         ULocale ulocs[] = Collator.getAvailableULocales();
         if (!assertTrue("getAvailableULocales != null", ulocs!=null)) return -1;
         checkArray(msg, ulocs, null);
-        // This is not true because since ULocale objects with script code cannot be 
+        // This is not true because since ULocale objects with script code cannot be
         // converted to Locale objects
         //assertTrue("getAvailableLocales().length == getAvailableULocales().length", locs.length == ulocs.length);
         return locs.length;
     }
-    
+
     private static final String KW[] = {
         "collation"
     };
@@ -341,7 +349,7 @@ public class CollationServiceTest extends TestFmwk {
         String kw[] = Collator.getKeywords();
         if (!assertTrue("getKeywords != null", kw!=null)) return;
         checkArray("getKeywords", kw, KW);
-        
+
         String kwval[] = Collator.getKeywordValues(KW[0]);
         if (!assertTrue("getKeywordValues != null", kwval!=null)) return;
         checkArray("getKeywordValues", kwval, KWVAL);
@@ -355,7 +363,7 @@ public class CollationServiceTest extends TestFmwk {
         }
         assertTrue("getFunctionalEquivalent(de).isAvailable==true",
                    isAvailable[0] == true);
-        
+
         equiv = Collator.getFunctionalEquivalent(KW[0],
                                                  new ULocale("de_DE"),
                                                  isAvailable);
@@ -370,11 +378,11 @@ public class CollationServiceTest extends TestFmwk {
             assertEquals("getFunctionalEquivalent(zh_Hans)", "zh", equiv.toString());
         }
     }
-    
+
     @Test
     public void TestGetFunctionalEquivalent() {
         String kw[] = Collator.getKeywords();
-        final String DATA[] = { 
+        final String DATA[] = {
                           "sv", "sv", "t",
                           "sv@collation=direct", "sv", "t",
                           "sv@collation=traditional", "sv", "t",
@@ -406,7 +414,7 @@ public class CollationServiceTest extends TestFmwk {
                           "en_US_VALLEYGIRL","root","f"
                         };
         final int DATA_COUNT=(DATA.length/3);
-        
+
         for(int i=0;i<DATA_COUNT;i++) {
             boolean isAvailable[] = new boolean[1];
             ULocale input = new ULocale(DATA[(i*3)+0]);
@@ -440,8 +448,8 @@ public class CollationServiceTest extends TestFmwk {
 //                for (int i = 0; i < Collator.getKeywords().length; ++i) {
 //                        ULocale base = Collator.getFunctionalEquivalent(keywords[i],locales[k]);
 //                        String[] values = Collator.getKeywordValues(keywords[i]);
-//                        for (int j = 0; j < Collator.getKeywordValues(keywords[i]).length;++j) {                          
-//                                ULocale other = Collator.getFunctionalEquivalent(keywords[i], 
+//                        for (int j = 0; j < Collator.getKeywordValues(keywords[i]).length;++j) {
+//                                ULocale other = Collator.getFunctionalEquivalent(keywords[i],
 //                                        new ULocale(locales[k] + "@" + keywords[i] + "=" + values[j]),
 //                                        isAvailable);
 //                                if (isAvailable[0] && !other.equals(base)) {
@@ -492,7 +500,7 @@ public class CollationServiceTest extends TestFmwk {
                     errln("Keyword value " + expected[j] + " missing for locale: " + locale);
                 }
             }
+
             // Collator.getKeywordValues return the same contents for both commonlyUsed
             // true and false.
             String[] all = Collator.getKeywordValuesForLocale("collation", loc, false);
index 42a599b8b2f5de85f60f41a98d5f43e2b0eb7618..11b55a94201320c15992737aa67c44c2685bc61d 100644 (file)
@@ -7,23 +7,26 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationSpanishTest
  * Source File: $ICU4CRoot/source/test/intltest/escoll.cpp
  **/
+
  package com.ibm.icu.dev.test.collator;
+
  import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
- public class CollationSpanishTest extends TestFmwk {
+
+@RunWith(JUnit4.class)
+public class CollationSpanishTest extends TestFmwk {
     private static char[][] testSourceCases = {
         {0x61, 0x6c, 0x69, 0x61, 0x73},
         {0x45, 0x6c, 0x6c, 0x69, 0x6f, 0x74},
@@ -60,19 +63,19 @@ import com.ibm.icu.text.Collator;
         -1,
         0
     };
-    
+
     //static public Collator myCollation = Collator.getInstance(new Locale("es", "ES"));
-    
+
     private Collator myCollation = null;
-    
+
     public CollationSpanishTest() {
     }
-    
+
     @Before
     public void init() throws Exception {
         myCollation = Collator.getInstance(new Locale("es", "ES"));
     }
-    
+
     @Test
     public void TestTertiary(){
         int i = 0;
@@ -81,7 +84,7 @@ import com.ibm.icu.text.Collator;
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
         }
     }
-    
+
     @Test
     public void TestPrimary(){
         int i;
@@ -90,7 +93,7 @@ import com.ibm.icu.text.Collator;
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
         }
     }
-    
+
     // amin test routine, tests rules specific to the spanish locale
     private void doTest(char[] source, char[] target, int result) {
         String s = new String(source);
@@ -102,7 +105,7 @@ import com.ibm.icu.text.Collator;
         int keyResult = sortKey1.compareTo(sortKey2);
         reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ) {
         if (expectedResult < -1 || expectedResult > 1) {
@@ -115,13 +118,13 @@ import com.ibm.icu.text.Collator;
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()) {
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -131,7 +134,7 @@ import com.ibm.icu.text.Collator;
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -144,7 +147,7 @@ import com.ibm.icu.text.Collator;
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -155,7 +158,7 @@ import com.ibm.icu.text.Collator;
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index 6189e7ad89c71098829830db53f45561dba16185..5b2212a6da894797b9cf1bd0de188983cda7f685 100644 (file)
@@ -18,6 +18,8 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -50,6 +52,7 @@ import com.ibm.icu.util.IllformedLocaleException;
 import com.ibm.icu.util.Output;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class CollationTest extends TestFmwk {
     public CollationTest() {
     }
@@ -62,14 +65,14 @@ public class CollationTest extends TestFmwk {
     String fileTestName;
 
     // package private methods ----------------------------------------------
-    
-    static void doTest(TestFmwk test, RuleBasedCollator col, String source, 
+
+    static void doTest(TestFmwk test, RuleBasedCollator col, String source,
                        String target, int result)
     {
         doTestVariant(test, col, source, target, result);
         if (result == -1) {
             doTestVariant(test, col, target, source, 1);
-        } 
+        }
         else if (result == 1) {
             doTestVariant(test, col, target, source, -1);
         }
@@ -82,17 +85,17 @@ public class CollationTest extends TestFmwk {
         iter.setText(target);
         backAndForth(test, iter);
     }
-    
+
     /**
      * Return an integer array containing all of the collation orders
      * returned by calls to next on the specified iterator
      */
-    static int[] getOrders(CollationElementIterator iter) 
+    static int[] getOrders(CollationElementIterator iter)
     {
         int maxSize = 100;
         int size = 0;
         int[] orders = new int[maxSize];
-        
+
         int order;
         while ((order = iter.next()) != CollationElementIterator.NULLORDER) {
             if (size == maxSize) {
@@ -103,7 +106,7 @@ public class CollationTest extends TestFmwk {
             }
             orders[size++] = order;
         }
-        
+
         if (maxSize > size) {
             int[] temp = new int[size];
             System.arraycopy(orders, 0, temp,  0, size);
@@ -111,20 +114,20 @@ public class CollationTest extends TestFmwk {
         }
         return orders;
     }
-    
-    static void backAndForth(TestFmwk test, CollationElementIterator iter) 
+
+    static void backAndForth(TestFmwk test, CollationElementIterator iter)
     {
         // Run through the iterator forwards and stick it into an array
         iter.reset();
         int[] orders = getOrders(iter);
-    
+
         // Now go through it backwards and make sure we get the same values
         int index = orders.length;
         int o;
-    
+
         // reset the iterator
         iter.reset();
-    
+
         while ((o = iter.previous()) != CollationElementIterator.NULLORDER) {
             if (o != orders[--index]) {
                 if (o == 0) {
@@ -132,24 +135,24 @@ public class CollationTest extends TestFmwk {
                 } else {
                     while (index > 0 && orders[index] == 0) {
                         index --;
-                    } 
+                    }
                     if (o != orders[index]) {
-                        TestFmwk.errln("Mismatch at index " + index + ": 0x" 
+                        TestFmwk.errln("Mismatch at index " + index + ": 0x"
                             + Utility.hex(orders[index]) + " vs 0x" + Utility.hex(o));
                         break;
                     }
                 }
             }
         }
-    
+
         while (index != 0 && orders[index - 1] == 0) {
           index --;
         }
-    
+
         if (index != 0) {
             String msg = "Didn't get back to beginning - index is ";
             TestFmwk.errln(msg + index);
-    
+
             iter.reset();
             TestFmwk.err("next: ");
             while ((o = iter.next()) != CollationElementIterator.NULLORDER) {
@@ -165,7 +168,7 @@ public class CollationTest extends TestFmwk {
             TestFmwk.errln("");
         }
     }
-    
+
     static final String appendCompareResult(int result, String target){
         if (result == -1) {
             target += "LESS";
@@ -191,7 +194,7 @@ public class CollationTest extends TestFmwk {
 
     static final String prettify(byte[] skBytes, int length) {
         StringBuilder target = new StringBuilder(length * 3 + 2).append('[');
-    
+
         for (int i = 0; i < length; i++) {
             String numStr = Integer.toHexString(skBytes[i] & 0xff);
             if (numStr.length() < 2) {
@@ -203,17 +206,17 @@ public class CollationTest extends TestFmwk {
         return target.toString();
     }
 
-    private static void doTestVariant(TestFmwk test, 
+    private static void doTestVariant(TestFmwk test,
                                       RuleBasedCollator myCollation,
                                       String source, String target, int result)
     {
         int compareResult  = myCollation.compare(source, target);
         if (compareResult != result) {
-            
+
             // !!! if not mod build, error, else nothing.
             // warnln if not build, error, else always print warning.
             // do we need a 'quiet warning?' (err or log).  Hmmm,
-            // would it work to have the 'verbose' flag let you 
+            // would it work to have the 'verbose' flag let you
             // suppress warnings?  Are there ever some warnings you
             // want to suppress, and others you don't?
             TestFmwk.errln("Comparing \"" + Utility.hex(source) + "\" with \""
@@ -224,9 +227,9 @@ public class CollationTest extends TestFmwk {
         CollationKey tsk = myCollation.getCollationKey(target);
         compareResult = ssk.compareTo(tsk);
         if (compareResult != result) {
-            TestFmwk.errln("Comparing CollationKeys of \"" + Utility.hex(source) 
-            + "\" with \"" + Utility.hex(target) 
-            + "\" expected " + result + " but got " 
+            TestFmwk.errln("Comparing CollationKeys of \"" + Utility.hex(source)
+            + "\" with \"" + Utility.hex(target)
+            + "\" expected " + result + " but got "
             + compareResult);
         }
         RawCollationKey srsk = new RawCollationKey();
@@ -235,10 +238,10 @@ public class CollationTest extends TestFmwk {
         myCollation.getRawCollationKey(target, trsk);
         compareResult = ssk.compareTo(tsk);
         if (compareResult != result) {
-            TestFmwk.errln("Comparing RawCollationKeys of \"" 
-                    + Utility.hex(source) 
-                    + "\" with \"" + Utility.hex(target) 
-                    + "\" expected " + result + " but got " 
+            TestFmwk.errln("Comparing RawCollationKeys of \""
+                    + Utility.hex(source)
+                    + "\" with \"" + Utility.hex(target)
+                    + "\" expected " + result + " but got "
                     + compareResult);
         }
     }
@@ -250,7 +253,7 @@ public class CollationTest extends TestFmwk {
 
         final String s = "\uFFFE\uFFFF";
         long[] ces;
+
         ces = rbc.internalGetCEs(s);
         if (ces.length != 2) {
             errln("expected 2 CEs for <FFFE, FFFF>, got " + ces.length);
@@ -355,7 +358,7 @@ public class CollationTest extends TestFmwk {
         }
     }
 
-    
+
     // ICU4C: TestIllegalUTF8 / not applicable to ICU4J
 
 
@@ -1475,7 +1478,7 @@ public class CollationTest extends TestFmwk {
             if (b != bytes[i]) {
                 break;
             }
-            if ((int)b == Collation.LEVEL_SEPARATOR_BYTE) {
+            if (b == Collation.LEVEL_SEPARATOR_BYTE) {
                 ++level;
                 if (level == Collation.CASE_LEVEL && !collHasCaseLevel) {
                     ++level;
index e7009af6b2a9337b8e7192868e48376d2e99f26b..07ad77bfdf17defaad164e4202aa18929953aa09 100644 (file)
@@ -7,11 +7,11 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : collate/CollationRegressionTest
  * Source File: $ICU4CRoot/source/test/intltest/regcoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
 
 import java.io.BufferedReader;
@@ -21,6 +21,8 @@ import java.util.Comparator;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -29,10 +31,11 @@ import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
 
+@RunWith(JUnit4.class)
 public class CollationThaiTest extends TestFmwk {
-    
+
     final int MAX_FAILURES_TO_SHOW = -1;
-    
+
     /**
      * Odd corner conditions taken from "How to Sort Thai Without Rewriting Sort",
      * by Doug Cooper, http://seasrc.th.net/paper/thaisort.zip
@@ -42,41 +45,41 @@ public class CollationThaiTest extends TestFmwk {
         String TESTS[] = {
             // Shorter words precede longer
             "\u0e01",                               "<",    "\u0e01\u0e01",
-    
+
             // Tone marks are considered after letters (i.e. are primary ignorable)
             "\u0e01\u0e32",                        "<",    "\u0e01\u0e49\u0e32",
-    
+
             // ditto for other over-marks
             "\u0e01\u0e32",                        "<",    "\u0e01\u0e32\u0e4c",
-    
+
             // commonly used mark-in-context order.
             // In effect, marks are sorted after each syllable.
             "\u0e01\u0e32\u0e01\u0e49\u0e32",   "<",    "\u0e01\u0e48\u0e32\u0e01\u0e49\u0e32",
-    
+
             // Hyphens and other punctuation follow whitespace but come before letters
             "\u0e01\u0e32",                        "=",    "\u0e01\u0e32-",
             "\u0e01\u0e32-",                       "<",    "\u0e01\u0e32\u0e01\u0e32",
-    
+
             // Doubler follows an indentical word without the doubler
             "\u0e01\u0e32",                        "=",    "\u0e01\u0e32\u0e46",
             "\u0e01\u0e32\u0e46",                 "<",    "\u0e01\u0e32\u0e01\u0e32",
-    
+
             // \u0e45 after either \u0e24 or \u0e26 is treated as a single
             // combining character, similar to "c < ch" in traditional spanish.
             // TODO: beef up this case
             "\u0e24\u0e29\u0e35",                 "<",    "\u0e24\u0e45\u0e29\u0e35",
             "\u0e26\u0e29\u0e35",                 "<",    "\u0e26\u0e45\u0e29\u0e35",
-    
+
             // Vowels reorder, should compare \u0e2d and \u0e34
             "\u0e40\u0e01\u0e2d",                 "<",    "\u0e40\u0e01\u0e34",
-    
+
             // Tones are compared after the rest of the word (e.g. primary ignorable)
             "\u0e01\u0e32\u0e01\u0e48\u0e32",   "<",    "\u0e01\u0e49\u0e32\u0e01\u0e32",
-    
+
             // Periods are ignored entirely
             "\u0e01.\u0e01.",                      "<",    "\u0e01\u0e32",
         };
-        
+
         RuleBasedCollator coll = null;
         try {
             coll = getThaiCollator();
@@ -84,9 +87,9 @@ public class CollationThaiTest extends TestFmwk {
             warnln("could not construct Thai collator");
             return;
         }
-        compareArray(coll, TESTS); 
+        compareArray(coll, TESTS);
     }
-    
+
     void compareArray(RuleBasedCollator c, String[] tests) {
         for (int i = 0; i < tests.length; i += 3) {
             int expect = 0;
@@ -106,13 +109,13 @@ public class CollationThaiTest extends TestFmwk {
             CollationTest.doTest(this, c, s1, s2, expect);
         }
     }
-    
+
     int sign(int i ) {
         if (i < 0) return -1;
         if (i > 0) return 1;
         return 0;
     }
-    
+
     /**
      * Read the external dictionary file, which is already in proper
      * sorted order, and confirm that the collator compares each line as
@@ -204,12 +207,12 @@ public class CollationThaiTest extends TestFmwk {
             errln("Summary: " + failed + " of " + (line - 1) +
                   " comparisons failed");
         }
-    
+
         logln("Words checked: " + wordCount);
     }
-    
+
     @Test
-    public void TestInvalidThai() 
+    public void TestInvalidThai()
     {
         String tests[] = { "\u0E44\u0E01\u0E44\u0E01",
                            "\u0E44\u0E01\u0E01\u0E44",
@@ -218,7 +221,7 @@ public class CollationThaiTest extends TestFmwk {
                            "\u0E44\u0E44\u0E01\u0E01",
                            "\u0E01\u0E44\u0E44\u0E01",
                          };
-     
+
         RuleBasedCollator collator;
         StrCmp comparator;
         try {
@@ -228,26 +231,26 @@ public class CollationThaiTest extends TestFmwk {
             warnln("could not construct Thai collator");
             return;
         }
-        
+
         Arrays.sort(tests, comparator);
-     
+
         for (int i = 0; i < tests.length; i ++)
         {
             for (int j = i + 1; j < tests.length; j ++) {
                 if (collator.compare(tests[i], tests[j]) > 0) {
                     // inconsistency ordering found!
-                    errln("Inconsistent ordering between strings " + i 
+                    errln("Inconsistent ordering between strings " + i
                           + " and " + j);
                 }
             }
-            CollationElementIterator iterator 
+            CollationElementIterator iterator
                 = collator.getCollationElementIterator(tests[i]);
             CollationTest.backAndForth(this, iterator);
         }
     }
-    
+
     @Test
-    public void TestReordering() 
+    public void TestReordering()
     {
         String tests[] = {
             "\u0E41c\u0301",      "=", "\u0E41\u0107", // composition
@@ -281,13 +284,13 @@ public class CollationThaiTest extends TestFmwk {
 
         RuleBasedCollator collator;
         try {
-            collator = (RuleBasedCollator)getThaiCollator();
+            collator = getThaiCollator();
         } catch (Exception e) {
             warnln("could not construct Thai collator");
             return;
         }
         compareArray(collator, tests);
-    
+
         String rule = "& c < ab";
         String testcontraction[] = { "\u0E41ab", ">", "\u0E41c"};
         try {
@@ -300,28 +303,29 @@ public class CollationThaiTest extends TestFmwk {
     }
 
     // private inner class -------------------------------------------------
-    
-    private static final class StrCmp implements Comparator<String> 
+
+    private static final class StrCmp implements Comparator<String>
     {
-        public int compare(String string1, String string2) 
+        @Override
+        public int compare(String string1, String string2)
         {
             return collator.compare(string1, string2);
         }
-        
+
         StrCmp() throws Exception
         {
             collator = getThaiCollator();
         }
-        
+
         Collator collator;
     }
-    
+
     // private data members ------------------------------------------------
-    
+
     private static RuleBasedCollator m_collator_;
-    
+
     // private methods -----------------------------------------------------
-    
+
     private static RuleBasedCollator getThaiCollator() throws Exception
     {
         if (m_collator_ == null) {
index ef6a8bb5b237ce29cc2ab2666224ee8968284ecb..27c04c792e8a3bc3359500ba29dd09d5e60ea2f5 100644 (file)
@@ -13,9 +13,13 @@ import java.util.Arrays;
 import java.util.Locale;
 import java.util.Random;
 
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.Collator;
 
+@RunWith(JUnit4.class)
 public class CollationThreadTest extends TestFmwk {
     private static final String[] threadTestData;
     static {
@@ -195,6 +199,7 @@ public class CollationThreadTest extends TestFmwk {
             this.r = r;
         }
 
+        @Override
         public void run() {
             try {
                 synchronized (control) {
index 98fe65b8778864b7be6584bd0fb8ad2a0da28f54..aa39111913afc7cfc13db66118093d42e214d80e 100644 (file)
@@ -7,22 +7,25 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/CollationTurkishTest
  * Source File: $ICU4CRoot/source/test/intltest/trcoll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
+
+@RunWith(JUnit4.class)
 public class CollationTurkishTest extends TestFmwk{
     private static char[][] testSourceCases = {
         {0x73, 0x0327},
@@ -66,18 +69,18 @@ public class CollationTurkishTest extends TestFmwk{
         -1,
         1
     };
-    
+
     private Collator myCollation = null;
-    
+
     public CollationTurkishTest() {
 
     }
-    
+
     @Before
     public void init()throws Exception{
         myCollation = Collator.getInstance(new Locale("tr", ""));
     }
-    
+
     @Test
     public void TestTertiary() {
         int i = 0;
@@ -86,7 +89,7 @@ public class CollationTurkishTest extends TestFmwk{
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
         }
     }
-    
+
     @Test
     public void TestPrimary() {
         int i;
@@ -95,8 +98,8 @@ public class CollationTurkishTest extends TestFmwk{
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
         }
     }
-    
-    
+
+
     // main test routine, tests rules specific to turkish locale
     private void doTest(char[] source, char[] target, int result) {
         String s = new String(source);
@@ -107,9 +110,9 @@ public class CollationTurkishTest extends TestFmwk{
         sortKey2 = myCollation.getCollationKey(t);
         int keyResult = sortKey1.compareTo(sortKey2);
         reportCResult(s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result);
-        
+
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ) {
         if (expectedResult < -1 || expectedResult > 1) {
@@ -122,13 +125,13 @@ public class CollationTurkishTest extends TestFmwk{
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()) {
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -138,7 +141,7 @@ public class CollationTurkishTest extends TestFmwk{
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -151,7 +154,7 @@ public class CollationTurkishTest extends TestFmwk{
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -162,7 +165,7 @@ public class CollationTurkishTest extends TestFmwk{
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index 5c069db0d775216372a3d15c3a1cd349fc49d1dd..29770da58514c908c2982351b486caa53a034ea1 100644 (file)
@@ -7,26 +7,29 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/G7CollationTest
  * Source File: $ICU4CRoot/source/test/intltest/g7coll.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.text.RuleBasedCollator;
+
+@RunWith(JUnit4.class)
 public class G7CollationTest extends TestFmwk{
     private static String[] testCases = {
-        "blackbirds", "Pat", "p\u00E9ch\u00E9", "p\u00EAche", "p\u00E9cher",            
-        "p\u00EAcher", "Tod", "T\u00F6ne", "Tofu", "blackbird", "Ton", 
+        "blackbirds", "Pat", "p\u00E9ch\u00E9", "p\u00EAche", "p\u00E9cher",
+        "p\u00EAcher", "Tod", "T\u00F6ne", "Tofu", "blackbird", "Ton",
         "PAT", "black-bird", "black-birds", "pat", // 14
         // Additional tests
         "czar", "churo", "cat", "darn", "?",                                                                                /* 19 */
@@ -44,7 +47,7 @@ public class G7CollationTest extends TestFmwk{
         { 12, 13, 9, 0, 14, 1, 11, 2, 3, 4, 5, 6, 8, 10, 7, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, /* it_IT */
         { 12, 13, 9, 0, 14, 1, 11, 2, 3, 4, 5, 6, 8, 10, 7, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, /* ja_JP */
         /* new table collation with rules "& Z < p, P"  loop to FIXEDTESTSET */
-        { 12, 13, 9, 0, 6, 8, 10, 7, 14, 1, 11, 2, 3, 4, 5, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 }, 
+        { 12, 13, 9, 0, 6, 8, 10, 7, 14, 1, 11, 2, 3, 4, 5, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 },
         /* new table collation with rules "& C < ch , cH, Ch, CH " loop to TOTALTESTSET */
         { 19, 22, 21, 23, 24, 25, 12, 13, 9, 0, 17, 26, 28, 27, 15, 16, 18, 14, 1, 11, 2, 3, 4, 5, 20, 6, 8, 10, 7, 29 },
         /* new table collation with rules "& Question-mark ; ? & Hash-mark ; # & Ampersand ; '&'  " loop to TOTALTESTSET */
@@ -52,31 +55,31 @@ public class G7CollationTest extends TestFmwk{
         /* analogous to Japanese rules " & aa ; a- & ee ; e- & ii ; i- & oo ; o- & uu ; u- " */  /* loop to TOTALTESTSET */
         { 19, 22, 21, 24, 23, 25, 12, 13, 9, 0, 17, 16, 28, 26, 27, 15, 18, 14, 1, 11, 2, 3, 4, 5, 20, 6, 8, 10, 7, 29 }
     };
-    
+
     //private static final int MAX_TOKEN_LEN = 16;
     //private static final int TESTLOCALES = 12;
     private static final int FIXEDTESTSET = 15;
     private static final int TOTALTESTSET = 30;
-    
+
     // perform test with added rules " & Z < p, P"
     @Test
     public void TestDemo1() {
         logln("Demo Test 1 : Create a new table collation with rules \"& Z < p, P\"");
-        
-        Collator col = Collator.getInstance(Locale.ENGLISH);    
 
-        
+        Collator col = Collator.getInstance(Locale.ENGLISH);
+
+
         String baseRules = ((RuleBasedCollator)col).getRules();
         String newRules = " & Z < p, P";
-        newRules = baseRules + newRules; 
-        RuleBasedCollator myCollation = null; 
+        newRules = baseRules + newRules;
+        RuleBasedCollator myCollation = null;
         try {
             myCollation = new RuleBasedCollator(newRules);
         } catch(Exception e) {
             errln("Fail to create RuleBasedCollator with rules:" + newRules);
             return;
         }
-        
+
         int j, n;
         for (j = 0; j < FIXEDTESTSET; j++) {
             for (n = j+1; n < FIXEDTESTSET; n++) {
@@ -84,25 +87,25 @@ public class G7CollationTest extends TestFmwk{
             }
         }
     }
-    
+
 
     // perorm test with added rules "& C < ch , cH, Ch, CH"
     @Test
     public void TestDemo2() {
         logln("Demo Test 2 : Create a new table collation with rules \"& C < ch , cH, Ch, CH\"");
-        Collator col = Collator.getInstance(Locale.ENGLISH);    
+        Collator col = Collator.getInstance(Locale.ENGLISH);
 
 
         String baseRules = ((RuleBasedCollator)col).getRules();
         String newRules = "& C < ch , cH, Ch, CH";
-        newRules = baseRules + newRules; 
-        RuleBasedCollator myCollation = null; 
+        newRules = baseRules + newRules;
+        RuleBasedCollator myCollation = null;
         try {
             myCollation = new RuleBasedCollator(newRules);
         }catch(Exception e){
             errln("Fail to create RuleBasedCollator with rules:" + newRules);
             return;
-        }  
+        }
 
         int j, n;
         for (j = 0; j < TOTALTESTSET; j++) {
@@ -111,26 +114,26 @@ public class G7CollationTest extends TestFmwk{
             }
         }
     }
-    
 
-    // perform test with added rules 
+
+    // perform test with added rules
     // "& Question'-'mark ; '?' & Hash'-'mark ; '#' & Ampersand ; '&'"
     @Test
     public void TestDemo3() {
         // logln("Demo Test 3 : Create a new table collation with rules \"& Question'-'mark ; '?' & Hash'-'mark ; '#' & Ampersand ; '&'\"");
-        Collator col = Collator.getInstance(Locale.ENGLISH);    
+        Collator col = Collator.getInstance(Locale.ENGLISH);
+
 
-        
         String baseRules = ((RuleBasedCollator)col).getRules();
         String newRules = "& Question'-'mark ; '?' & Hash'-'mark ; '#' & Ampersand ; '&'";
         newRules = baseRules + newRules;
-        RuleBasedCollator myCollation = null; 
+        RuleBasedCollator myCollation = null;
         try {
             myCollation = new RuleBasedCollator(newRules);
         }catch(Exception e){
             errln("Fail to create RuleBasedCollator with rules:" + newRules);
             return;
-        }  
+        }
 
         int j, n;
         for (j = 0; j < TOTALTESTSET; j++) {
@@ -139,25 +142,25 @@ public class G7CollationTest extends TestFmwk{
             }
         }
     }
-    
 
-    // perform test with added rules 
+
+    // perform test with added rules
     // " & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-' "
     @Test
     public void TestDemo4() {
         logln("Demo Test 4 : Create a new table collation with rules \" & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-' \"");
-        Collator col = Collator.getInstance(Locale.ENGLISH);    
+        Collator col = Collator.getInstance(Locale.ENGLISH);
 
         String baseRules = ((RuleBasedCollator)col).getRules();
         String newRules = " & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-' ";
         newRules = baseRules + newRules;
-        RuleBasedCollator myCollation = null; 
+        RuleBasedCollator myCollation = null;
         try {
             myCollation = new RuleBasedCollator(newRules);
         }catch(Exception e){
             errln("Fail to create RuleBasedCollator with rules:" + newRules);
             return;
-        }  
+        }
 
         int j, n;
         for (j = 0; j < TOTALTESTSET; j++) {
@@ -166,7 +169,7 @@ public class G7CollationTest extends TestFmwk{
             }
         }
     }
-    
+
     @Test
     public void TestG7Data() {
         Locale locales[] = {
@@ -199,21 +202,21 @@ public class G7CollationTest extends TestFmwk{
             myCollation = null;
         }
     }
-    
-    
+
+
     // main test routine, tests comparisons for a set of strings against sets of expected results
-    private void doTest(Collator myCollation, String source, String target, 
+    private void doTest(Collator myCollation, String source, String target,
                         int result){
-        
+
         int compareResult = myCollation.compare(source, target);
         CollationKey sortKey1, sortKey2;
         sortKey1 = myCollation.getCollationKey(source);
         sortKey2 = myCollation.getCollationKey(target);
         int keyResult = sortKey1.compareTo(sortKey2);
-        reportCResult(source, target, sortKey1, sortKey2, compareResult, 
+        reportCResult(source, target, sortKey1, sortKey2, compareResult,
                       keyResult, compareResult, result);
     }
-    
+
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
                                 int compareResult, int keyResult, int incResult, int expectedResult ){
         if (expectedResult < -1 || expectedResult > 1) {
@@ -226,13 +229,13 @@ public class G7CollationTest extends TestFmwk{
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()){
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -242,7 +245,7 @@ public class G7CollationTest extends TestFmwk{
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -255,7 +258,7 @@ public class G7CollationTest extends TestFmwk{
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -266,7 +269,7 @@ public class G7CollationTest extends TestFmwk{
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index 9112d3639f1cac6fee20c0df76b98ee0a600c35e..06280bb17d6e873e36adce421e8232e3a2ad28d4 100644 (file)
@@ -7,46 +7,49 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v2.1 : Collate/LotusCollationKoreanTest
  * Source File: $ICU4CRoot/source/test/intltest/lcukocol.cpp
  **/
+
 package com.ibm.icu.dev.test.collator;
+
 import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CollationKey;
 import com.ibm.icu.text.Collator;
+
+@RunWith(JUnit4.class)
 public class LotusCollationKoreanTest extends TestFmwk{
     private static char[][] testSourceCases = {
         {0xac00}
     };
-    
+
     private static char[][] testTargetCases = {
         {0xac01}
     };
-    
+
     private static int[] results = {
         -1
     };
-    
+
     private Collator myCollation;
-    
+
     public LotusCollationKoreanTest() {
     }
-    
+
     @Before
     public void init()throws Exception {
         myCollation = Collator.getInstance(Locale.KOREAN);
         myCollation.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
     }
-    
+
     // performs test with strength TERIARY
     @Test
     public void TestTertiary() {
@@ -56,7 +59,7 @@ public class LotusCollationKoreanTest extends TestFmwk{
             doTest(testSourceCases[i], testTargetCases[i], results[i]);
             }
         }
-    
+
     // main test routine, tests rules specific to "Korean" locale
     private void doTest( char[] source, char[] target, int result) {
         String s = new String(source);
@@ -66,7 +69,7 @@ public class LotusCollationKoreanTest extends TestFmwk{
         sortKey1 = myCollation.getCollationKey(s);
         sortKey2 = myCollation.getCollationKey(t);
         int keyResult = sortKey1.compareTo(sortKey2);
-        reportCResult( s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result ); 
+        reportCResult( s, t, sortKey1, sortKey2, compareResult, keyResult, compareResult, result );
     }
 
     private void reportCResult( String source, String target, CollationKey sourceKey, CollationKey targetKey,
@@ -81,13 +84,13 @@ public class LotusCollationKoreanTest extends TestFmwk{
         boolean ok3 = (incResult == expectedResult);
 
         if (ok1 && ok2 && ok3 && !isVerbose()) {
-            return;    
+            return;
         } else {
             String msg1 = ok1? "Ok: compare(\"" : "FAIL: compare(\"";
             String msg2 = "\", \"";
             String msg3 = "\") returned ";
             String msg4 = "; expected ";
-            
+
             String sExpect = new String("");
             String sResult = new String("");
             sResult = CollationTest.appendCompareResult(compareResult, sResult);
@@ -97,7 +100,7 @@ public class LotusCollationKoreanTest extends TestFmwk{
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
             }
-            
+
             msg1 = ok2 ? "Ok: key(\"" : "FAIL: key(\"";
             msg2 = "\").compareTo(key(\"";
             msg3 = "\")) returned ";
@@ -110,7 +113,7 @@ public class LotusCollationKoreanTest extends TestFmwk{
                 msg2 = " vs. ";
                 errln(msg1 + CollationTest.prettify(sourceKey) + msg2 + CollationTest.prettify(targetKey));
             }
-            
+
             msg1 = ok3 ? "Ok: incCompare(\"" : "FAIL: incCompare(\"";
             msg2 = "\", \"";
             msg3 = "\") returned ";
@@ -121,7 +124,7 @@ public class LotusCollationKoreanTest extends TestFmwk{
                 logln(msg1 + source + msg2 + target + msg3 + sResult);
             } else {
                 errln(msg1 + source + msg2 + target + msg3 + sResult + msg4 + sExpect);
-            }                
+            }
         }
     }
 }
index ec0c876d6e0dee81de514a9ae9eb173086185f06..f2ea0247859414025947bc7ec0e760c4522c2985 100644 (file)
@@ -18,6 +18,8 @@ import java.io.IOException;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -29,6 +31,7 @@ import com.ibm.icu.text.UTF16;
 import com.ibm.icu.util.ULocale;
 import com.ibm.icu.util.VersionInfo;
 
+@RunWith(JUnit4.class)
 public class UCAConformanceTest extends TestFmwk {
 
     public UCAConformanceTest() {
index 68a085b0eeb73163c1449c35d48a014889a79081..7bc21bc63657ae82805c6f86213851cae41565c0 100644 (file)
@@ -15,6 +15,8 @@ import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.BreakIterator;
@@ -32,8 +34,7 @@ import com.ibm.icu.util.JapaneseCalendar;
 import com.ibm.icu.util.TimeZone;
 import com.ibm.icu.util.ULocale;
 
-
-
+@RunWith(JUnit4.class)
 public class GlobalizationPreferencesTest extends TestFmwk {
     @Test
     public void TestDefault() {
@@ -46,7 +47,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
             // If not, some test cases will fail...
             errln("FAIL: The default locale of the test environment must be en_US");
         }
-        
+
         logln("Default locale: " + defLocale.toString());
 
         // First locale is en_US
@@ -68,7 +69,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         if (gpLocale2 != null) {
             errln("FAIL: Number of locales must be 2");
         }
-        
+
         // Calendar locale
         Calendar cal = gp.getCalendar();
         ULocale calLocale = cal.getLocale(ULocale.VALID_LOCALE);
@@ -118,7 +119,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         GlobalizationPreferences gp = new GlobalizationPreferences();
         if (gp.isFrozen()) {
             errln("FAIL: This object is not yet frozen");
-        }        
+        }
 
         logln("Call reset()");
         boolean bSet = true;
@@ -199,7 +200,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         if (bSet) {
             errln("FAIL: setLocale(ULocale) must be blocked after frozen");
         }
-        
+
         // setTerritory(String)
         logln("Call setTerritory(String) after frozen");
         bSet = true;
@@ -214,11 +215,11 @@ public class GlobalizationPreferencesTest extends TestFmwk {
 
         // Modifiable clone
         logln("Create a modifiable clone");
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
 
         if (gp1.isFrozen()) {
             errln("FAIL: The object returned by cloneAsThawed() must not be frozen yet");
-        }        
+        }
 
         // setLocale(ULocale)
         logln("Call setLocale(ULocale) of the modifiable clone");
@@ -230,7 +231,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         }
         if (!bSet) {
             errln("FAIL: setLocales(ULocale) must not throw an exception before frozen");
-        }        
+        }
     }
 
     static String[][] INPUT_LOCALEIDS = {
@@ -283,7 +284,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
                 sb.append(localeStrings[j]);
             }
             logln("Input locales: " + sb.toString());
-            
+
             gp.reset();
             gp.setLocales(locales);
 
@@ -292,7 +293,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
                 errln("FAIL: Number of locales mismatch - GP:" + resultLocales.size()
                         + " Expected:" + RESULTS_LOCALEIDS[i].length);
             } else {
-                
+
                 for (int j = 0; j < RESULTS_LOCALEIDS[i].length; j++) {
                     ULocale loc = gp.getLocale(j);
                     logln("Locale[" + j + "]: " + loc.toString());
@@ -300,10 +301,10 @@ public class GlobalizationPreferencesTest extends TestFmwk {
                         errln("FAIL: Locale index(" + j + ") does not match - GP:" + loc.toString()
                                 + " Expected:" + RESULTS_LOCALEIDS[i][j]);
                     }
-                }    
+                }
             }
         }
-        
+
         // setLocales(ULocale[])
         for (int i = 0; i < INPUT_LOCALEIDS.length; i++) {
             String[] localeStrings = INPUT_LOCALEIDS[i];
@@ -317,7 +318,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
                 sb.append(localeStrings[j]);
             }
             logln("Input locales: " + sb.toString());
-            
+
             gp.reset();
             gp.setLocales(localeArray);
 
@@ -326,7 +327,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
                 errln("FAIL: Number of locales mismatch - GP:" + resultLocales.size()
                         + " Expected:" + RESULTS_LOCALEIDS[i].length);
             } else {
-                
+
                 for (int j = 0; j < RESULTS_LOCALEIDS[i].length; j++) {
                     ULocale loc = gp.getLocale(j);
                     logln("Locale[" + j + "]: " + loc.toString());
@@ -334,7 +335,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
                         errln("FAIL: Locale index(" + j + ") does not match - GP:" + loc.toString()
                                 + " Expected:" + RESULTS_LOCALEIDS[i][j]);
                     }
-                }    
+                }
             }
         }
 
@@ -342,7 +343,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         for (int i = 0; i < ACCEPT_LANGUAGES.length; i++) {
             String acceptLanguage = ACCEPT_LANGUAGES[i];
             logln("Accept language: " + acceptLanguage);
-            
+
             gp.reset();
             gp.setLocales(acceptLanguage);
 
@@ -351,7 +352,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
                 errln("FAIL: Number of locales mismatch - GP:" + resultLocales.size()
                         + " Expected:" + RESULTS_LOCALEIDS[i].length);
             } else {
-                
+
                 for (int j = 0; j < RESULTS_LOCALEIDS[i].length; j++) {
                     ULocale loc = gp.getLocale(j);
                     logln("Locale[" + j + "]: " + loc.toString());
@@ -359,7 +360,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
                         errln("FAIL: Locale index(" + j + ") does not match - GP:" + loc.toString()
                                 + " Expected:" + RESULTS_LOCALEIDS[i][j]);
                     }
-                }    
+                }
             }
         }
 
@@ -370,7 +371,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         if (!gp.getLocale(0).toString().equals("de_AT")) {
             errln("FAIL: getLocale(0) returns " + gp.getLocale(0).toString() + " Expected: de_AT");
         }
-        
+
         // Invalid accept-language
         logln("Set locale - ko_KR");
         gp.setLocale(new ULocale("ko_KR"));
@@ -395,7 +396,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         String baseName = "com.ibm.icu.dev.data.resources.TestDataElements";
         ResourceBundle rb;
 
-        logln("Get a resource bundle " + baseName + 
+        logln("Get a resource bundle " + baseName +
                 " using GlobalizationPreferences initialized by locales - en_GB, en_US");
         GlobalizationPreferences gp = new GlobalizationPreferences();
         ULocale[] locales = new ULocale[2];
@@ -415,14 +416,14 @@ public class GlobalizationPreferencesTest extends TestFmwk {
 
         gp.reset();
 
-        logln("Get a resource bundle " + baseName + 
+        logln("Get a resource bundle " + baseName +
         " using GlobalizationPreferences initialized by locales - ja, en_US_California");
 
         locales = new ULocale[2];
         locales[0] = new ULocale("ja");
         locales[1] = new ULocale("en_US_California");
         gp.setLocales(locales);
-        
+
         try {
             rb = gp.getResourceBundle(baseName, Thread.currentThread().getContextClassLoader());
             String str = rb.getString("from_en_US");
@@ -478,7 +479,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         // Freeze
         logln("Freeze this object");
         gp.freeze();
-        
+
         boolean bFrozen = false;
         try {
             gp.setTerritory("FR");
@@ -495,7 +496,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         }
 
         // Safe clone
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
         territory = gp1.getTerritory();
         if (!territory.equals("CA")) {
             errln("FAIL: Territory is " + territory + " - Expected: CA");
@@ -505,7 +506,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         ULocale[] locales = new ULocale[2];
         locales[0] = new ULocale("ja");
         locales[1] = new ULocale("zh_Hant_TW");
+
         logln("Set locales - ja, zh_Hant_TW");
         gp1.setLocales(locales);
 
@@ -594,7 +595,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
 
         // Safe clone
         logln("cloneAsThawed");
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
         cur = gp.getCurrency();
         code = cur.getCurrencyCode();
         if (!code.equals("BRL")) {
@@ -674,7 +675,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
 
         // Safe clone
         logln("cloneAsThawed");
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
         cal = gp.getCalendar();
         calType = cal.getType();
         if (!calType.equals("japanese")) {
@@ -694,7 +695,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
     public void TestTimeZone() {
         GlobalizationPreferences gp = new GlobalizationPreferences();
 
-        // Set locale - zh_CN 
+        // Set locale - zh_CN
         logln("Set locale - zh_CN");
         gp.setLocale(new ULocale("zh_CN"));
         TimeZone tz = gp.getTimeZone();
@@ -757,7 +758,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
 
         // Modifiable clone
         logln("cloneAsThawed");
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
         tz = gp1.getTimeZone();
         tzid = tz.getID();
         if (!tzid.equals(customJstId)) {
@@ -770,7 +771,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         tzid = tz.getID();
         if (!tzid.equals(cst.getID())) {
             errln("FAIL: Time zone ID is " + tzid + " Expected: " + cst.getID());
-        }        
+        }
     }
 
     @Test
@@ -840,7 +841,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
 
         // Modifiable clone
         logln("cloneAsThawed");
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
         coll = gp1.getCollator();
         locStr = coll.getLocale(ULocale.VALID_LOCALE).toString();
         if (!locStr.equals("it")) {
@@ -939,7 +940,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
 
         // Modifiable clone
         logln("cloneAsThawed");
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
         brk = gp1.getBreakIterator(GlobalizationPreferences.BI_WORD);
         /* TODO: JB#5383
         locStr = brk.getLocale(ULocale.VALID_LOCALE).toString();
@@ -1207,7 +1208,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         // Set locale - en_GB
         logln("Set locale - en_GB");
         gp.setLocale(new ULocale("en_GB"));
-        
+
         // Date - full
         df = gp.getDateFormat(GlobalizationPreferences.DF_FULL, GlobalizationPreferences.DF_NONE);
         pattern = ((SimpleDateFormat)df).toPattern();
@@ -1354,9 +1355,9 @@ public class GlobalizationPreferencesTest extends TestFmwk {
 
         // Modifiable clone
         logln("cloneAsThawed");
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
         gp1.setDateFormat(GlobalizationPreferences.DF_LONG, GlobalizationPreferences.DF_NONE, customLD);
-        
+
         df = gp1.getDateFormat(GlobalizationPreferences.DF_SHORT, GlobalizationPreferences.DF_SHORT);
         dfCal = df.getCalendar();
         if (!(dfCal instanceof JapaneseCalendar)) {
@@ -1397,7 +1398,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         if (!numStr.equals("\u20a9\u00a0123,457")) {
             errln("FAIL: Number string is " + numStr + " Expected: \u20a9\u00a0123,457");
         }
-        
+
         // Set locale - de_DE
         logln("Set locale - de_DE");
         gp.setLocale(new ULocale("de_DE"));
@@ -1464,7 +1465,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         if (!illegalArg) {
             errln("FAIL: getNumberFormat must throw IllegalArgumentException for type -1");
         }
-        
+
         // Set explicit territory
         logln("Set territory - US");
         gp.setTerritory("US");
@@ -1496,7 +1497,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         NumberFormat customInt = NumberFormat.getIntegerInstance(new ULocale("pt_PT"));
         gp.setNumberFormat(GlobalizationPreferences.NF_INTEGER, customInt);
 
-        
+
         nf = gp.getNumberFormat(GlobalizationPreferences.NF_NUMBER);
         if (!nf.getLocale(ULocale.VALID_LOCALE).toString().equals("he_IL")) {
             errln("FAIL: The NumberFormat instance must use locale he_IL");
@@ -1535,7 +1536,7 @@ public class GlobalizationPreferencesTest extends TestFmwk {
         }
 
         // Create a modifiable clone
-        GlobalizationPreferences gp1 = (GlobalizationPreferences)gp.cloneAsThawed();
+        GlobalizationPreferences gp1 = gp.cloneAsThawed();
 
         // Number type format's locale is still he_IL
         nf = gp1.getNumberFormat(GlobalizationPreferences.NF_NUMBER);
index 84fcb6247fe276631ff93c87850e370bf254557e..ad8dfa3e9c5bac7b7ca54b303365d4173c94d5ff 100644 (file)
@@ -14,6 +14,8 @@ import java.util.Locale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.text.RbnfScannerProviderImpl;
@@ -21,6 +23,7 @@ import com.ibm.icu.text.RbnfLenientScannerProvider;
 import com.ibm.icu.text.RuleBasedNumberFormat;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class RbnfLenientScannerTest extends TestFmwk {
     private static final RbnfLenientScannerProvider provider = new RbnfScannerProviderImpl();
 
@@ -160,7 +163,7 @@ public class RbnfLenientScannerTest extends TestFmwk {
                         if (r == null) {
                             r = createRandom();
                         }
-                        n = ((int)(r.nextInt(10000) - 3000)) / 16d;
+                        n = (r.nextInt(10000) - 3000) / 16d;
                     }
 
                     String s = fmt.format(n);
index a633265d6160ef52a61216183fdfa15c8ce6f6e7..7b1bab398c82eed524e4a0dc8af5b18f7cb7465a 100644 (file)
@@ -29,6 +29,8 @@ import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.BreakIterator;
@@ -39,6 +41,7 @@ import com.ibm.icu.text.SearchIterator.ElementComparisonType;
 import com.ibm.icu.text.StringSearch;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class SearchTest extends TestFmwk {
 
     //inner class
index 7b25d4518fee5ac0d289ec46fbcefd1d9b1fdbdf..009613adf452cc7a90df042db736dcb09c4abc38 100644 (file)
@@ -11,6 +11,8 @@ package com.ibm.icu.dev.test.util;
 import java.util.MissingResourceException;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUData;
@@ -19,7 +21,7 @@ import com.ibm.icu.text.Collator;
 import com.ibm.icu.util.ULocale;
 import com.ibm.icu.util.UResourceBundle;
 
-
+@RunWith(JUnit4.class)
 public final class ICUResourceBundleCollationTest extends TestFmwk {
     private static final String COLLATION_RESNAME = "collations";
     private static final String COLLATION_KEYWORD = "collation";
@@ -146,7 +148,7 @@ public final class ICUResourceBundleCollationTest extends TestFmwk {
 
     @Test
     public void TestOpen(){
-        UResourceBundle bundle = (UResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_COLLATION_BASE_NAME, "en_US_POSIX");
+        UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUData.ICU_COLLATION_BASE_NAME, "en_US_POSIX");
         if(bundle==null){
             errln("could not load the stream");
         }
index 43bfc2d42e7c7d89ef3b686d9176b2b6b1f43853..ce1dafd2fbf8bb5dba9fb34f63586c8860fac79b 100644 (file)
@@ -13,10 +13,13 @@ import java.util.HashMap;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.text.Collator;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class LocaleAliasCollationTest extends com.ibm.icu.dev.test.TestFmwk {
     private static final ULocale[][] _LOCALES = {
             {new ULocale("en", "RH"), new ULocale("en", "ZW")},
index b84408909cec6cd67977d85943a7c8e2e9e5d6e9..0562e1fed59d660ba5c1e67a3c3c9c49a265d9d2 100644 (file)
@@ -23,6 +23,8 @@ import java.util.Locale;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.Collator;
@@ -33,17 +35,21 @@ import com.ibm.icu.text.LocaleDisplayNames.UiListItem;
 import com.ibm.icu.util.IllformedLocaleException;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class ULocaleCollationTest extends TestFmwk {
     @Test
     public void TestCollator() {
         checkService("ja_JP_YOKOHAMA", new ServiceFacade() {
+            @Override
             public Object create(ULocale req) {
                 return Collator.getInstance(req);
             }
         }, null, new Registrar() {
+            @Override
             public Object register(ULocale loc, Object prototype) {
                 return Collator.registerInstance((Collator) prototype, loc);
             }
+            @Override
             public boolean unregister(Object key) {
                 return Collator.unregister(key);
             }
@@ -233,99 +239,99 @@ public class ULocaleCollationTest extends TestFmwk {
     }
 
     @Test
-    public void TestNameList() { 
-        String[][][] tests = { 
+    public void TestNameList() {
+        String[][][] tests = {
                 /* name in French, name in self, minimized, modified */
-                {{"fr-Cyrl-BE", "fr-Cyrl-CA"}, 
-                    {"Français (cyrillique, Belgique)", "Français (cyrillique, Belgique)", "fr_Cyrl_BE", "fr_Cyrl_BE"}, 
-                    {"Français (cyrillique, Canada)", "Français (cyrillique, Canada)", "fr_Cyrl_CA", "fr_Cyrl_CA"}, 
-                }, 
-                {{"en", "de", "fr", "zh"}, 
-                    {"Allemand", "Deutsch", "de", "de"}, 
-                    {"Anglais", "English", "en", "en"}, 
-                    {"Chinois", "中文", "zh", "zh"}, 
-                    {"Français", "Français", "fr", "fr"}, 
-                }, 
+                {{"fr-Cyrl-BE", "fr-Cyrl-CA"},
+                    {"Français (cyrillique, Belgique)", "Français (cyrillique, Belgique)", "fr_Cyrl_BE", "fr_Cyrl_BE"},
+                    {"Français (cyrillique, Canada)", "Français (cyrillique, Canada)", "fr_Cyrl_CA", "fr_Cyrl_CA"},
+                },
+                {{"en", "de", "fr", "zh"},
+                    {"Allemand", "Deutsch", "de", "de"},
+                    {"Anglais", "English", "en", "en"},
+                    {"Chinois", "中文", "zh", "zh"},
+                    {"Français", "Français", "fr", "fr"},
+                },
                 // some non-canonical names
-                {{"iw", "iw-US", "no", "no-Cyrl", "in", "in-YU"}, 
-                    {"Hébreu (États-Unis)", "עברית (ארצות הברית)", "iw_US", "iw_US"}, 
-                    {"Hébreu (Israël)", "עברית (ישראל)", "iw", "iw_IL"}, 
-                    {"Indonésien (Indonésie)", "Indonesia (Indonesia)", "in", "in_ID"}, 
-                    {"Indonésien (Serbie)", "Indonesia (Serbia)", "in_YU", "in_YU"}, 
-                    {"Norvégien (cyrillique)", "Norsk (kyrillisk)", "no_Cyrl", "no_Cyrl"}, 
-                    {"Norvégien (latin)", "Norsk (latinsk)", "no", "no_Latn"}, 
-                }, 
-                {{"zh-Hant-TW", "en", "en-gb", "fr", "zh-Hant", "de", "de-CH", "zh-TW"}, 
-                    {"Allemand (Allemagne)", "Deutsch (Deutschland)", "de", "de_DE"}, 
-                    {"Allemand (Suisse)", "Deutsch (Schweiz)", "de_CH", "de_CH"}, 
-                    {"Anglais (États-Unis)", "English (United States)", "en", "en_US"}, 
-                    {"Anglais (Royaume-Uni)", "English (United Kingdom)", "en_GB", "en_GB"}, 
-                    {"Chinois (traditionnel)", "中文(繁體)", "zh_Hant", "zh_Hant"}, 
-                    {"Français", "Français", "fr", "fr"}, 
-                }, 
-                {{"zh", "en-gb", "en-CA", "fr-Latn-FR"}, 
-                    {"Anglais (Canada)", "English (Canada)", "en_CA", "en_CA"}, 
-                    {"Anglais (Royaume-Uni)", "English (United Kingdom)", "en_GB", "en_GB"}, 
-                    {"Chinois", "中文", "zh", "zh"}, 
-                    {"Français", "Français", "fr", "fr"}, 
-                }, 
-                {{"en-gb", "fr", "zh-Hant", "zh-SG", "sr", "sr-Latn"}, 
-                    {"Anglais (Royaume-Uni)", "English (United Kingdom)", "en_GB", "en_GB"}, 
-                    {"Chinois (simplifié, Singapour)", "中文(简体,新加坡)", "zh_SG", "zh_Hans_SG"}, 
-                    {"Chinois (traditionnel, Taïwan)", "中文(繁體,台灣)", "zh_Hant", "zh_Hant_TW"}, 
-                    {"Français", "Français", "fr", "fr"}, 
-                    {"Serbe (cyrillique)", "Српски (ћирилица)", "sr", "sr_Cyrl"}, 
-                    {"Serbe (latin)", "Srpski (latinica)", "sr_Latn", "sr_Latn"}, 
-                }, 
-                {{"fr-Cyrl", "fr-Arab"}, 
-                    {"Français (arabe)", "Français (arabe)", "fr_Arab", "fr_Arab"}, 
-                    {"Français (cyrillique)", "Français (cyrillique)", "fr_Cyrl", "fr_Cyrl"}, 
-                }, 
-                {{"fr-Cyrl-BE", "fr-Arab-CA"}, 
-                    {"Français (arabe, Canada)", "Français (arabe, Canada)", "fr_Arab_CA", "fr_Arab_CA"}, 
-                    {"Français (cyrillique, Belgique)", "Français (cyrillique, Belgique)", "fr_Cyrl_BE", "fr_Cyrl_BE"}, 
-                } 
-        }; 
-        ULocale french = ULocale.FRENCH; 
-        LocaleDisplayNames names = LocaleDisplayNames.getInstance(french,  
-                DisplayContext.CAPITALIZATION_FOR_UI_LIST_OR_MENU); 
-        for (Type type : DisplayContext.Type.values()) { 
-            logln("Contexts: " + names.getContext(type).toString()); 
-        } 
-        Collator collator = Collator.getInstance(french); 
+                {{"iw", "iw-US", "no", "no-Cyrl", "in", "in-YU"},
+                    {"Hébreu (États-Unis)", "עברית (ארצות הברית)", "iw_US", "iw_US"},
+                    {"Hébreu (Israël)", "עברית (ישראל)", "iw", "iw_IL"},
+                    {"Indonésien (Indonésie)", "Indonesia (Indonesia)", "in", "in_ID"},
+                    {"Indonésien (Serbie)", "Indonesia (Serbia)", "in_YU", "in_YU"},
+                    {"Norvégien (cyrillique)", "Norsk (kyrillisk)", "no_Cyrl", "no_Cyrl"},
+                    {"Norvégien (latin)", "Norsk (latinsk)", "no", "no_Latn"},
+                },
+                {{"zh-Hant-TW", "en", "en-gb", "fr", "zh-Hant", "de", "de-CH", "zh-TW"},
+                    {"Allemand (Allemagne)", "Deutsch (Deutschland)", "de", "de_DE"},
+                    {"Allemand (Suisse)", "Deutsch (Schweiz)", "de_CH", "de_CH"},
+                    {"Anglais (États-Unis)", "English (United States)", "en", "en_US"},
+                    {"Anglais (Royaume-Uni)", "English (United Kingdom)", "en_GB", "en_GB"},
+                    {"Chinois (traditionnel)", "中文(繁體)", "zh_Hant", "zh_Hant"},
+                    {"Français", "Français", "fr", "fr"},
+                },
+                {{"zh", "en-gb", "en-CA", "fr-Latn-FR"},
+                    {"Anglais (Canada)", "English (Canada)", "en_CA", "en_CA"},
+                    {"Anglais (Royaume-Uni)", "English (United Kingdom)", "en_GB", "en_GB"},
+                    {"Chinois", "中文", "zh", "zh"},
+                    {"Français", "Français", "fr", "fr"},
+                },
+                {{"en-gb", "fr", "zh-Hant", "zh-SG", "sr", "sr-Latn"},
+                    {"Anglais (Royaume-Uni)", "English (United Kingdom)", "en_GB", "en_GB"},
+                    {"Chinois (simplifié, Singapour)", "中文(简体,新加坡)", "zh_SG", "zh_Hans_SG"},
+                    {"Chinois (traditionnel, Taïwan)", "中文(繁體,台灣)", "zh_Hant", "zh_Hant_TW"},
+                    {"Français", "Français", "fr", "fr"},
+                    {"Serbe (cyrillique)", "Српски (ћирилица)", "sr", "sr_Cyrl"},
+                    {"Serbe (latin)", "Srpski (latinica)", "sr_Latn", "sr_Latn"},
+                },
+                {{"fr-Cyrl", "fr-Arab"},
+                    {"Français (arabe)", "Français (arabe)", "fr_Arab", "fr_Arab"},
+                    {"Français (cyrillique)", "Français (cyrillique)", "fr_Cyrl", "fr_Cyrl"},
+                },
+                {{"fr-Cyrl-BE", "fr-Arab-CA"},
+                    {"Français (arabe, Canada)", "Français (arabe, Canada)", "fr_Arab_CA", "fr_Arab_CA"},
+                    {"Français (cyrillique, Belgique)", "Français (cyrillique, Belgique)", "fr_Cyrl_BE", "fr_Cyrl_BE"},
+                }
+        };
+        ULocale french = ULocale.FRENCH;
+        LocaleDisplayNames names = LocaleDisplayNames.getInstance(french,
+                DisplayContext.CAPITALIZATION_FOR_UI_LIST_OR_MENU);
+        for (Type type : DisplayContext.Type.values()) {
+            logln("Contexts: " + names.getContext(type).toString());
+        }
+        Collator collator = Collator.getInstance(french);
 
-        for (String[][] test : tests) { 
-            Set<ULocale> list = new LinkedHashSet<ULocale>(); 
-            List<UiListItem> expected = new ArrayList<UiListItem>(); 
-            for (String item : test[0]) { 
-                list.add(new ULocale(item)); 
-            } 
-            for (int i = 1; i < test.length; ++i) { 
-                String[] rawRow = test[i]; 
-                expected.add(new UiListItem(new ULocale(rawRow[2]), new ULocale(rawRow[3]), rawRow[0], rawRow[1])); 
-            } 
-            List<UiListItem> newList = names.getUiList(list, false, collator); 
-            if (!expected.equals(newList)) { 
-                if (expected.size() != newList.size()) { 
-                    errln(list.toString() + ": wrong size" + expected + ", " + newList); 
-                } else { 
-                    errln(list.toString()); 
-                    for (int i = 0; i < expected.size(); ++i) { 
-                        assertEquals(i+"", expected.get(i), newList.get(i)); 
-                    } 
-                } 
-            } else { 
-                assertEquals(list.toString(), expected, newList); 
-            } 
-        } 
-    } 
+        for (String[][] test : tests) {
+            Set<ULocale> list = new LinkedHashSet<ULocale>();
+            List<UiListItem> expected = new ArrayList<UiListItem>();
+            for (String item : test[0]) {
+                list.add(new ULocale(item));
+            }
+            for (int i = 1; i < test.length; ++i) {
+                String[] rawRow = test[i];
+                expected.add(new UiListItem(new ULocale(rawRow[2]), new ULocale(rawRow[3]), rawRow[0], rawRow[1]));
+            }
+            List<UiListItem> newList = names.getUiList(list, false, collator);
+            if (!expected.equals(newList)) {
+                if (expected.size() != newList.size()) {
+                    errln(list.toString() + ": wrong size" + expected + ", " + newList);
+                } else {
+                    errln(list.toString());
+                    for (int i = 0; i < expected.size(); ++i) {
+                        assertEquals(i+"", expected.get(i), newList.get(i));
+                    }
+                }
+            } else {
+                assertEquals(list.toString(), expected, newList);
+            }
+        }
+    }
 
     @Test
     public void TestIllformedLocale() {
-        ULocale french = ULocale.FRENCH; 
-        Collator collator = Collator.getInstance(french); 
-        LocaleDisplayNames names = LocaleDisplayNames.getInstance(french,  
-                DisplayContext.CAPITALIZATION_FOR_UI_LIST_OR_MENU); 
+        ULocale french = ULocale.FRENCH;
+        Collator collator = Collator.getInstance(french);
+        LocaleDisplayNames names = LocaleDisplayNames.getInstance(french,
+                DisplayContext.CAPITALIZATION_FOR_UI_LIST_OR_MENU);
         for (String malformed : Arrays.asList("en-a", "$", "ü--a", "en--US")) {
             try {
                 Set<ULocale> supported = Collections.singleton(new ULocale(malformed));
@@ -333,7 +339,7 @@ public class ULocaleCollationTest extends TestFmwk {
                 assertNull("Failed to detect bogus locale «" + malformed + "»", supported);
             } catch (IllformedLocaleException e) {
                 logln("Successfully detected ill-formed locale «" + malformed + "»:" + e.getMessage());
-            } 
+            }
         }
     }
 }
index be2ea8e80f073a3d3c3adbe2afefba56b5a5bfb7..e0ce5aeb2e8fe4d8f7425b21f8ea3c087cdf4eb5 100644 (file)
@@ -12,6 +12,8 @@ import java.io.BufferedReader;
 import java.io.IOException;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -24,6 +26,7 @@ import com.ibm.icu.text.BidiClassifier;
  * BiDi conformance test, using the Unicode BidiTest.txt and BidiCharacterTest.txt files.
  * Ported from ICU4C intltest/bidiconf.cpp .
  */
+@RunWith(JUnit4.class)
 public class BiDiConformanceTest extends TestFmwk {
     public BiDiConformanceTest() {}
 
index a5800a97d6257f239a4af90284fcf4793903c40b..1790c52d14b75c2d89cb6ee544d7c982cbac3a3e 100644 (file)
@@ -4,6 +4,8 @@
 package com.ibm.icu.dev.test.bidi;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UCharacter;
@@ -19,6 +21,7 @@ import com.ibm.icu.text.BidiTransform.Order;
  * @author Lina Kemmel
  *
  */
+@RunWith(JUnit4.class)
 public class TestBidiTransform extends TestFmwk {
 
     static final char LATN_ZERO         = '\u0030';
index 8dd71f19275533580aa722add2f907e71f5d06fd..46e57e366d59810d7538b847ccd15eda10eae39b 100644 (file)
@@ -14,6 +14,8 @@ package com.ibm.icu.dev.test.bigdec;
 import java.math.BigInteger;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -97,6 +99,7 @@ import com.ibm.icu.math.BigDecimal;
  * @author Mike Cowlishaw
  */
 
+@RunWith(JUnit4.class)
 public class DiagBigDecimalTest extends TestFmwk {
     private static final com.ibm.icu.math.BigDecimal zero = com.ibm.icu.math.BigDecimal.ZERO;
     private static final com.ibm.icu.math.BigDecimal one = com.ibm.icu.math.BigDecimal.ONE;
index 9e4664fde14760f12c1b4bbf755b7b7d855e8a84..7ae7c032057af0500a579dc98959baa28a6ecff2 100644 (file)
@@ -14,6 +14,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.CalendarAstronomer;
@@ -27,6 +29,7 @@ import com.ibm.icu.util.TimeZone;
 
 // TODO: try finding next new moon after  07/28/1984 16:00 GMT
 
+@RunWith(JUnit4.class)
 public class AstroTest extends TestFmwk {
     static final double PI = Math.PI;
 
@@ -350,7 +353,7 @@ public class AstroTest extends TestFmwk {
 //        astro.setDate(cal3.getTime());
 //        astro.foo();
     }
-    
+
     @Test
     public void TestMoonAge(){
         GregorianCalendar gc = new GregorianCalendar(new SimpleTimeZone(0,"GMT"));
@@ -363,7 +366,7 @@ public class AstroTest extends TestFmwk {
                 {2012, 5, 20, 14, 55, 59},
                 {2012, 5, 21, 7, 40, 40},
                 {2023, 9, 25, 10,00, 00},
-                {2008, 7, 7, 15, 00, 33}, 
+                {2008, 7, 7, 15, 00, 33},
                 {1832, 9, 24, 2, 33, 41 },
                 {2016, 1, 31, 23, 59, 59},
                 {2099, 5, 20, 14, 55, 59}
index 71ed611ef118b1f95ba4be6f65619b2402e462e9..e0ca7f7ffddca13e565291813bc4e98013c2a937 100644 (file)
@@ -23,6 +23,8 @@ import java.util.Locale;
 import java.util.MissingResourceException;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.text.NumberFormat;
@@ -43,6 +45,7 @@ import com.ibm.icu.util.ULocale;
  * 4145158 4145983 4147269 4149677 4162587 4165343 4166109 4167060 4173516
  * 4174361 4177484 4197699 4209071 4288792
  */
+@RunWith(JUnit4.class)
 public class CalendarRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
     static final String[] FIELD_NAME = {
             "ERA", "YEAR", "MONTH", "WEEK_OF_YEAR", "WEEK_OF_MONTH",
index 90d7bdef6ced40d7e389fa9bf9a131e411e5414d..de43dc2656a18137558c99eb7dd250e2e270c476 100644 (file)
@@ -27,7 +27,7 @@ import com.ibm.icu.util.SimpleTimeZone;
  * Defines various useful utility methods and constants
  */
 public class CalendarTestFmwk extends TestFmwk {
-    
+
     // Constants for use by subclasses, solely to save typing
     public final static int SUN = Calendar.SUNDAY;
     public final static int MON = Calendar.MONDAY;
@@ -49,7 +49,7 @@ public class CalendarTestFmwk extends TestFmwk {
     public final static int WOM     = Calendar.WEEK_OF_MONTH;
     public final static int DOW     = Calendar.DAY_OF_WEEK;
     public final static int DOWM    = Calendar.DAY_OF_WEEK_IN_MONTH;
-    
+
     public final static SimpleTimeZone UTC = new SimpleTimeZone(0, "GMT");
 
     private static final String[] FIELD_NAME = {
@@ -75,14 +75,14 @@ public class CalendarTestFmwk extends TestFmwk {
     protected void doTestCases(TestCase[] cases, Calendar cal)
     {
         cal.setTimeZone(UTC);
-        
+
         // Get a format to use for printing dates in the calendar system we're testing
         DateFormat format = DateFormat.getDateTimeInstance(cal, DateFormat.SHORT, -1, Locale.getDefault());
 
         final String pattern = (cal instanceof ChineseCalendar) ?
             "E MMl/dd/y G HH:mm:ss.S z" :
             "E, MM/dd/yyyy G HH:mm:ss.S z";
-    
+
         ((SimpleDateFormat)format).applyPattern(pattern);
 
         // This format is used for printing Gregorian dates.
@@ -93,13 +93,13 @@ public class CalendarTestFmwk extends TestFmwk {
         pureGreg.setGregorianChange(new Date(Long.MIN_VALUE));
         DateFormat pureGregFmt = new SimpleDateFormat("E M/d/yyyy G");
         pureGregFmt.setCalendar(pureGreg);
-        
+
         // Now iterate through the test cases and see what happens
         for (int i = 0; i < cases.length; i++)
         {
             logln("\ntest case: " + i);
             TestCase test = cases[i];
-            
+
             //
             // First we want to make sure that the millis -> fields calculation works
             // test.applyTime will call setTime() on the calendar object, and
@@ -116,7 +116,7 @@ public class CalendarTestFmwk extends TestFmwk {
 
             //
             // If that was OK, check the fields -> millis calculation
-            // test.applyFields will set all of the calendar's fields to 
+            // test.applyFields will set all of the calendar's fields to
             // match those in the test case.
             //
             cal.clear();
@@ -128,10 +128,10 @@ public class CalendarTestFmwk extends TestFmwk {
             }
         }
     }
-    
+
     static public final boolean ROLL = true;
     static public final boolean ADD = false;
-    
+
     /**
      * Process test cases for <code>add</code> and <code>roll</code> methods.
      * Each test case is an array of integers, as follows:
@@ -158,7 +158,7 @@ public class CalendarTestFmwk extends TestFmwk {
     protected void doRollAdd(boolean roll, Calendar cal, int[][] tests)
     {
         String name = roll ? "rolling" : "adding";
-        
+
         for (int i = 0; i < tests.length; i++) {
             int[] test = tests[i];
 
@@ -346,7 +346,7 @@ public class CalendarTestFmwk extends TestFmwk {
         int testTime = TestFmwk.getExhaustiveness() <= 5 ? -3 : -120; // in seconds
         doLimitsTest(cal, fieldsToTest, startDate, testTime);
     }
-    
+
     /**
      * Test the functions getMaximum/getGeratestMinimum logically correct.
      * This method assumes day of week cycle is consistent.
@@ -412,7 +412,7 @@ public class CalendarTestFmwk extends TestFmwk {
             errln("FAIL: Least maximum value of WEEK_OF_MONTH is incorrect: " + lmaxWOM + "/expected: " + expected);
         }
     }
-    
+
     /**
      * Convert year,month,day values to the form "year/month/day".
      * On input the month value is zero-based, but in the result string it is one-based.
index 62319fec9498b93b611714b758273f2a8cd8a45e..44529e488f4f01a16cbedb86129aef9ad18293c9 100644 (file)
@@ -10,6 +10,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.text.ChineseDateFormat;
 import com.ibm.icu.text.DateFormat;
@@ -63,6 +65,7 @@ import com.ibm.icu.util.ULocale;
  * Tue May 22 2096 = 4733-04*-01, Year 53, Cycle 79
  * Sun Mar 22 2099 = 4736-02*-01, Year 56, Cycle 79
  */
+@RunWith(JUnit4.class)
 public class ChineseTest extends CalendarTestFmwk {
     /**
      * Test basic mapping to and from Gregorian.
@@ -79,7 +82,7 @@ public class ChineseTest extends CalendarTestFmwk {
             1964,  9,  7,   4601,  8,0,  2,
             1961, 12, 25,   4598, 11,0, 18,
             1999,  6,  4,   4636,  4,0, 21,
-            
+
             1990,  5, 23,   4627,  4,0, 29,
             1990,  5, 24,   4627,  5,0,  1,
             1990,  6, 22,   4627,  5,0, 30,
@@ -205,7 +208,7 @@ public class ChineseTest extends CalendarTestFmwk {
             // ** Millis->fields gives 0-based month -1
             // These failures were fixed by changing the start search date
             // for the winter solstice from Dec 15 to Dec 1.
-            // 
+            //
             //                  Julian Day   Era  Year Month  Leap   DOM WkDay
             new ChineseTestCase(1507231.5,   35,   11,    6, false,   12,  SUN),
             new ChineseTestCase(1660037.5,   42,    9,   10, false,   27,  WED),
@@ -222,7 +225,7 @@ public class ChineseTest extends CalendarTestFmwk {
             new ChineseTestCase(2195261.5,   66,   35,    3, false,    9,  SUN), //*
             new ChineseTestCase(2229274.5,   68,    8,    5, false,    2,  SUN), //*
             new ChineseTestCase(2245580.5,   68,   53,    1, false,    8,  WED), //**
-            new ChineseTestCase(2266100.5,   69,   49,    3, false,    4,  SAT), 
+            new ChineseTestCase(2266100.5,   69,   49,    3, false,    4,  SAT),
             new ChineseTestCase(2288542.5,   70,   50,    8, false,    2,  SAT), //*
             new ChineseTestCase(2290901.5,   70,   57,    1, false,   29,  SAT), //*
             new ChineseTestCase(2323140.5,   72,   25,    4,  true,   20,  WED), //*
@@ -268,14 +271,14 @@ public class ChineseTest extends CalendarTestFmwk {
 
         java.util.Calendar tempcal = java.util.Calendar.getInstance();
         tempcal.clear();
-        
+
         Date[] DATA = new Date[2];
         tempcal.set(2001, Calendar.MAY, 22);
         DATA[0] = tempcal.getTime();
         tempcal.set(2001, Calendar.MAY, 23);
         DATA[1] = tempcal.getTime();
         // Wed May 23 2001 = Month 4(leap), Day 1, Year 18, Cycle 78
-        
+
         for (int i=0; i<DATA.length; ++i) {
             String s = fmt.format(DATA[i]);
             try {
@@ -315,14 +318,14 @@ public class ChineseTest extends CalendarTestFmwk {
             Calendar.DAY_OF_YEAR, 1,
             END,
             1,0,1, // Expect 1-1
-            
+
             // If we set MONTH only, that should be used
             Calendar.IS_LEAP_MONTH, 1,
             Calendar.DAY_OF_MONTH, 1,
             Calendar.MONTH, 3,
             END,
             4,1,1, // Expect 4*-1
-            
+
             // If we set the DOY last, that should take precedence
             Calendar.MONTH, 1, // Should ignore
             Calendar.IS_LEAP_MONTH, 1, // Should ignore
@@ -330,7 +333,7 @@ public class ChineseTest extends CalendarTestFmwk {
             Calendar.DAY_OF_YEAR, 121,
             END,
             4,1,2, // Expect 4*-2
-            
+
             // I've disabled this test because it doesn't work this way,
             // not even with a GregorianCalendar!  MONTH alone isn't enough
             // to supersede DAY_OF_YEAR.  Some other month-related field is
@@ -342,7 +345,7 @@ public class ChineseTest extends CalendarTestFmwk {
             //! Calendar.MONTH, 3,
             //! END,
             //! 4,1,1, // Expect 4*-1
-            
+
             // If we set IS_LEAP_MONTH last, that should take precedence
             Calendar.MONTH, 3,
             Calendar.DAY_OF_MONTH, 1,
@@ -448,7 +451,7 @@ public class ChineseTest extends CalendarTestFmwk {
             {  4638,   4,0,  30,   MONTH,   2,   4638,   5,0,  30 }, // no dom pin
             {  4638,   4,0,  30,   MONTH,   3,   4638,   6,0,  29 }, // dom should pin
         };
-       
+
         ChineseCalendar cal = new ChineseCalendar();
         doRollAdd(ADD, cal, tests);
     }
@@ -480,14 +483,14 @@ public class ChineseTest extends CalendarTestFmwk {
             {  4638,   4,0,  30,   MONTH,  15,   4638,   5,0,  30 }, // no dom pin
             {  4638,   4,0,  30,   MONTH, -10,   4638,   6,0,  29 }, // dom should pin
         };
-       
+
         ChineseCalendar cal = new ChineseCalendar();
         doRollAdd(ROLL, cal, tests);
     }
-    
+
     void doRollAdd(boolean roll, ChineseCalendar cal, int[][] tests) {
         String name = roll ? "rolling" : "adding";
-        
+
         for (int i = 0; i < tests.length; i++) {
             int[] test = tests[i];
 
@@ -601,11 +604,11 @@ public class ChineseTest extends CalendarTestFmwk {
                 errln("could not create ChineseCalendar with ULocale");
             }
         }
-        
+
 
         {
             // new ChineseCalendar(TimeZone)
-            ChineseCalendar cal = new ChineseCalendar(TimeZone.getDefault()); 
+            ChineseCalendar cal = new ChineseCalendar(TimeZone.getDefault());
             if(cal == null){
                 errln("could not create ChineseCalendar with TimeZone");
             }
@@ -689,7 +692,7 @@ public class ChineseTest extends CalendarTestFmwk {
         // if the chinese calendar current millis isn't called, the default year is wrong.
         // this test is assuming the 'year' is the current cycle
         // so when we cross a cycle boundary, the target will need to change
-        // that shouldn't be for awhile yet... 
+        // that shouldn't be for awhile yet...
 
         ChineseCalendar cc = new ChineseCalendar();
         cc.set(Calendar.YEAR, 22);
@@ -704,7 +707,7 @@ public class ChineseTest extends CalendarTestFmwk {
         cc.set(Calendar.MILLISECOND, 0);
 
         cc.add(Calendar.DATE, 1);
+
         Calendar cal = new GregorianCalendar(2005, Calendar.FEBRUARY, 28);
         Date target = cal.getTime();
         Date result = cc.getTime();
@@ -713,38 +716,38 @@ public class ChineseTest extends CalendarTestFmwk {
     }
 
     @Test
-    public void Test6510() 
-    { 
-        Calendar gregorianCalendar; 
-        ChineseCalendar chineseCalendar, chineseCalendar2; 
-        ChineseDateFormat dateFormat; 
-        SimpleDateFormat simpleDateFormat; 
-        simpleDateFormat = new com.ibm.icu.text.SimpleDateFormat("MM/dd/yyyy G 'at' HH:mm:ss vvvv", Locale.US); 
-        dateFormat = new com.ibm.icu.text.ChineseDateFormat("MM/dd/yyyy(G) HH:mm:ss", Locale.CHINA); 
-        // lunar to gregorian 
-        chineseCalendar = new ChineseCalendar(77, 26, Calendar.JANUARY, 0, 6, 0, 0, 0); 
+    public void Test6510()
+    {
+        Calendar gregorianCalendar;
+        ChineseCalendar chineseCalendar, chineseCalendar2;
+        ChineseDateFormat dateFormat;
+        SimpleDateFormat simpleDateFormat;
+
+        simpleDateFormat = new com.ibm.icu.text.SimpleDateFormat("MM/dd/yyyy G 'at' HH:mm:ss vvvv", Locale.US);
+        dateFormat = new com.ibm.icu.text.ChineseDateFormat("MM/dd/yyyy(G) HH:mm:ss", Locale.CHINA);
+
+        // lunar to gregorian
+        chineseCalendar = new ChineseCalendar(77, 26, Calendar.JANUARY, 0, 6, 0, 0, 0);
         // coverage
         assertEquals("equivalent ChineseCalendar() constructors", chineseCalendar,
                 new ChineseCalendar(77, 26, Calendar.JANUARY, 0, 6));
 
-        gregorianCalendar = Calendar.getInstance(Locale.US); 
-        gregorianCalendar.setTime(chineseCalendar.getTime()); 
-        // gregorian to lunar 
-        chineseCalendar2 = new ChineseCalendar(); 
-        chineseCalendar2.setTimeInMillis(gregorianCalendar.getTimeInMillis()); 
-
-        // validate roundtrip 
-        if (chineseCalendar.getTimeInMillis() != chineseCalendar2.getTimeInMillis()) 
-        { 
-            errln("time1: " + chineseCalendar.getTimeInMillis()); 
-            errln("time2: " + chineseCalendar2.getTimeInMillis()); 
-            errln("Lunar [MM/dd/y(G) HH:mm:ss] " + dateFormat.format(chineseCalendar)); 
-            errln("**PROBLEM Grego [MM/dd/y(G) HH:mm:ss] " + simpleDateFormat.format(gregorianCalendar)); 
-            errln("Grego [MM/dd/y(G) HH:mm:ss] " + simpleDateFormat.format(gregorianCalendar)); 
-            errln("Lunar [MM/dd/y(G) HH:mm:ss] " + dateFormat.format(chineseCalendar2)); 
-        } 
-    }         
+        gregorianCalendar = Calendar.getInstance(Locale.US);
+        gregorianCalendar.setTime(chineseCalendar.getTime());
+
+        // gregorian to lunar
+        chineseCalendar2 = new ChineseCalendar();
+        chineseCalendar2.setTimeInMillis(gregorianCalendar.getTimeInMillis());
+
+        // validate roundtrip
+        if (chineseCalendar.getTimeInMillis() != chineseCalendar2.getTimeInMillis())
+        {
+            errln("time1: " + chineseCalendar.getTimeInMillis());
+            errln("time2: " + chineseCalendar2.getTimeInMillis());
+            errln("Lunar [MM/dd/y(G) HH:mm:ss] " + dateFormat.format(chineseCalendar));
+            errln("**PROBLEM Grego [MM/dd/y(G) HH:mm:ss] " + simpleDateFormat.format(gregorianCalendar));
+            errln("Grego [MM/dd/y(G) HH:mm:ss] " + simpleDateFormat.format(gregorianCalendar));
+            errln("Lunar [MM/dd/y(G) HH:mm:ss] " + dateFormat.format(chineseCalendar2));
+        }
+    }
 }
index 06be9276aa695d885444d1c4c0b08d6cec50abdc..4f741f5e58385344b3d1c02ab580a80e9661e2eb 100644 (file)
@@ -9,8 +9,12 @@
 package com.ibm.icu.dev.test.calendar;
 import java.util.Date;
 
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 import com.ibm.icu.util.Calendar;
 
+@RunWith(JUnit4.class)
 public class ChineseTestCase extends TestCase {
 
     /**
@@ -34,7 +38,7 @@ public class ChineseTestCase extends TestCase {
                            boolean isLeapMonth, int dayOfMonth, int dayOfWeek) {
 
         setTime(new Date(JULIAN_EPOCH + (long)(ONE_DAY * julian)));
-        
+
         set(Calendar.ERA, era);
         set(Calendar.YEAR, year);
         set(Calendar.MONTH, month - 1);
@@ -46,6 +50,7 @@ public class ChineseTestCase extends TestCase {
     /**
      * Return a String representation of this test case's time.
      */
+    @Override
     public String toString() {
         return dowToString(get(Calendar.DAY_OF_WEEK)) +
             get(Calendar.YEAR) + "of" + get(Calendar.ERA) +
index 3d34ba8d2c61b170d9ce2c85a50dd533aad36976..7b4a808897fda2c315ab14c8c51afa518f38c958 100644 (file)
@@ -18,14 +18,18 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.util.Calendar;
 import com.ibm.icu.util.GregorianCalendar;
 import com.ibm.icu.util.SimpleTimeZone;
 import com.ibm.icu.util.TimeZone;
 
-public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class CompatibilityTest extends TestFmwk {
     static final String[] FIELD_NAME = {
         "ERA", "YEAR", "MONTH", "WEEK_OF_YEAR", "WEEK_OF_MONTH",
         "DAY_OF_MONTH", "DAY_OF_YEAR", "DAY_OF_WEEK",
@@ -40,12 +44,12 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
      */
     @Test
     public void TestGregorianChangeover() {
-    
+
         java.util.TimeZone jdkGMT = java.util.TimeZone.getTimeZone("GMT");
         java.util.Calendar jdkCal = java.util.Calendar.getInstance(jdkGMT);
         jdkCal.clear();
         jdkCal.set(1582, Calendar.OCTOBER, 15);
-        
+
 //      if(jdkCal instanceof java.util.GregorianCalendar) {
 //          logln("jdk IS grego");
 //          java.util.GregorianCalendar jdkgc = (java.util.GregorianCalendar)
@@ -170,7 +174,7 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
             final long ONE_DAY = 24*60*60*1000L;
             int[] DATA = {
                 // Julian#   Year  Month               DOM   JULIAN:Year, Month,       DOM
-                2440588,     1970, Calendar.JANUARY,   1,    1969, Calendar.DECEMBER,  19, 
+                2440588,     1970, Calendar.JANUARY,   1,    1969, Calendar.DECEMBER,  19,
                 2415080,     1900, Calendar.MARCH,     1,    1900, Calendar.FEBRUARY,  17,
                 2451604,     2000, Calendar.FEBRUARY,  29,   2000, Calendar.FEBRUARY,  16,
                 2452269,     2001, Calendar.DECEMBER,  25,   2001, Calendar.DECEMBER,  12,
@@ -208,7 +212,7 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
                 if (delta != 0 || year != year2 || month != month2 ||
                     dom != dom2) errln(s + " FAIL");
                 else logln(s);
-                
+
                 // Test Julian computation
                 year = DATA[i+4];
                 month = DATA[i+5];
@@ -274,7 +278,7 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
         int tzoffset = 123400;
 
         SimpleTimeZone zone = new SimpleTimeZone(tzoffset, tzid);
-        Calendar cal = (Calendar)Calendar.getInstance((SimpleTimeZone)zone.clone());
+        Calendar cal = Calendar.getInstance((SimpleTimeZone)zone.clone());
 
         if (!zone.equals(cal.getTimeZone())) errln("FAIL: Calendar.getTimeZone failed");
 
@@ -300,7 +304,7 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
             cal.after(cal2)) errln("FAIL: equals/before/after failed");
 
         // Roll back to January
-        cal.roll(Calendar.MONTH, (int)(1 + Calendar.DECEMBER - cal.get(Calendar.MONTH)));
+        cal.roll(Calendar.MONTH, 1 + Calendar.DECEMBER - cal.get(Calendar.MONTH));
         if (cal.equals(cal2) ||
             cal2.before(cal) ||
             cal.after(cal2)) errln("FAIL: equals/before/after failed");
@@ -786,7 +790,7 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
             public int getDay() { return day; }
             public int getHour() { return hour; }
         }
-        final TransitionItem[] transitionItems = { 
+        final TransitionItem[] transitionItems = {
             new TransitionItem( "America/Caracas", 2007, Calendar.DECEMBER,  8, 10 ), // day before change in ZONE_OFFSET
             new TransitionItem( "US/Pacific",      2011,    Calendar.MARCH, 12, 10 ), // day before change in DST_OFFSET
         };
@@ -1151,7 +1155,7 @@ public class CompatibilityTest extends com.ibm.icu.dev.test.TestFmwk {
         // jb4406 is probably not a bug, this is to document the behavior
         GregorianCalendar cal = new GregorianCalendar();
         final int MILLIS_IN_DAY = 1000 * 60 * 60 * 24;
-        
+
         logln("julian day value jumps at changeover");
         for (int day = 12; day < 18; ++day) {
             cal.set(1582, 9, day);
index ab95c60dbdd18429fbde7a47d930bf270f653118..d4a73b0e907047efbd5ee2320ae5fd8d4c2a6090 100644 (file)
@@ -12,6 +12,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.impl.LocaleUtility;
 import com.ibm.icu.text.DateFormat;
@@ -26,7 +28,8 @@ import com.ibm.icu.util.ULocale;
 /**
  * Tests for the <code>CopticCalendar</code> class.
  */
-public class CopticTest extends CalendarTestFmwk 
+@RunWith(JUnit4.class)
+public class CopticTest extends CalendarTestFmwk
 {
     /** Constants to save typing. */
     public static final int TOUT      = CopticCalendar.TOUT;
@@ -45,49 +48,49 @@ public class CopticTest extends CalendarTestFmwk
 
     /* Test dates from:
      * "The Amharic Letters of Emperor Theodore of Ethiopia to Queen Victoria and
-     * Her Special Envoy", David Appleyard, Girma Selasse Asfaw, Oxford University Press, 
+     * Her Special Envoy", David Appleyard, Girma Selasse Asfaw, Oxford University Press,
      * June 1 1979, ISBN: 0856726605, Longwood Pr Ltd
-     *  
+     *
      * Coptic         Gregorian    JD
-     * 20/02/1579     29/10/1862  2401443 
+     * 20/02/1579     29/10/1862  2401443
      * 29/10/1581     05/07/1865  2402423
      * 22/05/1582     29/01/1866  2402631
      * 10/08/1582     17/04/1866  2402709
      * 28/04/1583     05/01/1867  2402972
      * 05/05/1584     13/01/1868  2403345
-     * 
+     *
      * --------------------------------------------------
-     * 
+     *
      * From the Calendrica applet:  http://emr.cs.iit.edu/home/reingold/calendar-book/Calendrica.html
-     * 
+     *
      * Coptic         Gregorian    JD
      * 07/05/-284     01/01/0000  1721060
      * 08/05/-283     01/01/0001  1721426
      * 06/13/-1       29/08/0283  1824664
-     * 
+     *
      * 01/01/0000     30/08/0283  1824665
      * 01/01/0001     29/08/0284  1825030
      * 01/01/0002     29/08/0285  1825395
      * 01/01/0003     29/08/0286  1825760
      * 01/01/0004     30/08/0287  1826126
-     * 05/13/0000     28/08/0284  1825029 
+     * 05/13/0000     28/08/0284  1825029
      * 05/13/0001     28/08/0285  1825394
      * 05/13/0002     28/08/0286  1825759
      * 05/13/0003     28/08/0287  1826124
      * 06/13/0003     29/08/0287  1826125  first coptic leap year
      * 05/13/0004     28/08/0288  1826490
-     * 
+     *
      * 06/02/1299     13/10/1582  2299159
      * 07/02/1299     14/10/1582  2299160  Julian 04/10/1582
      * 08/02/1299     15/10/1582  2299161
      * 09/02/1299     16/10/1582  2299162
-     * 
+     *
      * 23/04/1616     01/01/1900  2415021
-     * 23/04/1721     01/01/2005  2453372 
+     * 23/04/1721     01/01/2005  2453372
      * 05/13/2000     12/09/2284  2555529
      */
 
-    
+
     /** A huge list of test cases to make sure that computeTime and computeFields
      * work properly for a wide range of data in the civil calendar.
      */
@@ -134,7 +137,7 @@ public class CopticTest extends CalendarTestFmwk
             new TestCase(2453371.5,  1,  1721,    4,  23,  SAT,    0,  0,  0), // Gregorian: 01/01/2005
             new TestCase(2555528.5,  1,  2000,   13,   5,  FRI,    0,  0,  0), // Gregorian: 12/09/2284
         };
-        
+
         CopticCalendar testCalendar = new CopticCalendar();
         testCalendar.setLenient(true);
         doTestCases(tests, testCalendar);
@@ -157,8 +160,8 @@ public class CopticTest extends CalendarTestFmwk
                           m == month &&
                           d == day)) {
                         errln("y: " + y +
-                              " m: " + m + 
-                              " d: " + d + 
+                              " m: " + m +
+                              " d: " + d +
                               " --> jd: " + jd +
                               " --> y: " + eyear +
                               " m: " + month +
@@ -194,13 +197,13 @@ public class CopticTest extends CalendarTestFmwk
         cal.set(1000, 0, 30);
         logln("1000/0/30-> " +
               cal.get(YEAR) + "/" +
-              cal.get(MONTH) + "/" + 
+              cal.get(MONTH) + "/" +
               cal.get(DATE));
         cal.clear();
         cal.set(1, 0, 30);
         logln("1/0/30 -> " +
               cal.get(YEAR) + "/" +
-              cal.get(MONTH) + "/" + 
+              cal.get(MONTH) + "/" +
               cal.get(DATE));
     }
 
@@ -238,19 +241,19 @@ public class CopticTest extends CalendarTestFmwk
 
                 int expected = (month != maxMonth) ? 30 : (isLeap ? 6 : 5);
                 if (maxDayOfMonth != expected) {
-                    errln("FAIL: Expected maximum " + expected + " days for month #" 
-                            + (month + 1) + " - returned:" + maxDayOfMonth); 
+                    errln("FAIL: Expected maximum " + expected + " days for month #"
+                            + (month + 1) + " - returned:" + maxDayOfMonth);
                 }
             }
         }
-    }    
+    }
 
     @Test
     public void TestCoverage() {
 
         {
             // new CopticCalendar(TimeZone)
-            CopticCalendar cal = new CopticCalendar(TimeZone.getDefault()); 
+            CopticCalendar cal = new CopticCalendar(TimeZone.getDefault());
             if(cal == null){
                 errln("could not create CopticCalendar with TimeZone");
             }
@@ -263,7 +266,7 @@ public class CopticTest extends CalendarTestFmwk
                 errln("could not create CopticCalendar with ULocale");
             }
         }
-        
+
         {
             // new CopticCalendar(Locale)
             CopticCalendar cal = new CopticCalendar(Locale.getDefault());
@@ -271,23 +274,23 @@ public class CopticTest extends CalendarTestFmwk
                 errln("could not create CopticCalendar with Locale");
             }
         }
-        
-        {                                                                                       
-            // new CopticCalendar(TimeZone, Locale)                                             
-            CopticCalendar cal = new CopticCalendar(TimeZone.getDefault(),Locale.getDefault()); 
-            if(cal == null){                                                                    
-                errln("could not create CopticCalendar with TimeZone, Locale");                 
-            }                                                                                   
-        }                                                                                       
-                                                                                                
-        {                                                                                       
-            // new CopticCalendar(TimeZone, ULocale)                                            
+
+        {
+            // new CopticCalendar(TimeZone, Locale)
+            CopticCalendar cal = new CopticCalendar(TimeZone.getDefault(),Locale.getDefault());
+            if(cal == null){
+                errln("could not create CopticCalendar with TimeZone, Locale");
+            }
+        }
+
+        {
+            // new CopticCalendar(TimeZone, ULocale)
             CopticCalendar cal = new CopticCalendar(TimeZone.getDefault(),ULocale.getDefault());
-            if(cal == null){                                                                    
-                errln("could not create CopticCalendar with TimeZone, ULocale");                
-            }                                                                                   
-        }                                                                                       
-        
+            if(cal == null){
+                errln("could not create CopticCalendar with TimeZone, ULocale");
+            }
+        }
+
         {
             // new CopticCalendar(Date)
             CopticCalendar cal = new CopticCalendar(new Date());
@@ -311,7 +314,7 @@ public class CopticTest extends CalendarTestFmwk
                 errln("could not create CopticCalendar with year,month,date,hour,minute,second");
             }
         }
-    
+
         {
             // data
             CopticCalendar cal = new CopticCalendar(1997, CopticCalendar.TOUT, 1);
@@ -420,7 +423,7 @@ public class CopticTest extends CalendarTestFmwk
             int endMonth = testCalendar.get(Calendar.MONTH);
             int endDay = testCalendar.get(Calendar.DATE);
             if ( endYear != item.getEndYear() || endMonth != item.getEndMonth() || endDay != item.getEndDay() ) {
-                errln("CToJD FAILS: field " + item.getField() + " delta " + item.getDelta() + 
+                errln("CToJD FAILS: field " + item.getField() + " delta " + item.getDelta() +
                             " expected yr " + item.getEndYear() + " mo " + item.getEndMonth() +  " da " + item.getEndDay() +
                             " got yr " + endYear + " mo " + endMonth +  " da " + endDay);
             }
index 2941dc7aa8a0941d12d9e2f9de2b91ac148b6748..3b696e0b51d4d229eeaa74baaf73db4c42379fd6 100644 (file)
@@ -10,6 +10,8 @@ package com.ibm.icu.dev.test.calendar;
 import java.util.Date;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.util.Calendar;
@@ -18,6 +20,7 @@ import com.ibm.icu.util.GregorianCalendar;
 import com.ibm.icu.util.TimeZone;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class DangiTest extends CalendarTestFmwk {
     /**
      * Test basic mapping to and from Gregorian.
@@ -33,7 +36,7 @@ public class DangiTest extends CalendarTestFmwk {
             1964,  9,  7,   4297,  8,0,  2,
             1961, 12, 25,   4294, 11,0, 18,
             1999,  6,  4,   4332,  4,0, 21,
-            
+
             1990,  5, 23,   4323,  4,0, 29,
             1990,  5, 24,   4323,  5,0,  1,
             1990,  6, 22,   4323,  5,0, 30,
@@ -190,14 +193,14 @@ public class DangiTest extends CalendarTestFmwk {
             Calendar.DAY_OF_YEAR, 1,
             END,
             1,0,1, // Expect 1-1
-            
+
             // If we set MONTH only, that should be used
             Calendar.IS_LEAP_MONTH, 1,
             Calendar.DAY_OF_MONTH, 1,
             Calendar.MONTH, 3,
             END,
             4,1,1, // Expect 4*-1
-            
+
             // If we set the DOY last, that should take precedence
             Calendar.MONTH, 1, // Should ignore
             Calendar.IS_LEAP_MONTH, 1, // Should ignore
@@ -205,7 +208,7 @@ public class DangiTest extends CalendarTestFmwk {
             Calendar.DAY_OF_YEAR, 121,
             END,
             4,1,2, // Expect 4*-2
-            
+
             // If we set IS_LEAP_MONTH last, that should take precedence
             Calendar.MONTH, 3,
             Calendar.DAY_OF_MONTH, 1,
@@ -309,7 +312,7 @@ public class DangiTest extends CalendarTestFmwk {
             {  4334,   3,0,  30,   MONTH,   3,   4334,   5,0,  30 }, // no dom pin
             {  4334,   3,0,  30,   MONTH,   4,   4334,   6,0,  29 }, // dom should pin
         };
-       
+
         Calendar cal = Calendar.getInstance(new ULocale("ko_KR@calendar=dangi"));
         doRollAddDangi(ADD, cal, tests);
     }
@@ -341,11 +344,11 @@ public class DangiTest extends CalendarTestFmwk {
             {  4334,   3,0,  30,   MONTH,  16,   4334,   5,0,  30 }, // no dom pin
             {  4334,   3,0,  30,   MONTH,  -9,   4334,   6,0,  29 }, // dom should pin
         };
-       
+
         Calendar cal = Calendar.getInstance(new ULocale("ko_KR@calendar=dangi"));
         doRollAddDangi(ROLL, cal, tests);
     }
-    
+
     void doRollAddDangi(boolean roll, Calendar cal, int[][] tests) {
         String name = roll ? "rolling" : "adding";
 
@@ -410,7 +413,7 @@ public class DangiTest extends CalendarTestFmwk {
         // If the chinese calendar current millis isn't called, the default year is wrong.
         // this test is assuming the 'year' is the current cycle
         // so when we cross a cycle boundary, the target will need to change
-        // that shouldn't be for awhile yet... 
+        // that shouldn't be for awhile yet...
 
         Calendar cc = Calendar.getInstance(new ULocale("ko_KR@calendar=dangi"));
         cc.set(Calendar.EXTENDED_YEAR, 4338);
@@ -425,7 +428,7 @@ public class DangiTest extends CalendarTestFmwk {
         cc.set(Calendar.MILLISECOND, 0);
 
         cc.add(Calendar.DATE, 1);
+
         Calendar cal = new GregorianCalendar(2005, Calendar.FEBRUARY, 28);
         Date target = cal.getTime();
         Date result = cc.getTime();
index ecdb9e36f5fe718abb9caf034ae1a6f9de8bf550..2544a4962807f42d154b610dbdf3adb0b8c83c11 100644 (file)
@@ -12,6 +12,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.impl.LocaleUtility;
 import com.ibm.icu.text.DateFormat;
@@ -25,7 +27,8 @@ import com.ibm.icu.util.ULocale;
 /**
  * Tests for the <code>EthiopicCalendar</code> class.
  */
-public class EthiopicTest extends CalendarTestFmwk 
+@RunWith(JUnit4.class)
+public class EthiopicTest extends CalendarTestFmwk
 {
     /** Constants to save typing. */
     public static final int MESKEREM = EthiopicCalendar.MESKEREM;
@@ -42,13 +45,13 @@ public class EthiopicTest extends CalendarTestFmwk
     public static final int NEHASSE  = EthiopicCalendar.NEHASSE;
     public static final int PAGUMEN  = EthiopicCalendar.PAGUMEN;
 
-    /* DY[20050507]  I don't know what this is for yet: 
+    /* DY[20050507]  I don't know what this is for yet:
     @Test
     public void TestRoll() {
        int[][] tests = new int[][] {
        //       input                roll by          output
        //  year  month     day     field amount    year  month     day
-    
+
        {   0001, QIDAH,     2,     MONTH,   1,     0001, HIJJAH,    2 },   // non-leap years
        {   0001, QIDAH,     2,     MONTH,   2,     0001, MUHARRAM,  2 },
        {   0001, QIDAH,     2,     MONTH,  -1,     0001, SHAWWAL,   2 },
@@ -62,7 +65,7 @@ public class EthiopicTest extends CalendarTestFmwk
        {   0001, MUHARRAM, 30,     MONTH,   1,     0001, SAFAR,    29 },
        {   0002, HIJJAH,   30,     YEAR,   -1,     0001, HIJJAH,   29 },
        };
-       
+
        EthiopicCalendar cal = newCivil();
 
        doRollAdd(ROLL, cal, tests);
@@ -71,9 +74,9 @@ public class EthiopicTest extends CalendarTestFmwk
 
     /* Test dates from:
      * "The Amharic Letters of Emperor Theodore of Ethiopia to Queen Victoria and
-     * Her Special Envoy", David Appleyard, Girma Selasse Asfaw, Oxford University Press, 
+     * Her Special Envoy", David Appleyard, Girma Selasse Asfaw, Oxford University Press,
      * June 1 1979, ISBN: 0856726605, Longwood Pr Ltd
-     *  
+     *
      * Ethiopic       Gregorian    JD
      * 20/02/1855     29/10/1862  2401443
      * 29/10/1857     05/07/1865  2402423
@@ -81,16 +84,16 @@ public class EthiopicTest extends CalendarTestFmwk
      * 10/08/1858     17/04/1866  2402709
      * 28/04/1859     05/01/1867  2402972
      * 05/05/1860     13/01/1868  2403345
-     * 
+     *
      * --------------------------------------------------
-     * 
+     *
      * From the Calendrica applet:  http://emr.cs.iit.edu/home/reingold/calendar-book/Calendrica.html
-     * 
+     *
      * Ethiopic       Gregorian    JD
      * 07/05/-8       01/01/0000  1721060
      * 08/05/-7       01/01/0001  1721426
      * 06/13/-1       27/08/0007  1723855
-     * 
+     *
      * 01/01/0000     28/08/0007  1723856
      * 01/01/0001     27/08/0008  1724221
      * 01/01/0002     27/08/0009  1724586
@@ -102,17 +105,17 @@ public class EthiopicTest extends CalendarTestFmwk
      * 05/13/0003     26/08/0011  1725315
      * 06/13/0003     27/08/0011  1725316  first ethiopian leap year
      * 05/13/0004     26/08/0012  1725561
-     * 
+     *
      * 06/02/1575     13/10/1582  2299159
      * 07/02/1575     14/10/1582  2299160  Julian 04/10/1582
      * 08/02/1575     15/10/1582  2299161
      * 09/02/1575     16/10/1582  2299162
-     * 
+     *
      * 23/04/1892     01/01/1900  2415021
      * 23/04/1997     01/01/2005  2453372
      * 05/13/2000     10/09/2008  2454720
      */
-    
+
     /** A huge list of test cases to make sure that computeTime and computeFields
      * work properly for a wide range of data in the civil calendar.
      */
@@ -134,7 +137,7 @@ public class EthiopicTest extends CalendarTestFmwk
             new TestCase(2402708.5,  1,  1858,    8,  10,  TUE,   0,  0,  0), // Gregorian: 17/04/1866
             new TestCase(2402971.5,  1,  1859,    4,  28,  SAT,   0,  0,  0), // Gregorian: 05/01/1867
             new TestCase(2403344.5,  1,  1860,    5,   5,  MON,   0,  0,  0), // Gregorian: 13/01/1868
-                        
+
             // Miscellaneous:
             /* Skip these tests until JD bug fixed in the Gregorian calendar:
              * http://www.jtcsv.com/cgibin/icu-bugs/incoming?id=4406;page=2;user=guest
@@ -157,7 +160,7 @@ public class EthiopicTest extends CalendarTestFmwk
             new TestCase(1725315.5,  1,     3,   13,   6,  SAT,   0,  0,  0), // Gregorian: 27/08/0011 - first ethiopic leap year
             // new TestCase(1725560.5,  1,     4,   13,   5,  SUN,   0,  0,  0), // Gregorian: 26/08/0012 - dlf
             new TestCase(1725680.5,  1,     4,   13,   5,  SUN,   0,  0,  0), // Gregorian: 26/08/0012
-            new TestCase(2299158.5,  1,  1575,    2,   6,  WED,   0,  0,  0), // Gregorian: 13/10/1582  
+            new TestCase(2299158.5,  1,  1575,    2,   6,  WED,   0,  0,  0), // Gregorian: 13/10/1582
             new TestCase(2299159.5,  1,  1575,    2,   7,  THU,   0,  0,  0), // Gregorian: 14/10/1582  Julian 04/10/1582
 
             new TestCase(2299160.5,  1,  1575,    2,   8,  FRI,   0,  0,  0), // Gregorian: 15/10/1582
@@ -183,7 +186,7 @@ public class EthiopicTest extends CalendarTestFmwk
                 new TestCase(2402708.5,  0,  7358,    8,  10,  TUE,   0,  0,  0), // Gregorian: 17/04/1866
                 new TestCase(2402971.5,  0,  7359,    4,  28,  SAT,   0,  0,  0), // Gregorian: 05/01/1867
                 new TestCase(2403344.5,  0,  7360,    5,   5,  MON,   0,  0,  0), // Gregorian: 13/01/1868
-                            
+
                 // Miscellaneous:
                 /* Skip these tests until JD bug fixed in the Gregorian calendar:
                  * http://www.jtcsv.com/cgibin/icu-bugs/incoming?id=4406;page=2;user=guest
@@ -206,7 +209,7 @@ public class EthiopicTest extends CalendarTestFmwk
                 new TestCase(1725315.5,  0,  5503,   13,   6,  SAT,   0,  0,  0), // Gregorian: 27/08/0011 - first ethiopic leap year
                 // new TestCase(1725560.5,  0,  5504,   13,   5,  SUN,   0,  0,  0), // Gregorian: 26/08/0012 - dlf
                 new TestCase(1725680.5,  0,  5504,   13,   5,  SUN,   0,  0,  0), // Gregorian: 26/08/0012
-                new TestCase(2299158.5,  0,  7075,    2,   6,  WED,   0,  0,  0), // Gregorian: 13/10/1582  
+                new TestCase(2299158.5,  0,  7075,    2,   6,  WED,   0,  0,  0), // Gregorian: 13/10/1582
                 new TestCase(2299159.5,  0,  7075,    2,   7,  THU,   0,  0,  0), // Gregorian: 14/10/1582  Julian 04/10/1582
 
                 new TestCase(2299160.5,  0,  7075,    2,   8,  FRI,   0,  0,  0), // Gregorian: 15/10/1582
@@ -244,11 +247,11 @@ public class EthiopicTest extends CalendarTestFmwk
         assertEquals("Ethiopic Date", "Tue Jan 01, 5500 BC", fmt.format(cal));
 
         // The gregorian calendar gets off by two days when
-        // the date gets low, unless the gregorian changeover is set to 
+        // the date gets low, unless the gregorian changeover is set to
         // very early.  The funny thing is, it's ok for dates in the year
         // 283, but not in the year 7, and it claims to be ok until the year 4.
         // should track down when the dates start to differ...
-        
+
         GregorianCalendar gc = new GregorianCalendar();
         gc.setGregorianChange(new Date(Long.MIN_VALUE)); // act like proleptic Gregorian
         gc.setTime(cal.getTime());
@@ -263,16 +266,16 @@ public class EthiopicTest extends CalendarTestFmwk
         cal.set(1000, 0, 30);
         logln("1000/0/30-> " +
               cal.get(YEAR) + "/" +
-              cal.get(MONTH) + "/" + 
+              cal.get(MONTH) + "/" +
               cal.get(DATE));
         cal.clear();
         cal.set(1, 0, 30);
         logln("1/0/30 -> " +
               cal.get(YEAR) + "/" +
-              cal.get(MONTH) + "/" + 
+              cal.get(MONTH) + "/" +
               cal.get(DATE));
     }
-    
+
     @Test
     public void TestJD(){
         int jd = EthiopicCalendar.EthiopicToJD(1567,8,9);
@@ -300,13 +303,13 @@ public class EthiopicTest extends CalendarTestFmwk
         doTheoreticalLimitsTest(ethiopic, true);
     }
 
-    
+
     @Test
     public void TestCoverage() {
 
         {
             // new EthiopicCalendar(TimeZone)
-            EthiopicCalendar cal = new EthiopicCalendar(TimeZone.getDefault()); 
+            EthiopicCalendar cal = new EthiopicCalendar(TimeZone.getDefault());
             if(cal == null){
                 errln("could not create EthiopicCalendar with TimeZone");
             }
@@ -319,7 +322,7 @@ public class EthiopicTest extends CalendarTestFmwk
                 errln("could not create EthiopicCalendar with ULocale");
             }
         }
-        
+
         {
             // new EthiopicCalendar(Locale)
             EthiopicCalendar cal = new EthiopicCalendar(Locale.getDefault());
@@ -343,7 +346,7 @@ public class EthiopicTest extends CalendarTestFmwk
                 errln("could not create EthiopicCalendar with TimeZone,ULocale");
             }
         }
-        
+
         {
             // new EthiopicCalendar(Date)
             EthiopicCalendar cal = new EthiopicCalendar(new Date());
@@ -393,7 +396,7 @@ public class EthiopicTest extends CalendarTestFmwk
 
             logln(cal.getTime().toString());
         }
-    
+
         {
             // data
             EthiopicCalendar cal = new EthiopicCalendar(1997, EthiopicCalendar.MESKEREM, 1);
@@ -420,7 +423,7 @@ public class EthiopicTest extends CalendarTestFmwk
             }
         }
     }
-    
+
     private static EthiopicCalendar newAmeteAlemEraCalendar() {
         EthiopicCalendar alemawiCalendar = new EthiopicCalendar();
         alemawiCalendar.setAmeteAlemEra(true);
@@ -477,7 +480,7 @@ public class EthiopicTest extends CalendarTestFmwk
             int endMonth = testCalendar.get(Calendar.MONTH);
             int endDay = testCalendar.get(Calendar.DATE);
             if ( endYear != item.getEndYear() || endMonth != item.getEndMonth() || endDay != item.getEndDay() ) {
-                errln("EToJD FAILS: field " + item.getField() + " delta " + item.getDelta() + 
+                errln("EToJD FAILS: field " + item.getField() + " delta " + item.getDelta() +
                             " expected yr " + item.getEndYear() + " mo " + item.getEndMonth() +  " da " + item.getEndDay() +
                             " got yr " + endYear + " mo " + endMonth +  " da " + endDay);
             }
index 2febd3aa98cf8b3d7efc71ce8d45b0e89b810ef7..6507fa27ca343e7a78db44256b5d772b9f500fd3 100644 (file)
@@ -13,6 +13,8 @@ import java.util.Locale;
 import java.util.MissingResourceException;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.impl.LocaleUtility;
 import com.ibm.icu.text.DateFormat;
@@ -24,6 +26,7 @@ import com.ibm.icu.util.ULocale;
 /**
  * Tests for the <code>HebrewCalendar</code> class.
  */
+@RunWith(JUnit4.class)
 public class HebrewTest extends CalendarTestFmwk {
     // Constants to save typing.
     public static final int TISHRI  = HebrewCalendar.TISHRI;
@@ -50,7 +53,7 @@ public class HebrewTest extends CalendarTestFmwk {
         int[][] tests = new int[][] {
             //       input                roll by          output
             //  year  month     day     field amount    year  month     day
-    
+
             {   5759, HESHVAN,   2,     MONTH,   1,     5759, KISLEV,    2 },   // non-leap years
             {   5759, SHEVAT,    2,     MONTH,   1,     5759, ADAR,      2 },
             {   5759, SHEVAT,    2,     MONTH,   2,     5759, NISAN,     2 },
@@ -64,13 +67,13 @@ public class HebrewTest extends CalendarTestFmwk {
             {   5757, SHEVAT,    2,     MONTH,  12,     5757, TEVET,     2 },
             {   5757, SHEVAT,    2,     MONTH,  13,     5757, SHEVAT,    2 },
             {   5757, AV,        1,     MONTH,  12,     5757, TAMUZ,     1 }, // Alan
-            
+
             {   5757, KISLEV,    1,     DATE,   30,     5757, KISLEV,    2 },   // 29-day month
             {   5758, KISLEV,    1,     DATE,   31,     5758, KISLEV,    2 },   // 30-day month
-            
+
             // Try some other fields too
             {   5757, TISHRI,    1,     YEAR,    1,     5758, TISHRI,    1 },
-   
+
 
             // Try some rolls that require other fields to be adjusted
             {   5757, TISHRI,   30,     MONTH,   1,     5757, HESHVAN,  29 },
@@ -78,13 +81,13 @@ public class HebrewTest extends CalendarTestFmwk {
         };
 //        try{
             HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault());
-    
+
             doRollAdd(ROLL, cal, tests);
  //       }catch(MissingResourceException ex){
 //            warnln("Got Exception: "+ ex.getMessage());
  //       }
     }
-    
+
     /**
      * Test the behavior of HebrewCalendar.roll
      * The only real nastiness with roll is the MONTH field, since a year can
@@ -106,18 +109,18 @@ public class HebrewTest extends CalendarTestFmwk {
             {   5757, SHEVAT,    2,     MONTH,   3,     5757, NISAN,     2 },
             {   5757, SHEVAT,    2,     MONTH,  12,     5758, TEVET,     2 },
             {   5757, SHEVAT,    2,     MONTH,  13,     5758, SHEVAT,    2 },
-            
+
             {   5762, AV,        1,     MONTH,   1,     5762, ELUL,      1 },   // JB#2327
             {   5762, AV,       30,     DATE,    1,     5762, ELUL,      1 },   // JB#2327
             {   5762, ELUL,      1,     DATE,   -1,     5762, AV,       30 },   // JB#2327
             {   5762, ELUL,      1,     MONTH,  -1,     5762, AV,        1 },   // JB#2327
-            
+
             {   5757, KISLEV,    1,     DATE,   30,     5757, TEVET,     2 },   // 29-day month
             {   5758, KISLEV,    1,     DATE,   31,     5758, TEVET,     2 },   // 30-day month
         };
         try{
             HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault());
-    
+
             doRollAdd(ADD, cal, tests);
         }catch( MissingResourceException ex){
             warnln("Could not load the locale data");
@@ -208,8 +211,8 @@ public class HebrewTest extends CalendarTestFmwk {
                     new TestCase(2459464.5,  0,  5782,    1,   1,  TUE,   0,  0,  0),
                     new TestCase(2467142.5,  0,  5803,    1,   1,  MON,   0,  0,  0),
                     new TestCase(2455448.5,  0,  5771,    1,   1,  THU,   0,  0,  0),
-                
-                    // Test cases for JB#2327        
+
+                    // Test cases for JB#2327
                     // http://www.fourmilab.com/documents/calendar/
                     // http://www.calendarhome.com/converter/
 //                2452465.5, 2002, JULY, 10, 5762, AV, 1,
@@ -225,7 +228,7 @@ public class HebrewTest extends CalendarTestFmwk {
                     new TestCase(2452524.5,  0,  5763,TISHRI+1,  1,  SAT,   0,  0,  0),
                 };
                 doTestCases(testCases, new HebrewCalendar());
-   
+
         }catch(MissingResourceException ex){
             warnln("Got Exception: "+ ex.getMessage());
         }
@@ -265,14 +268,14 @@ public class HebrewTest extends CalendarTestFmwk {
                 // I hope that year = 0 does not exists
                 // because the test fails for it !
                 cal.clear();
-                
+
                 cal.set(Calendar.YEAR, year);
                 cal.set(Calendar.MONTH, ELUL);
                 cal.set(Calendar.DAY_OF_MONTH, 1);
-                
+
                 int yact = cal.get(Calendar.YEAR);
                 int mact = cal.get(Calendar.MONTH);
-                
+
                 if (year != yact || ELUL != mact) {
                     errln("Fail: " + ELUL + "/" + year +
                           " -> " +
@@ -281,9 +284,9 @@ public class HebrewTest extends CalendarTestFmwk {
             }
         }catch(MissingResourceException ex){
             warnln("Got Exception: "+ ex.getMessage());
-        }   
+        }
     }
-    
+
     /**
      * Test of the behavior of the month field.  This requires special
      * handling in the Hebrew calendar because of the pattern of leap
@@ -298,7 +301,7 @@ public class HebrewTest extends CalendarTestFmwk {
             // We can't test complete() on some lines below because of ADAR_1 -- if
             // the calendar is set to ADAR_1 on a non-leap year, the result is undefined.
             int[] DATA = {
-                // m1/y1 - month/year before (month is 1-based) 
+                // m1/y1 - month/year before (month is 1-based)
                 // delta - amount to add to month field
                 // m2/y2 - month/year after add(MONTH, delta)
                 // m3/y3 - month/year after set(MONTH, m1+delta)
@@ -319,7 +322,7 @@ public class HebrewTest extends CalendarTestFmwk {
                 int m2 = DATA[i++], y2 = DATA[i++];
                 int m3 = DATA[i++], y3 = DATA[i++];
                 int mact, yact;
-    
+
                 cal.clear();
                 cal.set(Calendar.YEAR, y);
                 cal.set(Calendar.MONTH, m-1);
@@ -341,7 +344,7 @@ public class HebrewTest extends CalendarTestFmwk {
                               (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.YEAR));
                     }
                 }
-                
+
                 cal.clear();
                 cal.set(Calendar.YEAR, y);
                 cal.set(Calendar.MONTH, m + monthDelta - 1);
@@ -415,7 +418,7 @@ public class HebrewTest extends CalendarTestFmwk {
                     errln("could not create HebrewCalendar with TimeZone");
                 }
             }
-    
+
             {
                 // new HebrewCalendar(ULocale)
                 HebrewCalendar cal = new HebrewCalendar(ULocale.getDefault());
@@ -423,7 +426,7 @@ public class HebrewTest extends CalendarTestFmwk {
                     errln("could not create HebrewCalendar with ULocale");
                 }
             }
-                
+
             {
                 // new HebrewCalendar(Locale)
                 HebrewCalendar cal = new HebrewCalendar(Locale.getDefault());
@@ -431,7 +434,7 @@ public class HebrewTest extends CalendarTestFmwk {
                     errln("could not create HebrewCalendar with locale");
                 }
             }
-        
+
             {
                 // new HebrewCalendar(Date)
                 HebrewCalendar cal = new HebrewCalendar(new Date());
@@ -439,16 +442,16 @@ public class HebrewTest extends CalendarTestFmwk {
                     errln("could not create HebrewCalendar with date");
                 }
             }
-        
+
             {
                 // data
                 HebrewCalendar cal = new HebrewCalendar(2800, HebrewCalendar.SHEVAT, 1);
                 Date time = cal.getTime();
-        
+
                 String[] calendarLocales = {
                 "iw_IL"
                 };
-        
+
                 String[] formatLocales = {
                 "en", "fi", "fr", "hu", "iw", "nl"
                 };
@@ -456,7 +459,7 @@ public class HebrewTest extends CalendarTestFmwk {
                     String calLocName = calendarLocales[i];
                     Locale calLocale = LocaleUtility.getLocaleFromName(calLocName);
                     cal = new HebrewCalendar(calLocale);
-            
+
                     for (int j = 0; j < formatLocales.length; ++j) {
                         String locName = formatLocales[j];
                         Locale formatLocale = LocaleUtility.getLocaleFromName(locName);
@@ -476,7 +479,7 @@ public class HebrewTest extends CalendarTestFmwk {
         HebrewCalendar hc = new HebrewCalendar (5742, HebrewCalendar.AV, 22);
         DateFormat df = hc.getDateTimeFormat(DateFormat.FULL, DateFormat.FULL, Locale.getDefault());
         String dateString = df.format(hc.getTime());
-     
+
         for (int year = 5600; year < 5800; year ++) {
             boolean leapYear = HebrewCalendar.isLeapYear (year);
             for (int month = HebrewCalendar.TISHRI; month <= HebrewCalendar.ELUL;month++) {
@@ -506,7 +509,7 @@ public class HebrewTest extends CalendarTestFmwk {
                     break;
                 }
             }
-        }       
+        }
     }
 
     // Test case for Ticket#10313. HebrewCalendar requires
index f8db0fe32927836fac12cacdb3052455b16d4e12..ac1425eaead130e2859be6db2697db953b9369fd 100644 (file)
@@ -13,6 +13,8 @@ import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.LocaleUtility;
@@ -29,6 +31,7 @@ import com.ibm.icu.util.ULocale;
 /**
  * Tests for the <code>Holiday</code> class.
  */
+@RunWith(JUnit4.class)
 public class HolidayTest extends TestFmwk {
     @Before
     public void init() throws Exception {
@@ -38,7 +41,7 @@ public class HolidayTest extends TestFmwk {
             now = new Date();
         }
     }
-    
+
     private Calendar cal;
     private Date longTimeAgo;
     private Date now;
@@ -135,8 +138,8 @@ public class HolidayTest extends TestFmwk {
         //        logln("rule: " + h.getRule().toString());
 
         //        h.setRule(h.getRule());
-        
-        
+
+
         logln("HolidayCalendarDemo test");
         {
             final Calendar c = Calendar.getInstance(TimeZone.GMT_ZONE); // Temporary copy
@@ -253,7 +256,7 @@ public class HolidayTest extends TestFmwk {
         logln("first between " + abd + " and " + xbd + " is " + rdr.firstBetween(abd, xbd));
         logln("first between " + abd + " and " + null + " is " + rdr.firstBetween(abd, null));
         logln("first between " + xbd + " and " + null + " is " + rdr.firstBetween(xbd, null));
-        
+
         //getRule, setRule
         logln("The rule in the holiday: " + h[1].getRule());
         exerciseHoliday(h[1], Locale.getDefault());
@@ -264,16 +267,16 @@ public class HolidayTest extends TestFmwk {
         }
         exerciseHoliday(h[1], Locale.getDefault());
     }
-    
+
     @Test
-    public void TestEaster(){        
+    public void TestEaster(){
         // Verify that Easter is working. Should be April 20, 2014
         final Holiday h = new EasterHoliday("Easter Sunday");
         final Date beginApril = getDate(2014, Calendar.APRIL, 1);
         final Date endApril   = getDate(2014, Calendar.APRIL, 30);
         final Date expect     = getDate(2014, Calendar.APRIL, 20);
         final Date actual     = h.firstBetween(beginApril, endApril);
-        
+
         if(actual == null) {
             errln("Error: Easter 2014 should be on " + expect + " but got null.");
         } else {
@@ -289,13 +292,13 @@ public class HolidayTest extends TestFmwk {
     public void TestIsOn() {
         // jb 1901
         SimpleHoliday sh = new SimpleHoliday(Calendar.AUGUST, 15, "Doug's Day", 1958, 2058);
-        
+
         Calendar gcal = new GregorianCalendar();
         gcal.clear();
         gcal.set(Calendar.YEAR, 2000);
         gcal.set(Calendar.MONTH, Calendar.AUGUST);
         gcal.set(Calendar.DAY_OF_MONTH, 15);
-        
+
         Date d0 = gcal.getTime();
         gcal.add(Calendar.SECOND, 1);
         Date d1 = gcal.getTime();
@@ -329,7 +332,7 @@ public class HolidayTest extends TestFmwk {
             logln("firstAfter: " + h);
         }
     }
-    
+
     @Test
     public void TestDisplayName() {
         Holiday[] holidays = Holiday.getHolidays(ULocale.US);
index c2a839c22bc85c4924019a50ca55a1e7ae32a6a8..5b13c49473df421ef22763b7a155c46eb4fed744 100644 (file)
@@ -15,6 +15,8 @@ import java.util.Locale;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.impl.CalendarAstronomer;
 import com.ibm.icu.impl.LocaleUtility;
@@ -35,6 +37,7 @@ import com.ibm.icu.util.ULocale;
 /**
  * @summary Tests of new functionality in IBMCalendar
  */
+@RunWith(JUnit4.class)
 public class IBMCalendarTest extends CalendarTestFmwk {
     /**
      * Test weekend support in IBMCalendar.
index 707a5c4f84f6d222f5beefc329accd5943de62f0..8854f8b0d58adc204457f75168270984cd1d826a 100644 (file)
@@ -12,6 +12,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.impl.LocaleUtility;
 import com.ibm.icu.text.DateFormat;
@@ -25,10 +27,11 @@ import com.ibm.icu.util.ULocale;
 /**
  * Tests for the <code>IndianCalendar</code> class.
  */
-public class IndianTest extends CalendarTestFmwk 
+@RunWith(JUnit4.class)
+public class IndianTest extends CalendarTestFmwk
 {
     // Months in indian calendar are 0-based. Here taking 1-based names:
-    public static final int CHAITRA = IndianCalendar.CHAITRA + 1; 
+    public static final int CHAITRA = IndianCalendar.CHAITRA + 1;
     public static final int VAISAKHA = IndianCalendar.VAISAKHA + 1;
     public static final int JYAISTHA = IndianCalendar.JYAISTHA + 1;
     public static final int ASADHA = IndianCalendar.ASADHA + 1;
@@ -43,8 +46,8 @@ public class IndianTest extends CalendarTestFmwk
 
     /** Constants to save typing. */
     /* Test dates generated from:
-     * http://www.fourmilab.ch/documents/calendar/ 
-    
+     * http://www.fourmilab.ch/documents/calendar/
+
     /** A huge list of test cases to make sure that computeTime and computeFields
      * work properly for a wide range of data in the Indian civil calendar.
      */
@@ -100,7 +103,7 @@ public class IndianTest extends CalendarTestFmwk
            new TestCase(2465737.5,  0,  1960,    KARTIKA,      19,  WED,   0,  0,  0),
            new TestCase(2486076.5,  0,  2016,    ASADHA,       27,  SUN,   0,  0,  0),
         };
-        
+
         IndianCalendar testCalendar = new IndianCalendar();
         testCalendar.setLenient(true);
         doTestCases(tests, testCalendar);
@@ -113,13 +116,13 @@ public class IndianTest extends CalendarTestFmwk
         cal.set(1000, 0, 30);
         logln("1000/0/30-> " +
               cal.get(YEAR) + "/" +
-              cal.get(MONTH) + "/" + 
+              cal.get(MONTH) + "/" +
               cal.get(DATE));
         cal.clear();
         cal.set(1, 0, 30);
         logln("1/0/30 -> " +
               cal.get(YEAR) + "/" +
-              cal.get(MONTH) + "/" + 
+              cal.get(MONTH) + "/" +
               cal.get(DATE));
     }
 
@@ -127,7 +130,7 @@ public class IndianTest extends CalendarTestFmwk
     public void TestCoverage() {
         {
             // new IndianCalendar(TimeZone)
-            IndianCalendar cal = new IndianCalendar(TimeZone.getDefault()); 
+            IndianCalendar cal = new IndianCalendar(TimeZone.getDefault());
             if(cal == null){
                 errln("could not create IndianCalendar with TimeZone");
             }
@@ -140,7 +143,7 @@ public class IndianTest extends CalendarTestFmwk
                 errln("could not create IndianCalendar with ULocale");
             }
         }
-        
+
         {
             // new IndianCalendar(Locale)
             IndianCalendar cal = new IndianCalendar(Locale.getDefault());
@@ -148,23 +151,23 @@ public class IndianTest extends CalendarTestFmwk
                 errln("could not create IndianCalendar with Locale");
             }
         }
-        
-        {                                                                                       
-            // new IndianCalendar(TimeZone, Locale)                                             
-            IndianCalendar cal = new IndianCalendar(TimeZone.getDefault(),Locale.getDefault()); 
-            if(cal == null){                                                                    
-                errln("could not create IndianCalendar with TimeZone, Locale");                 
-            }                                                                                   
-        }                                                                                       
-                                                                                                
-        {                                                                                       
-            // new IndianCalendar(TimeZone, ULocale)                                            
+
+        {
+            // new IndianCalendar(TimeZone, Locale)
+            IndianCalendar cal = new IndianCalendar(TimeZone.getDefault(),Locale.getDefault());
+            if(cal == null){
+                errln("could not create IndianCalendar with TimeZone, Locale");
+            }
+        }
+
+        {
+            // new IndianCalendar(TimeZone, ULocale)
             IndianCalendar cal = new IndianCalendar(TimeZone.getDefault(),ULocale.getDefault());
-            if(cal == null){                                                                    
-                errln("could not create IndianCalendar with TimeZone, ULocale");                
-            }                                                                                   
-        }                                                                                       
-        
+            if(cal == null){
+                errln("could not create IndianCalendar with TimeZone, ULocale");
+            }
+        }
+
         {
             // new IndianCalendar(Date)
             IndianCalendar cal = new IndianCalendar(new Date());
@@ -186,7 +189,7 @@ public class IndianTest extends CalendarTestFmwk
                 errln("could not create IndianCalendar with year,month,date,hour,minute,second");
             }
         }
-    
+
         {
             // data
             String[] calendarLocales = {
@@ -246,7 +249,7 @@ public class IndianTest extends CalendarTestFmwk
         doLimitsTest(indian, null, cal.getTime());
         doTheoreticalLimitsTest(indian, true);
     }
-    
+
     /**
      * Problem reported by Bruno Haible <bruno.haible@de.ibm.com>
      *  -- see ticket 8419 -- http://bugs.icu-project.org/trac/ticket/8419
@@ -282,14 +285,14 @@ public class IndianTest extends CalendarTestFmwk
 
     @Test
     public void TestCoverage12424() {
-        class StubCalendar extends IndianCalendar {   
+        class StubCalendar extends IndianCalendar {
             private static final long serialVersionUID = 1L;
             public StubCalendar() {
                 assertEquals("Indian month 0 length", 30, handleGetMonthLength(1000, 0));
                 assertEquals("Indian month 2 length", 31, handleGetMonthLength(1000, 2));
              }
         }
-        
+
         new StubCalendar();
     }
 }
index 504c6fee6923b1cf3fc4fc7ce0c648c1fd6d5b09..ef0ddaf6495be915cfe90d7bb5fd22cd4ffde65a 100644 (file)
@@ -17,6 +17,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.LocaleUtility;
@@ -32,6 +34,7 @@ import com.ibm.icu.util.ULocale;
 /**
  * Tests for the <code>IslamicCalendar</code> class.
  */
+@RunWith(JUnit4.class)
 public class IslamicTest extends CalendarTestFmwk {
     /** Constants to save typing. */
     public static final int MUHARRAM = IslamicCalendar.MUHARRAM;
@@ -52,7 +55,7 @@ public class IslamicTest extends CalendarTestFmwk {
         int[][] tests = new int[][] {
             //       input                roll by          output
             //  year  month     day     field amount    year  month     day
-    
+
             {   0001, QIDAH,     2,     MONTH,   1,     0001, HIJJAH,    2 },   // non-leap years
             {   0001, QIDAH,     2,     MONTH,   2,     0001, MUHARRAM,  2 },
             {   0001, QIDAH,     2,     MONTH,  -1,     0001, SHAWWAL,   2 },
@@ -66,10 +69,10 @@ public class IslamicTest extends CalendarTestFmwk {
             {   0001, MUHARRAM, 30,     MONTH,   1,     0001, SAFAR,    29 },
             {   0002, HIJJAH,   30,     YEAR,   -1,     0001, HIJJAH,   29 },
         };
-       
+
         IslamicCalendar cal = newCivil();
         doRollAdd(ROLL, cal, tests);
-        
+
         cal = newIslamicUmalqura();
         doRollAdd(ROLL, cal, tests);
     }
@@ -125,7 +128,7 @@ public class IslamicTest extends CalendarTestFmwk {
             new TestCase(2465737.5,  0,  1460,   10,  12,  WED,   0,  0,  0),
             new TestCase(2486076.5,  0,  1518,    3,   5,  SUN,   0,  0,  0),
         };
-        
+
         IslamicCalendar civilCalendar = newCivil();
         civilCalendar.setLenient(true);
         doTestCases(tests, civilCalendar);
@@ -138,13 +141,13 @@ public class IslamicTest extends CalendarTestFmwk {
         cal.set(1000, 0, 30);
         logln("1000/0/30 -> " +
               cal.get(YEAR) + "/" +
-              cal.get(MONTH) + "/" + 
+              cal.get(MONTH) + "/" +
               cal.get(DATE));
         cal.clear();
         cal.set(1, 0, 30);
         logln("1/0/30 -> " +
               cal.get(YEAR) + "/" +
-              cal.get(MONTH) + "/" + 
+              cal.get(MONTH) + "/" +
               cal.get(DATE));
     }
 
@@ -160,7 +163,7 @@ public class IslamicTest extends CalendarTestFmwk {
         doTheoreticalLimitsTest(islamic, true);
 
 
-        // number of days to test - Islamic calendar starts to exhibit 
+        // number of days to test - Islamic calendar starts to exhibit
         // rounding errors after year AH3954 - about 2500 years out.
 
         IslamicCalendar islamic2 = new IslamicCalendar();
@@ -180,11 +183,11 @@ public class IslamicTest extends CalendarTestFmwk {
         cal.add(IslamicCalendar.MONTH,1);
         if ( cal.get(IslamicCalendar.MONTH) != IslamicCalendar.MUHARRAM  ||
            ( cal.get(IslamicCalendar.YEAR) != 1432 )) {
-               errln("Error incrementing month at the end of a leap year.  Expected Month:0 Year:1432 - Got Month:" + 
+               errln("Error incrementing month at the end of a leap year.  Expected Month:0 Year:1432 - Got Month:" +
                        cal.get(IslamicCalendar.MONTH) + " Year:" + cal.get(IslamicCalendar.YEAR));
            }
     }
-    
+
     @Test
     public void TestCoverage() {
     {
@@ -202,7 +205,7 @@ public class IslamicTest extends CalendarTestFmwk {
             errln("could not create IslamicCalendar with ULocale");
         }
     }
-        
+
     {
         // new IslamicCalendar(Locale)
         IslamicCalendar cal = new IslamicCalendar(Locale.getDefault());
@@ -251,7 +254,7 @@ public class IslamicTest extends CalendarTestFmwk {
         if (cal.isCivil()) {
         errln("islamic calendar is civil");
         }
-        
+
         // ensure calculation type getter returns correct object and value
         cal.setCalculationType(CalculationType.ISLAMIC_UMALQURA);
         Object ctObj = cal.getCalculationType();
@@ -263,7 +266,7 @@ public class IslamicTest extends CalendarTestFmwk {
         } else {
             errln("wrong object type returned from getCalculationType");
         }
-        
+
 
         Date now = new Date();
         cal.setTime(now);
@@ -281,14 +284,14 @@ public class IslamicTest extends CalendarTestFmwk {
 
         logln(cal.getTime().toString());
     }
-    
+
     {
         // data
         IslamicCalendar cal = new IslamicCalendar(800, IslamicCalendar.RAMADAN, 1);
         Date time = cal.getTime();
 
         String[] calendarLocales = {
-        "ar_AE", "ar_BH", "ar_DZ", "ar_EG", "ar_JO", "ar_KW", "ar_OM", 
+        "ar_AE", "ar_BH", "ar_DZ", "ar_EG", "ar_JO", "ar_KW", "ar_OM",
         "ar_QA", "ar_SA", "ar_SY", "ar_YE", "ms_MY"
         };
 
@@ -320,7 +323,7 @@ public class IslamicTest extends CalendarTestFmwk {
         civilCalendar.setCalculationType(CalculationType.ISLAMIC);
         return civilCalendar;
     }
-    
+
     private static IslamicCalendar newIslamicUmalqura() {
         IslamicCalendar civilCalendar = new IslamicCalendar();
         civilCalendar.setCalculationType(CalculationType.ISLAMIC_UMALQURA);
@@ -339,8 +342,8 @@ public class IslamicTest extends CalendarTestFmwk {
         verifyType(newIslamic(),"islamic");
         verifyType(newCivil(),"islamic-civil");
         verifyType(newIslamicUmalqura(), "islamic-umalqura");
-    } 
-    
+    }
+
     private void setAndTestCalendar(IslamicCalendar cal, int initMonth, int initDay, int initYear) {
         cal.clear();
         cal.setLenient(false);
@@ -357,18 +360,18 @@ public class IslamicTest extends CalendarTestFmwk {
 
     private void setAndTestWholeYear(IslamicCalendar cal, int startYear) {
         for(int startMonth = 0; startMonth < 12; startMonth++) {
-            for(int startDay = 1; startDay < 31; startDay++ ) {                
+            for(int startDay = 1; startDay < 31; startDay++ ) {
                 try {
                     setAndTestCalendar(cal, startMonth, startDay, startYear);
                 } catch(IllegalArgumentException iae) {
                     if(startDay != 30) {
                         errln("unexpected exception that wasn't for trying to set a date to '30'. errmsg - " + iae.getLocalizedMessage());
-                    }                    
-                }                
+                    }
+                }
             }
         }
     }
-    
+
     @Test
     public void TestIslamicUmAlQura() {
 
@@ -804,15 +807,15 @@ public class IslamicTest extends CalendarTestFmwk {
         /*/
         int lastYear = 1480;    // the whole shootin' match
         //*/
-        
-        ULocale umalquraLoc = new ULocale("ar_SA@calendar=islamic-umalqura"); 
-        ULocale gregoLoc = new ULocale("ar_SA@calendar=gregorian"); 
+
+        ULocale umalquraLoc = new ULocale("ar_SA@calendar=islamic-umalqura");
+        ULocale gregoLoc = new ULocale("ar_SA@calendar=gregorian");
         TimeZone tzSA = TimeZone.getTimeZone("Asia/Riyadh");
         IslamicCalendar tstCal = new IslamicCalendar(tzSA, umalquraLoc);
         GregorianCalendar gregCal = new GregorianCalendar(tzSA, gregoLoc);
         tstCal.clear();
         tstCal.setLenient(false);
-        
+
         int day=0, month=0, year=0, initDay = 27, initMonth = IslamicCalendar.RAJAB, initYear = 1434;
 
         try {
@@ -840,7 +843,7 @@ public class IslamicTest extends CalendarTestFmwk {
         } catch(IllegalArgumentException iae) {
             errln("unexpected exception received!!!");
         }
-        
+
         try {
             tstCal.clear();
             initMonth = 2;
@@ -850,7 +853,7 @@ public class IslamicTest extends CalendarTestFmwk {
         } catch(IllegalArgumentException iae) {
             // expected this
         }
-        
+
         try {
             tstCal.clear();
             initMonth = 3;
@@ -859,9 +862,9 @@ public class IslamicTest extends CalendarTestFmwk {
         } catch(IllegalArgumentException iae) {
             errln("unexpected exception received!!!");
         }
-        
+
         try {
-            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");            
+            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
             Date date = formatter.parse("1975-05-06");
             IslamicCalendar is_cal = new IslamicCalendar();
             is_cal.setCalculationType(CalculationType.ISLAMIC_UMALQURA);
@@ -880,11 +883,11 @@ public class IslamicTest extends CalendarTestFmwk {
             String expectedFormatResult = "\u0661\u0663\u0669\u0665-\u0631\u0628\u064A\u0639 \u0627\u0644\u0622\u062E\u0631-\u0662\u0664";
             if(!str.equals(expectedFormatResult))
                 errln("unexpected formatted result: "+str);
-            
+
         }catch(Exception e){
             errln(e.getLocalizedMessage());
         }
-        
+
         // check against data
         gregCal.clear();
         tstCal.clear();
@@ -902,18 +905,18 @@ public class IslamicTest extends CalendarTestFmwk {
             }
         }
     }
-    
+
     @Test
     public void TestSerialization8449() {
         try {
             ByteArrayOutputStream icuStream = new ByteArrayOutputStream();
-    
+
             IslamicCalendar tstCalendar = new IslamicCalendar();
             tstCalendar.setCivil(false);
-            
+
             long expectMillis = 1187912520931L; // with seconds (not ms) cleared.
             tstCalendar.setTimeInMillis(expectMillis);
-            
+
             logln("instantiated: "+tstCalendar);
             logln("getMillis: "+tstCalendar.getTimeInMillis());
             tstCalendar.set(IslamicCalendar.SECOND, 0);
@@ -930,11 +933,11 @@ public class IslamicTest extends CalendarTestFmwk {
             icuOut.writeObject(tstCalendar);
             icuOut.flush();
             icuOut.close();
-            
+
             ObjectInputStream icuIn = new ObjectInputStream(new ByteArrayInputStream(icuStream.toByteArray()));
             tstCalendar = null;
             tstCalendar = (IslamicCalendar)icuIn.readObject();
-            
+
             logln("serialized back in: "+tstCalendar);
             {
                 long gotMillis = tstCalendar.getTimeInMillis();
@@ -944,9 +947,9 @@ public class IslamicTest extends CalendarTestFmwk {
                     logln("getMillis: "+gotMillis);
                 }
             }
-            
+
             tstCalendar.set(IslamicCalendar.SECOND, 0);
-                    
+
             logln("setSecond=0: "+tstCalendar);
             {
                 long gotMillis = tstCalendar.getTimeInMillis();
@@ -964,7 +967,7 @@ public class IslamicTest extends CalendarTestFmwk {
             cnf.printStackTrace();
         }
     }
-    
+
     @Test
     public void TestIslamicTabularDates() {
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
@@ -988,7 +991,7 @@ public class IslamicTest extends CalendarTestFmwk {
         int is_year2 = is_cal2.get(Calendar.YEAR);
         if( (is_month != is_month2) || (is_year != is_year2))
             errln("unexpected difference between islamic and tbla month "+is_month+" : "+is_month2+" and/or year "+is_year+" : "+is_year2);
-        
+
         int is_day = is_cal.get(Calendar.DAY_OF_MONTH);
         int is_day2 = is_cal2.get(Calendar.DAY_OF_MONTH);
         if(is_day2 - is_day != 1)
@@ -998,30 +1001,30 @@ public class IslamicTest extends CalendarTestFmwk {
 
     @Test
     public void TestCreationByLocale() {
-        ULocale islamicLoc = new ULocale("ar_SA@calendar=islamic-umalqura"); 
+        ULocale islamicLoc = new ULocale("ar_SA@calendar=islamic-umalqura");
         IslamicCalendar is_cal = new IslamicCalendar(islamicLoc);
-        String thisCalcType = is_cal.getType(); 
+        String thisCalcType = is_cal.getType();
         if(!"islamic-umalqura".equalsIgnoreCase(thisCalcType)) {
             errln("non umalqura calc type generated - " + thisCalcType);
         }
 
-        islamicLoc = new ULocale("ar_SA@calendar=islamic-civil"); 
+        islamicLoc = new ULocale("ar_SA@calendar=islamic-civil");
         is_cal = new IslamicCalendar(islamicLoc);
-        thisCalcType = is_cal.getType(); 
+        thisCalcType = is_cal.getType();
         if(!"islamic-civil".equalsIgnoreCase(thisCalcType)) {
             errln("non civil calc type generated - " + thisCalcType);
         }
 
-        islamicLoc = new ULocale("ar_SA@calendar=islamic-tbla"); 
+        islamicLoc = new ULocale("ar_SA@calendar=islamic-tbla");
         is_cal = new IslamicCalendar(islamicLoc);
-        thisCalcType = is_cal.getType(); 
+        thisCalcType = is_cal.getType();
         if(!"islamic-tbla".equalsIgnoreCase(thisCalcType)) {
             errln("non tbla calc type generated - " + thisCalcType);
         }
 
-        islamicLoc = new ULocale("ar_SA@calendar=islamic-xyzzy"); 
+        islamicLoc = new ULocale("ar_SA@calendar=islamic-xyzzy");
         is_cal = new IslamicCalendar(islamicLoc);
-        thisCalcType = is_cal.getType(); 
+        thisCalcType = is_cal.getType();
         if(!"islamic".equalsIgnoreCase(thisCalcType)) {
             errln("incorrect default calc type generated - " + thisCalcType);
         }
index 34f959564e5734e6f425ff157a158c09738a4f5d..6ec96f48c3bafccbf1e2687edc44552084239994 100644 (file)
@@ -14,6 +14,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.impl.LocaleUtility;
 import com.ibm.icu.text.DateFormat;
@@ -26,8 +28,9 @@ import com.ibm.icu.util.ULocale;
 /**
  * Tests for the <code>JapaneseCalendar</code> class.
  */
+@RunWith(JUnit4.class)
 public class JapaneseTest extends CalendarTestFmwk {
-    
+
     @Test
     public void TestCoverage() {
         {
@@ -143,7 +146,7 @@ public class JapaneseTest extends CalendarTestFmwk {
             }
         }
     }
-    
+
     @Test
     public void Test3860()
     {
@@ -160,10 +163,10 @@ public class JapaneseTest extends CalendarTestFmwk {
         cal.setTime(aDate);
         int gotYear = cal.get(Calendar.YEAR);
         int gotEra = cal.get(Calendar.ERA);
-        
+
         int expectYear = 1;
         int expectEra = JapaneseCalendar.CURRENT_ERA;
-        
+
         if((gotYear != expectYear) || (gotEra != expectEra)) {
             errln("Expected year " + expectYear + ", era " + expectEra +", but got year " + gotYear + " and era " + gotEra + ", == " + inEn);
         } else {
@@ -196,9 +199,9 @@ public class JapaneseTest extends CalendarTestFmwk {
         expectYear = 1;
         expectEra = JapaneseCalendar.CURRENT_ERA;
         if((gotYear != 1) || (gotEra != expectEra)) {
-            errln("parse "+ samplestr + " of 'y' as Japanese Calendar, expected year " + expectYear + 
+            errln("parse "+ samplestr + " of 'y' as Japanese Calendar, expected year " + expectYear +
                 " and era " + expectEra + ", but got year " + gotYear + " and era " + gotEra + " (Gregorian:" + str +")");
-        } else {            
+        } else {
             logln(" year: " + gotYear + ", era: " + gotEra);
         }
     }
@@ -231,14 +234,14 @@ public class JapaneseTest extends CalendarTestFmwk {
         Date otherDate;
         try {
             otherDate = fmt.parse(expected);
-            if(!otherDate.equals(aDate)) { 
+            if(!otherDate.equals(aDate)) {
                 String str3;
     //            ParsePosition pp;
                 Date dd = fmt.parse(expected);
                 str3 = fmt.format(otherDate);
                 long oLong = otherDate.getTime();
                 long aLong = otherDate.getTime();
-                
+
                 errln("FAIL: Parse incorrect of " + expected + ":  wanted " + aDate + " ("+aLong+"), but got " +  " " +
                     otherDate + " ("+oLong+") = " + str3 + " not " + dd.toString() );
 
@@ -267,7 +270,7 @@ public class JapaneseTest extends CalendarTestFmwk {
             int fieldNum = expected[i+0];
             int expectedVal = expected[i+1];
             int actualVal = c.get(fieldNum);
-            
+
             if(expectedVal == actualVal) {
                 logln(FIELD_NAME[fieldNum]+": "+ actualVal);
             } else {
@@ -275,7 +278,7 @@ public class JapaneseTest extends CalendarTestFmwk {
             }
         }
     }
-    
+
     @Test
     public void Test5345calendar() {
         logln("** testIncompleteCalendar()");
@@ -283,7 +286,7 @@ public class JapaneseTest extends CalendarTestFmwk {
         JapaneseCalendar c = new JapaneseCalendar(TimeZone.getDefault());
         logln("test clear");
         c.clear();
+
         // Showa 45 = Gregorian 1970
         int expected0[] = {   Calendar.ERA, 234,
                               Calendar.YEAR, 45 };
@@ -292,8 +295,8 @@ public class JapaneseTest extends CalendarTestFmwk {
         logln("test setting era");
         c.clear();
         c.set(Calendar.ERA, JapaneseCalendar.MEIJI);
-        
-        
+
+
         int expectedA[] = {   Calendar.ERA, JapaneseCalendar.MEIJI };
         checkExpected(c, expectedA);
 
@@ -316,11 +319,11 @@ public class JapaneseTest extends CalendarTestFmwk {
         c.set(Calendar.MONTH, Calendar.JANUARY);
         c.set(Calendar.DATE, 1);
         c.set(Calendar.ERA, JapaneseCalendar.MEIJI);
-        
-        
+
+
         checkExpected(c, expectedC);
-        
-        
+
+
         logln("test setting era and year");
         c.clear();
         c.set(Calendar.YEAR, 1);
index 2957e73f50a4c03c8b7544dd1c21afe742910a5a..7a51f1d35095e24e48770d7d02a1d89a9323ec84 100644 (file)
@@ -10,11 +10,14 @@ package com.ibm.icu.dev.test.calendar;
 import java.util.Date;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.util.Calendar;
 import com.ibm.icu.util.PersianCalendar;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class PersianTest extends CalendarTestFmwk {
     /**
      * Test basic mapping to and from Gregorian.
@@ -24,7 +27,7 @@ public class PersianTest extends CalendarTestFmwk {
         final int[] DATA = {
             // (Note: months are 1-based)
             2011, 1, 11, 1389, 10, 21,
-            1986, 2, 25, 1364, 12, 6, 
+            1986, 2, 25, 1364, 12, 6,
             1934, 3, 14, 1312, 12, 23,
 
             2090, 3, 19, 1468, 12, 29,
@@ -127,17 +130,17 @@ public class PersianTest extends CalendarTestFmwk {
 
     @Test
     public void TestCoverage12424() {
-        class StubCalendar extends PersianCalendar {   
+        class StubCalendar extends PersianCalendar {
             private static final long serialVersionUID = 1L;
             public StubCalendar() {
                 assertEquals("Persian month 0 length", 31, handleGetMonthLength(1000, 0));
                 assertEquals("Persian month 7 length", 30, handleGetMonthLength(1000, 7));
-                
+
                 int leastWeeks = handleGetLimit(Calendar.WEEK_OF_YEAR, Calendar.LEAST_MAXIMUM);
-                assertEquals("Persian Week of Year least maximum", 52, leastWeeks);             
+                assertEquals("Persian Week of Year least maximum", 52, leastWeeks);
              }
         }
-        
+
         new StubCalendar();
     }
 }
index 6056a4b2c6e4ee01a3a035c006f4eb7110ebe0c6..765c31abc4236aeafde7ed60322296b080c71c0a 100644 (file)
@@ -21,6 +21,8 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
@@ -38,6 +40,7 @@ import com.ibm.icu.text.CharsetMatch;
 /**
  * @author andy
  */
+@RunWith(JUnit4.class)
 public class TestCharsetDetector extends TestFmwk
 {
     public TestCharsetDetector()
@@ -57,27 +60,27 @@ public class TestCharsetDetector extends TestFmwk
             }
             errln(msg);
         }
-        
+
     }
-    
+
     private String stringFromReader(Reader reader)
     {
         StringBuffer sb = new StringBuffer();
         char[] buffer   = new char[1024];
         int bytesRead   = 0;
-        
+
         try {
             while ((bytesRead = reader.read(buffer, 0, 1024)) >= 0) {
                 sb.append(buffer, 0, bytesRead);
             }
-            
+
             return sb.toString();
         } catch (Exception e) {
             errln("stringFromReader() failed: " + e.toString());
             return null;
         }
     }
-    
+
     @Test
     public void TestConstruction() {
         int i;
@@ -88,7 +91,7 @@ public class TestCharsetDetector extends TestFmwk
         String [] charsetNames = CharsetDetector.getAllDetectableCharsets();
         CheckAssert(charsetNames.length != 0);
         for (i=0; i<charsetNames.length; i++) {
-            CheckAssert(charsetNames[i].equals("") == false); 
+            CheckAssert(charsetNames[i].equals("") == false);
             // System.out.println("\"" + charsetNames[i] + "\"");
         }
 
@@ -131,31 +134,31 @@ public class TestCharsetDetector extends TestFmwk
         byte[] bytes = s.getBytes("ISO-8859-1");
         CharsetDetector det = new CharsetDetector();
         CharsetMatch m;
-        
+
         det.enableInputFilter(true);
         if (!det.inputFilterEnabled()){
             errln("input filter should be enabled");
         }
-        
+
         det.setText(bytes);
         m = det.detect();
-        
+
         if (! m.getLanguage().equals("fr")) {
             errln("input filter did not strip markup!");
         }
-        
+
         det.enableInputFilter(false);
         det.setText(bytes);
         m = det.detect();
-        
+
         if (! m.getLanguage().equals("en")) {
             errln("unfiltered input did not detect as English!");
         }
     }
-    
+
     @Test
     public void TestUTF8() throws Exception {
-        
+
         String  s = "This is a string with some non-ascii characters that will " +
                     "be converted to UTF-8, then shoved through the detection process.  " +
                     "\u0391\u0392\u0393\u0394\u0395" +
@@ -164,10 +167,10 @@ public class TestCharsetDetector extends TestFmwk
         CharsetDetector det = new CharsetDetector();
         String retrievedS;
         Reader reader;
-        
+
         retrievedS = det.getString(bytes, "UTF-8");
         CheckAssert(s.equals(retrievedS));
-        
+
         reader = det.getReader(new ByteArrayInputStream(bytes), "UTF-8");
         try {
             CheckAssert(s.equals(stringFromReader(reader)));
@@ -176,79 +179,79 @@ public class TestCharsetDetector extends TestFmwk
         }
         det.setDeclaredEncoding("UTF-8"); // Jitterbug 4451, for coverage
     }
-    
+
     @Test
     public void TestUTF16() throws Exception
     {
-        String source = 
+        String source =
                 "u0623\u0648\u0631\u0648\u0628\u0627, \u0628\u0631\u0645\u062c\u064a\u0627\u062a " +
                 "\u0627\u0644\u062d\u0627\u0633\u0648\u0628 \u002b\u0020\u0627\u0646\u062a\u0631\u0646\u064a\u062a";
-        
+
         byte[] beBytes = source.getBytes("UnicodeBig");
         byte[] leBytes = source.getBytes("UnicodeLittle");
         CharsetDetector det = new CharsetDetector();
         CharsetMatch m;
-        
+
         det.setText(beBytes);
         m = det.detect();
-        
+
         if (! m.getName().equals("UTF-16BE")) {
             errln("Encoding detection failure: expected UTF-16BE, got " + m.getName());
         }
-        
+
         det.setText(leBytes);
         m = det.detect();
-        
+
         if (! m.getName().equals("UTF-16LE")) {
             errln("Encoding detection failure: expected UTF-16LE, got " + m.getName());
         }
 
         // Jitterbug 4451, for coverage
-        int confidence = m.getConfidence(); 
+        int confidence = m.getConfidence();
         if(confidence != 100){
             errln("Did not get the expected confidence level " + confidence);
         }
     }
-    
+
     @Test
     public void TestC1Bytes() throws Exception
     {
         String sISO =
             "This is a small sample of some English text. Just enough to be sure that it detects correctly.";
-        
+
         String sWindows =
             "This is another small sample of some English text. Just enough to be sure that it detects correctly. It also includes some \u201CC1\u201D bytes.";
 
         byte[] bISO     = sISO.getBytes("ISO-8859-1");
         byte[] bWindows = sWindows.getBytes("windows-1252");
-        
+
         CharsetDetector det = new CharsetDetector();
         CharsetMatch m;
-        
+
         det.setText(bWindows);
         m = det.detect();
-        
+
         if (!m.getName().equals("windows-1252")) {
             errln("Text with C1 bytes not correctly detected as windows-1252.");
             return;
         }
-        
+
         det.setText(bISO);
         m = det.detect();
-        
+
         if (!m.getName().equals("ISO-8859-1")) {
             errln("Text without C1 bytes not correctly detected as ISO-8859-1.");
         }
     }
-    
+
     @Test
     public void TestShortInput() {
         // Test that detection with very short byte strings does not crash and burn.
-        // The shortest input that should produce positive detection result is two bytes, 
+        // The shortest input that should produce positive detection result is two bytes,
         //   a UTF-16 BOM.
         // TODO:  Detector confidence levels needs to be refined for very short input.
         //        Too high now, for some charsets that happen to be compatible with a few bytes of input.
-        byte [][]  shortBytes = new byte [][] 
+        byte [][]  shortBytes = new byte [][]
             {
                 {},
                 {(byte)0x0a},
@@ -256,7 +259,7 @@ public class TestCharsetDetector extends TestFmwk
                 {(byte)'A', (byte)'B', (byte)'C'},
                 {(byte)'A', (byte)'B', (byte)'C', (byte)'D'}
             };
-        
+
         CharsetDetector det = new CharsetDetector();
         CharsetMatch m;
         for (int i=0; i<shortBytes.length; i++) {
@@ -265,7 +268,7 @@ public class TestCharsetDetector extends TestFmwk
             logln("i=" + i + " -> " + m.getName());
         }
     }
-    
+
     @Test
     public void TestBufferOverflow()
     {
@@ -279,7 +282,7 @@ public class TestCharsetDetector extends TestFmwk
             {(byte) 0x74, (byte) 0x68, (byte) 0xa1}, /* Could be a single byte shift-jis at the end */
             {(byte) 0x74, (byte) 0x68, (byte) 0x65, (byte) 0xa1} /* Could be a single byte shift-jis at the end, but now we have English creeping in. */
         };
-        
+
         String testResults[] = {
             "windows-1252",
             "windows-1252",
@@ -290,7 +293,7 @@ public class TestCharsetDetector extends TestFmwk
             null,
             "ISO-8859-1"
         };
-        
+
         CharsetDetector det = new CharsetDetector();
         CharsetMatch match;
 
@@ -325,7 +328,7 @@ public class TestCharsetDetector extends TestFmwk
         //  Open and read the test data file.
         //
         //InputStreamReader isr = null;
-        
+
         try {
             InputStream is = TestCharsetDetector.class.getResourceAsStream("CharsetDetectionTests.xml");
             if (is == null) {
@@ -335,11 +338,11 @@ public class TestCharsetDetector extends TestFmwk
 
             // Set up an xml parser.
             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            
+
             factory.setIgnoringComments(true);
-            
+
             DocumentBuilder builder = factory.newDocumentBuilder();
-            
+
             // Parse the xml content from the test case file.
             Document doc;
             try {
@@ -348,9 +351,9 @@ public class TestCharsetDetector extends TestFmwk
                 is.close();
             }
             Element root = doc.getDocumentElement();
-            
+
             NodeList testCases = root.getElementsByTagName("test-case");
-            
+
             // Process each test case
             Map<String, byte[]> encToBytes = new TreeMap<String, byte[]>();
             for (int n = 0; n < testCases.getLength(); n += 1) {
@@ -408,7 +411,7 @@ public class TestCharsetDetector extends TestFmwk
                 }
                 encToBytes.clear();
             }
-            
+
         } catch (Exception e) {
             errln("exception while processing test cases: " + e.toString());
         }
@@ -421,7 +424,7 @@ public class TestCharsetDetector extends TestFmwk
             errln(id + ": encoding detection failure - expected " + encoding + ", got " + m.getName());
             return;
         }
-        
+
         String charsetMatchLanguage = m.getLanguage();
         if ((language != null && !charsetMatchLanguage.equals(language))
             || (language == null && charsetMatchLanguage != null)
@@ -439,20 +442,20 @@ public class TestCharsetDetector extends TestFmwk
             logln("Skipping roundtrip check on IBM Java 8: " + id + ", " + encoding);
             return;
         }
-        
+
         String decoded = m.getString();
-        
+
         if (! testString.equals(decoded)) {
             errln(id + ", " + encoding + ": getString() didn't return the original string!");
         }
-        
+
         decoded = stringFromReader(m.getReader());
-        
+
         if (! testString.equals(decoded)) {
             errln(id + ", " + encoding + ": getReader() didn't yield the original string!");
         }
     }
-    
+
     private void checkEncoding(String testString,
             String encoding, String language, boolean checkRoundtrip,
             byte[] bytes, String id) {
@@ -485,25 +488,25 @@ public class TestCharsetDetector extends TestFmwk
             e.printStackTrace();
         }
     }
-    
+
     @Test
     public void TestJapanese() throws Exception {
-        String s = "\u3000\u3001\u3002\u3003\u3005\u3006\u3007\u3008\u3009\u300A\u300B\u300C\u300D\u300E\u300F\u3010\u3011\u3012\u3013\u3014" + 
-        "\u3015\u301C\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052" + 
-        "\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066" + 
-        "\u3067\u3068\u3069\u306A\u306B\u306C\u306D\u306E\u306F\u3070\u3071\u3072\u3073\u3074\u3075\u3076\u3077\u3078\u3079\u307A" + 
-        "\u307B\u307C\u307D\u307E\u307F\u3080\u3081\u3082\u3083\u3084\u3085\u3086\u3087\u3088\u3089\u308A\u308B\u308C\u308D\u308E" + 
-        "\u308F\u3090\u3091\u3092\u3093\u309B\u309C\u309D\u309E\u30A1\u30A2\u30A3\u30A4\u30A5\u30A6\u30A7\u30A8\u30A9\u30AA\u30AB" + 
-        "\u30AC\u30AD\u30AE\u30AF\u30B0\u30B1\u30B2\u30B3\u30B4\u30B5\u30B6\u30B7\u30B8\u30B9\u30BA\u30BB\u30BC\u30BD\u30BE\u30BF" + 
-        "\u30C0\u30C1\u30C2\u30C3\u30C4\u30C5\u30C6\u30C7\u30C8\u30C9\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D0\u30D1\u30D2\u30D3" + 
-        "\u30D4\u30D5\u30D6\u30D7\u30D8\u30D9\u30DA\u30DB\u30DC\u30DD\u30DE\u30DF\u30E0\u30E1\u30E2\u30E3\u30E4\u30E5\u30E6\u30E7" + 
-        "\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EE\u30EF\u30F0\u30F1\u30F2\u30F3\u30F4\u30F5\u30F6\u30FB\u30FC\u30FD\u30FE\u4E00" + 
-        "\u4E01\u4E02\u4E03\u4E04\u4E05\u4E07\u4E08\u4E09\u4E0A\u4E0B\u4E0C\u4E0D\u4E0E\u4E10\u4E11\u4E12\u4E14\u4E15\u4E16\u4E17" + 
-        "\u4E18\u4E19\u4E1E\u4E1F\u4E21\u4E23\u4E24\u4E26\u4E28\u4E2A\u4E2B\u4E2D\u4E2E\u4E2F\u4E30\u4E31\u4E32\u4E35\u4E36\u4E38" + 
-        "\u4E39\u4E3B\u4E3C\u4E3F\u4E40\u4E41\u4E42\u4E43\u4E44\u4E45\u4E47\u4E4B\u4E4D\u4E4E\u4E4F\u4E51\u4E55\u4E56\u4E57\u4E58" + 
-        "\u4E59\u4E5A\u4E5C\u4E5D\u4E5E\u4E5F\u4E62\u4E63\u4E68\u4E69\u4E71\u4E73\u4E74\u4E75\u4E79\u4E7E\u4E7F\u4E80\u4E82\u4E85" + 
+        String s = "\u3000\u3001\u3002\u3003\u3005\u3006\u3007\u3008\u3009\u300A\u300B\u300C\u300D\u300E\u300F\u3010\u3011\u3012\u3013\u3014" +
+        "\u3015\u301C\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052" +
+        "\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066" +
+        "\u3067\u3068\u3069\u306A\u306B\u306C\u306D\u306E\u306F\u3070\u3071\u3072\u3073\u3074\u3075\u3076\u3077\u3078\u3079\u307A" +
+        "\u307B\u307C\u307D\u307E\u307F\u3080\u3081\u3082\u3083\u3084\u3085\u3086\u3087\u3088\u3089\u308A\u308B\u308C\u308D\u308E" +
+        "\u308F\u3090\u3091\u3092\u3093\u309B\u309C\u309D\u309E\u30A1\u30A2\u30A3\u30A4\u30A5\u30A6\u30A7\u30A8\u30A9\u30AA\u30AB" +
+        "\u30AC\u30AD\u30AE\u30AF\u30B0\u30B1\u30B2\u30B3\u30B4\u30B5\u30B6\u30B7\u30B8\u30B9\u30BA\u30BB\u30BC\u30BD\u30BE\u30BF" +
+        "\u30C0\u30C1\u30C2\u30C3\u30C4\u30C5\u30C6\u30C7\u30C8\u30C9\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D0\u30D1\u30D2\u30D3" +
+        "\u30D4\u30D5\u30D6\u30D7\u30D8\u30D9\u30DA\u30DB\u30DC\u30DD\u30DE\u30DF\u30E0\u30E1\u30E2\u30E3\u30E4\u30E5\u30E6\u30E7" +
+        "\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EE\u30EF\u30F0\u30F1\u30F2\u30F3\u30F4\u30F5\u30F6\u30FB\u30FC\u30FD\u30FE\u4E00" +
+        "\u4E01\u4E02\u4E03\u4E04\u4E05\u4E07\u4E08\u4E09\u4E0A\u4E0B\u4E0C\u4E0D\u4E0E\u4E10\u4E11\u4E12\u4E14\u4E15\u4E16\u4E17" +
+        "\u4E18\u4E19\u4E1E\u4E1F\u4E21\u4E23\u4E24\u4E26\u4E28\u4E2A\u4E2B\u4E2D\u4E2E\u4E2F\u4E30\u4E31\u4E32\u4E35\u4E36\u4E38" +
+        "\u4E39\u4E3B\u4E3C\u4E3F\u4E40\u4E41\u4E42\u4E43\u4E44\u4E45\u4E47\u4E4B\u4E4D\u4E4E\u4E4F\u4E51\u4E55\u4E56\u4E57\u4E58" +
+        "\u4E59\u4E5A\u4E5C\u4E5D\u4E5E\u4E5F\u4E62\u4E63\u4E68\u4E69\u4E71\u4E73\u4E74\u4E75\u4E79\u4E7E\u4E7F\u4E80\u4E82\u4E85" +
         "\u4E86\u4E88\u4E89\u4E8A\u4E8B\u4E8C";
-        
+
         CharsetDetector det = new CharsetDetector();
         CharsetMatch m;
         String charsetMatch;
@@ -514,7 +517,7 @@ public class TestCharsetDetector extends TestFmwk
             m = det.detect();
             charsetMatch = m.getName();
             CheckAssert(charsetMatch.equals("EUC-JP"));
-            
+
             // Tests "public String getLanguage()"
             CheckAssert(m.getLanguage().equals("ja"));
         }
@@ -523,17 +526,17 @@ public class TestCharsetDetector extends TestFmwk
     @Test
     public void TestArabic() throws Exception {
         String  s = "\u0648\u0636\u0639\u062A \u0648\u0646\u0641\u0630\u062A \u0628\u0631\u0627" +
-        "\u0645\u062C \u062A\u0623\u0645\u064A\u0646 \u0639\u062F\u064A\u062F\u0629 \u0641\u064A " + 
-        "\u0645\u0624\u0633\u0633\u0629 \u0627\u0644\u062A\u0623\u0645\u064A\u0646 \u0627\u0644"  + 
-        "\u0648\u0637\u0646\u064A, \u0645\u0639 \u0645\u0644\u0627\u0626\u0645\u062A\u0647\u0627 " + 
-        "\u062F\u0627\u0626\u0645\u0627 \u0644\u0644\u0627\u062D\u062A\u064A\u0627\u062C" + 
-        "\u0627\u062A \u0627\u0644\u0645\u062A\u063A\u064A\u0631\u0629 \u0644\u0644\u0645\u062C" + 
-        "\u062A\u0645\u0639 \u0648\u0644\u0644\u062F\u0648\u0644\u0629. \u062A\u0648\u0633\u0639" + 
-        "\u062A \u0648\u062A\u0637\u0648\u0631\u062A \u0627\u0644\u0645\u0624\u0633\u0633\u0629 " + 
-        "\u0628\u0647\u062F\u0641 \u0636\u0645\u0627\u0646 \u0634\u0628\u0643\u0629 \u0623\u0645" + 
-        "\u0627\u0646 \u0644\u0633\u0643\u0627\u0646 \u062F\u0648\u0644\u0629 \u0627\u0633\u0631" + 
-        "\u0627\u0626\u064A\u0644 \u0628\u0648\u062C\u0647 \u0627\u0644\u0645\u062E\u0627\u0637" + 
-        "\u0631 \u0627\u0644\u0627\u0642\u062A\u0635\u0627\u062F\u064A\u0629 \u0648\u0627\u0644" + 
+        "\u0645\u062C \u062A\u0623\u0645\u064A\u0646 \u0639\u062F\u064A\u062F\u0629 \u0641\u064A " +
+        "\u0645\u0624\u0633\u0633\u0629 \u0627\u0644\u062A\u0623\u0645\u064A\u0646 \u0627\u0644"  +
+        "\u0648\u0637\u0646\u064A, \u0645\u0639 \u0645\u0644\u0627\u0626\u0645\u062A\u0647\u0627 " +
+        "\u062F\u0627\u0626\u0645\u0627 \u0644\u0644\u0627\u062D\u062A\u064A\u0627\u062C" +
+        "\u0627\u062A \u0627\u0644\u0645\u062A\u063A\u064A\u0631\u0629 \u0644\u0644\u0645\u062C" +
+        "\u062A\u0645\u0639 \u0648\u0644\u0644\u062F\u0648\u0644\u0629. \u062A\u0648\u0633\u0639" +
+        "\u062A \u0648\u062A\u0637\u0648\u0631\u062A \u0627\u0644\u0645\u0624\u0633\u0633\u0629 " +
+        "\u0628\u0647\u062F\u0641 \u0636\u0645\u0627\u0646 \u0634\u0628\u0643\u0629 \u0623\u0645" +
+        "\u0627\u0646 \u0644\u0633\u0643\u0627\u0646 \u062F\u0648\u0644\u0629 \u0627\u0633\u0631" +
+        "\u0627\u0626\u064A\u0644 \u0628\u0648\u062C\u0647 \u0627\u0644\u0645\u062E\u0627\u0637" +
+        "\u0631 \u0627\u0644\u0627\u0642\u062A\u0635\u0627\u062F\u064A\u0629 \u0648\u0627\u0644" +
         "\u0627\u062C\u062A\u0645\u0627\u0639\u064A\u0629.";
 
         CharsetDetector det = new CharsetDetector();
@@ -550,7 +553,7 @@ public class TestCharsetDetector extends TestFmwk
             m = det.detect();
             charsetMatch = m.getName();
             CheckAssert(charsetMatch.equals("windows-1256"));
-            
+
             // Tests "public String getLanguage()"
             CheckAssert(m.getLanguage().endsWith("ar"));
         }
@@ -592,7 +595,7 @@ public class TestCharsetDetector extends TestFmwk
             m = det.detect();
             charsetMatch = m.getName();
             CheckAssert(charsetMatch.equals("IBM420_rtl"));
-            
+
          // Tests "public String getLanguage()"
             CheckAssert(m.getLanguage().endsWith("ar"));
         }
@@ -643,32 +646,32 @@ public class TestCharsetDetector extends TestFmwk
     @Test
     public void TestHebrew() throws Exception {
         String  s =  "\u05D4\u05E4\u05E8\u05E7\u05DC\u05D9\u05D8 \u05D4\u05E6\u05D1\u05D0\u05D9 \u05D4" +
-            "\u05E8\u05D0\u05E9\u05D9, \u05EA\u05EA \u05D0\u05DC\u05D5\u05E3 \u05D0\u05D1\u05D9" + 
-            "\u05D7\u05D9 \u05DE\u05E0\u05D3\u05DC\u05D1\u05DC\u05D9\u05D8, \u05D4\u05D5\u05E8" + 
-            "\u05D4 \u05E2\u05DC \u05E4\u05EA\u05D9\u05D7\u05EA \u05D7\u05E7\u05D9\u05E8\u05EA " + 
-            "\u05DE\u05E6\"\u05D7 \u05D1\u05E2\u05E7\u05D1\u05D5\u05EA \u05E2\u05D3\u05D5\u05D9" + 
-            "\u05D5\u05EA \u05D7\u05D9\u05D9\u05DC\u05D9 \u05E6\u05D4\"\u05DC \u05DE\u05DE\u05D1" + 
+            "\u05E8\u05D0\u05E9\u05D9, \u05EA\u05EA \u05D0\u05DC\u05D5\u05E3 \u05D0\u05D1\u05D9" +
+            "\u05D7\u05D9 \u05DE\u05E0\u05D3\u05DC\u05D1\u05DC\u05D9\u05D8, \u05D4\u05D5\u05E8" +
+            "\u05D4 \u05E2\u05DC \u05E4\u05EA\u05D9\u05D7\u05EA \u05D7\u05E7\u05D9\u05E8\u05EA " +
+            "\u05DE\u05E6\"\u05D7 \u05D1\u05E2\u05E7\u05D1\u05D5\u05EA \u05E2\u05D3\u05D5\u05D9" +
+            "\u05D5\u05EA \u05D7\u05D9\u05D9\u05DC\u05D9 \u05E6\u05D4\"\u05DC \u05DE\u05DE\u05D1" +
             "\u05E6\u05E2 \u05E2\u05D5\u05E4\u05E8\u05EA \u05D9\u05E6\u05D5\u05E7\u05D4 \u05D1+ " +
-            "\u05E8\u05E6\u05D5\u05E2\u05EA \u05E2\u05D6\u05D4. \u05DC\u05D3\u05D1\u05E8\u05D9 " + 
+            "\u05E8\u05E6\u05D5\u05E2\u05EA \u05E2\u05D6\u05D4. \u05DC\u05D3\u05D1\u05E8\u05D9 " +
             "\u05D4\u05E4\u05E6\"\u05E8, \u05DE\u05D4\u05E2\u05D3\u05D5\u05D9\u05D5\u05EA \u05E2" +
-            "\u05D5\u05DC\u05D4 \u05EA\u05DE\u05D5\u05E0\u05D4 \u05E9\u05DC \"\u05D4\u05EA\u05E0" + 
-            "\u05D4\u05D2\u05D5\u05EA \u05E4\u05E1\u05D5\u05DC\u05D4 \u05DC\u05DB\u05D0\u05D5\u05E8" + 
-            "\u05D4 \u05E9\u05DC \u05D7\u05D9\u05D9\u05DC\u05D9\u05DD \u05D1\u05DE\u05D4\u05DC\u05DA" + 
-            " \u05DE\u05D1\u05E6\u05E2 \u05E2\u05D5\u05E4\u05E8\u05EA \u05D9\u05E6\u05D5\u05E7\u05D4\"." + 
+            "\u05D5\u05DC\u05D4 \u05EA\u05DE\u05D5\u05E0\u05D4 \u05E9\u05DC \"\u05D4\u05EA\u05E0" +
+            "\u05D4\u05D2\u05D5\u05EA \u05E4\u05E1\u05D5\u05DC\u05D4 \u05DC\u05DB\u05D0\u05D5\u05E8" +
+            "\u05D4 \u05E9\u05DC \u05D7\u05D9\u05D9\u05DC\u05D9\u05DD \u05D1\u05DE\u05D4\u05DC\u05DA" +
+            " \u05DE\u05D1\u05E6\u05E2 \u05E2\u05D5\u05E4\u05E8\u05EA \u05D9\u05E6\u05D5\u05E7\u05D4\"." +
             " \u05DE\u05E0\u05D3\u05DC\u05D1\u05DC\u05D9\u05D8 \u05E7\u05D9\u05D1\u05DC \u05D0\u05EA" +
             " \u05D4\u05D7\u05DC\u05D8\u05EA\u05D5 \u05DC\u05D0\u05D7\u05E8 \u05E9\u05E2\u05D9\u05D9" +
             "\u05DF \u05D1\u05EA\u05DE\u05DC\u05D9\u05DC \u05D4\u05E2\u05D3\u05D5\u05D9\u05D5\u05EA";
-        
+
         CharsetMatch m = _test1255(s);
         String charsetMatch = m.getName();
         CheckAssert(charsetMatch.equals("ISO-8859-8-I"));
         CheckAssert(m.getLanguage().equals("he"));
-        
+
         m = _test1255_reverse(s);
         charsetMatch = m.getName();
         CheckAssert(charsetMatch.equals("ISO-8859-8"));
         CheckAssert(m.getLanguage().equals("he"));
-        
+
         m = _testIBM424_he_rtl(s);
         charsetMatch = m.getName();
         CheckAssert(charsetMatch.equals("IBM424_rtl"));
@@ -678,7 +681,7 @@ public class TestCharsetDetector extends TestFmwk
         } catch (Exception ex) {
             errln("Error getting string for charsetMatch: " + charsetMatch);
         }
-        
+
         m = _testIBM424_he_ltr(s);
         charsetMatch = m.getName();
         CheckAssert(charsetMatch.equals("IBM424_ltr"));
@@ -689,7 +692,7 @@ public class TestCharsetDetector extends TestFmwk
             errln("Error getting string for charsetMatch: " + charsetMatch);
         }
     }
-    
+
     private CharsetMatch _test1255(String s) throws Exception {
         byte [] bytes = s.getBytes("ISO-8859-8");
         CharsetDetector det = new CharsetDetector();
@@ -697,18 +700,18 @@ public class TestCharsetDetector extends TestFmwk
         CharsetMatch m = det.detect();
         return m;
     }
-    
+
     private CharsetMatch _test1255_reverse(String s) throws Exception {
         StringBuffer reverseStrBuf = new StringBuffer(s);
         reverseStrBuf = reverseStrBuf.reverse();
         byte [] bytes = reverseStrBuf.toString().getBytes("ISO-8859-8");
-        
+
         CharsetDetector det = new CharsetDetector();
         det.setText(bytes);
         CharsetMatch m = det.detect();
         return m;
     }
-    
+
     private CharsetMatch _testIBM424_he_rtl(String s) throws Exception {
         byte [] bytes = s.getBytes("IBM424");
         CharsetDetector det = new CharsetDetector();
@@ -720,16 +723,16 @@ public class TestCharsetDetector extends TestFmwk
         CharsetMatch m = det.detect();
         return m;
     }
-    
+
     private CharsetMatch _testIBM424_he_ltr(String s) throws Exception {
         /**
          * transformation of input string to CP420 left to right requires reversing the string
-         */    
-        
+         */
+
         StringBuffer ltrStrBuf = new StringBuffer(s);
         ltrStrBuf = ltrStrBuf.reverse();
         byte [] bytes = ltrStrBuf.toString().getBytes("IBM424");
-        
+
         CharsetDetector det = new CharsetDetector();
         det.setDetectableCharset("IBM424_rtl", true);
         det.setDetectableCharset("IBM424_ltr", true);
@@ -739,7 +742,7 @@ public class TestCharsetDetector extends TestFmwk
         CharsetMatch m = det.detect();
         return m;
     }
-    
+
     /*
      * Test the method int match(CharsetDetector det) in CharsetRecog_UTF_16_LE
      */
@@ -767,7 +770,7 @@ public class TestCharsetDetector extends TestFmwk
           detector1.setText(data1);
           CharsetMatch match1 = detector1.detect();
           assertEquals("Expected GB18030", "GB18030", match1.getName());
-  
+
           CharsetDetector detector2 = new CharsetDetector();
           byte[] data2 = createData2();
           detector2.setText(data2);
@@ -775,12 +778,12 @@ public class TestCharsetDetector extends TestFmwk
           // It is actually GB18030 but the sample size is way too small to be reliable.
           assertEquals("Expected ISO-8859-1, even though that isn't strictly correct", "ISO-8859-1", match2.getName());
       }
-  
+
     @Test
     public void TestReusingDetector() throws Exception
       {
           CharsetDetector detector = new CharsetDetector();
+
           byte[] data1 = createData1();
           detector.setText(data1);
           CharsetMatch match1 = detector.detect();
@@ -793,7 +796,7 @@ public class TestCharsetDetector extends TestFmwk
           CharsetMatch match2a = detector.detect();
           assertEquals("[second]Expected ISO-8859-1, even though that isn't strictly correct", "ISO-8859-1", match2a.getName());
       }
-  
+
       private static byte[] createData1()
       {
          return bytesFromString("3B 3B 3B 20 2D 2A 2D 20 4D 6F 64 65 3A 20 4C 49 53 50 3B 20 53 79 6E 74 61 78 " +
@@ -1084,15 +1087,15 @@ public class TestCharsetDetector extends TestFmwk
                                 "23 27 6D 61 74 63 68 69 6E 67 2D 73 75 62 73 74 72 69 6E 67 3F 29 29 0D 0A 09 " +
                                 "20 20 0D 0A");
       }
-  
+
       private static byte[] createData2()
       {
           return bytesFromString("0A D0 A1 CA B1 20 3B 3B 20 48 6F 75 72 28 73 29 0A D0 C7 C6 DA 20 3B 3B 20 57 " +
                                  "65 65 6B 28 73 29 0A B5 B1 B5 D8 20 CA B1 BC E4 20 3B 3B 20 6C 6F 63 61 6C 20 " +
                                  "74 69 6D 65 0A");
       }
-  
-  
+
+
       /**
        * Creates a byte array by decoding the hex string passed in.
        *
@@ -1117,7 +1120,7 @@ public class TestCharsetDetector extends TestFmwk
                   out.write(Integer.parseInt(new String(number), 16));
               }
           }
-  
+
           return out.toByteArray();
       }
       //
@@ -1129,7 +1132,7 @@ public class TestCharsetDetector extends TestFmwk
     public void TestBug9267() {
         // Test a long input of Lam Alef characters for CharsetRecog_IBM420_ar.
         // Bug 9267 was an array out of bounds problem in the unshaping code for these.
-        byte [] input = new byte [7700]; 
+        byte [] input = new byte [7700];
         int i;
         for (i=0; i<input.length; i++) {
           input[i] = (byte)0xb2;
@@ -1138,7 +1141,7 @@ public class TestCharsetDetector extends TestFmwk
         det.setText(input);
         det.detect();
     }
-    
+
     @Test
     public void TestBug6954 () throws Exception {
         // Ticket 6954 - trouble with the haveC1Bytes flag that is used to distinguish between
@@ -1166,14 +1169,14 @@ public class TestCharsetDetector extends TestFmwk
         CharsetMatch match2 = csd2.detect();
         String name2 = match2.getName();
         assertEquals("Initial use of second detector", "ISO-8859-1", name2);
-        
+
         // Recheck the 1252 results from the first detector, which should not have been
         //  altered by the use of a different detector.
 
         name1 = match1.getName();
         assertEquals("Wrong charset name after running a second charset detector", "windows-1252", name1);
     }
-    
+
     @Test
     public void TestBug6889() {
         // Verify that CharsetDetector.detectAll() does not return the same encoding multiple times.
@@ -1187,18 +1190,18 @@ public class TestCharsetDetector extends TestFmwk
             fail("Unexpected exception " + e.toString());
             return;
         }
-        
+
         CharsetDetector det = new CharsetDetector();
         det.setText(textBytes);
         CharsetMatch matches[] = det.detectAll();
-        
+
         HashSet<String> detectedEncodings = new HashSet<String>();
         for (CharsetMatch m: matches) {
             assertTrue("Charset " + m.getName() + " encountered before",
                         detectedEncodings.add(m.getName()));
-        }   
+        }
     }
-    
+
     @Test
     public void TestMultithreaded() {
         String  s = "This is some random plain text to run charset detection on.";
@@ -1210,16 +1213,17 @@ public class TestCharsetDetector extends TestFmwk
             fail("Unexpected exception " + e.toString());
             return;
         }
-        
+
         class WorkerThread extends Thread {
             WorkerThread(int num) {
                 n = num;
-            }           
-            private int n;            
+            }
+            private int n;
+            @Override
             public void run() {
                 // System.out.println("Thread " + n + " is running.");
                 CharsetDetector det = new CharsetDetector();
-                det.setText(bytes);                
+                det.setText(bytes);
                 for (int i=0; i<10000; i++) {
                     CharsetMatch matches[] = det.detectAll();
                     for (CharsetMatch m: matches) {
@@ -1229,7 +1233,7 @@ public class TestCharsetDetector extends TestFmwk
                 // System.out.println("Thread " + n + " is finished.");
             }
         }
-        
+
         Thread threads[] = new Thread[10];
         for (int i=0; i<10; i++) {
             threads[i] = new WorkerThread(i);
@@ -1245,5 +1249,5 @@ public class TestCharsetDetector extends TestFmwk
         }
     }
 
-      
+
 }
index 1e30e67f6c19e2daa1b81770b1d98c28701cf166..05ecb4b7103cafbacfea259fa1238584df6cc1a5 100644 (file)
@@ -9,10 +9,13 @@
 package com.ibm.icu.dev.test.compression;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.UnicodeDecompressor;
 
+@RunWith(JUnit4.class)
 public class DecompressionTest extends TestFmwk {
     /** Print out a segment of a character array, if in verbose mode */
     private void log(char [] chars, int start, int count) {
@@ -42,7 +45,7 @@ public class DecompressionTest extends TestFmwk {
         count1 = myDecompressor.decompress(segment1, 0, segment1.length,
                                            bytesRead,
                                            charBuffer, 0, charBuffer.length);
-        
+
         logln("Segment 1 (" + segment1.length + " bytes) " +
                 "decompressed into " + count1  + " chars");
         logln("Bytes consumed: " + bytesRead[0]);
@@ -53,16 +56,16 @@ public class DecompressionTest extends TestFmwk {
 
         count2 = myDecompressor.decompress(segment2, 0, segment2.length,
                                            bytesRead,
-                                           charBuffer, count1, 
+                                           charBuffer, count1,
                                            charBuffer.length);
-        
+
         logln("Segment 2 (" + segment2.length + " bytes) " +
                 "decompressed into " + count2  + " chars");
         logln("Bytes consumed: " + bytesRead[0]);
 
         logln("Got chars: ");
         logln(charBuffer, count1, count2);
-        
+
         s.append(charBuffer, count1, count2);
 
         logln("Result: ");
@@ -84,7 +87,7 @@ public class DecompressionTest extends TestFmwk {
         // continuation
         /*                   IDX   ,           S     .          */
         byte [] segment2 = { 0x01, 0x2c, 0x20, 0x53, 0x2e };
-        
+
         result = decompressTest(segment1, segment2);
         if(! result.equals("Booth, S.")) {
             errln("Decompression test failed");
@@ -120,16 +123,16 @@ public class DecompressionTest extends TestFmwk {
             return;
         }
     }
-    
+
     /* Testing the method
-     *      public int decompress(*** 
+     *      public int decompress(***
      */
     @Test
     public void TestDecompress(){
         char[] charBufferBlank = {};
         char[] charBuffer1 = {'a'};
         char[] charValid = {'d','u','m','m','y'};
-        
+
         // Test when "if(charBuffer.length < 2 || (charBufferLimit - charBufferStart) < 2)" is true
         //      The following tests when "charBuffer.length < 2"
         UnicodeDecompressor ud = new UnicodeDecompressor();
@@ -137,42 +140,42 @@ public class DecompressionTest extends TestFmwk {
             ud.decompress(null, 0, 0, null, null, 4, 0);
             errln("UnicodeDecompressor.decompress was suppose to return an exception.");
         } catch(Exception e){}
-        
+
         try{
             ud.decompress(null, 0, 0, null, charBufferBlank, 4, 0);
             errln("UnicodeDecompressor.decompress was suppose to return an exception.");
         } catch(Exception e){}
-        
+
         try{
             ud.decompress(null, 0, 0, null, charBuffer1, 4, 0);
             errln("UnicodeDecompressor.decompress was suppose to return an exception.");
         } catch(Exception e){}
-        
+
         //      The following tests when "(charBufferLimit - charBufferStart) < 2"
         try{
             ud.decompress(null, 0, 0, null, charValid, 0, 0);
             errln("UnicodeDecompressor.decompress was suppose to return an exception.");
         } catch(Exception e){}
-        
+
         try{
             ud.decompress(null, 0, 0, null, charValid, 1, 0);
             errln("UnicodeDecompressor.decompress was suppose to return an exception.");
         } catch(Exception e){}
-        
+
         try{
             ud.decompress(null, 0, 0, null, charValid, 1, 1);
             errln("UnicodeDecompressor.decompress was suppose to return an exception.");
         } catch(Exception e){}
-        
+
         try{
             ud.decompress(null, 0, 0, null, charValid, 0, 1);
             errln("UnicodeDecompressor.decompress was suppose to return an exception.");
         } catch(Exception e){}
-        
+
         try{
             ud = new UnicodeDecompressor();
             byte[] b = {
-                    (byte) 0x80, (byte) 0x81, (byte) 0x82, (byte) 0x83, (byte) 0x84, 
+                    (byte) 0x80, (byte) 0x81, (byte) 0x82, (byte) 0x83, (byte) 0x84,
                     (byte) 0x85, (byte) 0x86, (byte) 0x87, (byte) 0x88, (byte) 0x89,
                     (byte) 0x8A, (byte) 0x8B, (byte) 0x8C, (byte) 0x8D, (byte) 0x8E,
                     (byte) 0x8F, (byte) 0x90, (byte) 0x91, (byte) 0x92, (byte) 0x93,
@@ -220,7 +223,7 @@ public class DecompressionTest extends TestFmwk {
                     (byte) 0x7A, (byte) 0x7B, (byte) 0x7C, (byte) 0x7D, (byte) 0x7E,
                     (byte) 0x7F,
                     (byte) UnicodeDecompressor.SQUOTEU,
-                    (byte) UnicodeDecompressor.SCHANGEU, 
+                    (byte) UnicodeDecompressor.SCHANGEU,
                     (byte) UnicodeDecompressor.SQUOTE0, (byte) UnicodeDecompressor.SQUOTE1, (byte) UnicodeDecompressor.SQUOTE2, (byte) UnicodeDecompressor.SQUOTE3,
                     (byte) UnicodeDecompressor.SQUOTE4, (byte) UnicodeDecompressor.SQUOTE5, (byte) UnicodeDecompressor.SQUOTE6, (byte) UnicodeDecompressor.SQUOTE7,
                     (byte) UnicodeDecompressor.SCHANGE0, (byte) UnicodeDecompressor.SCHANGE1, (byte) UnicodeDecompressor.SCHANGE2, (byte) UnicodeDecompressor.SCHANGE3,
index a29a57b3bb347cd730a080ac10fd17e5381bd545..c21d7866e15b452f370057ad18cf6d9de8b04fd3 100644 (file)
@@ -9,11 +9,14 @@
 package com.ibm.icu.dev.test.compression;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.UnicodeCompressor;
 import com.ibm.icu.text.UnicodeDecompressor;
 
+@RunWith(JUnit4.class)
 public class ExhaustiveTest extends TestFmwk {
     /** Test simple compress/decompress API, returning # of errors */
     @Test
@@ -25,10 +28,10 @@ public class ExhaustiveTest extends TestFmwk {
     private void simpleTest(String s) throws Exception {
         byte [] compressed = UnicodeCompressor.compress(s);
         String res = UnicodeDecompressor.decompress(compressed);
-        if (logDiffs(s.toCharArray(), s.length(), 
+        if (logDiffs(s.toCharArray(), s.length(),
                 res.toCharArray(), res.length()) == false) {
-            logln(s.length() + " chars ===> " 
-                    + compressed.length + " bytes ===> " 
+            logln(s.length() + " chars ===> "
+                    + compressed.length + " bytes ===> "
                     + res.length() + " chars");
         } else {
             logln("Compressed:");
@@ -47,7 +50,7 @@ public class ExhaustiveTest extends TestFmwk {
     private void myTest(char[] chars, int len) {
         UnicodeCompressor myCompressor = new UnicodeCompressor();
         UnicodeDecompressor myDecompressor = new UnicodeDecompressor();
-        
+
         // variables for my compressor
         int myByteCount = 0;
         int myCharCount = 0;
@@ -57,7 +60,7 @@ public class ExhaustiveTest extends TestFmwk {
         char[] myDecompressed = new char[myDecompressedSize];
         int[] unicharsRead = new int[1];
         int[] bytesRead = new int[1];
-        
+
         myByteCount = myCompressor.compress(chars, 0, len, unicharsRead,
                 myCompressed, 0, myCompressedSize);
 
@@ -65,8 +68,8 @@ public class ExhaustiveTest extends TestFmwk {
                 bytesRead, myDecompressed, 0, myDecompressedSize);
 
         if (logDiffs(chars, len, myDecompressed, myCharCount) == false) {
-            logln(len + " chars ===> " 
-                    + myByteCount + " bytes ===> " 
+            logln(len + " chars ===> "
+                    + myByteCount + " bytes ===> "
                     + myCharCount + " chars");
         } else {
             logln("Compressed:");
@@ -85,9 +88,9 @@ public class ExhaustiveTest extends TestFmwk {
     private void myMultipassTest(char [] chars, int len) throws Exception {
         UnicodeCompressor myCompressor = new UnicodeCompressor();
         UnicodeDecompressor myDecompressor = new UnicodeDecompressor();
-        
+
         // variables for my compressor
-        
+
         // for looping
         int byteBufferSize = 4;//Math.max(4, len / 4);
         byte[] byteBuffer = new byte [byteBufferSize];
@@ -107,7 +110,7 @@ public class ExhaustiveTest extends TestFmwk {
 
         int[] unicharsRead = new int[1];
         int[] bytesRead = new int[1];
-        
+
         int totalCharsCompressed = 0;
         int totalBytesWritten = 0;
 
@@ -119,21 +122,21 @@ public class ExhaustiveTest extends TestFmwk {
 
         // perform the compression in a loop
         do {
-            
+
             // do the compression
-            bytesWritten = myCompressor.compress(chars, totalCharsCompressed, 
+            bytesWritten = myCompressor.compress(chars, totalCharsCompressed,
                    len, unicharsRead, byteBuffer, 0, byteBufferSize);
 
             // copy the current set of bytes into the target buffer
-            System.arraycopy(byteBuffer, 0, compressed, 
+            System.arraycopy(byteBuffer, 0, compressed,
                    totalBytesWritten, bytesWritten);
-            
+
             // update the no. of characters compressed
             totalCharsCompressed += unicharsRead[0];
-            
+
             // update the no. of bytes written
             totalBytesWritten += bytesWritten;
-            
+
             /*System.out.logln("Compression pass complete.  Compressed "
                                + unicharsRead[0] + " chars into "
                                + bytesWritten + " bytes.");*/
@@ -145,40 +148,40 @@ public class ExhaustiveTest extends TestFmwk {
         } else {
             logln("MP: " + len + " chars ===> " + totalBytesWritten + " bytes.");
         }
-        
+
         // perform the decompression in a loop
         do {
-            
+
             // do the decompression
-            unicharsWritten = myDecompressor.decompress(compressed, 
-                    totalBytesDecompressed, totalBytesWritten, 
+            unicharsWritten = myDecompressor.decompress(compressed,
+                    totalBytesDecompressed, totalBytesWritten,
                     bytesRead, unicharBuffer, 0, unicharBufferSize);
 
             // copy the current set of chars into the target buffer
-            System.arraycopy(unicharBuffer, 0, decompressed, 
+            System.arraycopy(unicharBuffer, 0, decompressed,
                     totalCharsWritten, unicharsWritten);
-            
+
             // update the no. of bytes decompressed
             totalBytesDecompressed += bytesRead[0];
-            
+
             // update the no. of chars written
             totalCharsWritten += unicharsWritten;
-            
+
             /*System.out.logln("Decompression pass complete.  Decompressed "
                                + bytesRead[0] + " bytes into "
                                + unicharsWritten + " chars.");*/
         } while (totalBytesDecompressed < totalBytesWritten);
 
         if (totalBytesDecompressed != totalBytesWritten) {
-            errln("ERROR: Number of bytes decompressed(" 
-                    + totalBytesDecompressed 
-                    + ") != totalBytesWritten(" 
+            errln("ERROR: Number of bytes decompressed("
+                    + totalBytesDecompressed
+                    + ") != totalBytesWritten("
                     + totalBytesWritten + ")");
         } else {
             logln("MP: " + totalBytesWritten
                     + " bytes ===> " + totalCharsWritten + " chars.");
         }
-        
+
         if (logDiffs(chars, len, decompressed, totalCharsWritten)) {
             errln("ERROR: buffer contents incorrect");
         }
@@ -187,7 +190,7 @@ public class ExhaustiveTest extends TestFmwk {
     /** Print differences between two character buffers */
     private boolean logDiffs(char[] s1, int s1len, char[] s2, int s2len) {
         boolean result  = false;
-        
+
         if(s1len != s2len) {
             logln("====================");
             logln("Length doesn't match: expected " + s1len
@@ -198,7 +201,7 @@ public class ExhaustiveTest extends TestFmwk {
             printChars(s2, s2len);
             result = true;
         }
-        
+
         int len = Math.min(s1len, s2len);
         for(int i = 0; i < len; ++i) {
             if(s1[i] != s2[i]) {
@@ -216,7 +219,7 @@ public class ExhaustiveTest extends TestFmwk {
                 break;
             }
         }
-    
+
         return result;
     }
 
@@ -225,7 +228,7 @@ public class ExhaustiveTest extends TestFmwk {
         char[] result = new char [len];
         int runLen = 0;
         int used = 0;
-        
+
         while(used < len) {
             runLen = (int) (30 * random.nextDouble());
             if(used + runLen >= len) {
@@ -234,7 +237,7 @@ public class ExhaustiveTest extends TestFmwk {
             randomRun(result, used, runLen, random);
             used += runLen;
         }
-    
+
         return result;
     }*/
 
@@ -287,7 +290,7 @@ public class ExhaustiveTest extends TestFmwk {
 
         "\ud800\udc00", // smallest surrogate
         "\ud8ff\udcff", // largest surrogate pair
-        
+
         // regression tests
         "\u6441\ub413\ua733\uf8fe\ueedb\u587f\u195f\u4899\uf23d\u49fd\u0aac\u5792\ufc22\ufc3c\ufc46\u00aa",
         "\u30f9\u8321\u05e5\u181c\ud72b\u2019\u99c9\u2f2f\uc10c\u82e1\u2c4d\u1ebc\u6013\u66dc\ubbde\u94a5\u4726\u74af\u3083\u55b9\u000c",
@@ -303,7 +306,7 @@ public class ExhaustiveTest extends TestFmwk {
     //==========================
     private final static int SINGLEBYTEMODE                 = 0;
     private final static int UNICODEMODE                    = 1;
-    
+
     //==========================
     // Single-byte mode tags
     //==========================
@@ -364,11 +367,11 @@ public class ExhaustiveTest extends TestFmwk {
     private final static int UDEFINEX                       = 0xF1;
     //private final static int URESERVED                      = 0xF2;         // this is a reserved value
 
-    /* Print out an array of characters, with non-printables (for me) 
+    /* Print out an array of characters, with non-printables (for me)
        displayed as hex values */
     private void printChars(char[] chars, int len) {
         for(int i = 0; i < len; i++) {
-            int c = (int)chars[i];
+            int c = chars[i];
             if(c < 0x0020 || c >= 0x7f) {
                 log("[0x");
                 log(Integer.toHexString(c));
@@ -385,137 +388,137 @@ public class ExhaustiveTest extends TestFmwk {
         int byteBufferLimit = len;
         int mode = SINGLEBYTEMODE;
         int aByte = 0x00;
-        
+
         if(len > byteBuffer.length) {
             logln("Warning: printBytes called with length too large. Truncating");
             byteBufferLimit = byteBuffer.length;
         }
-        
+
         while(curByteIndex < byteBufferLimit) {
-            switch(mode) {  
+            switch(mode) {
             case SINGLEBYTEMODE:
-                while(curByteIndex < byteBufferLimit 
+                while(curByteIndex < byteBufferLimit
                       && mode == SINGLEBYTEMODE)  {
-                    aByte = ((int)byteBuffer[curByteIndex++]) & 0xFF;
+                    aByte = (byteBuffer[curByteIndex++]) & 0xFF;
                     switch(aByte) {
                     default:
-                        log(Integer.toHexString(((int) aByte) & 0xFF) + " ");
+                        log(Integer.toHexString((aByte) & 0xFF) + " ");
                         break;
                         // quote unicode
                     case SQUOTEU:
                         log("SQUOTEU ");
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         break;
-                        
+
                         // switch to Unicode mode
                     case SSWITCHU:
                         log("SSWITCHU ");
                         mode = UNICODEMODE;
                         break;
-                        
+
                         // handle all quote tags
                     case SQUOTE0: case SQUOTE1: case SQUOTE2: case SQUOTE3:
                     case SQUOTE4: case SQUOTE5: case SQUOTE6: case SQUOTE7:
                         log("SQUOTE" + (aByte - SQUOTE0) + " ");
                         if(curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         break;
-                        
+
                         // handle all switch tags
                     case SSWITCH0: case SSWITCH1: case SSWITCH2: case SSWITCH3:
                     case SSWITCH4: case SSWITCH5: case SSWITCH6: case SSWITCH7:
                         log("SSWITCH" + (aByte - SSWITCH0) + " ");
                         break;
-                                        
+
                         // handle all define tags
                     case SDEFINE0: case SDEFINE1: case SDEFINE2: case SDEFINE3:
                     case SDEFINE4: case SDEFINE5: case SDEFINE6: case SDEFINE7:
                         log("SDEFINE" + (aByte - SDEFINE0) + " ");
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         break;
-                        
+
                         // handle define extended tag
                     case SDEFINEX:
                         log("SDEFINEX ");
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         break;
-                        
+
                     } // end switch
                 } // end while
                 break;
-                
+
             case UNICODEMODE:
                 while(curByteIndex < byteBufferLimit && mode == UNICODEMODE) {
-                    aByte = ((int)byteBuffer[curByteIndex++]) & 0xFF;
+                    aByte = (byteBuffer[curByteIndex++]) & 0xFF;
                     switch(aByte) {
                         // handle all define tags
                     case UDEFINE0: case UDEFINE1: case UDEFINE2: case UDEFINE3:
                     case UDEFINE4: case UDEFINE5: case UDEFINE6: case UDEFINE7:
                         log("UDEFINE" + (aByte - UDEFINE0) + " ");
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         mode = SINGLEBYTEMODE;
                         break;
-                        
+
                         // handle define extended tag
                     case UDEFINEX:
                         log("UDEFINEX ");
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         break;
-                        
+
                         // handle all switch tags
                     case USWITCH0: case USWITCH1: case USWITCH2: case USWITCH3:
                     case USWITCH4: case USWITCH5: case USWITCH6: case USWITCH7:
                         log("USWITCH" + (aByte - USWITCH0) + " ");
                         mode = SINGLEBYTEMODE;
                         break;
-                        
+
                         // quote unicode
                     case UQUOTEU:
                         log("UQUOTEU ");
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         break;
-                        
+
                     default:
-                        log(Integer.toHexString(((int) aByte) & 0xFF) + " ");
+                        log(Integer.toHexString((aByte) & 0xFF) + " ");
                         if (curByteIndex < byteBufferLimit) {
-                            log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " ");
+                            log(Integer.toHexString((byteBuffer[curByteIndex++]) & 0xFF) + " ");
                         }
                         break;
-                        
+
                     } // end switch
                 } // end while
                 break;
-                
+
             } // end switch( mode )
         } // end while
-        
+
         logln("");
-    }    
+    }
 }
 
 
index 89ffaf3205550951dcf11f7e1592868cd9f61574..762028e55c8ba9c84a7d51e35db49ea2b0e740aa 100644 (file)
@@ -15,11 +15,14 @@ import java.io.StringReader;
 import java.io.StringWriter;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.duration.impl.XMLRecordReader;
 import com.ibm.icu.impl.duration.impl.XMLRecordWriter;
 
+@RunWith(JUnit4.class)
 public class DataReadWriteTest extends TestFmwk {
     // strip line ends and trailing spaces
     private String normalize(String str) {
@@ -80,7 +83,7 @@ public class DataReadWriteTest extends TestFmwk {
             { true, false },
             { true, false, true },
         };
-    
+
         String[] targets = {
             "<testList></testList>",
             "<testList><test>true</test></testList>",
@@ -255,7 +258,7 @@ public class DataReadWriteTest extends TestFmwk {
         String s4 = "  It is\n   only  a test\t  ";
         String s4x = " It is only a test ";
 
-        String[][] datas = { 
+        String[][] datas = {
             {},
             { s1 },
             { s2, s1 },
@@ -268,11 +271,11 @@ public class DataReadWriteTest extends TestFmwk {
             "<testList></testList>",
             "<testList><test>" + s1 + "</test></testList>",
             "<testList><test>" + s2 + "</test><test>" + s1 + "</test></testList>",
-            "<testList><test>" + s3 + "</test><test>" + s2 + 
+            "<testList><test>" + s3 + "</test><test>" + s2 +
                 "</test><test>" + s1 + "</test></testList>",
-            "<testList><test>" + s3 + "</test><test>Null</test><test>" + s1 + 
+            "<testList><test>" + s3 + "</test><test>Null</test><test>" + s1 +
                 "</test><test>Null</test></testList>",
-            "<testList><test>" + s4x + "</test><test>" + s1 + 
+            "<testList><test>" + s4x + "</test><test>" + s1 +
                 "</test><test>" + s3 + "</test><test>" + s2 + "</test></testList>",
         };
 
@@ -311,7 +314,7 @@ public class DataReadWriteTest extends TestFmwk {
         String s3 = "This is a test";
         String s4 = "It is only a test";
 
-        String[][] table = { 
+        String[][] table = {
             {},
             { s1 },
             { s2, s1 },
@@ -324,7 +327,7 @@ public class DataReadWriteTest extends TestFmwk {
             "<testList></testList>" +
             "<testList><test></test></testList>" +
             "<testList><test> </test><test></test></testList>" +
-            "<testList><test>This is a test</test><test> </test>" + 
+            "<testList><test>This is a test</test><test> </test>" +
                 "<test></test></testList>" +
             "<testList>Null</testList>" +
             "<testList><test>It is only a test</test><test></test>" +
index 4d9d762d147cba5880845f10bf3c1edc0885e84a..b3cf867f926ebe95e92751835e46bdc9735bde70 100644 (file)
@@ -20,6 +20,8 @@ import javax.xml.datatype.DatatypeConstants.Field;
 import javax.xml.datatype.Duration;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DurationFormat;
@@ -30,6 +32,7 @@ import com.ibm.icu.util.ULocale;
  * @author srl
  *
  */
+@RunWith(JUnit4.class)
 public class ICUDurationTest extends TestFmwk {
     /**
      * Allows us to not depend on javax.xml.datatype.DatatypeFactory.
@@ -161,7 +164,7 @@ public class ICUDurationTest extends TestFmwk {
     }
 
     /**
-     * 
+     *
      */
     public ICUDurationTest() {
     }
@@ -174,7 +177,7 @@ public class ICUDurationTest extends TestFmwk {
         DurationFormat df;
         String expect;
         String formatted;
-        
+
         df = DurationFormat.getInstance(new ULocale("it"));
         formatted = df.formatDurationFromNow(4096);
         expect = "fra quattro secondi";
@@ -183,7 +186,7 @@ public class ICUDurationTest extends TestFmwk {
         } else {
             logln("format duration -> " + formatted);
         }
-        
+
         formatted = df.formatDurationFromNowTo(new Date(0));
         Calendar cal = Calendar.getInstance();
         int years = cal.get(Calendar.YEAR) - 1970; // year of Date(0)
@@ -193,7 +196,7 @@ public class ICUDurationTest extends TestFmwk {
         } else {
             logln("format date  -> " + formatted);
         }
-        
+
         formatted = df.formatDurationFrom(1000*3600*24, new Date(0).getTime());
         expect = "fra un giorno";
         if(!expect.equals(formatted)) {
@@ -218,7 +221,7 @@ public class ICUDurationTest extends TestFmwk {
         String out;
         String expected;
         String expected2;
-        
+
         // test 1
         d = newDuration(1, 2, 46, 40);  // "PT2H46M40S"
         df = DurationFormat.getInstance(new ULocale("en"));
@@ -229,7 +232,7 @@ public class ICUDurationTest extends TestFmwk {
         } else {
             errln("FAIL: got " + out + " wanted " + expected + " from " + d);
         }
-        
+
         // test 2
         d = newDuration(10000);
         df = DurationFormat.getInstance(new ULocale("en"));
@@ -313,7 +316,7 @@ public class ICUDurationTest extends TestFmwk {
 
             DurationFormat df = DurationFormat.getInstance(locale);
             String output = df.format(d);
-            
+
             if(output.equals(to)) {
                 logln("SUCCESS: locale: " + loc + ", from " + from + " ["+d.toString()+"] " +" to " + to + "= " + output);
             } else {
@@ -364,7 +367,7 @@ public class ICUDurationTest extends TestFmwk {
             errln("FAIL: null DurationFormat returned.");
         }
     }
-    
+
     /* Tests the class
      *      DurationFormat
      */
@@ -372,14 +375,18 @@ public class ICUDurationTest extends TestFmwk {
     public void TestDurationFormat(){
         @SuppressWarnings("serial")
         class TestDurationFormat extends DurationFormat {
+            @Override
             public StringBuffer format(Object object, StringBuffer toAppend, FieldPosition pos) {return null;}
+            @Override
             public String formatDurationFrom(long duration, long referenceDate) {return null;}
+            @Override
             public String formatDurationFromNow(long duration) {return null;}
+            @Override
             public String formatDurationFromNowTo(Date targetDate) {return null;}
             public TestDurationFormat() {super();}
-            
+
         }
-        
+
         // Tests the constructor and the following method
         //      public Object parseObject(String source, ParsePosition pos)
         try{
index 56564ef3ed81ae956b3de2d1bf23489efca5bf2c..e20b0c2f5c25b47d3b7a2ef8e85f29ab96a59651 100644 (file)
@@ -21,6 +21,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.duration.BasicPeriodFormatterService;
@@ -37,10 +39,11 @@ import com.ibm.icu.impl.duration.impl.DataRecord.EUnitVariant;
 /**
  * Test cases for en
  */
+@RunWith(JUnit4.class)
 public abstract class LanguageTestFmwk extends TestFmwk implements TimeUnitConstants {
 
     private static final TimeUnit[] units = {
-        TimeUnit.YEAR, TimeUnit.MONTH, TimeUnit.WEEK, TimeUnit.DAY, TimeUnit.HOUR, 
+        TimeUnit.YEAR, TimeUnit.MONTH, TimeUnit.WEEK, TimeUnit.DAY, TimeUnit.HOUR,
         TimeUnit.MINUTE, TimeUnit.SECOND, TimeUnit.MILLISECOND
     };
 
@@ -63,7 +66,7 @@ public abstract class LanguageTestFmwk extends TestFmwk implements TimeUnitConst
     private static final Map datacache = new HashMap(); // String->TestData
 
     private static final long[] approxDurations = {
-        36525L*24*60*60*10, 3045*24*60*60*10L, 7*24*60*60*1000L, 24*60*60*1000L, 
+        36525L*24*60*60*10, 3045*24*60*60*10L, 7*24*60*60*1000L, 24*60*60*1000L,
         60*60*1000L, 60*1000L, 1000L, 1L
     };
 
@@ -536,46 +539,57 @@ class FileTestData extends LanguageTestFmwk.TestData {
     private String[] fractionalUnitTargets;
     private String[] multipleUnitTargets;
 
+    @Override
     int[] getFullPluralizedFormCounts() {
         return fullPluralizedFormCounts;
     }
 
+    @Override
     String[] getFullPluralizedFormTargets() {
         return fullPluralizedFormTargets;
     }
 
+    @Override
     String[] getMediumFormTargets() {
         return mediumFormTargets;
     }
 
+    @Override
     String[] getShortFormTargets() {
         return shortFormTargets;
     }
 
+    @Override
     String[] getCustomMinuteTargets() {
         return customMinuteTargets;
     }
 
+    @Override
     String[] getLimitedUnitTargets() {
         return limitedUnitTargets;
     }
 
+    @Override
     int[] getHalfUnitCounts() {
         return halfUnitCounts;
     }
 
+    @Override
     String[] getHalfUnitTargets() {
         return halfUnitTargets;
     }
 
+    @Override
     float[] getFractionalUnitCounts() {
         return fractionalUnitCounts;
     }
 
+    @Override
     String[] getFractionalUnitTargets() {
         return fractionalUnitTargets;
     }
 
+    @Override
     String[] getMultipleUnitTargets() {
         return multipleUnitTargets;
     }
@@ -695,46 +709,57 @@ class DefaultData extends LanguageTestFmwk.TestData {
         return instance;
     }
 
+    @Override
     int[] getFullPluralizedFormCounts() {
         return fullPluralizedFormCounts;
     }
 
+    @Override
     String[] getFullPluralizedFormTargets() {
         return null;
     }
 
+    @Override
     String[] getMediumFormTargets() {
         return null;
     }
 
+    @Override
     String[] getShortFormTargets() {
         return null;
     }
 
+    @Override
     String[] getCustomMinuteTargets() {
         return null;
     }
 
+    @Override
     String[] getLimitedUnitTargets() {
         return null;
     }
 
+    @Override
     int[] getHalfUnitCounts() {
         return halfUnitCounts;
     }
 
+    @Override
     String[] getHalfUnitTargets() {
         return null;
     }
 
+    @Override
     float[] getFractionalUnitCounts() {
         return fractionalUnitCounts;
     }
 
+    @Override
     String[] getFractionalUnitTargets() {
         return null;
     }
 
+    @Override
     String[] getMultipleUnitTargets() {
         return null;
     }
index 0d5adbf4853265b5bb462f9323c7e2ce2187e623..fa98ad5c89e89f4741a4540b447226437590857a 100644 (file)
@@ -12,6 +12,8 @@
 package com.ibm.icu.dev.test.duration;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.duration.BasicPeriodFormatterService;
@@ -21,14 +23,15 @@ import com.ibm.icu.impl.duration.PeriodBuilderFactory;
 import com.ibm.icu.impl.duration.TimeUnit;
 import com.ibm.icu.impl.duration.TimeUnitConstants;
 
+@RunWith(JUnit4.class)
 public class PeriodBuilderFactoryTest extends TestFmwk implements TimeUnitConstants {
     private PeriodBuilderFactory pbf;
 
     private static final long[] approxDurations = {
-      36525L*24*60*60*10, 3045*24*60*60*10L, 7*24*60*60*1000L, 24*60*60*1000L, 
+      36525L*24*60*60*10, 3045*24*60*60*10L, 7*24*60*60*1000L, 24*60*60*1000L,
       60*60*1000L, 60*1000L, 1000L, 1L
     };
-    
+
     @Test
     public void testSetAvailableUnitRange() {
         // sanity check, make sure by default all units are set
@@ -86,7 +89,7 @@ public class PeriodBuilderFactoryTest extends TestFmwk implements TimeUnitConsta
         assertNotNull(null, pbf.getOneOrTwoUnitBuilder());
         assertNotNull(null, pbf.getMultiUnitBuilder(2));
     }
-    
+
     @Test
     public void testBuilderFactoryPeriodConstruction() {
         // see ticket #8307
@@ -98,7 +101,7 @@ public class PeriodBuilderFactoryTest extends TestFmwk implements TimeUnitConsta
         assertEquals("hours", 1.0f, p.getCount(HOUR));
         assertEquals("minutes", 35.501f, p.getCount(MINUTE));
         assertFalse("seconds", p.isSet(SECOND));
-        
+
         pb = pbf.getMultiUnitBuilder(3);
         p = pb.create(H1M35S30M100);
         assertEquals("hours", 1.0f, p.getCount(HOUR));
index ae9a33ba847968b95d711c1974a05708edd80c2c..bf9d3f7d766e4cd98ad0353157b8a7b7ea583b58 100644 (file)
 package com.ibm.icu.dev.test.duration;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.duration.Period;
 import com.ibm.icu.impl.duration.TimeUnit;
 
+@RunWith(JUnit4.class)
 public class PeriodTest extends TestFmwk {
     @Test
     public void testIsSet() {
index bf3b26f5897a1743d7522acc6e6cb88e3b3ee733..973845bb66259bba471b5875f9ff83300cbe0480 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.duration;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.duration.BasicPeriodFormatterService;
@@ -18,23 +20,24 @@ import com.ibm.icu.impl.duration.PeriodFormatterService;
 import com.ibm.icu.text.DurationFormat;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class RegressionTest extends TestFmwk {
     // bug6397
     @Test
     public void TestDisallowedMillis() {
         // original test case
-        // if we don't support milliseconds, format times less than 1 second as 
+        // if we don't support milliseconds, format times less than 1 second as
         // 'less than 1 second'
         {
             ULocale ul = new ULocale("th");
             DurationFormat df = DurationFormat.getInstance(ul);
             String result = df.formatDurationFromNow(500);
             assertEquals(
-                "original test case", 
-                "\u0E44\u0E21\u0E48\u0E16\u0E36\u0E07\u0E2D\u0E35\u0E01 1 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35", 
+                "original test case",
+                "\u0E44\u0E21\u0E48\u0E16\u0E36\u0E07\u0E2D\u0E35\u0E01 1 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35",
                 result);
         }
-        
+
         // same issue, but using English and the internal APIs
         {
             PeriodFormatterService pfs = BasicPeriodFormatterService.getInstance();
@@ -49,10 +52,10 @@ public class RegressionTest extends TestFmwk {
                 "english test case",
                 "less than 1 second from now",
                 result);
-           
+
         }
-        
-        // if the limit is set on milliseconds, and they are not supported, 
+
+        // if the limit is set on milliseconds, and they are not supported,
         // use an effective limit based on seconds
         {
             PeriodFormatterService pfs = BasicPeriodFormatterService.getInstance();
index 97a412e033fff1620ca46df80b8f37bbc89c87b2..59dc9c26c0b98abe4bfd93c4734c575423e1e12c 100644 (file)
@@ -15,11 +15,14 @@ import java.util.Collection;
 import java.util.Iterator;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.duration.impl.PeriodFormatterData;
 import com.ibm.icu.impl.duration.impl.ResourceBasedPeriodFormatterDataService;
 
+@RunWith(JUnit4.class)
 public class ResourceBasedPeriodFormatterDataServiceTest extends TestFmwk {
   @Test
   public void testAvailable() {
index 86946deea8a354df8051589f4c0deae8ce57e1f1..649b7b5e2b8b28aece44322f8238db5a528164b6 100644 (file)
@@ -12,6 +12,8 @@ import java.text.ParseException;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -23,6 +25,7 @@ import com.ibm.icu.text.NumberFormat;
  * @test
  * General test of Big NumberFormat
  */
+@RunWith(JUnit4.class)
 public class BigNumberFormatTest extends TestFmwk {
 
     static final int ILLEGAL = -1;
index 7e3f34e81312b2427e3f9cea275c9f85cc410204..cdc2694c39b1a949e83d750c559ec5083da45792 100644 (file)
@@ -25,6 +25,8 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.number.Properties;
@@ -37,6 +39,7 @@ import com.ibm.icu.util.Currency;
 import com.ibm.icu.util.CurrencyAmount;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class CompactDecimalFormatTest extends TestFmwk {
     Object[][] EnglishTestData = {
             // default is 2 digits of accuracy
index 8df8e871b71dc4f942518ae9292b33145d40f069..0e02ab82c4535d15ebd1a6561680b1ecbf6c89a3 100644 (file)
@@ -7,7 +7,7 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v1.8.1 : format : DateFormatMiscTests
  * Source File: $ICU4CRoot/source/test/intltest/miscdtfm.cpp
  **/
@@ -20,14 +20,18 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormatSymbols;
 import com.ibm.icu.text.SimpleDateFormat;
 
-/** 
+/**
  * Performs miscellaneous tests for DateFormat, SimpleDateFormat, DateFormatSymbols
  **/
-public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class DateFormatMiscTests extends TestFmwk {
     /*
      * @bug 4097450
      */
@@ -38,13 +42,13 @@ public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
         //
         String dstring[] = {
             "97", "1997", "97", "1997", "01", "2001", "01", "2001",
-             "1", "1", "11", "11", "111", "111"}; 
-    
-        String dformat[] = 
+             "1", "1", "11", "11", "111", "111"};
+
+        String dformat[] =
             {
-                "yy", "yy", "yyyy", "yyyy", "yy", "yy", "yyyy", "yyyy", 
-                "yy", "yyyy", "yy", "yyyy", "yy", "yyyy"};         
-    
+                "yy", "yy", "yyyy", "yyyy", "yy", "yy", "yyyy", "yyyy",
+                "yy", "yyyy", "yy", "yyyy", "yy", "yyyy"};
+
         SimpleDateFormat formatter;
         SimpleDateFormat resultFormatter = new SimpleDateFormat("yyyy");
         logln("Format\tSource\tResult");
@@ -55,7 +59,7 @@ public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
             try {
                 StringBuffer str = new StringBuffer("");
                 FieldPosition pos = new FieldPosition(0);
-                logln(resultFormatter.format(formatter.parse(dstring[i]), str, pos).toString()); 
+                logln(resultFormatter.format(formatter.parse(dstring[i]), str, pos).toString());
             }
             catch (ParseException exception) {
                 errln("exception --> " + exception);
@@ -63,7 +67,7 @@ public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
             logln("");
         }
     }
-    
+
     /* @Bug 4099975
      * SimpleDateFormat constructor SimpleDateFormat(String, DateFormatSymbols)
      * should clone the DateFormatSymbols parameter
@@ -76,15 +80,15 @@ public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
             DateFormatSymbols symbols = new DateFormatSymbols(Locale.US);
             SimpleDateFormat df = new SimpleDateFormat("E hh:mm", symbols);
             SimpleDateFormat dfClone = (SimpleDateFormat) df.clone();
-            
+
             logln(df.toLocalizedPattern());
             String s0 = df.format(d);
             String s_dfClone = dfClone.format(d);
-            
+
             symbols.setLocalPatternChars("abcdefghijklmonpqr"); // change value of field
             logln(df.toLocalizedPattern());
             String s1 = df.format(d);
-            
+
             if (!s1.equals(s0) || !s1.equals(s_dfClone)) {
                 errln("Constructor: the formats are not equal");
             }
@@ -98,15 +102,15 @@ public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
             SimpleDateFormat df = new SimpleDateFormat("E hh:mm");
             df.setDateFormatSymbols(symbols);
             SimpleDateFormat dfClone = (SimpleDateFormat) df.clone();
-            
+
             logln(df.toLocalizedPattern());
             String s0 = df.format(d);
             String s_dfClone = dfClone.format(d);
-            
+
             symbols.setLocalPatternChars("abcdefghijklmonpqr"); // change value of field
             logln(df.toLocalizedPattern());
             String s1 = df.format(d);
-            
+
             if (!s1.equals(s0) || !s1.equals(s_dfClone)) {
                 errln("setDateFormatSymbols: the formats are not equal");
             }
@@ -115,7 +119,7 @@ public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
             }
         }
     }
-    
+
     /*
      * @bug 4117335
      */
index d3d1b3fc18371e83aedf7f48b93555fddcc51978..2d5645f356466d174dfe0c1ec86b229f10a79600 100644 (file)
@@ -7,7 +7,7 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v1.8.1 : format : DateFormatRegressionTest
  * Source File: $ICU4CRoot/source/test/intltest/dtfmrgts.cpp
  **/
@@ -28,7 +28,10 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.text.SimpleDateFormat;
 import com.ibm.icu.util.Calendar;
@@ -39,10 +42,11 @@ import com.ibm.icu.util.SimpleTimeZone;
 import com.ibm.icu.util.TimeZone;
 import com.ibm.icu.util.ULocale;
 
-/** 
+/**
  * Performs regression test for DateFormat
  **/
-public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class DateFormatRegressionTest extends TestFmwk {
     /**
      * @bug 4029195
      */
@@ -58,7 +62,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         FieldPosition pos = new FieldPosition(0);
         fmtd = sdf.format(today, fmtd, pos);
         logln("today: " + fmtd);
-    
+
         sdf.applyPattern("G yyyy DDD");
         StringBuffer todayS = new StringBuffer("");
         todayS = sdf.format(today, todayS, pos);
@@ -69,7 +73,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         } catch (Exception e) {
             errln("Error reparsing date: " + e.getMessage());
         }
-    
+
         try {
             StringBuffer rt = new StringBuffer("");
             rt = sdf.format(sdf.parse(todayS.toString()), rt, pos);
@@ -81,24 +85,24 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             e.printStackTrace();
         }
     }
-    
+
     /**
      * @bug 4052408
      */
     @Test
     public void Test4052408() {
-    
-        DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.US); 
+
+        DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.US);
         Calendar cal = Calendar.getInstance();
         cal.clear();
         cal.set(97 + 1900, Calendar.MAY, 3, 8, 55);
         Date dt = cal.getTime();
         String str = fmt.format(dt);
         logln(str);
-        
+
         if (!str.equals("5/3/97, 8:55 AM"))
             errln("Fail: Test broken; Want 5/3/97, 8:55 AM Got " + str);
-    
+
         String expected[] = {
             "", //"ERA_FIELD",
             "97", //"YEAR_FIELD",
@@ -118,27 +122,27 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             "8", //"HOUR1_FIELD",
             "", //"HOUR0_FIELD",
             "" //"TIMEZONE_FIELD"
-            };        
+            };
         String fieldNames[] = {
-                "ERA_FIELD", 
-                "YEAR_FIELD", 
-                "MONTH_FIELD", 
-                "DATE_FIELD", 
-                "HOUR_OF_DAY1_FIELD", 
-                "HOUR_OF_DAY0_FIELD", 
-                "MINUTE_FIELD", 
-                "SECOND_FIELD", 
-                "MILLISECOND_FIELD", 
-                "DAY_OF_WEEK_FIELD", 
-                "DAY_OF_YEAR_FIELD", 
-                "DAY_OF_WEEK_IN_MONTH_FIELD", 
-                "WEEK_OF_YEAR_FIELD", 
-                "WEEK_OF_MONTH_FIELD", 
-                "AM_PM_FIELD", 
-                "HOUR1_FIELD", 
-                "HOUR0_FIELD", 
-                "TIMEZONE_FIELD"}; 
-    
+                "ERA_FIELD",
+                "YEAR_FIELD",
+                "MONTH_FIELD",
+                "DATE_FIELD",
+                "HOUR_OF_DAY1_FIELD",
+                "HOUR_OF_DAY0_FIELD",
+                "MINUTE_FIELD",
+                "SECOND_FIELD",
+                "MILLISECOND_FIELD",
+                "DAY_OF_WEEK_FIELD",
+                "DAY_OF_YEAR_FIELD",
+                "DAY_OF_WEEK_IN_MONTH_FIELD",
+                "WEEK_OF_YEAR_FIELD",
+                "WEEK_OF_MONTH_FIELD",
+                "AM_PM_FIELD",
+                "HOUR1_FIELD",
+                "HOUR0_FIELD",
+                "TIMEZONE_FIELD"};
+
         boolean pass = true;
         for (int i = 0; i <= 17; ++i) {
             FieldPosition pos = new FieldPosition(i);
@@ -148,7 +152,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             String dst = buf.substring(pos.getBeginIndex(), pos.getEndIndex());
             str = dst;
             log(i + ": " + fieldNames[i] + ", \"" + str + "\", "
-                    + pos.getBeginIndex() + ", " + pos.getEndIndex()); 
+                    + pos.getBeginIndex() + ", " + pos.getEndIndex());
             String exp = expected[i];
             if ((exp.length() == 0 && str.length() == 0) || str.equals(exp))
                 logln(" ok");
@@ -160,14 +164,14 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         if (!pass)
             errln("Fail: FieldPosition not set right by DateFormat");
     }
-    
+
     /**
      * @bug 4056591
      * Verify the function of the [s|g]et2DigitYearStart() API.
      */
     @Test
     public void Test4056591() {
-    
+
         try {
             SimpleDateFormat fmt = new SimpleDateFormat("yyMMdd", Locale.US);
             Calendar cal = Calendar.getInstance();
@@ -189,11 +193,11 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             cal.clear();
             cal.set(1861, Calendar.DECEMBER, 25);
             Date d4 = cal.getTime();
-            
+
             Date dates[] = {d1, d2, d3, d4};
-    
-            String strings[] = {"091225", "091224", "091226", "611225"};            
-    
+
+            String strings[] = {"091225", "091224", "091226", "611225"};
+
             for (int i = 0; i < 4; i++) {
                 String s = strings[i];
                 Date exp = dates[i];
@@ -207,40 +211,40 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             e.printStackTrace();
         }
     }
-    
+
     /**
      * @bug 4059917
      */
     @Test
-    public void Test4059917() {        
+    public void Test4059917() {
         SimpleDateFormat fmt;
         String myDate;
         fmt = new SimpleDateFormat("yyyy/MM/dd");
         myDate = "1997/01/01";
-        aux917( fmt, myDate );        
+        aux917( fmt, myDate );
         fmt = new SimpleDateFormat("yyyyMMdd");
         myDate = "19970101";
         aux917( fmt, myDate );
     }
-    
+
     public void aux917(SimpleDateFormat fmt, String str) {
-    
+
         String pat = fmt.toPattern();
         logln("==================");
         logln("testIt: pattern=" + pat + " string=" + str);
         ParsePosition pos = new ParsePosition(0);
         Object o = fmt.parseObject(str, pos);
         //logln( UnicodeString("Parsed object: ") + o );
-    
+
         StringBuffer formatted = new StringBuffer("");
         FieldPosition poss = new FieldPosition(0);
         formatted = fmt.format(o, formatted, poss);
-    
+
         logln("Formatted string: " + formatted);
         if (!formatted.toString().equals(str))
             errln("Fail: Want " + str + " Got " + formatted);
     }
-    
+
     /**
      * @bug 4060212
      */
@@ -252,14 +256,14 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-DDD.hh:mm:ss");
         ParsePosition pos = new ParsePosition(0);
         Date myDate = formatter.parse(dateString, pos);
-        DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.LONG); 
+        DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.LONG);
         String myString = fmt.format(myDate);
         logln(myString);
         Calendar cal = new GregorianCalendar();
         cal.setTime(myDate);
         if ((cal.get(Calendar.DAY_OF_YEAR) != 40))
             errln("Fail: Got " + cal.get(Calendar.DAY_OF_YEAR) + " Want 40");
-    
+
         logln("Using yyyy-ddd.hh:mm:ss");
         formatter = new SimpleDateFormat("yyyy-ddd.hh:mm:ss");
         pos.setIndex(0);
@@ -275,7 +279,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
      */
     @Test
     public void Test4061287() {
-    
+
         SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
         try {
             logln(df.parse("35/01/1971").toString());
@@ -293,7 +297,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         if (!ok)
             errln("Fail: Lenient not working");
     }
-    
+
     /**
      * @bug 4065240
      */
@@ -304,7 +308,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         String strShortDate, strFullDate;
         Locale saveLocale = Locale.getDefault();
         TimeZone saveZone = TimeZone.getDefault();
-    
+
         try {
             Locale curLocale = new Locale("de", "DE");
             Locale.setDefault(curLocale);
@@ -324,16 +328,16 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             strFullDate = "The current date (long form) is ";
             String temp2 = fulldate.format(curDate);
             strFullDate += temp2;
-    
+
             logln(strShortDate);
             logln(strFullDate);
-    
+
             // {sfb} What to do with resource bundle stuff?????
-    
+
             // Check to see if the resource is present; if not, we can't test
             //ResourceBundle bundle = //The variable is never used
-            //    ICULocaleData.getBundle("DateFormatZoneData", curLocale); 
-    
+            //    ICULocaleData.getBundle("DateFormatZoneData", curLocale);
+
             // {sfb} API change to ResourceBundle -- add getLocale()
             /*if (bundle.getLocale().getLanguage().equals("de")) {
                 // UPDATE THIS AS ZONE NAME RESOURCE FOR <EST> in de_DE is updated
@@ -349,16 +353,16 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             Locale.setDefault(saveLocale);
             TimeZone.setDefault(saveZone);
         }
-    
+
     }
-    
+
     /*
       DateFormat.equals is too narrowly defined.  As a result, MessageFormat
       does not work correctly.  DateFormat.equals needs to be written so
       that the Calendar sub-object is not compared using Calendar.equals,
       but rather compared for equivalency.  This may necessitate adding a
       (package private) method to Calendar to test for equivalency.
-      
+
       Currently this bug breaks MessageFormat.toPattern
       */
     /**
@@ -368,7 +372,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
     public void Test4071441() {
         DateFormat fmtA = DateFormat.getInstance();
         DateFormat fmtB = DateFormat.getInstance();
-    
+
         // {sfb} Is it OK to cast away const here?
         Calendar calA = fmtA.getCalendar();
         Calendar calB = fmtB.getCalendar();
@@ -388,14 +392,14 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             errln("Fail: DateFormat unequal when Calendars equivalent");
         logln("DateFormat.equals ok");
     }
-        
+
     /* The java.text.DateFormat.parse(String) method expects for the
       US locale a string formatted according to mm/dd/yy and parses it
       correctly.
-    
+
       When given a string mm/dd/yyyy it only parses up to the first
       two y's, typically resulting in a date in the year 1919.
-      
+
       Please extend the parsing method(s) to handle strings with
       four-digit year values (probably also applicable to various
       other locales.  */
@@ -423,9 +427,9 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         } catch (ParseException e) {
             errln("Fail: " + e);
             e.printStackTrace();
-        }    
+        }
     }
-    
+
     /**
      * @bug 4089106
      */
@@ -442,24 +446,24 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             TimeZone.setDefault(def);
         }
     }
-    
+
     /**
      * @bug 4100302
      */
     @Test
     public void Test4100302() {
-        
+
         Locale locales[] = {
-            Locale.CANADA, Locale.CANADA_FRENCH, Locale.CHINA, 
-            Locale.CHINESE, Locale.ENGLISH, Locale.FRANCE, Locale.FRENCH, 
-            Locale.GERMAN, Locale.GERMANY, Locale.ITALIAN, Locale.ITALY, 
-            Locale.JAPAN, Locale.JAPANESE, Locale.KOREA, Locale.KOREAN, 
-            Locale.PRC, Locale.SIMPLIFIED_CHINESE, Locale.TAIWAN, 
-            Locale.TRADITIONAL_CHINESE, Locale.UK, Locale.US}; 
+            Locale.CANADA, Locale.CANADA_FRENCH, Locale.CHINA,
+            Locale.CHINESE, Locale.ENGLISH, Locale.FRANCE, Locale.FRENCH,
+            Locale.GERMAN, Locale.GERMANY, Locale.ITALIAN, Locale.ITALY,
+            Locale.JAPAN, Locale.JAPANESE, Locale.KOREA, Locale.KOREAN,
+            Locale.PRC, Locale.SIMPLIFIED_CHINESE, Locale.TAIWAN,
+            Locale.TRADITIONAL_CHINESE, Locale.UK, Locale.US};
         try {
             boolean pass = true;
             for (int i = 0; i < 21; i++) {
-                Format format = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, locales[i]); 
+                Format format = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, locales[i]);
                 byte[] bytes;
                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 ObjectOutputStream oos = new ObjectOutputStream(baos);
@@ -471,7 +475,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
                 Object o = ois.readObject();
                 if (!format.equals(o)) {
                     pass = false;
-                    logln("DateFormat instance for locale " + locales[i] + " is incorrectly serialized/deserialized."); 
+                    logln("DateFormat instance for locale " + locales[i] + " is incorrectly serialized/deserialized.");
                 } else {
                     logln("DateFormat instance for locale " + locales[i] + " is OKAY.");
                 }
@@ -485,9 +489,9 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         } catch (ClassNotFoundException e) {
             errln("Fail: " + e);
         }
-    
+
     }
-    
+
     /**
      * @bug 4101483
      */
@@ -504,7 +508,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         if (fp.getBeginIndex() == fp.getEndIndex())
             errln("Fail: Empty field");
     }
-    
+
     /**
      * @bug 4103340
      * @bug 4138203
@@ -515,25 +519,25 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
      */
     @Test
     public void Test4103340() {
-    
-        // choose a date that is the FIRST of some month 
+
+        // choose a date that is the FIRST of some month
         // and some arbitrary time
         Calendar cal = Calendar.getInstance();
         cal.clear();
         cal.set(1997, 3, 1, 1, 1, 1);
-        Date d = cal.getTime(); 
+        Date d = cal.getTime();
         SimpleDateFormat df = new SimpleDateFormat("MMMM", Locale.US);
         String s = d.toString();
         StringBuffer s2 = new StringBuffer("");
         FieldPosition pos = new FieldPosition(0);
         s2 = df.format(d, s2, pos);
-        logln("Date=" + s); 
+        logln("Date=" + s);
         logln("DF=" + s2);
         String substr = s2.substring(0,2);
         if (s.indexOf(substr) == -1)
           errln("Months should match");
     }
-    
+
     /**
      * @bug 4103341
      */
@@ -551,7 +555,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             TimeZone.setDefault(saveZone);
         }
     }
-    
+
     /**
      * @bug 4104136
      */
@@ -582,7 +586,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
                 errln( "Fail: Expected result " + exp);
         }
     }
-    
+
     /**
      * @bug 4104522
      * CANNOT REPRODUCE
@@ -605,9 +609,9 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         pp.setIndex(0);
         text = "time";
         dt = sdf.parse(text, pp);
-        logln(" text: \"" + text + "\"" + " date: " + dt);    
+        logln(" text: \"" + text + "\"" + " date: " + dt);
     }
-    
+
     /**
      * @bug 4106807
      */
@@ -615,19 +619,19 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
     public void Test4106807() {
         Date dt;
         DateFormat df = DateFormat.getDateTimeInstance();
-    
+
         SimpleDateFormat sdfs[] = {
-                new SimpleDateFormat("yyyyMMddHHmmss"), 
-                new SimpleDateFormat("yyyyMMddHHmmss'Z'"), 
-                new SimpleDateFormat("yyyyMMddHHmmss''"), 
-                new SimpleDateFormat("yyyyMMddHHmmss'a''a'"), 
-                new SimpleDateFormat("yyyyMMddHHmmss %")}; 
+                new SimpleDateFormat("yyyyMMddHHmmss"),
+                new SimpleDateFormat("yyyyMMddHHmmss'Z'"),
+                new SimpleDateFormat("yyyyMMddHHmmss''"),
+                new SimpleDateFormat("yyyyMMddHHmmss'a''a'"),
+                new SimpleDateFormat("yyyyMMddHHmmss %")};
         String strings[] = {
-                "19980211140000", 
-                "19980211140000", 
-                "19980211140000", 
-                "19980211140000a", 
-                "19980211140000 "}; 
+                "19980211140000",
+                "19980211140000",
+                "19980211140000",
+                "19980211140000a",
+                "19980211140000 "};
         GregorianCalendar gc = new GregorianCalendar();
         TimeZone timeZone = TimeZone.getDefault();
         TimeZone gmt = (TimeZone) timeZone.clone();
@@ -639,12 +643,12 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
                 format.setTimeZone(gmt);
                 dt = format.parse(dateString);
                 // {sfb} some of these parses will fail purposely
-    
+
                 StringBuffer fmtd = new StringBuffer("");
                 FieldPosition pos = new FieldPosition(0);
                 fmtd = df.format(dt, fmtd, pos);
                 logln(fmtd.toString());
-                //logln(df.format(dt)); 
+                //logln(df.format(dt));
                 gc.setTime(dt);
                 logln("" + gc.get(Calendar.ZONE_OFFSET));
                 StringBuffer s = new StringBuffer("");
@@ -655,35 +659,35 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             }
         }
     }
-    
+
     /*
       Synopsis: Chinese time zone CTT is not recogonized correctly.
-      Description: Platform Chinese Windows 95 - ** Time zone set to CST ** 
+      Description: Platform Chinese Windows 95 - ** Time zone set to CST **
       */
     /**
      * @bug 4108407
      */
-    
-    // {sfb} what to do with this one ?? 
+
+    // {sfb} what to do with this one ??
     @Test
     public void Test4108407() {
         /*
     // TODO user.timezone is a protected system property, catch securityexception and warn
     // if this is reenabled
-        long l = System.currentTimeMillis(); 
+        long l = System.currentTimeMillis();
         logln("user.timezone = " + System.getProperty("user.timezone", "?"));
-        logln("Time Zone :" + 
-                           DateFormat.getDateInstance().getTimeZone().getID()); 
-        logln("Default format :" + 
-                           DateFormat.getDateInstance().format(new Date(l))); 
-        logln("Full format :" + 
-                           DateFormat.getDateInstance(DateFormat.FULL).format(new 
-                                                                              Date(l))); 
+        logln("Time Zone :" +
+                           DateFormat.getDateInstance().getTimeZone().getID());
+        logln("Default format :" +
+                           DateFormat.getDateInstance().format(new Date(l)));
+        logln("Full format :" +
+                           DateFormat.getDateInstance(DateFormat.FULL).format(new
+                                                                              Date(l)));
         logln("*** Set host TZ to CST ***");
         logln("*** THE RESULTS OF THIS TEST MUST BE VERIFIED MANUALLY ***");
         */
     }
-    
+
     /**
      * @bug 4134203
      * SimpleDateFormat won't parse "GMT"
@@ -692,7 +696,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
     public void Test4134203() {
         String dateFormat = "MM/dd/yy HH:mm:ss zzz";
         SimpleDateFormat fmt = new SimpleDateFormat(dateFormat);
-    
+
         ParsePosition p0 = new ParsePosition(0);
         Date d = fmt.parse("01/22/92 04:52:00 GMT", p0);
         logln(d.toString());
@@ -701,15 +705,15 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         // In the failure case an exception is thrown by parse();
         // if no exception is thrown, the test passes.
     }
-    
+
     /**
      * @bug 4151631
      * SimpleDateFormat incorrect handling of 2 single quotes in format()
      */
     @Test
     public void Test4151631() {
-        String pattern = 
-            "'TO_DATE('''dd'-'MM'-'yyyy HH:mm:ss''' , ''DD-MM-YYYY HH:MI:SS'')'"; 
+        String pattern =
+            "'TO_DATE('''dd'-'MM'-'yyyy HH:mm:ss''' , ''DD-MM-YYYY HH:MI:SS'')'";
         logln("pattern=" + pattern);
         SimpleDateFormat format = new SimpleDateFormat(pattern, Locale.US);
         StringBuffer result = new StringBuffer("");
@@ -718,14 +722,14 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         cal.clear();
         cal.set(1998, Calendar.JUNE, 30, 13, 30, 0);
         Date d = cal.getTime();
-        result = format.format(d, result, pos); 
+        result = format.format(d, result, pos);
         if (!result.toString().equals("TO_DATE('30-06-1998 13:30:00' , 'DD-MM-YYYY HH:MI:SS')")) {
             errln("Fail: result=" + result);
         } else {
             logln("Pass: result=" + result);
         }
     }
-    
+
     /**
      * @bug 4151706
      * 'z' at end of date format throws index exception in SimpleDateFormat
@@ -751,7 +755,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         FieldPosition pos = new FieldPosition(0);
         logln(dateString + " . " + fmt.format(d, temp, pos));
     }
-    
+
     /**
      * @bug 4162071
      * Cannot reproduce this bug under 1.2 FCS -- it may be a convoluted duplicate
@@ -771,7 +775,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             errln("Parse format \"" + format + "\" failed.");
         }
     }
-    
+
     /**
      * DateFormat shouldn't parse year "-1" as a two-digit year (e.g., "-1" . 1999).
      */
@@ -784,10 +788,10 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
          * greater than "99", are treated as literal years.  So "1/2/3456"
          * becomes 3456 AD.  Likewise, "1/2/-3" becomes -3 AD == 2 BC.
          */
-        final String STRINGS[] = 
-            {"02/29/00", "01/23/01", "04/05/-1", "01/23/-9", "11/12/1314", "10/31/1", "09/12/+1", "09/12/001",}; 
+        final String STRINGS[] =
+            {"02/29/00", "01/23/01", "04/05/-1", "01/23/-9", "11/12/1314", "10/31/1", "09/12/+1", "09/12/001",};
         int STRINGS_COUNT = STRINGS.length;
-                
+
         Calendar cal = Calendar.getInstance();
         Date FAIL_DATE = cal.getTime();
         cal.clear();
@@ -808,16 +812,16 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         cal.clear();
         cal.set(1, Calendar.OCTOBER, 31);
         Date d5 = cal.getTime();
-        cal.clear();        
+        cal.clear();
         cal.set(1, Calendar.SEPTEMBER, 12);
         Date d7 = cal.getTime();
         Date DATES[] = {d0, d1, d2, d3, d4, d5, FAIL_DATE, d7};
-    
+
         String out = "";
         boolean pass = true;
         for (int i = 0; i < STRINGS_COUNT; ++i) {
             String str = STRINGS[i];
-            Date expected = DATES[i];            
+            Date expected = DATES[i];
             Date actual = null;
             try {
                 actual = fmt.parse(str);
@@ -831,7 +835,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
                 // Yuck: See j25
                 actStr = ((DateFormat) dispFmt).format(actual);
             }
-                               
+
             if (expected.getTime() == (actual.getTime())) {
                 out += str + " => " + actStr + "\n";
             } else {
@@ -852,18 +856,18 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             err(out);
         }
     }
-    
+
     /**
      * j32 {JDK Bug 4210209 4209272}
      * DateFormat cannot parse Feb 29 2000 when setLenient(false)
      */
     @Test
     public void Test4210209() {
-    
+
         String pattern = "MMM d, yyyy";
         DateFormat fmt = new SimpleDateFormat(pattern, Locale.US);
         DateFormat disp = new SimpleDateFormat("MMM dd yyyy GG", Locale.US);
-    
+
         Calendar calx = fmt.getCalendar();
         calx.setLenient(false);
         Calendar calendar = Calendar.getInstance();
@@ -880,7 +884,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         if (pos.getErrorIndex() != -1) {
             errln("FAIL: Error index should be -1");
         }
-    
+
         // The underlying bug is in GregorianCalendar.  If the following lines
         // succeed, the bug is fixed.  If the bug isn't fixed, they will throw
         // an exception.
@@ -891,7 +895,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         d = cal.getTime();
         logln("Attempt to set Calendar to Feb 29 2000: " + disp.format(d));
     }
-    
+
     @Test
     public void Test714() {
         //TimeZone Offset
@@ -982,7 +986,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             logln(what + "=" + s);
             first = s.charAt(0);
             if(first<kHindiZero || first>(kHindiZero+9)) {
-                errln(what + "- wrong digit,  got " + s + " (integer digit value " + new Integer((int)first).toString());
+                errln(what + "- wrong digit,  got " + s + " (integer digit value " + new Integer(first).toString());
             }
         }
 
@@ -993,7 +997,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             logln(what + ": " + s);
             first = s.charAt(0);
             if(first<kArabicZero || first>(kArabicZero+9)) {
-                errln(what + " wrong digit, got " + s + " (integer digit value " + new Integer((int)first).toString());
+                errln(what + " wrong digit, got " + s + " (integer digit value " + new Integer(first).toString());
             }
         }
 
@@ -1004,7 +1008,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             logln(what + ": " + s);
             first = s.charAt(0);
             if(first<kArabicZero || first>(kArabicZero+9)) {
-                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer((int)first).toString());
+                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer(first).toString());
             }
         }
         {
@@ -1014,7 +1018,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             logln(what + ": " + s);
             first = s.charAt(0);
             if(first<kLatinZero || first>(kLatinZero+9)) {
-                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer((int)first).toString());
+                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer(first).toString());
             }
         }
 
@@ -1025,7 +1029,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             logln(what+ ": " + s);
             first = s.charAt(0);
             if(first<kArabicZero || first>(kArabicZero+9)) {
-                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer((int)first).toString());
+                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer(first).toString());
             }
         }
 
@@ -1036,7 +1040,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             logln(what+ ": " + s);
             first = s.charAt(0);
             if(first<kArabicZero || first>(kArabicZero+9)) {
-                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer((int)first).toString());
+                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer(first).toString());
             }
         }
 
@@ -1047,7 +1051,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             logln(what+ ": " + s);
             first = s.charAt(0);
             if(first<kArabicZero || first>(kArabicZero+9)) {
-                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer((int)first).toString());
+                errln(what + " wrong  digit but got " + s + " (integer digit value " + new Integer(first).toString());
             }
         }
     }
@@ -1138,7 +1142,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             String twelfthMonthLocalizedCivil = shortMonthsCivil[11];
 
             islamicCivilTwelfthMonthLocalized[i] = twelfthMonthLocalizedCivil;
-            
+
             com.ibm.icu.util.IslamicCalendar islamicCalendar = new com.ibm.icu.util.IslamicCalendar(locale);
             islamicCalendar.setCivil(false);
             com.ibm.icu.text.SimpleDateFormat islamicDateFormat = (com.ibm.icu.text.SimpleDateFormat) islamicCalendar
@@ -1195,7 +1199,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             }
         }
     }
-    
+
     @Test
     public void TestParsing() {
         String pattern = "EEE-WW-MMMM-yyyy";
@@ -1205,7 +1209,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         SimpleDateFormat format = new SimpleDateFormat(pattern);
         Calendar cal = GregorianCalendar.getInstance(Locale.US);
         ParsePosition pos = new ParsePosition(0);
-        
+
         try {
             format.parse(text, cal, pos);
         } catch (Exception e) {
@@ -1231,7 +1235,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         String dangiDateStr = fmt.format(d);
         assertEquals("Bad date format", "Mo1 20, 2013", dangiDateStr);
     }
-    
+
     @Test
     public void TestT10110() {
         try {
@@ -1250,7 +1254,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
 
     @Test
     public void TestT10239() {
-        
+
         class TestDateFormatItem {
             public String parseString;
             public String pattern;
@@ -1262,7 +1266,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
                 expectedResult = expResult;
             }
         };
-        
+
         final TestDateFormatItem[] items = {
         //                     parse String                 pattern                 expected result
         new TestDateFormatItem("1 Oct 13 2013",             "e MMM dd yyyy",        "1 Oct 13 2013"),
@@ -1277,7 +1281,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
 
         StringBuffer result = new StringBuffer();
         Date d = new Date();
-        Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.US); 
+        Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.US);
         SimpleDateFormat sdfmt = new SimpleDateFormat();
         ParsePosition p = new ParsePosition(0);
         for (TestDateFormatItem item: items) {
@@ -1307,7 +1311,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             }
         }
   }
-  
+
 
     @Test
     public void TestT10334() {
@@ -1315,11 +1319,11 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         String text = new String("--mon-02-march-2011");
         SimpleDateFormat format = new SimpleDateFormat(pattern);
 
-        format.setBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH, false);      
+        format.setBooleanAttribute(DateFormat.BooleanAttribute.PARSE_PARTIAL_LITERAL_MATCH, false);
         try {
             format.parse(text);
             errln("parse partial match did NOT fail in strict mode!");
-        } catch (ParseException pe) {        
+        } catch (ParseException pe) {
             // expected
         }
 
@@ -1335,7 +1339,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         format.applyPattern(pattern);
         Date referenceDate = null;
         try {
-            referenceDate = format.parse(text);            
+            referenceDate = format.parse(text);
         } catch (ParseException pe) {
             errln("unable to instantiate reference date: " + pe.getLocalizedMessage());
         }
@@ -1343,7 +1347,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         FieldPosition fp = new FieldPosition(0);
         pattern = new String("YYYY LL dd ee cc qq QQ");
         format.applyPattern(pattern);
-        StringBuffer formattedString = new StringBuffer(); 
+        StringBuffer formattedString = new StringBuffer();
         formattedString = format.format(referenceDate, formattedString, fp);
         logln("ref date: " + formattedString);
 
@@ -1352,13 +1356,13 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         text = new String("2013 12 10 03 3 04 04");
         format.applyPattern(pattern);
         logln(format.format(referenceDate));
-        
+
         format.setBooleanAttribute(DateFormat.BooleanAttribute.PARSE_ALLOW_NUMERIC, true);
         ParsePosition pp = new ParsePosition(0);
         format.parse(text, pp);
         int errorIdx = pp.getErrorIndex();
         if (errorIdx != -1) {
-            
+
             errln("numeric parse error at["+errorIdx+"] on char["+pattern.substring(errorIdx, errorIdx+1)+"] in pattern["+pattern+"]");
         }
 
@@ -1369,7 +1373,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         } catch (ParseException pe) {
             // expected
         }
-        
+
         /*
          * test to verify new code (and improve code coverage) for normal quarter processing
          */
@@ -1384,7 +1388,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
 
     @Test
     public void TestT10619() {
-        
+
         class TestDateFormatLeniencyItem {
             public boolean leniency;
             public String parseString;
@@ -1412,7 +1416,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
 
         StringBuffer result = new StringBuffer();
         Date d = new Date();
-        Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.US); 
+        Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.US);
         SimpleDateFormat sdfmt = new SimpleDateFormat();
         ParsePosition p = new ParsePosition(0);
         for (TestDateFormatLeniencyItem item: items) {
@@ -1443,7 +1447,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             }
         }
   }
-    
+
     @Test
   public void TestT10906()
   {
@@ -1454,7 +1458,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
       try {
           format.parse(text, pp);
           int errorIdx = pp.getErrorIndex();
-          if (errorIdx == -1) {          
+          if (errorIdx == -1) {
               errln("failed to report invalid (negative) starting parse position");
           }
       } catch(StringIndexOutOfBoundsException e) {
@@ -1476,6 +1480,7 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
                 this.d = d;
             }
 
+            @Override
             public void run() {
                 String s0 = fmt.format(d);
                 for (int i = 0; i < 1000; i++) {
index 922507739fa5b45921ba70e120dcc815ceb620a5..a797a8771084d6262188607a7bd21da319409ab2 100644 (file)
@@ -20,31 +20,35 @@ import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.text.DateFormatSymbols;
 import com.ibm.icu.text.SimpleDateFormat;
 import com.ibm.icu.util.Calendar;
 import com.ibm.icu.util.TimeZone;
 
-public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
-    
+@RunWith(JUnit4.class)
+public class DateFormatRegressionTestJ extends TestFmwk {
+
     private static final String TIME_STRING = "2000/11/17 08:01:00";
     private static final long UTC_LONG = 974476860000L;
     private SimpleDateFormat sdf_;
-    
+
     @Before
     public void init()throws Exception {
-        sdf_ = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");        
+        sdf_ = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
     }
-    
+
     //Return value of getAmPmStrings
     @Test
     public void Test4103926() {
         String act_Ampms[];
         String exp_Ampms[]={"AM","PM"};
         Locale.setDefault(Locale.US);
-        
+
         DateFormatSymbols dfs = new DateFormatSymbols();
         act_Ampms = dfs.getAmPmStrings();
         if(act_Ampms.length != exp_Ampms.length) {
@@ -57,24 +61,24 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
         }
     }
 
-    // Missing digit in millisecond format in SimpleDateFormat 
+    // Missing digit in millisecond format in SimpleDateFormat
     @Test
     public void Test4148168() {
             Date d = new Date(1002705212906L);
             String[] ISOPattern = {
-                "''yyyy-MM-dd-hh.mm.ss.S''", "''yyyy-MM-dd-hh.mm.ss.SS''", 
-                "''yyyy-MM-dd-hh.mm.ss.SSS''", "''yyyy-MM-dd-hh.mm.ss.SSSS''", 
-                "''yyyy-MM-dd-hh.mm.ss.SSSSS''", "''yyyy-MM-dd-hh.mm.ss.SSSSSS''", 
+                "''yyyy-MM-dd-hh.mm.ss.S''", "''yyyy-MM-dd-hh.mm.ss.SS''",
+                "''yyyy-MM-dd-hh.mm.ss.SSS''", "''yyyy-MM-dd-hh.mm.ss.SSSS''",
+                "''yyyy-MM-dd-hh.mm.ss.SSSSS''", "''yyyy-MM-dd-hh.mm.ss.SSSSSS''",
                 "''yyyy-MM-dd-hh.mm.ss.SSSSSSS''", "''yyyy-MM-dd-hh.mm.ss.SSS000''"};
             SimpleDateFormat aSimpleDF = (SimpleDateFormat)DateFormat.getDateTimeInstance();
-    
+
             for(int i = 0; i<ISOPattern.length; i++) {
                 aSimpleDF.applyPattern( ISOPattern[i] );
                 logln( "Pattern = " + aSimpleDF.toPattern());
                 logln( "Format = " + aSimpleDF.format(d));
             }
     }
-    
+
     //DateFormat getDateTimeInstance(int, int), invalid styles no exception
     @Test
     public void Test4213086() {
@@ -87,8 +91,8 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
         } catch(Exception e){
             logln("dateStyle = 2" + "\t timeStyle = -2");
             logln("Exception caught!");
-        }            
-        
+        }
+
         try {
             DateFormat df3 = DateFormat.getDateTimeInstance(4, 2);
             d = df3.format(someDate);
@@ -98,7 +102,7 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
             logln("Exception caught!");
             logln("********************************************");
         }
-    
+
         try {
             DateFormat df4 = DateFormat.getDateTimeInstance(-12, -12);
             d = df4.format(someDate);
@@ -108,10 +112,10 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
             logln("Exception caught!");
             logln("********************************************");
         }
-    
+
         try{
             DateFormat df5 = DateFormat.getDateTimeInstance(2, 123);
-            d = df5.format(someDate);    
+            d = df5.format(someDate);
             errln("we should catch an exception here");
         } catch(Exception e){
             logln("dateStyle = 2" + "\t timeStyle = 123");
@@ -123,7 +127,7 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
             logln("The value of d: " + d);
         }
     }
-    
+
     //DateFormat.format works wrongly?
     @Test
     public void Test4250359() {
@@ -135,26 +139,26 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
         DateFormat tf = DateFormat.getTimeInstance(DateFormat.SHORT);
         String act_result = tf.format(d);
         String exp_result = "5:53 PM";
-        
+
         if(!act_result.equals(exp_result)){
             errln("The result is not expected");
         }
     }
-    
+
     //pattern "s.S, parse '1ms'"
     @Test
     public void Test4253490() {
         Date d = new Date(1002705212231L);
 
         String[] ISOPattern = {
-                "''yyyy-MM-dd-hh.mm.ss.S''", 
-                "''yyyy-MM-dd-hh.mm.ss.SS''", 
-                "''yyyy-MM-dd-hh.mm.ss.SSS''", 
-                "''yyyy-MM-dd-hh.mm.ss.SSSS''", 
-                "''yyyy-MM-dd-hh.mm.ss.SSSSS''", 
-                "''yyyy-MM-dd-hh.mm.ss.SSSSSS''", 
-                "''yyyy-MM-dd-hh.mm.ss.SSSSSSS''"}; 
-    
+                "''yyyy-MM-dd-hh.mm.ss.S''",
+                "''yyyy-MM-dd-hh.mm.ss.SS''",
+                "''yyyy-MM-dd-hh.mm.ss.SSS''",
+                "''yyyy-MM-dd-hh.mm.ss.SSSS''",
+                "''yyyy-MM-dd-hh.mm.ss.SSSSS''",
+                "''yyyy-MM-dd-hh.mm.ss.SSSSSS''",
+                "''yyyy-MM-dd-hh.mm.ss.SSSSSSS''"};
+
         SimpleDateFormat aSimpleDF = (SimpleDateFormat) DateFormat.getDateTimeInstance();
         for (int i = 0; i < ISOPattern.length; i++) {
             aSimpleDF.applyPattern(ISOPattern[i]);
@@ -162,7 +166,7 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
             logln("Format = " + aSimpleDF.format(d));
         }
     }
-    
+
     //about regression test
     @Test
     public void Test4266432() {
@@ -170,13 +174,13 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
         Locale loc = Locale.getDefault();
         String dateFormat = "MM/dd/yy HH:mm:ss zzz";
         SimpleDateFormat fmt = new SimpleDateFormat(dateFormat);
-    
+
         ParsePosition p0 = new ParsePosition(0);
         logln("Under  " + loc +"  locale");
         Date d = fmt.parse("01/22/92 04:52:00 GMT", p0);
         logln(d.toString());
     }
-    
+
     //SimpleDateFormat inconsistent for number of digits for years
     @Test
     public void Test4358730() {
@@ -185,22 +189,22 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
         cal.clear();
         cal.set(2001,11,10);
         Date today = cal.getTime();
-    
+
         sdf.applyPattern("MM d y");
         logln(sdf.format(today));
         sdf.applyPattern("MM d yy");
         logln(sdf.format(today));
-    
+
         sdf.applyPattern("MM d yyy");
         logln(sdf.format(today));
-    
+
         sdf.applyPattern("MM d yyyy");
         logln(sdf.format(today));
-    
+
         sdf.applyPattern("MM d yyyyy");
         logln(sdf.format(today));
     }
-    
+
     //Parse invalid string
     @Test
     public void Test4375399() {
@@ -227,7 +231,7 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
             Thread.sleep(1000);
         } catch (Exception e) {}
     }*/
-    
+
     @Test
     public void Test4468663() {
         Date d =new Date(-93716671115767L);
@@ -240,23 +244,24 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
             logln("original date: " + origin_d.toString());
             str = sdf.format(d);
             logln(" after format----->" + str);
-            
+
             d = sdf.parse(str, new ParsePosition(0));
             logln(" after parse----->" + d.toString());
-    
+
             str = sdf.format(d);
             logln(" after format----->" + str);
-    
+
             d = sdf.parse(str, new ParsePosition(0));
             logln(" after parse----->" + d.toString());
-    
+
             str = sdf.format(d);
-            logln(" after format----->" + str);        
+            logln(" after format----->" + str);
         }
     }
-    
+
     //Class used by Test4407042
     class DateParseThread extends Thread {
+        @Override
         public void run() {
             SimpleDateFormat sdf = (SimpleDateFormat) sdf_.clone();
             TimeZone defaultTZ = TimeZone.getDefault();
@@ -272,7 +277,7 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
                     long t = date.getTime();
                     i++;
                     if (t != ms) {
-                        throw new ParseException("Parse Error: " + i + " (" + sdf.format(date) 
+                        throw new ParseException("Parse Error: " + i + " (" + sdf.format(date)
                                   + ") " + t + " != " + ms, 0);
                     }
                 }
@@ -281,10 +286,11 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
             }
         }
     }
-    
+
     //Class used by Test4407042
     class DateFormatThread extends Thread {
-        public void run() {            
+        @Override
+        public void run() {
             SimpleDateFormat sdf = (SimpleDateFormat) sdf_.clone();
             TimeZone tz = TimeZone.getTimeZone("PST");
             sdf.setTimeZone(tz);
@@ -293,11 +299,11 @@ public class DateFormatRegressionTestJ extends com.ibm.icu.dev.test.TestFmwk {
                 i++;
                 String s = sdf.format(new Date(UTC_LONG));
                 if (!s.equals(TIME_STRING)) {
-                    errln("Format Error: " + i + " " + s + " != " 
+                    errln("Format Error: " + i + " " + s + " != "
                                     + TIME_STRING);
                 }
             }
         }
     }
-    
+
 }
index ff515fdfaf4deef91884e2ce36de846062e10041..35044f5056cc5ac636b5e2de9d7dfd2e35aca70a 100644 (file)
@@ -21,7 +21,10 @@ import java.util.Locale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.text.SimpleDateFormat;
 import com.ibm.icu.util.Calendar;
@@ -31,7 +34,8 @@ import com.ibm.icu.util.TimeZone;
 /**
  * Performs round-trip tests for DateFormat
  **/
-public class DateFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class DateFormatRoundTripTest extends TestFmwk {
     public boolean INFINITE = false;
     public boolean quick = true;
     private SimpleDateFormat dateFormat;
index c3de66d88d714e6c72bb62e84569da1449b8dd68..fdd9dded4b130407f5fe1c741bef839187cb9929 100644 (file)
@@ -37,7 +37,10 @@ import java.util.ResourceBundle;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUData;
 import com.ibm.icu.impl.ICUResourceBundle;
 import com.ibm.icu.text.ChineseDateFormat;
@@ -63,7 +66,8 @@ import com.ibm.icu.util.ULocale;
 import com.ibm.icu.util.UResourceBundle;
 import com.ibm.icu.util.VersionInfo;
 
-public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class DateFormatTest extends TestFmwk {
     /**
      * Verify that patterns have the correct values and could produce the
      * the DateFormat instances that contain the correct localized patterns.
@@ -2394,9 +2398,9 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
 
         f.format((Object)cal, buf, pos);
         f.format((Object)now, buf, pos);
-        f.format((Object)new Long(now.getTime()), buf, pos);
+        f.format(new Long(now.getTime()), buf, pos);
         try {
-            f.format((Object)"Howdy", buf, pos);
+            f.format("Howdy", buf, pos);
         }
         catch (Exception e) {
         }
@@ -4000,7 +4004,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
             String expected = data[i + 1];
             if (!out.equals(expected))
             {
-                errln((String)"FAIL: " + in + " -> " + out + " expected -> " + expected);
+                errln("FAIL: " + in + " -> " + out + " expected -> " + expected);
             }
         }
     }
@@ -4023,7 +4027,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         String res1 = result.toString();
         String expected = "\u4e8c\u3007\u3007\u4e5d\u5e74\u4e03\u6708\u4e8c\u5341\u516b\u65e5";
         if (! res1.equals(expected)) {
-            errln((String)"FAIL: -> " + result.toString() + " expected -> " + expected);
+            errln("FAIL: -> " + result.toString() + " expected -> " + expected);
         }
         ParsePosition pp = new ParsePosition(0);
         Date parsedate = sdf.parse(expected, pp);
@@ -4090,7 +4094,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk {
             String expected  = DATA[i][1];
 
             if (!result.equals(expected))
-                errln((String) "FAIL: -> " + result.toString() + " expected -> " + expected);
+                errln("FAIL: -> " + result.toString() + " expected -> " + expected);
         }
     }
 
index 859bc1bdaed2a935a67bff9634a8ff0b06d09486..ec22af2cbeec70fbd3cd1be3248934bf638225ef 100644 (file)
@@ -8,7 +8,7 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v1.8.1 : format : DateIntervalFormatTest
  * Source File: $ICU4CRoot/source/test/intltest/dtifmtts.cpp
  **/
@@ -25,6 +25,8 @@ import java.util.ListIterator;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -39,14 +41,15 @@ import com.ibm.icu.util.Output;
 import com.ibm.icu.util.TimeZone;
 import com.ibm.icu.util.ULocale;
 
-public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class DateIntervalFormatTest extends TestFmwk {
 
     /**
-     * 
+     *
      */
     private static final ULocale SPANISH = new ULocale("es");
     /**
-     * 
+     *
      */
     private static final ULocale LA_SPANISH = new ULocale("es-419");
 
@@ -58,7 +61,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         // first item is date pattern
         // followed by a group of locale/from_data/to_data/skeleton/interval_data
         String[] DATA = {
-                "yyyy MM dd HH:mm:ss",    
+                "yyyy MM dd HH:mm:ss",
                 // test root
                 "root", "2007 11 10 10:10:10", "2007 12 10 10:10:10", "yM", "2007-11 \\u2013 2007-12",
 
@@ -67,623 +70,623 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 "en", "2007 11 10 10:10:10", "2007 11 10 15:10:10", "hms", "10:10:10 AM \\u2013 3:10:10 PM",
 
                 // test skeleton with both date and time
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMyhm", "Nov 10, 2007, 10:10 AM \\u2013 Nov 20, 2007, 10:10 AM", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMyhm", "Nov 10, 2007, 10:10 AM \\u2013 Nov 20, 2007, 10:10 AM",
 
-                "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "dMMMyhm", "Nov 10, 2007, 10:10 \\u2013 11:10 AM", 
+                "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "dMMMyhm", "Nov 10, 2007, 10:10 \\u2013 11:10 AM",
 
-                "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "hms", "10:10:10 AM \\u2013 11:10:10 AM", 
+                "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "hms", "10:10:10 AM \\u2013 11:10:10 AM",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10, 2007 \\u2013 Friday, October 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10, 2007 \\u2013 Friday, October 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMMy", "October 10, 2007 \\u2013 October 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMMy", "October 10, 2007 \\u2013 October 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMM", "October 10, 2007 \\u2013 October 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMM", "October 10, 2007 \\u2013 October 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMMy", "October 2007 \\u2013 October 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMMy", "October 2007 \\u2013 October 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10, 2007 \\u2013 Friday, October 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10, 2007 \\u2013 Friday, October 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMMMy", "Wed, Oct 10, 2007 \\u2013 Fri, Oct 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMMMy", "Wed, Oct 10, 2007 \\u2013 Fri, Oct 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMy", "Oct 10, 2007 \\u2013 Oct 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMy", "Oct 10, 2007 \\u2013 Oct 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "Oct 10, 2007 \\u2013 Oct 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "Oct 10, 2007 \\u2013 Oct 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Oct 2007 \\u2013 Oct 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Oct 2007 \\u2013 Oct 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMMM", "Wed, Oct 10, 2007 \\u2013 Fri, Oct 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMMM", "Wed, Oct 10, 2007 \\u2013 Fri, Oct 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10/10/2007 \\u2013 10/10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10/10/2007 \\u2013 10/10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dM", "10/10/2007 \\u2013 10/10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dM", "10/10/2007 \\u2013 10/10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10/2007 \\u2013 10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10/2007 \\u2013 10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "d", "10/10/2007 \\u2013 10/10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "d", "10/10/2007 \\u2013 10/10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Ed", "10 Wed \\u2013 10 Fri", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Ed", "10 Wed \\u2013 10 Fri",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007 \\u2013 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007 \\u2013 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10/2007 \\u2013 10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10/2007 \\u2013 10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMM", "Oct 2007 \\u2013 Oct 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMM", "Oct 2007 \\u2013 Oct 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMM", "October 2007 \\u2013 October 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMM", "October 2007 \\u2013 October 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10/10/2007, 10:10 AM \\u2013 10/10/2008, 10:10 AM", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10/10/2007, 10:10 AM \\u2013 10/10/2008, 10:10 AM",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hmv", "10/10/2007, 10:10 AM PT \\u2013 10/10/2008, 10:10 AM PT", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hmv", "10/10/2007, 10:10 AM PT \\u2013 10/10/2008, 10:10 AM PT",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hmz", "10/10/2007, 10:10 AM PDT \\u2013 10/10/2008, 10:10 AM PDT", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hmz", "10/10/2007, 10:10 AM PDT \\u2013 10/10/2008, 10:10 AM PDT",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "h", "10/10/2007, 10 AM \\u2013 10/10/2008, 10 AM", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "h", "10/10/2007, 10 AM \\u2013 10/10/2008, 10 AM",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hv", "10/10/2007, 10 AM PT \\u2013 10/10/2008, 10 AM PT", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hv", "10/10/2007, 10 AM PT \\u2013 10/10/2008, 10 AM PT",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hz", "10/10/2007, 10 AM PDT \\u2013 10/10/2008, 10 AM PDT", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hz", "10/10/2007, 10 AM PDT \\u2013 10/10/2008, 10 AM PDT",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EddMMy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EddMMy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hhmm", "10/10/2007, 10:10 AM \\u2013 10/10/2008, 10:10 AM", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hhmm", "10/10/2007, 10:10 AM \\u2013 10/10/2008, 10:10 AM",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hhmmzz", "10/10/2007, 10:10 AM PDT \\u2013 10/10/2008, 10:10 AM PDT", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hhmmzz", "10/10/2007, 10:10 AM PDT \\u2013 10/10/2008, 10:10 AM PDT",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hms", "10/10/2007, 10:10:10 AM \\u2013 10/10/2008, 10:10:10 AM", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hms", "10/10/2007, 10:10:10 AM \\u2013 10/10/2008, 10:10:10 AM",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMMMy", "O 10, 2007 \\u2013 O 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMMMy", "O 10, 2007 \\u2013 O 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEEdM", "W, 10/10/2007 \\u2013 F, 10/10/2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEEdM", "W, 10/10/2007 \\u2013 F, 10/10/2008",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10 \\u2013 Saturday, November 10, 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10 \\u2013 Saturday, November 10, 2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "October 10 \\u2013 November 10, 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "October 10 \\u2013 November 10, 2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMM", "October 10 \\u2013 November 10", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMM", "October 10 \\u2013 November 10",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "October \\u2013 November 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "October \\u2013 November 2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10 \\u2013 Saturday, November 10", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10 \\u2013 Saturday, November 10",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMMMy", "Wed, Oct 10 \\u2013 Sat, Nov 10, 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMMMy", "Wed, Oct 10 \\u2013 Sat, Nov 10, 2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMy", "Oct 10 \\u2013 Nov 10, 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMy", "Oct 10 \\u2013 Nov 10, 2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "Oct 10 \\u2013 Nov 10", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "Oct 10 \\u2013 Nov 10",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Oct \\u2013 Nov 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Oct \\u2013 Nov 2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMMM", "Wed, Oct 10 \\u2013 Sat, Nov 10", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMMM", "Wed, Oct 10 \\u2013 Sat, Nov 10",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMy", "10/10/2007 \\u2013 11/10/2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMy", "10/10/2007 \\u2013 11/10/2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dM", "10/10 \\u2013 11/10", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dM", "10/10 \\u2013 11/10",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10/2007 \\u2013 11/2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10/2007 \\u2013 11/2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdM", "Wed, 10/10 \\u2013 Sat, 11/10", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdM", "Wed, 10/10 \\u2013 Sat, 11/10",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10/10 \\u2013 11/10", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10/10 \\u2013 11/10",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Ed", "10 Wed \\u2013 10 Sat", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Ed", "10 Wed \\u2013 10 Sat",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "y", "2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "y", "2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "M", "10 \\u2013 11", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "M", "10 \\u2013 11",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Oct \\u2013 Nov", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Oct \\u2013 Nov",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMM", "October \\u2013 November", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMM", "October \\u2013 November",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hm", "10/10/2007, 10:10 AM \\u2013 11/10/2007, 10:10 AM", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hm", "10/10/2007, 10:10 AM \\u2013 11/10/2007, 10:10 AM",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "10/10/2007, 10:10 AM PT \\u2013 11/10/2007, 10:10 AM PT", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "10/10/2007, 10:10 AM PT \\u2013 11/10/2007, 10:10 AM PT",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmz", "10/10/2007, 10:10 AM PDT \\u2013 11/10/2007, 10:10 AM PST", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmz", "10/10/2007, 10:10 AM PDT \\u2013 11/10/2007, 10:10 AM PST",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "h", "10/10/2007, 10 AM \\u2013 11/10/2007, 10 AM", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "h", "10/10/2007, 10 AM \\u2013 11/10/2007, 10 AM",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hv", "10/10/2007, 10 AM PT \\u2013 11/10/2007, 10 AM PT", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hv", "10/10/2007, 10 AM PT \\u2013 11/10/2007, 10 AM PT",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hz", "10/10/2007, 10 AM PDT \\u2013 11/10/2007, 10 AM PST", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hz", "10/10/2007, 10 AM PDT \\u2013 11/10/2007, 10 AM PST",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EddMMy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EddMMy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hhmm", "10/10/2007, 10:10 AM \\u2013 11/10/2007, 10:10 AM", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hhmm", "10/10/2007, 10:10 AM \\u2013 11/10/2007, 10:10 AM",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hhmmzz", "10/10/2007, 10:10 AM PDT \\u2013 11/10/2007, 10:10 AM PST", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hhmmzz", "10/10/2007, 10:10 AM PDT \\u2013 11/10/2007, 10:10 AM PST",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10/10/2007, 10:10:10 AM \\u2013 11/10/2007, 10:10:10 AM", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10/10/2007, 10:10:10 AM \\u2013 11/10/2007, 10:10:10 AM",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMMy", "O 10 \\u2013 N 10, 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMMy", "O 10 \\u2013 N 10, 2007",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEEdM", "W, 10/10 \\u2013 S, 11/10", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEEdM", "W, 10/10 \\u2013 S, 11/10",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMMy", "Saturday, November 10 \\u2013 Tuesday, November 20, 2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMMy", "Saturday, November 10 \\u2013 Tuesday, November 20, 2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMy", "November 10 \\u2013 20, 2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMy", "November 10 \\u2013 20, 2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "November 10 \\u2013 20", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "November 10 \\u2013 20",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMMy", "November 2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMMy", "November 2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "Saturday, November 10 \\u2013 Tuesday, November 20", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "Saturday, November 10 \\u2013 Tuesday, November 20",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMMy", "Sat, Nov 10 \\u2013 Tue, Nov 20, 2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMMy", "Sat, Nov 10 \\u2013 Tue, Nov 20, 2007",
 
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMM", "Nov 10 \\u2013 20", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMM", "Nov 10 \\u2013 20",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov 2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov 2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMM", "Sat, Nov 10 \\u2013 Tue, Nov 20", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMM", "Sat, Nov 10 \\u2013 Tue, Nov 20",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMy", "11/10/2007 \\u2013 11/20/2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMy", "11/10/2007 \\u2013 11/20/2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11/2007", 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "Sat, 11/10 \\u2013 Tue, 11/20", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11/2007",
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "Sat, 11/10 \\u2013 Tue, 11/20",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10 \\u2013 20", 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Ed", "10 Sat \\u2013 20 Tue", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10 \\u2013 20",
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Ed", "10 Sat \\u2013 20 Tue",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "Nov", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "Nov",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hm", "11/10/2007, 10:10 AM \\u2013 11/20/2007, 10:10 AM", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hm", "11/10/2007, 10:10 AM \\u2013 11/20/2007, 10:10 AM",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "11/10/2007, 10:10 AM PT \\u2013 11/20/2007, 10:10 AM PT", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "11/10/2007, 10:10 AM PT \\u2013 11/20/2007, 10:10 AM PT",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "11/10/2007, 10:10 AM PST \\u2013 11/20/2007, 10:10 AM PST", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "11/10/2007, 10:10 AM PST \\u2013 11/20/2007, 10:10 AM PST",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hz", "11/10/2007, 10 AM PST \\u2013 11/20/2007, 10 AM PST", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hz", "11/10/2007, 10 AM PST \\u2013 11/20/2007, 10 AM PST",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEddMMyyyy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEddMMyyyy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EddMMy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EddMMy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hhmm", "11/10/2007, 10:10 AM \\u2013 11/20/2007, 10:10 AM", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hhmm", "11/10/2007, 10:10 AM \\u2013 11/20/2007, 10:10 AM",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hms", "11/10/2007, 10:10:10 AM \\u2013 11/20/2007, 10:10:10 AM", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hms", "11/10/2007, 10:10:10 AM \\u2013 11/20/2007, 10:10:10 AM",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMMy", "N 10 \\u2013 20, 2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMMy", "N 10 \\u2013 20, 2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEEdM", "S, 11/10 \\u2013 T, 11/20", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEEdM", "S, 11/10 \\u2013 T, 11/20",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMMy", "Wednesday, January 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMMy", "Wednesday, January 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMMy", "January 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMMy", "January 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMM", "January 10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMM", "January 10",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMMy", "January 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMMy", "January 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMM", "Wednesday, January 10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMM", "Wednesday, January 10",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMy", "Jan 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMy", "Jan 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "Jan 10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "Jan 10",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdMMM", "Wed, Jan 10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdMMM", "Wed, Jan 10",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdMy", "Wed, 1/10/2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdMy", "Wed, 1/10/2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMy", "1/10/2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMy", "1/10/2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dM", "1/10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dM", "1/10",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdM", "Wed, 1/10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdM", "Wed, 1/10",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "d", "10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "d", "10",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Ed", "10 Wed", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Ed", "10 Wed",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "y", "2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "y", "2007",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMM", "Jan", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMM", "Jan",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMM", "January", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMM", "January",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "10:00 AM \\u2013 2:10 PM", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "10:00 AM \\u2013 2:10 PM",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "10:00 AM \\u2013 2:10 PM PST", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "10:00 AM \\u2013 2:10 PM PST",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 AM \\u2013 2 PM", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 AM \\u2013 2 PM",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hv", "10 AM \\u2013 2 PM PT", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hv", "10 AM \\u2013 2 PM PT",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hz", "10 AM \\u2013 2 PM PST", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hz", "10 AM \\u2013 2 PM PST",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEddMMyyyy", "Wed, 01/10/2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEddMMyyyy", "Wed, 01/10/2007",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hhmm", "10:00 AM \\u2013 2:10 PM", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hhmm", "10:00 AM \\u2013 2:10 PM",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hhmmzz", "10:00 AM \\u2013 2:10 PM PST", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hhmmzz", "10:00 AM \\u2013 2:10 PM PST",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMMMy", "J 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMMMy", "J 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEEdM", "W, 1/10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEEdM", "W, 1/10",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMMMy", "Wednesday, January 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMMMy", "Wednesday, January 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMMy", "January 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMMy", "January 10, 2007",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "MMMMy", "January 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "MMMMy", "January 2007",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMMMy", "Wed, Jan 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMMMy", "Wed, Jan 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMy", "Jan 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMy", "Jan 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMM", "Jan 10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMM", "Jan 10",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMMM", "Wed, Jan 10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMMM", "Wed, Jan 10",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMy", "Wed, 1/10/2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMy", "Wed, 1/10/2007",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dM", "1/10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dM", "1/10",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdM", "Wed, 1/10", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdM", "Wed, 1/10",
 
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "y", "2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "y", "2007",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "MMM", "Jan", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "MMM", "Jan",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "10:00 \\u2013 10:20 AM", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "10:00 \\u2013 10:20 AM",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "10:00 \\u2013 10:20 AM PT", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "10:00 \\u2013 10:20 AM PT",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "10 AM", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "10 AM",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "10 AM PST", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "10 AM PST",
 
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EddMMy", "Wed, 01/10/2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EddMMy", "Wed, 01/10/2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hhmm", "10:00 \\u2013 10:20 AM", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hhmm", "10:00 \\u2013 10:20 AM",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hhmmzz", "10:00 \\u2013 10:20 AM PST", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hhmmzz", "10:00 \\u2013 10:20 AM PST",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hms", "10:00:10 AM \\u2013 10:20:10 AM", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hms", "10:00:10 AM \\u2013 10:20:10 AM",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMMM", "January 10", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMMM", "January 10",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMM", "Wednesday, January 10", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMM", "Wednesday, January 10",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdMMMy", "Wed, Jan 10, 2007", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdMMMy", "Wed, Jan 10, 2007",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMM", "Jan 10", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMM", "Jan 10",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdMMM", "Wed, Jan 10", 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dM", "1/10", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdMMM", "Wed, Jan 10",
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dM", "1/10",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "My", "1/2007", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "My", "1/2007",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdM", "Wed, 1/10", 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "d", "10", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdM", "Wed, 1/10",
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "d", "10",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Ed", "10 Wed", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Ed", "10 Wed",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "y", "2007", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "y", "2007",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "M", "1", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "M", "1",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "MMM", "Jan", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "MMM", "Jan",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "MMMM", "January", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "MMMM", "January",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "10:10 AM", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "10:10 AM",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmv", "10:10 AM PT", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmv", "10:10 AM PT",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 AM PST", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 AM PST",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "10 AM", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "10 AM",
 
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hz", "10 AM PST", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hz", "10 AM PST",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hhmmzz", "10:10 AM PST", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hhmmzz", "10:10 AM PST",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hms", "10:10:10 AM \u2013 10:10:20 AM", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hms", "10:10:10 AM \u2013 10:10:20 AM",
 
-                "en", "2007 01 01 22:00:00", "2007 01 01 23:00:00", "yMMMMdHm", "January 1, 2007, 22:00 \u2013 23:00", 
+                "en", "2007 01 01 22:00:00", "2007 01 01 23:00:00", "yMMMMdHm", "January 1, 2007, 22:00 \u2013 23:00",
 
-                "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f32008\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e94", 
+                "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f32008\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e94",
 
-                "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "2007/10/10 \\u4e0a\\u534810:10 \\u2013 2008/10/10 \\u4e0a\\u534810:10", 
+                "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "2007/10/10 \\u4e0a\\u534810:10 \\u2013 2008/10/10 \\u4e0a\\u534810:10",
 
-                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u81f311\\u670810\\u65e5", 
+                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u81f311\\u670810\\u65e5",
 
-                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMM", "10\\u670810\\u65e5\\u81f311\\u670810\\u65e5", 
+                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMM", "10\\u670810\\u65e5\\u81f311\\u670810\\u65e5",
 
-                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "2007\\u5e7410\\u6708\\u81f311\\u6708", 
+                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "2007\\u5e7410\\u6708\\u81f311\\u6708",
 
-                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMM", "10\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f311\\u670810\\u65e5\\u661f\\u671f\\u516d", 
+                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMM", "10\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f311\\u670810\\u65e5\\u661f\\u671f\\u516d",
 
-                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "2007/10/10 \\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10 \\u2013 2007/11/10 \\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10", 
+                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "2007/10/10 \\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10 \\u2013 2007/11/10 \\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMMy", "2007\\u5e7411\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMMy", "2007\\u5e7411\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMy", "2007\\u5e7411\\u670810\\u65e5\\u81f320\\u65e5", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMy", "2007\\u5e7411\\u670810\\u65e5\\u81f320\\u65e5",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "11\\u670810\\u65e5\\u81f320\\u65e5", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "11\\u670810\\u65e5\\u81f320\\u65e5",
 
                 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMMy", "2007\\u5E7411\\u6708", // (fixed expected result per ticket 6872<-6626)
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "11\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "11\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMM", "11\\u670810\\u65e5\\u5468\\u516d\\u81f320\\u65e5\\u5468\\u4e8c", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMM", "11\\u670810\\u65e5\\u5468\\u516d\\u81f320\\u65e5\\u5468\\u4e8c",
 
                 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "2007/11/10\\u5468\\u516d\\u81f32007/11/20\\u5468\\u4e8c",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMy", "2007/11/10 \\u2013 2007/11/20", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMy", "2007/11/10 \\u2013 2007/11/20",
 
                 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "2007\u5E7411\u6708", 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "11/10\\u5468\\u516d\\u81f311/20\\u5468\\u4e8c", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "2007\u5E7411\u6708",
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "11/10\\u5468\\u516d\\u81f311/20\\u5468\\u4e8c",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10\\u201320\\u65e5", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10\\u201320\\u65e5",
 
                 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007\\u5E74", // (fixed expected result per ticket:6626:)
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11\\u6708", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11\\u6708",
 
                 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "11\\u6708", // (fixed expected result per ticket 6872<-6626 and others)
 
                 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMM", "\\u5341\\u4E00\\u6708", // (fixed expected result per ticket 6872<-6626 and others)
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "2007/11/10 GMT-8 \\u4e0a\\u534810:10 \\u2013 2007/11/20 GMT-8 \\u4e0a\\u534810:10", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "2007/11/10 GMT-8 \\u4e0a\\u534810:10 \\u2013 2007/11/20 GMT-8 \\u4e0a\\u534810:10",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "h", "2007/11/10 \\u4e0a\\u534810\\u65f6 \\u2013 2007/11/20 \\u4e0a\\u534810\\u65f6", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "h", "2007/11/10 \\u4e0a\\u534810\\u65f6 \\u2013 2007/11/20 \\u4e0a\\u534810\\u65f6",
 
                 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMMy", "2007\\u5e741\\u670810\\u65e5\\u661f\\u671f\\u4e09", // (fixed expected result per ticket 6872<-6626)
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10",
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810:00\\u81F3\\u4E0B\\u53482:10", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810:00\\u81F3\\u4E0B\\u53482:10",
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "GMT-8\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "GMT-8\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10",
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "\\u4e0a\\u534810\\u65F6\\u81f3\\u4e0b\\u53482\\u65f6", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "\\u4e0a\\u534810\\u65F6\\u81f3\\u4e0b\\u53482\\u65f6",
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810\\u65F6\\u81F3\\u4E0B\\u53482\\u65F6", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810\\u65F6\\u81F3\\u4E0B\\u53482\\u65F6",
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hz", "GMT-8\\u4e0a\\u534810\\u65F6\\u81f3\\u4e0b\\u53482\\u65f6", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hz", "GMT-8\\u4e0a\\u534810\\u65F6\\u81f3\\u4e0b\\u53482\\u65f6",
 
                 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMM", "1\\u670810\\u65e5", // (fixed expected result per ticket 6872<-6626)
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "\\u4e0a\\u534810:00\\u81f310:20", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "\\u4e0a\\u534810:00\\u81f310:20",
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810:00\\u81F310:20", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4\\u4E0A\\u534810:00\\u81F310:20",
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "\\u4e0a\\u534810\\u65f6", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "\\u4e0a\\u534810\\u65f6",
 
-                "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "GMT-8\\u4e0a\\u534810\\u65f6", 
+                "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "GMT-8\\u4e0a\\u534810\\u65f6",
 
                 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMMy", "2007\\u5e741\\u670810\\u65e5\\u661f\\u671f\\u4e09", // (fixed expected result per ticket 6872<-6626)
 
-                "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "\\u4e0a\\u534810:10", 
+                "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "\\u4e0a\\u534810:10",
 
-                "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "\\u4e0a\\u534810\\u65f6", 
+                "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "\\u4e0a\\u534810\\u65f6",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt. 2007 \\u2013 Freitag, 10. Okt. 2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt. 2007 \\u2013 Freitag, 10. Okt. 2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMy", "10. Okt. 2007 \\u2013 10. Okt. 2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMy", "10. Okt. 2007 \\u2013 10. Okt. 2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "10. Okt. 2007 \\u2013 10. Okt. 2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "10. Okt. 2007 \\u2013 10. Okt. 2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Okt. 2007 \\u2013 Okt. 2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Okt. 2007 \\u2013 Okt. 2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEdMMM", "Mi., 10. Okt. 2007 \\u2013 Fr., 10. Okt. 2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEdMMM", "Mi., 10. Okt. 2007 \\u2013 Fr., 10. Okt. 2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Mi., 10.10.2007 \\u2013 Fr., 10.10.2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Mi., 10.10.2007 \\u2013 Fr., 10.10.2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10.10.2007 \\u2013 10.10.2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10.10.2007 \\u2013 10.10.2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dM", "10.10.2007 \\u2013 10.10.2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dM", "10.10.2007 \\u2013 10.10.2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10.2007 \\u2013 10.2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10.2007 \\u2013 10.2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Mi., 10.10.2007 \\u2013 Fr., 10.10.2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Mi., 10.10.2007 \\u2013 Fr., 10.10.2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "d", "10.10.2007 \\u2013 10.10.2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "d", "10.10.2007 \\u2013 10.10.2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007\\u20132008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007\\u20132008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10.2007 \\u2013 10.2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10.2007 \\u2013 10.2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMM", "Okt. 2007 \\u2013 Okt. 2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMM", "Okt. 2007 \\u2013 Okt. 2008",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10.10.2007, 10:10 vorm. \\u2013 10.10.2008, 10:10 vorm.", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10.10.2007, 10:10 vorm. \\u2013 10.10.2008, 10:10 vorm.",
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "jm", "10.10.2007, 10:10 \\u2013 10.10.2008, 10:10", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "jm", "10.10.2007, 10:10 \\u2013 10.10.2008, 10:10",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt. \\u2013 Samstag, 10. Nov. 2007", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt. \\u2013 Samstag, 10. Nov. 2007",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMy", "10. Okt. \\u2013 10. Nov. 2007", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMy", "10. Okt. \\u2013 10. Nov. 2007",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "10. Okt. \\u2013 10. Nov.", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "10. Okt. \\u2013 10. Nov.",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Okt.\\u2013Nov. 2007", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Okt.\\u2013Nov. 2007",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMM", "Mittwoch, 10. Okt. \\u2013 Samstag, 10. Nov.", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMM", "Mittwoch, 10. Okt. \\u2013 Samstag, 10. Nov.",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMy", "Mi., 10.10.2007 \\u2013 Sa., 10.11.2007", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMy", "Mi., 10.10.2007 \\u2013 Sa., 10.11.2007",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dM", "10.10. \\u2013 10.11.", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dM", "10.10. \\u2013 10.11.",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10.2007 \\u2013 11.2007", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10.2007 \\u2013 11.2007",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdM", "Mi., 10.10. \\u2013 Sa., 10.11.", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdM", "Mi., 10.10. \\u2013 Sa., 10.11.",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10.10. \\u2013 10.11.", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10.10. \\u2013 10.11.",
 
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "M", "10.\\u201311.", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "M", "10.\\u201311.",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Okt.\\u2013Nov.", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Okt.\\u2013Nov.",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "10.10.2007, 10:10 vorm. Los Angeles Zeit \\u2013 10.11.2007, 10:10 vorm. Los Angeles Zeit", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "10.10.2007, 10:10 vorm. Los Angeles Zeit \\u2013 10.11.2007, 10:10 vorm. Los Angeles Zeit",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "jmv", "10.10.2007, 10:10 Los Angeles Zeit \\u2013 10.11.2007, 10:10 Los Angeles Zeit", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "jmv", "10.10.2007, 10:10 Los Angeles Zeit \\u2013 10.11.2007, 10:10 Los Angeles Zeit",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10.10.2007, 10:10:10 vorm. \\u2013 10.11.2007, 10:10:10 vorm.", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10.10.2007, 10:10:10 vorm. \\u2013 10.11.2007, 10:10:10 vorm.",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMy", "Samstag, 10. \\u2013 Dienstag, 20. Nov. 2007", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMy", "Samstag, 10. \\u2013 Dienstag, 20. Nov. 2007",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMy", "10.\\u201320. Nov. 2007", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMy", "10.\\u201320. Nov. 2007",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMM", "10.\\u201320. Nov.", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMM", "10.\\u201320. Nov.",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov. 2007", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov. 2007",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMM", "Samstag, 10. \\u2013 Dienstag, 20. Nov.", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMM", "Samstag, 10. \\u2013 Dienstag, 20. Nov.",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sa., 10.11.2007 \\u2013 Di., 20.11.2007", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sa., 10.11.2007 \\u2013 Di., 20.11.2007",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMy", "10.11.2007 \\u2013 20.11.2007", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMy", "10.11.2007 \\u2013 20.11.2007",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "10.11. \\u2013 20.11.", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "10.11. \\u2013 20.11.",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11.2007", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11.2007",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "Sa., 10.11. \\u2013 Di., 20.11.", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "Sa., 10.11. \\u2013 Di., 20.11.",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10.\\u201320.", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10.\\u201320.",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "10.11.2007, 10:10 vorm. Los Angeles Zeit \\u2013 20.11.2007, 10:10 vorm. Los Angeles Zeit", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "10.11.2007, 10:10 vorm. Los Angeles Zeit \\u2013 20.11.2007, 10:10 vorm. Los Angeles Zeit",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "jmv", "10.11.2007, 10:10 Los Angeles Zeit \\u2013 20.11.2007, 10:10 Los Angeles Zeit", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "jmv", "10.11.2007, 10:10 Los Angeles Zeit \\u2013 20.11.2007, 10:10 Los Angeles Zeit",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMy", "10. Jan. 2007", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMy", "10. Jan. 2007",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "10. Jan.", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "10. Jan.",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan. 2007", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan. 2007",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMM", "Mittwoch, 10. Jan.", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMM", "Mittwoch, 10. Jan.",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "10:00 vorm. \\u2013 2:10 nachm. GMT-8", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "10:00 vorm. \\u2013 2:10 nachm. GMT-8",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 Uhr vorm. \\u2013 2 Uhr nachm.", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 Uhr vorm. \\u2013 2 Uhr nachm.",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMM", "Mittwoch, 10. Jan.", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMM", "Mittwoch, 10. Jan.",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "10:00\\u201310:20 vorm.", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "10:00\\u201310:20 vorm.",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "10:00\\u201310:20 vorm. Los Angeles Zeit", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "10:00\\u201310:20 vorm. Los Angeles Zeit",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmz", "10:00\\u201310:20 vorm. GMT-8", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmz", "10:00\\u201310:20 vorm. GMT-8",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "10 Uhr vorm.", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "10 Uhr vorm.",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hv", "10 Uhr vorm. Los Angeles Zeit", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hv", "10 Uhr vorm. Los Angeles Zeit",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "10 Uhr vorm. GMT-8", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "10 Uhr vorm. GMT-8",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "10:10 vorm.", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "10:10 vorm.",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "jm", "10:10", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "jm", "10:10",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmv", "10:10 vorm. Los Angeles Zeit", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmv", "10:10 vorm. Los Angeles Zeit",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "jmv", "10:10 Los Angeles Zeit", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "jmv", "10:10 Los Angeles Zeit",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 vorm. GMT-8", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 vorm. GMT-8",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "jmz", "10:10 GMT-8", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "jmz", "10:10 GMT-8",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "10 Uhr vorm.", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "10 Uhr vorm.",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hv", "10 Uhr vorm. Los Angeles Zeit", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hv", "10 Uhr vorm. Los Angeles Zeit",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hz", "10 Uhr vorm. GMT-8", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hz", "10 Uhr vorm. GMT-8",
 
                 // Thai (default calendar buddhist)
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2550 \\u2013 \\u0E27\\u0E31\\u0E19\\u0E28\\u0E38\\u0E01\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2550 \\u2013 \\u0E27\\u0E31\\u0E19\\u0E28\\u0E38\\u0E01\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2551",
 
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. 2550 \\u2013 10 \\u0E15.\\u0E04. 2551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. 2550 \\u2013 10 \\u0E15.\\u0E04. 2551",
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u0E04. 2550 \\u2013 \\u0E15.\\u0E04. 2551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u0E04. 2550 \\u2013 \\u0E15.\\u0E04. 2551",
 
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdMy", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdMy", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551",
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMy", "10/10/2550 \\u2013 10/10/2551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMy", "10/10/2550 \\u2013 10/10/2551",
 
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "My", "10/2550 \\u2013 10/2551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "My", "10/2550 \\u2013 10/2551",
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdM", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdM", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551",
 
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "y", "2550\\u20132551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "y", "2550\\u20132551",
 
-                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "M", "10/2550 \\u2013 10/2551", 
+                "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "M", "10/2550 \\u2013 10/2551",
 
 
-                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. \\u2013 \\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E1E.\\u0E22. 2550", 
+                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. \\u2013 \\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E1E.\\u0E22. 2550",
 
 
-                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. \\u2013 10 \\u0E1E.\\u0E22.", 
+                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. \\u2013 10 \\u0E1E.\\u0E22.",
 
-                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22. 2550", 
+                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22. 2550",
 
-                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dM", "10/10 \\u2013 10/11", 
+                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dM", "10/10 \\u2013 10/11",
 
-                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "My", "10/2550 \\u2013 11/2550", 
+                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "My", "10/2550 \\u2013 11/2550",
 
 
-                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "d", "10/10 \\u2013 10/11", 
+                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "d", "10/10 \\u2013 10/11",
 
-                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "\u0E1E.\u0E28. 2550", 
+                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "\u0E1E.\u0E28. 2550",
 
 
-                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMM", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22.", 
+                "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMM", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22.",
 
         };
         expect(DATA, DATA.length);
@@ -707,7 +710,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 errln("parse exception" + e);
                 continue;
             }
-            DateInterval dtitv = new DateInterval(date.getTime(), 
+            DateInterval dtitv = new DateInterval(date.getTime(),
                     date_2.getTime());
             String oneSkeleton = data[i++];
             DateIntervalFormat dtitvfmt = DateIntervalFormat.getInstance(
@@ -721,7 +724,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
     }
 
 
-    /* 
+    /*
      * Test format using user defined DateIntervalInfo
      */
     @Test
@@ -730,22 +733,22 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         // followed by a group of locale/from_data/to_data/interval_data
         String[] DATA = {
                 "yyyy MM dd HH:mm:ss",
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Oct 10, 2007 --- Oct 10, 2008", 
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Oct 10, 2007 --- Oct 10, 2008",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 Oct 10 - Nov 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 Oct 10 - Nov 2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Nov 10, 2007 --- Nov 20, 2007", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Nov 10, 2007 --- Nov 20, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Jan 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Jan 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Jan 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Jan 10, 2007",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Jan 10, 2007", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Jan 10, 2007",
 
-                "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "2007\\u5e7410\\u670810\\u65e5 --- 2008\\u5e7410\\u670810\\u65e5", 
+                "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "2007\\u5e7410\\u670810\\u65e5 --- 2008\\u5e7410\\u670810\\u65e5",
 
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007\\u5e7411\\u670810\\u65e5 --- 2007\\u5e7411\\u670820\\u65e5", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007\\u5e7411\\u670810\\u65e5 --- 2007\\u5e7411\\u670820\\u65e5",
 
                 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket 6872<-6626)
 
@@ -753,29 +756,29 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
 
                 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket 6872<-6626)
 
-                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10. Okt. 2007 --- 10. Okt. 2008", 
+                "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10. Okt. 2007 --- 10. Okt. 2008",
 
-                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 Okt. 10 - Nov. 2007", 
+                "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 Okt. 10 - Nov. 2007",
 
-                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10. Nov. 2007 --- 20. Nov. 2007", 
+                "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10. Nov. 2007 --- 20. Nov. 2007",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10. Jan. 2007", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10. Jan. 2007",
 
-                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10. Jan. 2007", 
+                "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10. Jan. 2007",
 
-                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10. Jan. 2007", 
+                "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10. Jan. 2007",
 
-                "es", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10 oct. 2007 --- 10 oct. 2008", 
+                "es", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10 oct. 2007 --- 10 oct. 2008",
 
-                "es", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 oct. 10 - nov. 2007", 
+                "es", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 oct. 10 - nov. 2007",
 
-                "es", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10 nov. 2007 --- 20 nov. 2007", 
+                "es", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10 nov. 2007 --- 20 nov. 2007",
 
-                "es", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10 ene. 2007", 
+                "es", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10 ene. 2007",
 
-                "es", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10 ene. 2007", 
+                "es", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10 ene. 2007",
 
-                "es", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10 ene. 2007", 
+                "es", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10 ene. 2007",
         };
         expectUserDII(DATA, DATA.length);
     }
@@ -798,7 +801,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 errln("parse exception" + e);
                 continue;
             }
-            DateInterval dtitv = new DateInterval(date.getTime(), 
+            DateInterval dtitv = new DateInterval(date.getTime(),
                     date_2.getTime());
 
             DateIntervalInfo dtitvinf = new DateIntervalInfo();
@@ -818,7 +821,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
 
 
 
-    /* 
+    /*
      * Test format using user defined DateIntervalInfo
      */
     @Test
@@ -826,24 +829,24 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         // first item is date pattern
         // followed by a group of locale/from_data/to_data/interval_data
         String[] DATA = {
-                "yyyy MM dd HH:mm:ss",    
-                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "all diff", 
+                "yyyy MM dd HH:mm:ss",
+                "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "all diff",
 
-                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 diff Oct 10 - Nov 2007", 
+                "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 diff Oct 10 - Nov 2007",
 
-                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007 Nov 10 ~ 20", 
+                "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007 Nov 10 ~ 20",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Jan 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Jan 10, 2007",
 
-                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Jan 10, 2007", 
+                "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Jan 10, 2007",
 
-                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Jan 10, 2007", 
+                "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Jan 10, 2007",
 
-                "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "all diff", 
+                "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "all diff",
 
-                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 diff 10\\u6708 10 - 11\\u6708 2007", 
+                "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 diff 10\\u6708 10 - 11\\u6708 2007",
 
-                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007 11\\u6708 10 ~ 20", 
+                "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007 11\\u6708 10 ~ 20",
 
                 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "2007\u5E741\\u670810\u65E5", // (fixed expected result per ticket 6872<-6626)
 
@@ -872,7 +875,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 errln("parse exception" + e);
                 continue;
             }
-            DateInterval dtitv = new DateInterval(date.getTime(), 
+            DateInterval dtitv = new DateInterval(date.getTime(),
                     date_2.getTime());
 
             DateIntervalFormat dtitvfmt = DateIntervalFormat.getInstance("yyyyMMMdd", loc);
@@ -920,12 +923,12 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         // and the 2nd in the pair is the later date
         String[] DATA = {
                 "yyyy MM dd HH:mm:ss",
-                "2007 10 10 10:10:10", "2008 10 10 10:10:10", 
-                "2007 10 10 10:10:10", "2007 11 10 10:10:10", 
-                "2007 11 10 10:10:10", "2007 11 20 10:10:10", 
-                "2007 01 10 10:00:10", "2007 01 10 14:10:10", 
-                "2007 01 10 10:00:10", "2007 01 10 10:20:10", 
-                "2007 01 10 10:10:10", "2007 01 10 10:10:20", 
+                "2007 10 10 10:10:10", "2008 10 10 10:10:10",
+                "2007 10 10 10:10:10", "2007 11 10 10:10:10",
+                "2007 11 10 10:10:10", "2007 11 20 10:10:10",
+                "2007 01 10 10:00:10", "2007 01 10 14:10:10",
+                "2007 01 10 10:00:10", "2007 01 10 10:20:10",
+                "2007 01 10 10:10:10", "2007 01 10 10:10:20",
         };
 
 
@@ -973,8 +976,8 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
 
         int localeIndex;
         for ( localeIndex = 0; localeIndex < testLocale.length; ++localeIndex) {
-            stress(DATA, DATA.length, new Locale(testLocale[localeIndex][0], 
-                    testLocale[localeIndex][1], testLocale[localeIndex][2]), 
+            stress(DATA, DATA.length, new Locale(testLocale[localeIndex][0],
+                    testLocale[localeIndex][1], testLocale[localeIndex][2]),
                     testLocale[localeIndex][0]+testLocale[localeIndex][1]);
         }
     }
@@ -1009,7 +1012,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 "hv",
                 "hz",
                 "EEddMMyyyy", // following could be normalized
-                "EddMMy", 
+                "EddMMy",
                 "hhmm",
                 "hhmmzz",
                 "hms",  // following could not be normalized
@@ -1036,8 +1039,8 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
             }
             DateInterval dtitv = new DateInterval(date.getTime(), date_2.getTime());
 
-            for ( int skeletonIndex = 0; 
-                    skeletonIndex < skeleton.length; 
+            for ( int skeletonIndex = 0;
+                    skeletonIndex < skeleton.length;
                     ++skeletonIndex ) {
                 String oneSkeleton = skeleton[skeletonIndex];
                 // need special handle of "Thai" since the default calendar
@@ -1057,7 +1060,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
             }
 
 
-            // test interval format by algorithm 
+            // test interval format by algorithm
             for ( int style = DateFormat.FULL; style  < 4; ++style ) {
                 SimpleDateFormat dtfmt = (SimpleDateFormat) DateFormat.getDateInstance(style, loc);
                 FieldPosition pos = new FieldPosition(0);
@@ -1067,12 +1070,12 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 fromCalendar.setTimeInMillis(dtitv.getFromDate());
                 toCalendar.setTimeInMillis(dtitv.getToDate());
                 dtfmt.intervalFormatByAlgorithm(fromCalendar, toCalendar, str, pos);
-            } 
-        } 
+            }
+        }
     }
 
     /*
-     * Ticket#6396 DateIntervalInfo of ICU4J 4.0d3 throw NullPointerException 
+     * Ticket#6396 DateIntervalInfo of ICU4J 4.0d3 throw NullPointerException
      */
     @Test
     public void TestT6396() {
@@ -1187,7 +1190,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         } catch (Exception e){}
 
         // Tests when "if ( firstPatternIndex == -1 || secondPatternIndex == -1 )" is true
-        dii = (DateIntervalInfo) dii.cloneAsThawed();
+        dii = dii.cloneAsThawed();
         try{
             dii.setFallbackIntervalPattern("");
             errln("DateIntervalInfo.setFallbackIntervalPattern(String fallbackPattern) " +
@@ -1242,11 +1245,11 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         // Tests when "if ( lrgDiffCalUnit > MINIMUM_SUPPORTED_CALENDAR_FIELD )" is true
         // MINIMUM_SUPPORTED_CALENDAR_FIELD = Calendar.SECOND;
         try{
-            dii = (DateIntervalInfo) dii.cloneAsThawed();
+            dii = dii.cloneAsThawed();
             dii.setIntervalPattern("", Calendar.SECOND+1, "");
             errln("DateIntervalInfo.setIntervalPattern(String,int,String) " +
                     "was suppose to return an exception when the " +
-                    "variable 'lrgDiffCalUnit' is greater than " + 
+                    "variable 'lrgDiffCalUnit' is greater than " +
                     "MINIMUM_SUPPORTED_CALENDAR_FIELD.");
         } catch(Exception e){}
     }
@@ -1465,7 +1468,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 "Custom DateIntervalInfo objects should not mess up cache",
                 expected,
                 dif.format(from, to, new StringBuffer(), new FieldPosition(0))
-                .toString()); 
+                .toString());
 
     }
 
@@ -1505,7 +1508,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 "Custom DateIntervalInfo objects should not mess up cache",
                 expected,
                 dif.format(from, to, new StringBuffer(), new FieldPosition(0))
-                .toString()); 
+                .toString());
     }
 
     @Test
@@ -1545,13 +1548,13 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
     @Test
     public void TestTicket11583 () {
         ULocale[] locales = {
-                ULocale.ENGLISH, 
-                SPANISH, 
-                LA_SPANISH, 
+                ULocale.ENGLISH,
+                SPANISH,
+                LA_SPANISH,
                 };
         String[] skeletons = {
-                "yMMMMd", "yMMMM", "MMMM", 
-                "yMMMd", "yMMM", "MMM", 
+                "yMMMMd", "yMMMM", "MMMM",
+                "yMMMd", "yMMM", "MMM",
                 "yMMd", "yMMdd", "yMM", "MM",
                 "yMdd", "yMd", "yM", "M"
                 };
@@ -1568,10 +1571,10 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
 
                 DateFormat dateFormat = DateFormat.getPatternInstance(skeleton, locale);
                 String dateFormatPattern = ((SimpleDateFormat)dateFormat).toPattern();
-                
+
                 DateIntervalFormat intervalFormat = DateIntervalFormat.getInstance(skeleton, locale);
                 DateIntervalInfo intervalInfo = intervalFormat.getDateIntervalInfo();
-                
+
                 if (skeleton.equals(filterPattern)) {
                     logln(filterPattern + " => " + intervalInfo.getRawPatterns().get(filterPattern));
                 }
@@ -1584,7 +1587,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 String formattedEnd = dateFormat.format(endDate);
 
                 PatternInfo patternInfo = intervalFormat.getRawPatterns().get("M");
-                
+
                 String firstPart = patternInfo.getFirstPart();
                 String secondPart = patternInfo.getSecondPart();
                 if (!matches(dateFormatPattern, firstPart, secondPart)) {
@@ -1596,7 +1599,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                                 + dateFormatPattern + "» and date interval format «" + firstPart + secondPart + "».");
                     }
                 }
-                
+
                 logln(locale
                         + "\tskeleton: «" + skeleton
                         + "»\tpattern: «" + dateFormatPattern
@@ -1623,7 +1626,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         // brute force for now
         int lastButOne = dateFormatPattern.length()-1;
         for (int i = 1; i < lastButOne; ++i) {
-            if (firstPart.startsWith(dateFormatPattern.substring(0,i)) 
+            if (firstPart.startsWith(dateFormatPattern.substring(0,i))
                     && secondPart.endsWith(dateFormatPattern.substring(i,dateFormatPattern.length()))) {
                 return true;
             }
@@ -1633,7 +1636,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
 
     @Test
     public void TestFPos_SkelWithSeconds () {
-        
+
         final long[] deltas = {
                0L, // none
                200L, // 200 millisec
@@ -1657,7 +1660,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 format = fmt;
             }
         };
-        
+
         final ExpectPosAndFormat[] exp_en_HHmm = {
             new ExpectPosAndFormat(  3,  5, "09:00" ),
             new ExpectPosAndFormat(  3,  5, "09:00" ),
@@ -1780,7 +1783,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 expected = exp;
             }
         };
-        
+
         final LocaleAndSkeletonItem[] locSkelItems = {
            new LocaleAndSkeletonItem( "en",            "HHmm",         DateFormat.MINUTE_FIELD, exp_en_HHmm ),
            new LocaleAndSkeletonItem( "en",            "HHmmss",       DateFormat.MINUTE_FIELD, exp_en_HHmmss ),
@@ -1793,7 +1796,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
            new LocaleAndSkeletonItem( "ja",            "yyMMddHHmmss", DateFormat.MINUTE_FIELD, exp_ja_yyMMddHHmmss ),
            new LocaleAndSkeletonItem( "ja",            "yMMMdHHmmss",  DateFormat.MINUTE_FIELD, exp_ja_yMMMdHHmmss )
         };
-        
+
         //final String zoneGMT = "GMT";
         final long startTimeGMT = 1416474000000L; // 2014 Nov 20 09:00 GMT
 
@@ -1826,18 +1829,18 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
         final DateIntervalFormat formatter = DateIntervalFormat.getInstance(DateFormat.YEAR_MONTH_DAY, ULocale.US);
         final ArrayList<DateInterval> testIntervals = new ArrayList<DateInterval>();
         final ArrayList<String>expectedResults = new ArrayList<String>();
-        
+
         // Create and save the input test data.
         TimeZone tz = TimeZone.getTimeZone("Americal/Los_Angeles");
         Calendar intervalStart = Calendar.getInstance(tz, ULocale.US);
-        Calendar intervalEnd = Calendar.getInstance(tz, ULocale.US);        
+        Calendar intervalEnd = Calendar.getInstance(tz, ULocale.US);
         intervalStart.set(2009,  6, 1);
         intervalEnd.set(2009, 6, 2);
-        testIntervals.add(new DateInterval(intervalStart.getTimeInMillis(), intervalEnd.getTimeInMillis()));        
+        testIntervals.add(new DateInterval(intervalStart.getTimeInMillis(), intervalEnd.getTimeInMillis()));
         intervalStart.set(2015, 2, 27);
         intervalEnd.set(2015, 3, 1);
         testIntervals.add(new DateInterval(intervalStart.getTimeInMillis(), intervalEnd.getTimeInMillis()));
-        
+
         // Run the formatter single-threaded to create and save the expected results.
         for (DateInterval interval: testIntervals) {
             FieldPosition pos = new FieldPosition(0);
@@ -1845,9 +1848,10 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
             formatter.format(interval, result, pos);
             expectedResults.add(result.toString());
         }
-               
+
         class TestThread extends Thread {
             public String errorMessage;
+            @Override
             public void run() {
                 for (int loop=0; loop < 2000; ++loop) {
                     ListIterator<String> expectedItr = expectedResults.listIterator();
@@ -1866,7 +1870,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                 }
             }
         }
-        
+
         List<TestThread> threads = new ArrayList<TestThread>();
         for (int i=0; i<4; ++i) {
             threads.add(new TestThread());
index 81d5d5fc851d0238cae6a6b76276ed19eeaf5444..0463b786b998e3b283bf39ecedfc7234e8ffeab5 100644 (file)
@@ -23,6 +23,8 @@ import java.util.Random;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.PatternTokenizer;
@@ -40,6 +42,7 @@ import com.ibm.icu.util.SimpleTimeZone;
 import com.ibm.icu.util.TimeZone;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class DateTimeGeneratorTest extends TestFmwk {
     public static boolean GENERATE_TEST_DATA;
     static {
index 4426e65fa5cd24d321c8414dd8a7b4bd4007f28f..ec36fc1e45408badfb8f0f3db75761de9f5e81f9 100644 (file)
@@ -6,7 +6,7 @@
  *   Corporation and others.  All Rights Reserved.
  */
 
-/** 
+/**
  * Port From:   JDK 1.4b1 : java.text.Format.IntlTestDateFormat
  * Source File: java/text/format/IntlTestDateFormat.java
  **/
@@ -25,12 +25,16 @@ import java.util.Random;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.text.SimpleDateFormat;
 import com.ibm.icu.util.ULocale;
 
-public class IntlTestDateFormat extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class IntlTestDateFormat extends TestFmwk {
     // Values in milliseconds (== Date)
     private static final long ONESECOND = 1000;
     private static final long ONEMINUTE = 60 * ONESECOND;
@@ -52,12 +56,12 @@ public class IntlTestDateFormat extends com.ibm.icu.dev.test.TestFmwk {
     public IntlTestDateFormat() {
         //Constructure
     }
-    
+
     @Before
     public void init() throws Exception {
         fFormat = DateFormat.getInstance();
     }
-    
+
     @Test
     public void TestULocale() {
         localeTest(ULocale.getDefault(), "Default Locale");
@@ -144,7 +148,7 @@ public class IntlTestDateFormat extends com.ibm.icu.dev.test.TestFmwk {
         SimpleDateFormat s = (SimpleDateFormat) fFormat;
         logln(fTestName + " Pattern " + s.toPattern());
     }
-    
+
     private void tryDate(Date theDate) {
         final int DEPTH = 10;
         Date[] date = new Date[DEPTH];
index 3fb37fe75f19373bc1166b7aad9ea17496abc52c..8e950686f772d2573fdf12ce52fddb2ff0cfa633 100644 (file)
@@ -6,7 +6,7 @@
  *   Corporation and others.  All Rights Reserved.
  **/
 
-/** 
+/**
  * Port From:   JDK 1.4b1 : java.text.Format.IntlTestDateFormatAPI
  * Source File: java/text/format/IntlTestDateFormatAPI.java
  **/
@@ -25,7 +25,10 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
 import com.ibm.icu.dev.test.TestUtil.JavaVendor;
 import com.ibm.icu.text.DateFormat;
@@ -33,7 +36,8 @@ import com.ibm.icu.text.NumberFormat;
 import com.ibm.icu.util.Calendar;
 import com.ibm.icu.util.TimeZone;
 
-public class IntlTestDateFormatAPI extends com.ibm.icu.dev.test.TestFmwk
+@RunWith(JUnit4.class)
+public class IntlTestDateFormatAPI extends TestFmwk
 {
     // Test that the equals method works correctly.
     @Test
index 52224afb1ca861884d418911b341cd8ded270d85..91e5e8d2b8248d073a644b4d90d42643e093485a 100644 (file)
@@ -7,7 +7,7 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Port From:   ICU4C v1.8.1 : format : IntlTestDateFormatAPI
  * Source File: $ICU4CRoot/source/test/intltest/dtfmapts.cpp
  **/
@@ -19,7 +19,10 @@ import java.text.ParsePosition;
 import java.util.Date;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.text.DecimalFormat;
 import com.ibm.icu.text.NumberFormat;
@@ -30,7 +33,8 @@ import com.ibm.icu.text.SimpleDateFormat;
  * try to test the full functionality.  It just calls each function in the class and
  * verifies that it works on a basic level.
  */
-public class IntlTestDateFormatAPIC extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class IntlTestDateFormatAPIC extends TestFmwk {
     /**
      * Test hiding of parse() and format() APIs in the Format hierarchy.
      * We test the entire hierarchy, even though this test is located in
@@ -38,17 +42,17 @@ public class IntlTestDateFormatAPIC extends com.ibm.icu.dev.test.TestFmwk {
      */
     @Test
     public void TestNameHiding() {
-    
+
         // N.B.: This test passes if it COMPILES, since it's a test of
         // compile-time name hiding.
-    
+
         Date dateObj = new Date(0);
         Number numObj = new Double(3.1415926535897932384626433832795);
         StringBuffer strBuffer = new StringBuffer("");
         String str;
         FieldPosition fpos = new FieldPosition(0);
         ParsePosition ppos = new ParsePosition(0);
-    
+
         // DateFormat calling Format API
         {
             logln("DateFormat");
@@ -60,7 +64,7 @@ public class IntlTestDateFormatAPIC extends com.ibm.icu.dev.test.TestFmwk {
                 errln("FAIL: Can't create DateFormat");
             }
         }
-    
+
         // SimpleDateFormat calling Format & DateFormat API
         {
             logln("SimpleDateFormat");
@@ -78,7 +82,7 @@ public class IntlTestDateFormatAPIC extends com.ibm.icu.dev.test.TestFmwk {
                 System.out.println(pe);
             }
         }
-    
+
         // NumberFormat calling Format API
         {
             logln("NumberFormat");
@@ -90,7 +94,7 @@ public class IntlTestDateFormatAPIC extends com.ibm.icu.dev.test.TestFmwk {
                 errln("FAIL: Can't create NumberFormat");
             }
         }
-    
+
         // DecimalFormat calling Format & NumberFormat API
         {
             logln("DecimalFormat");
@@ -113,7 +117,7 @@ public class IntlTestDateFormatAPIC extends com.ibm.icu.dev.test.TestFmwk {
                 System.out.println(pe);
             }
         }
-        
+
         //ICU4J have not the classes ChoiceFormat and MessageFormat
         /*
         // ChoiceFormat calling Format & NumberFormat API
@@ -135,8 +139,8 @@ public class IntlTestDateFormatAPIC extends com.ibm.icu.dev.test.TestFmwk {
                 System.out.println(pe);
             }
         }
-    
-        
+
+
         // MessageFormat calling Format API
         {
             logln("MessageFormat");
index 6b39e73320a497d6525137999f5b818792079abd..4a3a67213733583d578cdb84c22fac2c2cb43e2d 100644 (file)
@@ -6,11 +6,11 @@
  *   Corporation and others.  All Rights Reserved.
  **/
 
-/** 
+/**
  * Port From:   JDK 1.4b1 : java.text.Format.IntlTestDateFormatSymbols
  * Source File: java/text/format/IntlTestDateFormatSymbols.java
  **/
+
 /*
     @test 1.4 98/03/06
     @summary test International Date Format Symbols
@@ -21,12 +21,16 @@ package com.ibm.icu.dev.test.format;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormatSymbols;
 import com.ibm.icu.util.Calendar;
 import com.ibm.icu.util.ULocale;
 
-public class IntlTestDateFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
+@RunWith(JUnit4.class)
+public class IntlTestDateFormatSymbols extends TestFmwk
 {
     // Test getMonths
     @Test
@@ -56,7 +60,7 @@ public class IntlTestDateFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
 
         int[] context = {DateFormatSymbols.STANDALONE, DateFormatSymbols.FORMAT};
         int[] width = {DateFormatSymbols.WIDE, DateFormatSymbols.ABBREVIATED, DateFormatSymbols.NARROW};
-        
+
         for (int i = 0; i < context.length; i++) {
             for (int j = 0; j < width.length; j++) {
                 String[] month =symbol.getMonths(context[i],width[j]);
@@ -70,7 +74,7 @@ public class IntlTestDateFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
             }
         }
     }
-    
+
     @Test
     public void TestGetWeekdays2(){
         DateFormatSymbols symbol;
@@ -78,7 +82,7 @@ public class IntlTestDateFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
 
         int[] context = {DateFormatSymbols.STANDALONE, DateFormatSymbols.FORMAT};
         int[] width = {DateFormatSymbols.WIDE, DateFormatSymbols.ABBREVIATED, DateFormatSymbols.NARROW};
-        
+
         for (int i = 0; i < context.length; i++) {
             for (int j = 0; j < width.length; j++) {
                 String[] wd =symbol.getWeekdays(context[i],width[j]);
@@ -91,9 +95,9 @@ public class IntlTestDateFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
                 }
             }
         }
-        
+
     }
-    
+
     @Test
     public void TestGetEraNames(){
         DateFormatSymbols symbol;
@@ -102,7 +106,7 @@ public class IntlTestDateFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
         for (int i = 0; i < s.length; i++) {
             logln(s[i]);
         }
-        
+
     }
 
     private boolean UnicodeStringsArePrefixes(String[] prefixArray, String[] baseArray){
@@ -508,7 +512,7 @@ public class IntlTestDateFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
         if(! en.equals(fr)) {
             errln("ERROR: Clone failed");
         }
-        
+
         final String[] shortYearNames = zhChiCal.getYearNames(DateFormatSymbols.FORMAT, DateFormatSymbols.ABBREVIATED);
         final String[] narrowYearNames = zhChiCal.getYearNames(DateFormatSymbols.STANDALONE, DateFormatSymbols.NARROW);
         if (shortYearNames == null || shortYearNames.length != 60 ||
@@ -537,7 +541,7 @@ public class IntlTestDateFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
                 !testZodiacNames[0].equals("Rat") || !testZodiacNames[11].equals("Pig")) {
             errln("ERROR: setZodiacNames then getZodiacNames not working for zh@calendar=chinese");
         }
-        
+
         String leapMonthPatternFmtAbbrev = zhChiCal.getLeapMonthPattern(DateFormatSymbols.FORMAT, DateFormatSymbols.ABBREVIATED);
         if (leapMonthPatternFmtAbbrev == null || !leapMonthPatternFmtAbbrev.equals("\u95F0{0}")) {
             errln("ERROR: invalid FORMAT/ABBREVIATED leapMonthPattern from zh@calendar=chinese");
index 9f28b1c057d5418ec6f9e1e93c95666e0c303c6a..5ec2d8566500ce7bea37637ef4b08b38fb715b90 100644 (file)
@@ -25,14 +25,18 @@ import java.text.ParsePosition;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.math.BigDecimal;
 import com.ibm.icu.math.MathContext;
 import com.ibm.icu.text.DecimalFormat;
 import com.ibm.icu.text.DecimalFormatSymbols;
 import com.ibm.icu.text.NumberFormat;
 
-public class IntlTestDecimalFormatAPI extends com.ibm.icu.dev.test.TestFmwk
+@RunWith(JUnit4.class)
+public class IntlTestDecimalFormatAPI extends TestFmwk
 {
     /**
      * Problem 1: simply running
index 3532ed1e33b97961e17d4047a4e1441d15e29b1e..5f0c778ea5c14188f63ff298f35f8ac003f78396 100644 (file)
@@ -24,7 +24,10 @@ import java.util.List;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.CurrencyPluralInfo;
 import com.ibm.icu.text.DecimalFormat;
 import com.ibm.icu.text.DecimalFormatSymbols;
@@ -34,7 +37,8 @@ import com.ibm.icu.util.ULocale;
 // This is an API test, not a unit test.  It doesn't test very many cases, and doesn't
 // try to test the full functionality.  It just calls each function in the class and
 // verifies that it works on a basic level.
-public class IntlTestDecimalFormatAPIC extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class IntlTestDecimalFormatAPIC extends TestFmwk {
 
     // This test checks various generic API methods in DecimalFormat to achieve 100% API coverage.
     @Test
index 360f3f2e9043d770c85249427fecc10868c1d49d..a015c5bbc4e50806834c09a2399c3ef33957b9f0 100644 (file)
@@ -23,14 +23,18 @@ import java.util.Arrays;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DecimalFormat;
 import com.ibm.icu.text.DecimalFormatSymbols;
 import com.ibm.icu.text.NumberingSystem;
 import com.ibm.icu.util.Currency;
 import com.ibm.icu.util.ULocale;
 
-public class IntlTestDecimalFormatSymbols extends com.ibm.icu.dev.test.TestFmwk
+@RunWith(JUnit4.class)
+public class IntlTestDecimalFormatSymbols extends TestFmwk
 {
     // Test the API of DecimalFormatSymbols; primarily a simple get/set set.
     @Test
index 77495f41d342271d3025ef47eb6d4cb4e0f39be6..8f5e759b96475b3369c20cd8360b5c5bf3eebc84 100644 (file)
@@ -18,14 +18,18 @@ import java.text.FieldPosition;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DecimalFormat;
 import com.ibm.icu.text.DecimalFormatSymbols;
 
 /**
  * Tests for DecimalFormatSymbols
  **/
-public class IntlTestDecimalFormatSymbolsC extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class IntlTestDecimalFormatSymbolsC extends TestFmwk {
     /**
      * Test the API of DecimalFormatSymbols; primarily a simple get/set set.
      */
index b106de70c73ec2b08f708c1feaf1fa4509bc97ea..2f7dcb10c1fca751f0ff721a6ddd00ebaa418cd3 100644 (file)
@@ -17,6 +17,8 @@ import java.util.Locale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DecimalFormat;
@@ -26,7 +28,8 @@ import com.ibm.icu.text.NumberFormat;
  * This test does round-trip testing (format -> parse -> format -> parse -> etc.) of
  * NumberFormat.
  */
-public class IntlTestNumberFormat extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class IntlTestNumberFormat extends TestFmwk {
 
     public NumberFormat fNumberFormat;
 
index 4c6167233e51371eb06dd27e497f59bb18af2b10..a4aa716d34f3c9635c7054b4f579a40786e62bda 100644 (file)
@@ -5,7 +5,7 @@
  *   Copyright (C) 1996-2009, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  **/
-/** 
+/**
  * Port From:   JDK 1.4b1 : java.text.Format.IntlTestNumberFormatAPI
  * Source File: java/text/format/IntlTestNumberFormatAPI.java
  **/
@@ -24,11 +24,15 @@ import java.text.ParsePosition;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.NumberFormat;
 import com.ibm.icu.util.ULocale;
 
-public class IntlTestNumberFormatAPI extends com.ibm.icu.dev.test.TestFmwk
+@RunWith(JUnit4.class)
+public class IntlTestNumberFormatAPI extends TestFmwk
 {
     // This test checks various generic API methods in DecimalFormat to achieve 100% API coverage.
     @Test
@@ -52,17 +56,17 @@ public class IntlTestNumberFormatAPI extends com.ibm.icu.dev.test.TestFmwk
         NumberFormat per = NumberFormat.getPercentInstance();
 
         NumberFormat per_fr = NumberFormat.getPercentInstance(Locale.FRENCH);
-        
+
         NumberFormat integer = NumberFormat.getIntegerInstance();
-        
+
         NumberFormat int_fr = NumberFormat.getIntegerInstance(Locale.FRENCH);
-        
+
         //Fix "The variable is never used" compilation warnings
         logln("Currency : " + cur.format(1234.5));
         logln("Percent : " + per.format(1234.5));
         logln("Integer : " + integer.format(1234.5));
         logln("Int_fr : " + int_fr.format(1234.5));
-        
+
         // ======= Test equality
 
         logln("Testing equality operator");
@@ -201,7 +205,7 @@ public class IntlTestNumberFormatAPI extends com.ibm.icu.dev.test.TestFmwk
 //            errln("ERROR: Couldn't create a DecimalFormat");
 //        }
     }
-    
+
     // Jitterbug 4451, for coverage
     @Test
     public void TestCoverage(){
@@ -216,11 +220,17 @@ public class IntlTestNumberFormatAPI extends com.ibm.icu.dev.test.TestFmwk
                     errln("NumberFormat.getPattern(Locale, int) should delegate to (ULocale,)");
                 }
             }
+            @Override
             public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) {return null;}
+            @Override
             public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos) {return null;}
+            @Override
             public StringBuffer format(BigInteger number, StringBuffer toAppendTo, FieldPosition pos) {return null;}
+            @Override
             public StringBuffer format(java.math.BigDecimal number, StringBuffer toAppendTo, FieldPosition pos) {return null;}
+            @Override
             public StringBuffer format(com.ibm.icu.math.BigDecimal number, StringBuffer toAppendTo, FieldPosition pos) {return null;}
+            @Override
             public Number parse(String text, ParsePosition parsePosition) {return null;}
         }
         new StubNumberFormat().run();
index c0852a013baca90dec429aa35ded9f48ba5fedbe..afa0634cebc4efbdbdc696ba4ac3962176835744 100644 (file)
  *   Taligent is a registered trademark of Taligent, Inc.
  **/
 
-/** 
+/**
  * Port From:   JDK 1.4b1 : java.text.Format.IntlTestSimpleDateFormatAPI
  * Source File: java/text/format/IntlTestSimpleDateFormatAPI.java
  **/
+
 package com.ibm.icu.dev.test.format;
 
 import java.text.FieldPosition;
@@ -27,7 +27,10 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormatSymbols;
 import com.ibm.icu.text.SimpleDateFormat;
 
@@ -35,7 +38,8 @@ import com.ibm.icu.text.SimpleDateFormat;
 * @test 1.4 98/03/06
 * @summary test International Simple Date Format API
 */
-public class IntlTestSimpleDateFormatAPI extends com.ibm.icu.dev.test.TestFmwk
+@RunWith(JUnit4.class)
+public class IntlTestSimpleDateFormatAPI extends TestFmwk
 {
     // This test checks various generic API methods in DecimalFormat to achieve 100% API coverage.
     @Test
@@ -154,7 +158,7 @@ public class IntlTestSimpleDateFormatAPI extends com.ibm.icu.dev.test.TestFmwk
         if( ! s3.equals(p1) ) {
             errln("ERROR: toLocalizedPattern() result did not match pattern applied");
         }
-        
+
         // ======= Test for Ticket 5684 (Parsing patterns with 'Y' and 'e'
         logln("Testing parse()");
 
@@ -182,7 +186,7 @@ public class IntlTestSimpleDateFormatAPI extends com.ibm.icu.dev.test.TestFmwk
 //            errln("ERROR: Couldn't create a SimpleDateFormat");
 //        }
     }
-    
+
     // Jitterbug 4451, for coverage
     @Test
     public void TestCoverage(){
index 9f52775b38410ead22ff63c4c2cea880545cd471..667525c2b00caa0eef413e1d864f3bc6c4caa8cf 100644 (file)
@@ -12,11 +12,14 @@ import java.util.ArrayList;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.ListFormatter;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class ListFormatterTest extends TestFmwk {
     String[] HardcodedTestData = {
             "",
@@ -141,7 +144,7 @@ public class ListFormatterTest extends TestFmwk {
         assertEquals("4", strings[4], listFormat.format("A", "B", "C", "D"));
         assertEquals("5", strings[5], listFormat.format("A", "B", "C", "D", "E"));
     }
-    
+
     @Test
     public void TestFromList() {
         ListFormatter listFormatter = ListFormatter.getInstance(ULocale.ENGLISH);
@@ -151,16 +154,16 @@ public class ListFormatterTest extends TestFmwk {
         list.add("C");
         assertEquals("list", "A, B, and C", listFormatter.format(list));
     }
-    
+
     @Test
     public void TestCreatePatternForNumItems() {
         ListFormatter listFormatter = ListFormatter.getInstance(ULocale.ENGLISH);
         assertEquals(
                 "createPatternForNumItems",
                 "{0}, {1}, and {2}",
-                listFormatter.getPatternForNumItems(3));        
+                listFormatter.getPatternForNumItems(3));
     }
-    
+
     @Test
     public void TestGetPatternForNumItemsException() {
         ListFormatter listFormatter = ListFormatter.getInstance(ULocale.ENGLISH);
@@ -171,13 +174,13 @@ public class ListFormatterTest extends TestFmwk {
             // expected.
         }
     }
-    
+
     @Test
     public void TestGetLocale() {
         assertEquals(
                 "getLocale", ULocale.ENGLISH, ListFormatter.getInstance(ULocale.ENGLISH).getLocale());
     }
-    
+
     @Test
     public void Test9946() {
         ListFormatter listFormatter = ListFormatter.getInstance(ULocale.ENGLISH);
index 14de333161ef9313f2fea52d2479557989a6ed2e..361a79b569650a9350011844f4ba0509395bb10e 100644 (file)
@@ -28,6 +28,8 @@ import java.util.Set;
 import java.util.TreeMap;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.serializable.FormatHandler;
@@ -50,6 +52,7 @@ import com.ibm.icu.util.ULocale;
  * for information on how to update with each new release.
  * @author markdavis
  */
+@RunWith(JUnit4.class)
 public class MeasureUnitTest extends TestFmwk {
 
     static class OrderedPair<F extends Comparable, S extends Comparable> extends Pair<F, S> implements Comparable<OrderedPair<F, S>> {
index e78f1cbf4de1590a1b1f72fd72bdcaa44f9f4b66..e86ed12fe3a42cf3cc6cd0033ce58c5216a2764e 100644 (file)
@@ -4,12 +4,15 @@
 package com.ibm.icu.dev.test.format;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.Currency;
 import com.ibm.icu.util.MeasureUnit;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class MeasureUnitThreadTest extends TestFmwk {
 
     @Test
index b53be9589c5019e8b3cd6d749d50417a510a913c..42e4c34a6921be702cfaba343f13d5d343486602 100644 (file)
@@ -17,7 +17,10 @@ import java.util.List;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.MessagePattern;
 import com.ibm.icu.text.MessagePatternUtil;
 import com.ibm.icu.text.MessagePatternUtil.ArgNode;
@@ -31,7 +34,8 @@ import com.ibm.icu.text.MessagePatternUtil.VariantNode;
  * Test MessagePatternUtil (MessagePattern-as-tree-of-nodes API)
  * by building parallel trees of nodes and verifying that they match.
  */
-public final class MessagePatternUtilTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public final class MessagePatternUtilTest extends TestFmwk {
     // The following nested "Expect..." classes are used to build
     // a tree structure parallel to what the MessagePatternUtil class builds.
     // These nested test classes are not static so that they have access to TestFmwk methods.
index 2583a792e0cf1c9a43c1d45a0c579b6490fd5bbe..28a574314654201867fd8fc31e051577430058f7 100644 (file)
@@ -46,12 +46,16 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.MessageFormat;
 import com.ibm.icu.text.NumberFormat;
 import com.ibm.icu.util.ULocale;
 
-public class MessageRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class MessageRegressionTest extends TestFmwk {
     /* @bug 4074764
      * Null exception when formatting pattern with MessageFormat
      * with no parameters.
@@ -178,7 +182,7 @@ public class MessageRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         pos.setErrorIndex(4);
         if (pos.getErrorIndex() != 4)
             errln("setErrorIndex failed, got " + pos.getErrorIndex() + " instead of 4");
-        
+
         if (objs != null) {
             errln("objs should be null");
         }
@@ -526,8 +530,8 @@ public class MessageRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
      */
     @Test
     public void Test4142938() {
-        String pat = "''Vous'' {0,choice,0#n''|1#}avez s\u00E9lectionne\u00E9 " + 
-            "{0,choice,0#aucun|1#{0}} client{0,choice,0#s|1#|2#s} " + 
+        String pat = "''Vous'' {0,choice,0#n''|1#}avez s\u00E9lectionne\u00E9 " +
+            "{0,choice,0#aucun|1#{0}} client{0,choice,0#s|1#|2#s} " +
             "personnel{0,choice,0#s|1#|2#s}.";
         MessageFormat mf = new MessageFormat(pat);
 
@@ -535,13 +539,13 @@ public class MessageRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             "'Vous' n'avez s\u00E9lectionne\u00E9 aucun clients personnels.",
             "'Vous' avez s\u00E9lectionne\u00E9 ",
             "'Vous' avez s\u00E9lectionne\u00E9 "
-        };  
+        };
         String[] SUFFIX = {
             null,
             " client personnel.",
             " clients personnels."
         };
-    
+
         for (int i=0; i<3; i++) {
             String out = mf.format(new Object[]{new Integer(i)});
             if (SUFFIX[i] == null) {
@@ -646,7 +650,7 @@ public class MessageRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             throw new RuntimeException("didn't get exception for invalid input");
         }
     }
-    
+
     @Test
     public void test4293229() {
         MessageFormat format = new MessageFormat("'''{'0}'' '''{0}'''");
@@ -658,12 +662,12 @@ public class MessageRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
                     expected + "\", got \"" + result + "\"");
         }
     }
-     
+
     // This test basically ensures that the tests defined above also work with
     // valid named arguments.
     @Test
     public void testBugTestsWithNamesArguments() {
-        
+
       { // Taken from Test4031438().
         String pattern1 = "Impossible {arg1} has occurred -- status code is {arg0} and message is {arg2}.";
         String pattern2 = "Double '' Quotes {ARG_ZERO} test and quoted '{ARG_ONE}' test plus 'other {ARG_TWO} stuff'.";
@@ -812,7 +816,7 @@ public class MessageRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             logln("\"" + mf.format(objs3) + "\"");
         } catch (Exception e) {
             errln("Exception thrown for null argument tests.");
-        } 
+        }
     }{ // Taken from Test4118594().
         String argName = "something_stupid";
         MessageFormat mf = new MessageFormat("{"+ argName + "}, {" + argName + "}, {" + argName + "}");
@@ -870,7 +874,7 @@ public class MessageRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
             ostream.writeObject(original);
             ostream.flush();
             byte bytes[] = baos.toByteArray();
-    
+
             ObjectInputStream istream = new ObjectInputStream(new ByteArrayInputStream(bytes));
             MessageFormat reconstituted = (MessageFormat)istream.readObject();
             return reconstituted;
index 44611b523c5dc4759b0dd7ea738c04359efdf324..54feb3bad8c7d673b19b6ed3536fe8a4d98267d6 100644 (file)
@@ -11,12 +11,16 @@ package com.ibm.icu.dev.test.format;
 import java.util.Arrays;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.NumberFormat;
 import com.ibm.icu.text.NumberFormat.SimpleNumberFormatFactory;
 import com.ibm.icu.util.ULocale;
 
-public class NumberFormatRegistrationTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class NumberFormatRegistrationTest extends TestFmwk {
     @Test
     public void TestRegistration() {
         final ULocale SRC_LOC = ULocale.FRANCE;
@@ -34,6 +38,7 @@ public class NumberFormatRegistrationTest extends com.ibm.icu.dev.test.TestFmwk
                 currencyStyle = NumberFormat.getIntegerInstance(swapLoc);
             }
 
+            @Override
             public NumberFormat createFormat(ULocale loc, int formatType) {
                 if (formatType == FORMAT_CURRENCY) {
                     return currencyStyle;
index d7d1f600efc5ecdf536d8dd9a90c3b93bf86db02..1dcb2ba84adcbbad54f7ab4e94bc5239bd364d14 100644 (file)
@@ -23,7 +23,10 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.text.DecimalFormat;
 import com.ibm.icu.text.DecimalFormatSymbols;
@@ -34,7 +37,8 @@ import com.ibm.icu.util.ULocale;
 /**
  * Performs regression test for MessageFormat
  **/
-public class NumberFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class NumberFormatRegressionTest extends TestFmwk {
     /**
      * alphaWorks upgrade
      */
@@ -76,7 +80,7 @@ public class NumberFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
         // or this (with changes to fr_CH per cldrbug:9370):
         //nf.setGroupingUsed(false);
         // so they are done in DateFormat.setNumberFormat
-    
+
         // create the DateFormat
         DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, loc);
 
index f72ad205429d02e0ef00736028ce32d0e04e176f..c4bf06fc1fc4d054c2ae3f76dde8283bb9fe6425 100644 (file)
@@ -7,7 +7,7 @@
  *******************************************************************************
  */
 
-/** 
+/**
  * Porting From: ICU4C v1.8.1 : format : NumberFormatRoundTripTest
  * Source File: $ICU4CRoot/source/test/intltest/nmfmtrt.cpp
  **/
@@ -18,15 +18,19 @@ import java.util.Locale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DecimalFormat;
 import com.ibm.icu.text.NumberFormat;
 
-/** 
+/**
  * Performs round-trip tests for NumberFormat
  **/
-public class NumberFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
-    
+@RunWith(JUnit4.class)
+public class NumberFormatRoundTripTest extends TestFmwk {
+
     public double MAX_ERROR = 1e-14;
     public double max_numeric_error = 0.0;
     public double min_numeric_error = 1.0;
@@ -35,27 +39,27 @@ public class NumberFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
     public boolean EXACT_NUMERIC_COMPARE = false;
     public boolean DEBUG = false;
     public boolean quick = true;
-    
+
     @Test
     public void TestNumberFormatRoundTrip() {
-    
+
         NumberFormat fmt = null;
-    
+
         logln("Default Locale");
-        
+
         logln("Default Number format");
         fmt = NumberFormat.getInstance();
         _test(fmt);
-    
+
         logln("Currency Format");
         fmt = NumberFormat.getCurrencyInstance();
         _test(fmt);
-    
+
         logln("Percent Format");
         fmt = NumberFormat.getPercentInstance();
         _test(fmt);
-    
-    
+
+
         int locCount = 0;
         final Locale[] loc = NumberFormat.getAvailableLocales();
         if(quick) {
@@ -65,20 +69,20 @@ public class NumberFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
         }
         for(int i = 0; i < locCount; ++i) {
             logln(loc[i].getDisplayName());
-    
+
             fmt = NumberFormat.getInstance(loc[i]);
             _test(fmt);
-        
+
             fmt = NumberFormat.getCurrencyInstance(loc[i]);
             _test(fmt);
-        
+
             fmt = NumberFormat.getPercentInstance(loc[i]);
             _test(fmt);
         }
-    
+
         logln("Numeric error " + min_numeric_error + " to " + max_numeric_error);
     }
-    
+
     /**
      * Return a random value from -range..+range.
      */
@@ -88,14 +92,14 @@ public class NumberFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
             random = createRandom(); // use test framework's random seed
         }
         return  random.nextDouble() * range;
-    } 
-    
+    }
+
     private void _test(NumberFormat fmt) {
-    
+
         _test(fmt, Double.NaN);
         _test(fmt, Double.POSITIVE_INFINITY);
         _test(fmt, Double.NEGATIVE_INFINITY);
-    
+
         _test(fmt, 500);
         _test(fmt, 0);
         _test(fmt, -0);
@@ -106,50 +110,50 @@ public class NumberFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
         _test(fmt, 9223372036854775808.0d);
         _test(fmt, -9223372036854775809.0d);
         //_test(fmt, 6.936065876100493E74d);
-        
+
     //    _test(fmt, 6.212122845281909E48d);
         for (int i = 0; i < 10; ++i) {
-    
+
             _test(fmt, randomDouble(1));
-            
+
             _test(fmt, randomDouble(10000));
-    
+
             _test(fmt, Math.floor((randomDouble(10000))));
-    
+
             _test(fmt, randomDouble(1e50));
-    
+
             _test(fmt, randomDouble(1e-50));
-    
+
             _test(fmt, randomDouble(1e100));
-    
+
             _test(fmt, randomDouble(1e75));
-    
+
             _test(fmt, randomDouble(1e308) / ((DecimalFormat) fmt).getMultiplier());
-    
+
             _test(fmt, randomDouble(1e75) / ((DecimalFormat) fmt).getMultiplier());
-    
+
             _test(fmt, randomDouble(1e65) / ((DecimalFormat) fmt).getMultiplier());
-    
+
             _test(fmt, randomDouble(1e-292));
-    
+
             _test(fmt, randomDouble(1e-78));
-    
+
             _test(fmt, randomDouble(1e-323));
-    
+
             _test(fmt, randomDouble(1e-100));
-    
+
             _test(fmt, randomDouble(1e-78));
         }
     }
-    
+
     private void _test(NumberFormat fmt, double value) {
         _test(fmt, new Double(value));
     }
-    
+
     private void _test(NumberFormat fmt, long value) {
         _test(fmt, new Long(value));
     }
-    
+
     private void _test(NumberFormat fmt, Number value) {
         logln("test data = " + value);
         fmt.setMaximumFractionDigits(999);
@@ -158,7 +162,7 @@ public class NumberFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
             s = fmt.format(value.doubleValue());
         else
             s = fmt.format(value.longValue());
-    
+
         Number n = new Double(0);
         boolean show = verbose;
         if (DEBUG)
@@ -169,25 +173,25 @@ public class NumberFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
         } catch (java.text.ParseException e) {
             System.out.println(e);
         }
-    
+
         if (DEBUG)
             logln(s + " P> " /*+ n.getString(temp)*/);
-    
+
         if (value.getClass().getName().equalsIgnoreCase("java.lang.Double"))
             s2 = fmt.format(n.doubleValue());
         else
             s2 = fmt.format(n.longValue());
-    
+
         if (DEBUG)
             logln(/*n.getString(temp) +*/ " F> " + s2);
-    
+
         if (STRING_COMPARE) {
             if (!s.equals(s2)) {
                 errln("*** STRING ERROR \"" + s + "\" != \"" + s2 + "\"");
                 show = true;
             }
         }
-    
+
         if (EXACT_NUMERIC_COMPARE) {
             if (value != n) {
                 errln("*** NUMERIC ERROR");
@@ -196,42 +200,42 @@ public class NumberFormatRoundTripTest extends com.ibm.icu.dev.test.TestFmwk {
         } else {
             // Compute proportional error
             double error = proportionalError(value, n);
-    
+
             if (error > MAX_ERROR) {
                 errln("*** NUMERIC ERROR " + error);
                 show = true;
             }
-    
+
             if (error > max_numeric_error)
                 max_numeric_error = error;
             if (error < min_numeric_error)
                 min_numeric_error = error;
         }
-    
+
         if (show)
             logln(
             /*value.getString(temp) +*/ value.getClass().getName() + " F> " + s + " P> " +
             /*n.getString(temp) +*/ n.getClass().getName() + " F> " + s2);
-    
+
     }
-        
+
     private double proportionalError(Number a, Number b) {
         double aa,bb;
-        
+
         if(a.getClass().getName().equalsIgnoreCase("java.lang.Double"))
             aa = a.doubleValue();
         else
             aa = a.longValue();
-    
+
         if(a.getClass().getName().equalsIgnoreCase("java.lang.Double"))
             bb = b.doubleValue();
         else
             bb = b.longValue();
-    
+
         double error = aa - bb;
-        if(aa != 0 && bb != 0) 
+        if(aa != 0 && bb != 0)
             error /= aa;
-           
+
         return Math.abs(error);
-    }   
+    }
 }
index a657158809e284e9b0a274e43e114d6db11bb044..ebbc00cfe1e29e13b4e87963b45d3e6cfec7a5da 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.format;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DecimalFormat;
@@ -21,6 +23,7 @@ import com.ibm.icu.util.ULocale;
  * @author rocketman
  *
  */
+@RunWith(JUnit4.class)
 public class NumberFormatSpecificationTest extends TestFmwk {
     @Test
     public void TestBasicPatterns() {
@@ -32,9 +35,9 @@ public class NumberFormatSpecificationTest extends TestFmwk {
         assertEquals("", "1234,567", formatFrWithPattern(num, "###0.#####"));
         assertEquals("", "1234,5670", formatFrWithPattern(num, "###0.0000#"));
         assertEquals("", "01234,5670", formatFrWithPattern(num, "00000.0000"));
-        assertEquals("", "1 234,57 €", formatFrWithPattern(num, "#,##0.00 ¤"));  
+        assertEquals("", "1 234,57 €", formatFrWithPattern(num, "#,##0.00 ¤"));
     }
-    
+
     @Test
     public void TestNfSetters() {
         NumberFormat nf = nfWithPattern("#,##0.##");
@@ -42,9 +45,9 @@ public class NumberFormatSpecificationTest extends TestFmwk {
         nf.setMinimumIntegerDigits(4);
         assertEquals("", "34 567,89", format(1234567.89, nf));
         assertEquals("", "0 034,56", format(34.56, nf));
-        
+
     }
-    
+
     @Test
     public void TestRounding() {
         assertEquals("", "1,0", formatFrWithPattern(1.25, "0.5"));
@@ -58,7 +61,7 @@ public class NumberFormatSpecificationTest extends TestFmwk {
         assertEquals("", "273,00", formatFrWithPattern(272.0, "2.73"));
         assertEquals("", "1 03,60", formatFrWithPattern(104.0, "#,#3.70"));
     }
-    
+
     @Test
     public void TestSignificantDigits() {
         assertEquals("", "1230", formatFrWithPattern(1234.0, "@@@"));
@@ -70,9 +73,9 @@ public class NumberFormatSpecificationTest extends TestFmwk {
         assertEquals("", "12 34 567", formatFrWithPattern(1234567.0, "@@@@,@@,@##"));
         assertEquals("", "12 34 567", formatFrWithPattern(1234567.001, "@@@@,@@,@##"));
         assertEquals("", "12 34 567", formatFrWithPattern(1234567.001, "@@@@,@@,###"));
-        assertEquals("", "1 200", formatFrWithPattern(1234.0, "#,#@@"));       
+        assertEquals("", "1 200", formatFrWithPattern(1234.0, "#,#@@"));
     }
-    
+
     @Test
     public void TestScientificNotation() {
         assertEquals("", "1,23E4", formatFrWithPattern(12345.0, "0.00E0"));
@@ -89,7 +92,7 @@ public class NumberFormatSpecificationTest extends TestFmwk {
             assertEquals("", "170,0E-3", formatFrWithPattern(0.17, "##0.000#E0"));
         }
     }
-    
+
     @Test
     public void TestPercent() {
         assertEquals("", "57,3%", formatFrWithPattern(0.573, "0.0%"));
@@ -99,9 +102,9 @@ public class NumberFormatSpecificationTest extends TestFmwk {
         assertEquals("", "%3,260", formatFrWithPattern(0.0326, "%@@@@"));
         assertEquals("", "%1 540", formatFrWithPattern(15.43, "%#,@@@"));
         assertEquals("", "%1 656,4", formatFrWithPattern(16.55, "%#,##4.1"));
-        assertEquals("", "%16,3E3", formatFrWithPattern(162.55, "%##0.00E0"));  
+        assertEquals("", "%16,3E3", formatFrWithPattern(162.55, "%##0.00E0"));
     }
-    
+
     @Test
     public void TestPerMilli() {
         assertEquals("", "573,0‰", formatFrWithPattern(0.573, "0.0‰"));
@@ -113,7 +116,7 @@ public class NumberFormatSpecificationTest extends TestFmwk {
         assertEquals("", "‰16 551,7", formatFrWithPattern(16.55, "‰#,##4.1"));
         assertEquals("", "‰163E3", formatFrWithPattern(162.55, "‰##0.00E0"));
     }
-    
+
     @Test
     public void TestPadding() {
         assertEquals("", "$***1 234", formatFrWithPattern(1234, "$**####,##0"));
@@ -132,31 +135,31 @@ public class NumberFormatSpecificationTest extends TestFmwk {
             DecimalFormat fmt = new DecimalFormat("¤¤ **#######0", sym);
             fmt.setCurrency(Currency.getInstance("JPY"));
             if (!logKnownIssue("11025", "Padding broken when used with currencies")) {
-                assertEquals("", "JPY ****433", fmt.format(433.22)); 
+                assertEquals("", "JPY ****433", fmt.format(433.22));
             }
         }
         {
             DecimalFormatSymbols sym = new DecimalFormatSymbols(ULocale.US);
             DecimalFormat fmt = new DecimalFormat("¤¤ **#######0;¤¤ (#)", sym);
-            assertEquals("", "USD (433.22)", fmt.format(-433.22));   
+            assertEquals("", "USD (433.22)", fmt.format(-433.22));
         }
         assertEquals("", "QU***43,3E-1", formatFrWithPattern(4.33, "QU**00.#####E0"));
         {
             DecimalFormatSymbols sym = new DecimalFormatSymbols(ULocale.FRANCE);
             sym.setExponentSeparator("EE");
             DecimalFormat fmt = new DecimalFormat("QU**00.#####E0", sym);
-            assertEquals("", "QU**43,3EE-1", fmt.format(4.33));   
+            assertEquals("", "QU**43,3EE-1", fmt.format(4.33));
         }
         // padding cannot work as intended with scientific notation.
         assertEquals("", "QU**43,32E-1", formatFrWithPattern(4.332, "QU**00.#####E0"));
     }
-    
+
     private static String formatFrWithPattern(double d, String pattern) {
         DecimalFormatSymbols sym = new DecimalFormatSymbols(ULocale.FRANCE);
         DecimalFormat fmt = new DecimalFormat(pattern, sym);
         return fmt.format(d).replace('\u00a0', ' ');
     }
-    
+
     private static NumberFormat nfWithPattern(String pattern) {
         DecimalFormatSymbols sym = new DecimalFormatSymbols(ULocale.FRANCE);
         return new DecimalFormat(pattern, sym);
@@ -165,6 +168,6 @@ public class NumberFormatSpecificationTest extends TestFmwk {
     private static String format(double d, NumberFormat nf) {
         return nf.format(d).replace('\u00a0', ' ');
     }
-   
+
 
 }
index 21c190c5e8236dde9739582190ea946d09a73c19..23c699bb03c969b3580cb5f17d1437b56459d1c3 100644 (file)
@@ -35,6 +35,8 @@ import java.util.Locale;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -66,6 +68,7 @@ import com.ibm.icu.util.Currency.CurrencyUsage;
 import com.ibm.icu.util.CurrencyAmount;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class NumberFormatTest extends TestFmwk {
 
     @Test
index 0b03a846b7d72545bc9b4d356ec54b239fc8de54..f805d8a1106bf0337459cfd4d73ce204e157ee12 100644 (file)
@@ -39,6 +39,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUData;
@@ -51,6 +53,7 @@ import com.ibm.icu.util.GregorianCalendar;
 import com.ibm.icu.util.ULocale;
 import com.ibm.icu.util.VersionInfo;
 
+@RunWith(JUnit4.class)
 public class NumberRegressionTests extends TestFmwk {
     private static final char EURO = '\u20ac';
 
index 96fbcf4e86df822a39cac342c292d2dea9dd8f67..129713c5ee406790ebbd008556d84104d6188517 100644 (file)
@@ -13,6 +13,8 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -25,6 +27,7 @@ import com.ibm.icu.util.ULocale;
  * @author tschumann (Tim Schumann)
  *
  */
+@RunWith(JUnit4.class)
 public class PluralFormatTest extends TestFmwk {
   private void helperTestRules(String localeIDs, String testPattern, Map<Integer,String> changes) {
     String[] locales = Utility.split(localeIDs, ',');
index 100e83778a27aacbf1149afcfde85c898bc54e5c..3cb3a04e03b22fba5fa8f5367d3bfa27526d09ef 100644 (file)
@@ -19,6 +19,8 @@ import java.util.Map;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DecimalFormat;
@@ -35,6 +37,7 @@ import com.ibm.icu.util.ULocale;
  * @author tschumann (Tim Schumann)
  *
  */
+@RunWith(JUnit4.class)
 public class PluralFormatUnitTest extends TestFmwk {
     @Test
     public void TestConstructor() {
@@ -402,7 +405,7 @@ public class PluralFormatUnitTest extends TestFmwk {
         assertEquals("offset-decimals format(2)", "another 1.0 meters", pf2.format(2));
         assertEquals("offset-decimals format(2.5)", "another 1.5 meters", pf2.format(2.5));
     }
-    
+
     @Test
     public void TestNegative() {
         PluralFormat pluralFormat = new PluralFormat(ULocale.ENGLISH, "one{# foot}other{# feet}");
index 25653afd4d4ec08800c459ae10937eadfb4779e1..5f8b81f08f2163f2b55f5c98f38d854a3b5dc1b8 100644 (file)
@@ -11,6 +11,8 @@ package com.ibm.icu.dev.test.format;
 import java.util.Arrays;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.SimpleFormatterImpl;
@@ -26,8 +28,9 @@ import com.ibm.icu.util.ULocale;
 
 /**
  * @author markdavis
- * 
+ *
  */
+@RunWith(JUnit4.class)
 public class PluralRangesTest extends TestFmwk {
     @Test
     public void TestLocaleData() {
index 3de97b1476dc8e8b4a688eeecda17ccae1aadbf2..c5bb67dafaabc4d0f9d523cdf887efd82e9f4e11 100644 (file)
@@ -33,6 +33,8 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.serializable.SerializableTestUtility;
@@ -55,6 +57,7 @@ import com.ibm.icu.util.ULocale;
  * @author dougfelt (Doug Felt)
  * @author markdavis (Mark Davis) [for fractional support]
  */
+@RunWith(JUnit4.class)
 public class PluralRulesTest extends TestFmwk {
 
     PluralRulesFactory factory = PluralRulesFactory.NORMAL;
@@ -862,14 +865,14 @@ public class PluralRulesTest extends TestFmwk {
     enum StandardPluralCategories {
         zero, one, two, few, many, other;
         /**
-         * 
+         *
          */
         private static final Set<StandardPluralCategories> ALL = Collections.unmodifiableSet(EnumSet
                 .allOf(StandardPluralCategories.class));
 
         /**
          * Return a mutable set
-         * 
+         *
          * @param source
          * @return
          */
@@ -882,6 +885,7 @@ public class PluralRulesTest extends TestFmwk {
         }
 
         static final Comparator<Set<StandardPluralCategories>> SHORTEST_FIRST = new Comparator<Set<StandardPluralCategories>>() {
+            @Override
             public int compare(Set<StandardPluralCategories> arg0, Set<StandardPluralCategories> arg1) {
                 int diff = arg0.size() - arg1.size();
                 if (diff != 0) {
@@ -927,6 +931,7 @@ public class PluralRulesTest extends TestFmwk {
     }
 
     private static final Comparator<PluralRules> PLURAL_RULE_COMPARATOR = new Comparator<PluralRules>() {
+        @Override
         public int compare(PluralRules o1, PluralRules o2) {
             return o1.compareTo(o2);
         }
@@ -1066,12 +1071,14 @@ public class PluralRulesTest extends TestFmwk {
     }
 
     public static class FixedDecimalHandler implements SerializableTestUtility.Handler {
+        @Override
         public Object[] getTestObjects() {
             FixedDecimal items[] = { new FixedDecimal(3d), new FixedDecimal(3d, 2), new FixedDecimal(3.1d, 1),
                     new FixedDecimal(3.1d, 2), };
             return items;
         }
 
+        @Override
         public boolean hasSameBehavior(Object a, Object b) {
             FixedDecimal a1 = (FixedDecimal) a;
             FixedDecimal b1 = (FixedDecimal) b;
index 9322fa86c025badddf379c3e16a9d541db3ddf40..dfdf0222fa8cdfcc772674098e14d2b14c533c26 100644 (file)
@@ -11,11 +11,14 @@ package com.ibm.icu.dev.test.format;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.RuleBasedNumberFormat;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class RBNFParseTest extends TestFmwk {
     @Test
     public void TestParse() {
index 9e95906050852b4610fdb13ddf7a0d6a27328a9b..a8574c21cb0fe7c5e1c57c9fd7f05ca85381e19c 100644 (file)
@@ -11,10 +11,13 @@ package com.ibm.icu.dev.test.format;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.RuleBasedNumberFormat;
 
+@RunWith(JUnit4.class)
 public class RbnfRoundTripTest extends TestFmwk {
     /**
      * Perform an exhaustive round-trip test on the English spellout rules
index ec80686c447ce1e55387f180c730ae4621f74b22..fbfaa6b962e5be28e6f7cf76ad6ac8fe4b72a05c 100644 (file)
@@ -14,6 +14,8 @@ import java.util.Locale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.math.BigDecimal;
@@ -28,6 +30,7 @@ import com.ibm.icu.util.ULocale;
  * This does not test lenient parse mode, since testing the default implementation
  * introduces a dependency on collation.  See RbnfLenientScannerTest.
  */
+@RunWith(JUnit4.class)
 public class RbnfTest extends TestFmwk {
     static String fracRules =
         "%main:\n" +
index 958639772752481dea104072f74693d6393073a9..b9c67e43c7727b6a78e9021a5bb7308645865f2c 100644 (file)
@@ -11,6 +11,8 @@ package com.ibm.icu.dev.test.format;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.math.BigDecimal;
@@ -24,6 +26,7 @@ import com.ibm.icu.text.RelativeDateTimeFormatter.RelativeUnit;
 import com.ibm.icu.text.RelativeDateTimeFormatter.Style;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class RelativeDateTimeFormatterTest extends TestFmwk {
     @Test
     public void TestRelativeDateWithQuantity() {
index 09b79d2ba7920e85b1ed5b0df550e8236520a477..02357e489308b75760e1ea9e77f99e646404b45f 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.format;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DecimalFormat;
@@ -20,6 +22,7 @@ import com.ibm.icu.util.ULocale;
  * @author rocketman
  *
  */
+@RunWith(JUnit4.class)
 public class ScientificNumberFormatterTest extends TestFmwk {
     @Test
     public void TestBasic() {
@@ -35,8 +38,8 @@ public class ScientificNumberFormatterTest extends TestFmwk {
                 "1.23456×10⁻⁷⁸",
                 superscript.format(1.23456e-78));
     }
-    
-    
+
+
     @Test
     public void TestFarsi() {
         ScientificNumberFormatter fmt = ScientificNumberFormatter.getMarkupInstance(
@@ -54,14 +57,14 @@ public class ScientificNumberFormatterTest extends TestFmwk {
         decfmt.applyPattern("0.00E+0");
         ScientificNumberFormatter fmt = ScientificNumberFormatter.getMarkupInstance(
                 decfmt, "<sup>", "</sup>");
-                
+
         assertEquals(
                 "",
                 "6.02×10<sup>+23</sup>",
                 fmt.format(6.02e23));
     }
 
-    
+
     @Test
     public void TestPlusSignInExponentSuperscript() {
         DecimalFormat decfmt = (DecimalFormat) NumberFormat.getScientificInstance(ULocale.ENGLISH);
@@ -73,7 +76,7 @@ public class ScientificNumberFormatterTest extends TestFmwk {
                 "6.02×10⁺²³",
                 fmt.format(6.02e23));
     }
-    
+
     @Test
     public void TestFixedDecimalMarkup() {
         DecimalFormat decfmt = (DecimalFormat) NumberFormat.getInstance(ULocale.ENGLISH);
@@ -84,7 +87,7 @@ public class ScientificNumberFormatterTest extends TestFmwk {
                 "123,456",
                 fmt.format(123456.0));
     }
-    
+
     @Test
     public void TestFixedDecimalSuperscript() {
         DecimalFormat decfmt = (DecimalFormat) NumberFormat.getInstance(ULocale.ENGLISH);
index 304376ee603d72386952792725a9b0573d5bd9a3..55cb178c67e00e5125a6b240dd5713fb39b89e42 100644 (file)
@@ -4,7 +4,7 @@
  *******************************************************************************
  * Copyright (c) 2004-2011, International Business Machines
  * Corporation and others.  All Rights Reserved.
- * Copyright (C) 2010 , Yahoo! Inc.                                            
+ * Copyright (C) 2010 , Yahoo! Inc.
  *******************************************************************************
  */
 package com.ibm.icu.dev.test.format;
@@ -13,16 +13,19 @@ import java.text.FieldPosition;
 import java.text.ParsePosition;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.SelectFormat;
 
 /**
- * @author kirtig 
+ * @author kirtig
  * This class tests the API functionality of the SelectFormat
  */
+@RunWith(JUnit4.class)
 public class SelectFormatAPITest extends TestFmwk {
-  
+
     static final String SIMPLE_PATTERN1 = "feminine {feminineVerbValue1} other{otherVerbValue1}";
     static final String SIMPLE_PATTERN2 = "feminine {feminineVerbValue2} other{otherVerbValue2}";
 
@@ -33,7 +36,7 @@ public class SelectFormatAPITest extends TestFmwk {
     public void TestConstructors() {
         SelectFormat selFmt = new SelectFormat(SIMPLE_PATTERN1);
         assertNotNull("Error: TestConstructors - SelectFormat object constructed "
-                      + "with argument constructor is null" , selFmt );  
+                      + "with argument constructor is null" , selFmt );
     }
 
     /**
@@ -46,19 +49,19 @@ public class SelectFormatAPITest extends TestFmwk {
         //Check equality for pattern constructed SelectFormats
         selFmt1 = new SelectFormat(SIMPLE_PATTERN1);
         SelectFormat selFmt2 = new SelectFormat(SIMPLE_PATTERN1);
-        assertTrue("Equals test failed while checking equality for " 
-                   + "pattern constructed SelectFormats ." 
-                   , selFmt1.equals(selFmt2) ); 
+        assertTrue("Equals test failed while checking equality for "
+                   + "pattern constructed SelectFormats ."
+                   , selFmt1.equals(selFmt2) );
 
-        //Check equality for 2 objects  
+        //Check equality for 2 objects
         Object selFmt3 = new SelectFormat(SIMPLE_PATTERN1);
         Object selFmt4 = new SelectFormat(SIMPLE_PATTERN1);
         Object selFmt5 = new SelectFormat(SIMPLE_PATTERN2);
-        assertTrue("Equals test failed while checking equality for object 1." 
+        assertTrue("Equals test failed while checking equality for object 1."
                 , selFmt3.equals(selFmt4) );
-        assertTrue("Equals test failed while checking equality for object 2." 
+        assertTrue("Equals test failed while checking equality for object 2."
                     , selFmt1.equals(selFmt3) );
-        assertFalse("Equals test failed while checking equality for object 3." 
+        assertFalse("Equals test failed while checking equality for object 3."
                 , selFmt3.equals(selFmt5) );
     }
 
@@ -134,7 +137,7 @@ public class SelectFormatAPITest extends TestFmwk {
         SelectFormat selFmt1 = new SelectFormat(SIMPLE_PATTERN1);
         String expected = "feminineVerbValue1";
         assertEquals("Failed in TestFormat with unexpected output 1"
-                     , expected 
+                     , expected
                      , selFmt1.format("feminine") );
 
         //Check format with appendTo for pattern constructed object
@@ -143,7 +146,7 @@ public class SelectFormatAPITest extends TestFmwk {
         assertEquals("Failed in TestFormat with unexpected output 2"
                      , expected
                      , (selFmt1.format("other", strBuf, new FieldPosition(0))).toString());
-       
+
         //Check format throws exception on invalid argument.
         boolean threwException = false;
         try {
index 7330294e04aa3f1734af9878955f1e59bf16dce1..e8b770c3adeefd40f058effce7b2906a3f6ca6b3 100644 (file)
@@ -4,22 +4,25 @@
  *******************************************************************************
  * Copyright (c) 2004-2011, International Business Machines
  * Corporation and others.  All Rights Reserved.
- * Copyright (C) 2010 , Yahoo! Inc.                                            
+ * Copyright (C) 2010 , Yahoo! Inc.
  *******************************************************************************
  */
 package com.ibm.icu.dev.test.format;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.SelectFormat;
 
 /**
- * @author kirtig 
+ * @author kirtig
  * This class does the unit testing for the SelectFormat
  */
+@RunWith(JUnit4.class)
 public class SelectFormatUnitTest extends TestFmwk {
-  
+
     static final String SIMPLE_PATTERN = "feminine {feminineVerbValue} other{otherVerbValue}";
 
     /**
@@ -33,8 +36,8 @@ public class SelectFormatUnitTest extends TestFmwk {
             "odd{foo},other{bar}",
             "od d{foo} other{bar}",
             "odd{foo}{foobar}other{foo}",
-            "odd{foo1}other{foo2}}",  
-            "odd{foo1}other{{foo2}",  
+            "odd{foo1}other{foo2}}",
+            "odd{foo1}other{{foo2}",
             "odd{fo{o1}other{foo2}}"
         };
 
@@ -59,7 +62,7 @@ public class SelectFormatUnitTest extends TestFmwk {
     }
 
     /**
-     * Unit tests for invalid keywords 
+     * Unit tests for invalid keywords
      */
     @Test
     public void TestInvalidKeyword() {
@@ -86,7 +89,7 @@ public class SelectFormatUnitTest extends TestFmwk {
                      + "for keyword: " + keywords[i]  );
             } catch (IllegalArgumentException e){
                 assertEquals("Error:TestInvalidKeyword failed with unexpected "
-                            +"error message for keyword: " + keywords[i] 
+                            +"error message for keyword: " + keywords[i]
                             , expected , e.getMessage() );
                 continue;
             }
@@ -137,7 +140,7 @@ public class SelectFormatUnitTest extends TestFmwk {
         };
 
         log("SelectFormat Unit test: Testing  applyPattern() and format() ...");
-        SelectFormat selFmt = new SelectFormat(SIMPLE_PATTERN); 
+        SelectFormat selFmt = new SelectFormat(SIMPLE_PATTERN);
 
         for (int i=0; i<patternTestData.length; ++i) {
             try {
index 7e9fa53edba7aed379d6bf43c5fac3a426954ffb..9c3b1099043dce321d145733ea0a2ad5d6cced24 100644 (file)
@@ -28,7 +28,10 @@ import java.util.Set;
 import java.util.TreeMap;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
+import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
 import com.ibm.icu.text.DecimalFormat;
 import com.ibm.icu.text.DecimalFormatSymbols;
@@ -40,7 +43,8 @@ import com.ibm.icu.text.UFormat;
 import com.ibm.icu.util.TimeZone;
 import com.ibm.icu.util.ULocale;
 
-public class TestMessageFormat extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class TestMessageFormat extends TestFmwk {
     @Test
     public void TestBug3()
     {
index ff349088533e8d07e071513f8f9c30a678badd30..c60700354ff34ba503b372ae1f4026309b319c4c 100644 (file)
@@ -13,6 +13,8 @@ import java.text.ParsePosition;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.math.BigDecimal;
@@ -29,6 +31,7 @@ import com.ibm.icu.util.ULocale;
  * @author markdavis
  *
  */
+@RunWith(JUnit4.class)
 public class TimeUnitTest extends TestFmwk {
     @Test
     public void Test10219FractionalPlurals() {
@@ -40,16 +43,16 @@ public class TimeUnitTest extends TestFmwk {
             nf.setMaximumFractionDigits(i);
             tuf.setNumberFormat(nf);
             assertEquals("Test10219", expected[i], tuf.format(new TimeUnitAmount(1.588, TimeUnit.MINUTE)));
-        }   
+        }
     }
-    
+
     @Test
     public void Test10219FactionalPluralsParse() throws ParseException {
         TimeUnitFormat tuf = new TimeUnitFormat(ULocale.ENGLISH, TimeUnitFormat.FULL_NAME);
         ParsePosition ppos = new ParsePosition(0);
         String parseString = "1 minutes";
         tuf.parseObject(parseString, ppos);
-        
+
         // Parsing should go all the way to the end of the string.
         // We want the longest match, and we don't care if the plural form of the unit
         // matches the plural form of the number.
@@ -64,7 +67,7 @@ public class TimeUnitTest extends TestFmwk {
             TimeUnitFormat[] formats = new TimeUnitFormat[] {
                 new TimeUnitFormat(new ULocale(locales[locIndex]), TimeUnitFormat.FULL_NAME),
                 new TimeUnitFormat(new ULocale(locales[locIndex]), TimeUnitFormat.ABBREVIATED_NAME),
-                
+
             };
             for (int style = TimeUnitFormat.FULL_NAME;
                  style <= TimeUnitFormat.ABBREVIATED_NAME;
@@ -111,7 +114,7 @@ public class TimeUnitTest extends TestFmwk {
         format.setNumberFormat(NumberFormat.getNumberInstance(es));
         format.setLocale(es);
         formatParsing(format);
-        
+
         format.setLocale(new Locale("pt_BR"));
         formatParsing(format);
         format = new TimeUnitFormat(new Locale("de"));
@@ -120,7 +123,7 @@ public class TimeUnitTest extends TestFmwk {
         format.setNumberFormat(NumberFormat.getNumberInstance(new Locale("en")));
         formatParsing(format);
     }
-    
+
     @Test
     public void TestClone() {
         TimeUnitFormat tuf = new TimeUnitFormat(ULocale.ENGLISH, TimeUnitFormat.ABBREVIATED_NAME);
@@ -130,18 +133,18 @@ public class TimeUnitTest extends TestFmwk {
         tuf.setLocale(Locale.GERMAN);
         assertEquals("", "1 hr", tufClone.format(new TimeUnitAmount(1, TimeUnit.HOUR)));
     }
-    
+
     @Test
     public void TestEqHashCode() {
         TimeUnitFormat tf = new TimeUnitFormat(ULocale.ENGLISH, TimeUnitFormat.FULL_NAME);
         MeasureFormat tfeq = new TimeUnitFormat(ULocale.ENGLISH, TimeUnitFormat.FULL_NAME);
-        
+
         MeasureFormat tfne = new TimeUnitFormat(ULocale.ENGLISH, TimeUnitFormat.ABBREVIATED_NAME);
         MeasureFormat tfne2 = new TimeUnitFormat(ULocale.GERMAN, TimeUnitFormat.FULL_NAME);
         verifyEqualsHashCode(tf, tfeq, tfne);
         verifyEqualsHashCode(tf, tfeq, tfne2);
     }
-    
+
     @Test
     public void TestGetLocale() {
         TimeUnitFormat tf = new TimeUnitFormat(ULocale.GERMAN);
@@ -150,8 +153,8 @@ public class TimeUnitTest extends TestFmwk {
 
     /*
      * @bug 7902
-     * This tests that requests for short unit names correctly fall back 
-     * to long unit names for a locale where the locale data does not 
+     * This tests that requests for short unit names correctly fall back
+     * to long unit names for a locale where the locale data does not
      * provide short unit names. As of CLDR 1.9, Greek is one such language.
      */
     @Test
@@ -250,9 +253,9 @@ public class TimeUnitTest extends TestFmwk {
 
                         assertEquals(
                                 "locale: " + locales[locIndex]
-                                        + ", style: " + styles[styleIndex] 
+                                        + ", style: " + styles[styleIndex]
                                                 + ", units: " + units[unitIndex]
-                                                        + ", value: " + numbers[numIndex], 
+                                                        + ", value: " + numbers[numIndex],
                                                 expected[counter], formatted);
                         ++counter;
                     }
@@ -262,22 +265,22 @@ public class TimeUnitTest extends TestFmwk {
     }
 
     /**
-     * @bug9042 
+     * @bug9042
      * Performs tests for Greek.
-     * This tests that if the plural count listed in time unit format does not 
-     * match those in the plural rules for the locale, those plural count in 
-     * time unit format will be ingored and subsequently, fall back will kick in 
-     * which is tested above. 
-     * Without data sanitization, setNumberFormat() would crash. 
-     * As of CLDR shiped in ICU4.8, Greek is one such language. 
-     */ 
+     * This tests that if the plural count listed in time unit format does not
+     * match those in the plural rules for the locale, those plural count in
+     * time unit format will be ingored and subsequently, fall back will kick in
+     * which is tested above.
+     * Without data sanitization, setNumberFormat() would crash.
+     * As of CLDR shiped in ICU4.8, Greek is one such language.
+     */
     @Test
     public void TestGreekWithSanitization() {
         ULocale loc = new ULocale("el");
         NumberFormat numfmt = NumberFormat.getInstance(loc);
         TimeUnitFormat tuf = new TimeUnitFormat(loc);
         tuf.parseObject("", new ParsePosition(0));
-        tuf.setNumberFormat(numfmt);        
+        tuf.setNumberFormat(numfmt);
     }
 
     @Test
@@ -320,7 +323,7 @@ public class TimeUnitTest extends TestFmwk {
             }
         }
     }
-    
+
     /*
      * Tests the method public TimeUnitFormat(ULocale locale, int style), public TimeUnitFormat(Locale locale, int style)
      */
@@ -347,7 +350,7 @@ public class TimeUnitTest extends TestFmwk {
             }
         }
     }
-    
+
     /*
      * Tests the method public TimeUnitFormat setLocale(ULocale locale) public TimeUnitFormat setLocale(Locale locale)
      */
@@ -391,7 +394,7 @@ public class TimeUnitTest extends TestFmwk {
         tuf1.setNumberFormat(NumberFormat.getInstance());
         tuf1.setNumberFormat(null);
     }
-    
+
     /*
      * Tests the method public StringBuffer format(Object obj, ...
      */
@@ -406,21 +409,21 @@ public class TimeUnitTest extends TestFmwk {
         } catch (Exception e) {
         }
     }
-    
+
     /* Tests the method private void setup() from
      * public Object parseObject(String source, ParsePosition pos)
-     * 
+     *
      */
     @Test
     public void TestSetup(){
         TimeUnitFormat tuf = new TimeUnitFormat();
         tuf.parseObject("", new ParsePosition(0));
-        
+
         TimeUnitFormat tuf1 = new TimeUnitFormat();
         tuf1.setNumberFormat(NumberFormat.getInstance());
         tuf1.parseObject("", new ParsePosition(0));
     }
-    
+
     @Test
     public void TestStandInForMeasureFormat() {
         TimeUnitFormat tuf = new TimeUnitFormat(ULocale.FRENCH, TimeUnitFormat.ABBREVIATED_NAME);
@@ -437,14 +440,14 @@ public class TimeUnitTest extends TestFmwk {
         assertEquals("getNumberFormat", ULocale.FRENCH, tuf.getNumberFormat().getLocale(ULocale.VALID_LOCALE));
         assertEquals("getWidth", MeasureFormat.FormatWidth.WIDE, tuf.getWidth());
     }
-    
+
     private void verifyEqualsHashCode(Object o, Object eq, Object ne) {
         assertEquals("verifyEqualsHashCodeSame", o, o);
         assertEquals("verifyEqualsHashCodeEq", o, eq);
         assertNotEquals("verifyEqualsHashCodeNe", o, ne);
         assertNotEquals("verifyEqualsHashCodeEqTrans", eq, ne);
         assertEquals("verifyEqualsHashCodeHashEq", o.hashCode(), eq.hashCode());
-        
+
         // May be a flaky test, but generally should be true.
         // May need to comment this out later.
         assertNotEquals("verifyEqualsHashCodeHashNe", o.hashCode(), ne.hashCode());
index 914cdbd2ae38a2b9cba12f61d21999e1edfc869e..ea907cee4ce6f10c99dcdd9ddd24be51784c6d47 100644 (file)
@@ -26,6 +26,8 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.regex.Pattern;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.TZDBTimeZoneNames;
@@ -50,7 +52,8 @@ import com.ibm.icu.util.TimeZone.SystemTimeZoneType;
 import com.ibm.icu.util.TimeZoneTransition;
 import com.ibm.icu.util.ULocale;
 
-public class TimeZoneFormatTest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class TimeZoneFormatTest extends TestFmwk {
 
     private static boolean JDKTZ = (TimeZone.getDefaultTimeZoneType() == TimeZone.TIMEZONE_JDK);
     private static final Pattern EXCL_TZ_PATTERN = Pattern.compile(".*/Riyadh8[7-9]");
index 10657ee96f1cff505e04b576a48dcb53582bd1ac..56523bd2d9993622fd26b7c4ed0d719eb0d78d5b 100644 (file)
@@ -7,10 +7,13 @@ import java.text.CharacterIterator;
 import java.text.StringCharacterIterator;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.CSCharacterIterator;
 
+@RunWith(JUnit4.class)
 public class CSCharacterIteratorTest extends TestFmwk {
     public CSCharacterIteratorTest() {};
 
index e98b35d7d5550e87e05813087dee6935f09122e1..7f8fa1f891a5b48c096762908ecaa7d048d0e917 100644 (file)
@@ -9,11 +9,14 @@
 package com.ibm.icu.dev.test.impl;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.CacheValue;
 import com.ibm.icu.impl.CacheValue.Strength;
 
+@RunWith(JUnit4.class)
 public class CacheTest extends TestFmwk {
     public CacheTest() {}
 
index 24e675b1f74c54f8d0d109f162fdc512a90750b6..a6b456ec888b188352744cac954d0626beeb7dc6 100644 (file)
@@ -12,6 +12,8 @@ import java.text.CharacterIterator;
 import java.text.StringCharacterIterator;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.ReplaceableString;
@@ -26,19 +28,20 @@ import com.ibm.icu.text.UTF16;
  * To enable and disable the creation of type comments go to
  * Window>Preferences>Java>Code Generation.
  */
+@RunWith(JUnit4.class)
 public class TestUCharacterIterator extends TestFmwk{
 
     // constructor -----------------------------------------------------
-  
+
     /**
      * Constructor
      */
     public TestUCharacterIterator()
     {
     }
-  
+
     // public methods --------------------------------------------------
-  
+
     /**
     * Testing cloning
     */
@@ -70,7 +73,7 @@ public class TestUCharacterIterator extends TestFmwk{
             errln("getText failed for iterator");
         }
     }
-    
+
     /**
      * Testing iteration
      */
@@ -81,18 +84,18 @@ public class TestUCharacterIterator extends TestFmwk{
                                                        ITERATION_STRING_);
         UCharacterIterator iterator2 = UCharacterIterator.getInstance(
                                                        ITERATION_STRING_);
-        iterator.setToStart();                                               
+        iterator.setToStart();
         if (iterator.current() != ITERATION_STRING_.charAt(0)) {
             errln("Iterator failed retrieving first character");
         }
-        iterator.setToLimit(); 
+        iterator.setToLimit();
         if (iterator.previous() != ITERATION_STRING_.charAt(
                                        ITERATION_STRING_.length() - 1)) {
             errln("Iterator failed retrieving last character");
-        }                                               
+        }
         if (iterator.getLength() != ITERATION_STRING_.length()) {
             errln("Iterator failed determining begin and end index");
-        }  
+        }
         iterator2.setIndex(0);
         iterator.setIndex(0);
         int ch = 0;
@@ -100,9 +103,9 @@ public class TestUCharacterIterator extends TestFmwk{
             int index = iterator2.getIndex();
             ch = iterator2.nextCodePoint();
             if (index != ITERATION_SUPPLEMENTARY_INDEX) {
-                if (ch != (int)iterator.next() && 
+                if (ch != iterator.next() &&
                     ch != UCharacterIterator.DONE) {
-                    errln("Error mismatch in next() and nextCodePoint()"); 
+                    errln("Error mismatch in next() and nextCodePoint()");
                 }
             }
             else {
@@ -119,14 +122,14 @@ public class TestUCharacterIterator extends TestFmwk{
             int index = iterator2.getIndex();
             ch = iterator2.previousCodePoint();
             if (index != ITERATION_SUPPLEMENTARY_INDEX) {
-                if (ch != (int)iterator.previous() && 
+                if (ch != iterator.previous() &&
                     ch != UCharacterIterator.DONE) {
                     errln("Error mismatch in previous() and " +
-                          "previousCodePoint()"); 
+                          "previousCodePoint()");
                 }
             }
             else {
-                if (UTF16.getLeadSurrogate(ch) != iterator.previous() || 
+                if (UTF16.getLeadSurrogate(ch) != iterator.previous() ||
                     UTF16.getTrailSurrogate(ch) != iterator.previous()) {
                     errln("Error mismatch in previous and " +
                           "previousCodePoint for supplementary characters");
@@ -134,8 +137,8 @@ public class TestUCharacterIterator extends TestFmwk{
             }
         }
     }
-    
-    //Tests for new API for utf-16 support 
+
+    //Tests for new API for utf-16 support
     @Test
     public void TestIterationUChar32() {
         String text="\u0061\u0062\ud841\udc02\u20ac\ud7ff\ud842\udc06\ud801\udc00\u0061";
@@ -143,15 +146,15 @@ public class TestUCharacterIterator extends TestFmwk{
         int i;
         {
             UCharacterIterator iter = UCharacterIterator.getInstance(text);
-    
+
             String iterText = iter.getText();
             if (!iterText.equals(text))
               errln("iter.getText() failed");
-            
+
             iter.setIndex(1);
             if (iter.currentCodePoint() != UTF16.charAt(text,1))
                 errln("Iterator didn't start out in the right place.");
-    
+
             iter.setToStart();
             c=iter.currentCodePoint();
             i=0;
@@ -159,12 +162,12 @@ public class TestUCharacterIterator extends TestFmwk{
             c=iter.currentCodePoint();
             if(c != UTF16.charAt(text,1) || i!=1)
                 errln("moveCodePointIndex(1) didn't work correctly expected "+ hex(c) +" got "+hex(UTF16.charAt(text,1)) + " i= " + i);
-    
+
             i=iter.moveCodePointIndex(2);
             c=iter.currentCodePoint();
             if(c != UTF16.charAt(text,4) || i!=4)
                 errln("moveCodePointIndex(2) didn't work correctly expected "+ hex(c) +" got "+hex(UTF16.charAt(text,4)) + " i= " + i);
-                
+
             i=iter.moveCodePointIndex(-2);
             c=iter.currentCodePoint();
             if(c != UTF16.charAt(text,1) || i!=1)
@@ -175,11 +178,11 @@ public class TestUCharacterIterator extends TestFmwk{
             c=iter.currentCodePoint();
             if(c != UTF16.charAt(text,(text.length()-3)) || i!=(text.length()-3))
                 errln("moveCodePointIndex(-2) didn't work correctly expected "+ hex(c) +" got "+hex(UTF16.charAt(text,(text.length()-3)) ) + " i= " + i);
-            
+
             iter.setToStart();
             c = iter.currentCodePoint();
             i = 0;
-    
+
             //testing first32PostInc, nextCodePointPostInc, setTostart
             i = 0;
             iter.setToStart();
@@ -188,24 +191,24 @@ public class TestUCharacterIterator extends TestFmwk{
                 errln("first32PostInc failed.  Expected->"+hex(UTF16.charAt(text,i))+" Got-> "+hex(c));
             if(iter.getIndex() != UTF16.getCharCount(c) + i)
                 errln("getIndex() after first32PostInc() failed");
-    
+
             iter.setToStart();
             i=0;
             if (iter.getIndex() != 0)
                 errln("setToStart failed");
-           
+
             logln("Testing forward iteration...");
             do {
                 if (c != UCharacterIterator.DONE)
                     c = iter.nextCodePoint();
-    
+
                 if(c != UTF16.charAt(text,i))
                     errln("Character mismatch at position "+i+", iterator has "+hex(c)+", string has "+hex(UTF16.charAt(text,i)));
-    
+
                 i+=UTF16.getCharCount(c);
                 if(iter.getIndex() != i)
                     errln("getIndex() aftr nextCodePointPostInc() isn't working right");
-                c = iter.currentCodePoint();                   
+                c = iter.currentCodePoint();
                 if( c!=UCharacterIterator.DONE && c != UTF16.charAt(text,i))
                     errln("current() after nextCodePointPostInc() isn't working right");
 
@@ -213,20 +216,20 @@ public class TestUCharacterIterator extends TestFmwk{
             c=iter.nextCodePoint();
             if(c!= UCharacterIterator.DONE)
                 errln("nextCodePointPostInc() didn't return DONE at the beginning");
-    
-    
+
+
         }
-    }  
-    
+    }
+
     class UCharIterator {
-    
+
        public UCharIterator(int[] src, int len, int index){
-            
+
             s=src;
             length=len;
             i=index;
        }
-    
+
         public int current() {
             if(i<length) {
                 return s[i];
@@ -234,7 +237,7 @@ public class TestUCharacterIterator extends TestFmwk{
                 return -1;
             }
         }
-    
+
         public int next() {
             if(i<length) {
                 return s[i++];
@@ -242,7 +245,7 @@ public class TestUCharacterIterator extends TestFmwk{
                 return -1;
             }
         }
-    
+
         public int previous() {
             if(i>0) {
                 return s[--i];
@@ -250,11 +253,11 @@ public class TestUCharacterIterator extends TestFmwk{
                 return -1;
             }
         }
-    
+
         public int getIndex() {
             return i;
         }
-    
+
         private int[] s;
         private int length, i;
     }
@@ -318,37 +321,37 @@ public class TestUCharacterIterator extends TestFmwk{
             0xc4,
             0x1ed0
         };
-    
+
         // expected src indexes corresponding to expect indexes
         int expectIndex[]={
             0,0,
             1,1,
             2,
             3,
-            4 //needed 
+            4 //needed
         };
-    
+
         // initial indexes into the src and expect strings
-        
+
         final int SRC_MIDDLE=4;
         final int EXPECT_MIDDLE=2;
-        
-    
+
+
         // movement vector
         // - for previous(), 0 for current(), + for next()
         // not const so that we can terminate it below for the error message
         String moves="0+0+0--0-0-+++0--+++++++0--------";
-    
-        
-        UCharIterator iter32 = new UCharIterator(expect, expect.length, 
+
+
+        UCharIterator iter32 = new UCharIterator(expect, expect.length,
                                                      EXPECT_MIDDLE);
-    
+
         int c1, c2;
         char m;
-    
+
         // initially set the indexes into the middle of the strings
         iter.setIndex(SRC_MIDDLE);
-    
+
         // move around and compare the iteration code points with
         // the expected ones
         int movesIndex =0;
@@ -360,11 +363,11 @@ public class TestUCharacterIterator extends TestFmwk{
             } else if(m=='0') {
                 c1=iter.currentCodePoint();
                 c2=iter32.current();
-            } else  {// m=='+' 
+            } else  {// m=='+'
                 c1=iter.nextCodePoint();
                 c2=iter32.next();
             }
-    
+
             // compare results
             if(c1!=c2) {
                 // copy the moves until the current (m) move, and terminate
@@ -373,7 +376,7 @@ public class TestUCharacterIterator extends TestFmwk{
                       +"got c1= " + hex(c1) +" != expected c2= "+ hex(c2));
                 break;
             }
-    
+
             // compare indexes
             if(expectIndex[iter.getIndex()]!=iter32.getIndex()) {
                 // copy the moves until the current (m) move, and terminate
@@ -397,7 +400,7 @@ public class TestUCharacterIterator extends TestFmwk{
         int c1, c2;
         char m;
         int movesIndex =0;
-        
+
         while(movesIndex<moves.length()) {
             m=moves.charAt(movesIndex++);
             if(m=='-') {
@@ -406,11 +409,11 @@ public class TestUCharacterIterator extends TestFmwk{
             } else if(m=='0') {
                 c1=wrap_ci.current();
                 c2=ci.current();
-            } else  {// m=='+' 
+            } else  {// m=='+'
                 c1=wrap_ci.next();
                 c2=ci.next();
             }
-    
+
             // compare results
             if(c1!=c2) {
                 // copy the moves until the current (m) move, and terminate
@@ -419,7 +422,7 @@ public class TestUCharacterIterator extends TestFmwk{
                       +"got c1= " + hex(c1) +" != expected c2= "+ hex(c2));
                 break;
             }
-    
+
             // compare indexes
             if(wrap_ci.getIndex()!=ci.getIndex()) {
                 // copy the moves until the current (m) move, and terminate
@@ -452,11 +455,11 @@ public class TestUCharacterIterator extends TestFmwk{
         }
     }
     // private data members ---------------------------------------------
-    
+
     private static final String ITERATION_STRING_ =
                                         "Testing 1 2 3 \ud800\udc00 456";
     private static final int ITERATION_SUPPLEMENTARY_INDEX = 14;
-    
+
     @Test
     public void TestJitterbug1952(){
         //test previous code point
@@ -475,8 +478,8 @@ public class TestUCharacterIterator extends TestFmwk{
         while((ch=iter.nextCodePoint()) !=UCharacterIterator.DONE){
             if(ch!= 0xDC03){
                 errln("iter.nextCodePoint() failed");
-            } 
-        }      
+            }
+        }
     }
-        
+
 }
index ee82e29a64818ea3da1375863fe6a2068c065b4d..816b0a5b92aff88aa9d67ad5dec1764a512f1efa 100644 (file)
@@ -12,6 +12,8 @@ package com.ibm.icu.dev.test.lang;
 import java.util.BitSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UProperty;
@@ -19,6 +21,7 @@ import com.ibm.icu.lang.UScript;
 import com.ibm.icu.lang.UScript.ScriptUsage;
 import com.ibm.icu.text.UnicodeSet;
 
+@RunWith(JUnit4.class)
 public class TestUScript extends TestFmwk {
 
     /**
index a0fea61eb6c74ac9504bd77d1c38fe295ba3e3e7..b874c25638ca6b87423586dd7852cb88986209b3 100644 (file)
 package com.ibm.icu.dev.test.lang;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UScript;
 import com.ibm.icu.lang.UScriptRun;
 
+@RunWith(JUnit4.class)
 public class TestUScriptRun extends TestFmwk
 {
     public TestUScriptRun()
     {
         // nothing
     }
-    
+
     private static final class RunTestData
     {
         String runText;
         int    runScript;
-        
+
         public RunTestData(String theText, int theScriptCode)
         {
             runText   = theText;
             runScript = theScriptCode;
         }
     }
-    
+
     private static final RunTestData[][] m_testData = {
         {
             new RunTestData("\u0020\u0946\u0939\u093F\u0928\u094D\u0926\u0940\u0020", UScript.DEVANAGARI),
@@ -51,9 +54,9 @@ public class TestUScriptRun extends TestFmwk
             new RunTestData("((((((((((abc))))))))))", UScript.LATIN)
         }
     };
-    
+
     private static final String padding = "This string is used for padding...";
-    
+
     private void CheckScriptRuns(UScriptRun scriptRun, int[] runStarts, RunTestData[] testData)
     {
         int run, runStart, runLimit;
@@ -65,7 +68,7 @@ public class TestUScriptRun extends TestFmwk
             runStart  = scriptRun.getScriptStart();
             runLimit  = scriptRun.getScriptLimit();
             runScript = scriptRun.getScriptCode();
-            
+
             if (runStart != runStarts[run]) {
                 errln("Incorrect start offset for run " + run + ": expected " + runStarts[run] + ", got " + runStart);
             }
@@ -77,7 +80,7 @@ public class TestUScriptRun extends TestFmwk
             if (runScript != testData[run].runScript) {
                 errln("Incorrect script for run " + run + ": expected \"" + UScript.getName(testData[run].runScript) + "\", got \"" + UScript.getName(runScript) + "\"");
             }
-            
+
             run += 1;
 
             /* stop when we've seen all the runs we expect to see */
@@ -98,112 +101,112 @@ public class TestUScriptRun extends TestFmwk
         UScriptRun scriptRun = null;
         char[] nullChars  = null, dummyChars  = {'d', 'u', 'm', 'm', 'y'};
         String nullString = null, dummyString = new String(dummyChars);
-        
+
         try {
             scriptRun = new UScriptRun(nullString, 0, 100);
             errln("new UScriptRun(nullString, 0, 100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(nullString, 100, 0);
             errln("new UScriptRun(nullString, 100, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(nullString, 0, -100);
             errln("new UScriptRun(nullString, 0, -100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(nullString, -100, 0);
             errln("new UScriptRun(nullString, -100, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(nullChars, 0, 100);
             errln("new UScriptRun(nullChars, 0, 100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(nullChars, 100, 0);
             errln("new UScriptRun(nullChars, 100, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(nullChars, 0, -100);
             errln("new UScriptRun(nullChars, 0, -100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(nullChars, -100, 0);
             errln("new UScriptRun(nullChars, -100, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(dummyString, 0, 6);
             errln("new UScriptRun(dummyString, 0, 6) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(dummyString, 6, 0);
             errln("new UScriptRun(dummy, 6, 0) did not produce an IllegalArgumentException!");
         }catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(dummyString, 0, -100);
             errln("new UScriptRun(dummyString, 0, -100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(dummyString, -100, 0);
             errln("new UScriptRun(dummy, -100, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(dummyChars, 0, 6);
             errln("new UScriptRun(dummyChars, 0, 6) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(dummyChars, 6, 0);
             errln("new UScriptRun(dummyChars, 6, 0) did not produce an IllegalArgumentException!");
         }catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(dummyChars, 0, -100);
             errln("new UScriptRun(dummyChars, 0, -100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UScriptRun failed as expected");
         }
-        
+
         try {
             scriptRun = new UScriptRun(dummyChars, -100, 0);
             errln("new UScriptRun(dummy, -100, 0) did not produce an IllegalArgumentException!");
@@ -214,116 +217,116 @@ public class TestUScriptRun extends TestFmwk
             errln("Did not get the expected Exception");
         }
     }
-    
+
     @Test
     public void TestReset()
     {
         UScriptRun scriptRun = null;
         char[] dummy = {'d', 'u', 'm', 'm', 'y'};
-        
+
         try {
             scriptRun = new UScriptRun();
         } catch (IllegalArgumentException iae) {
             errln("new UScriptRun() produced an IllegalArgumentException!");
         }
-        
+
         try {
             scriptRun.reset(0, 100);
             errln("scriptRun.reset(0, 100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(100, 0);
             errln("scriptRun.reset(100, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(0, -100);
             errln("scriptRun.reset(0, -100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(-100, 0);
             errln("scriptRun.reset(-100, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(dummy, 0, 6);
             errln("scriptRun.reset(dummy, 0, 6) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(dummy, 6, 0);
             errln("scriptRun.reset(dummy, 6, 0) did not produce an IllegalArgumentException!");
         }catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(dummy, 0, -100);
             errln("scriptRun.reset(dummy, 0, -100) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(dummy, -100, 0);
             errln("scriptRun.reset(dummy, -100, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(dummy, 0, dummy.length);
         } catch (IllegalArgumentException iae) {
             errln("scriptRun.reset(dummy, 0, dummy.length) produced an IllegalArgumentException!");
         }
-        
-        
+
+
         try {
             scriptRun.reset(0, 6);
             errln("scriptRun.reset(0, 6) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(6, 0);
             errln("scriptRun.reset(6, 0) did not produce an IllegalArgumentException!");
         } catch (IllegalArgumentException iae) {
             logln("PASS: scriptRun.reset failed as expected");
         }
-        
+
         try {
             scriptRun.reset(dummy, 0, dummy.length);
             scriptRun.reset();
         } catch(IllegalArgumentException iae){
             errln("scriptRun.reset() produced an IllegalArgumentException!");
         }
-        
+
         try {
             scriptRun.reset((char[]) null);
         } catch(IllegalArgumentException iae){
             errln("scriptRun.reset((char[])null) produced an IllegalArgumentException!");
         }
-        
+
         try {
             scriptRun.reset((String) null);
         } catch(IllegalArgumentException iae){
             errln("scriptRun.reset((String)null) produced an IllegalArgumentException!");
         }
     }
-    
+
     @Test
     public void TestRuns()
     {
@@ -333,7 +336,7 @@ public class TestUScriptRun extends TestFmwk
             int[] runStarts = new int[test.length + 1];
             String testString = "";
             UScriptRun scriptRun = null;
-        
+
             /*
              * Fill in the test string and the runStarts array.
              */
@@ -343,47 +346,47 @@ public class TestUScriptRun extends TestFmwk
                 testString  += test[run].runText;
             }
 
-            /* The limit of the last run */ 
+            /* The limit of the last run */
             runStarts[test.length] = stringLimit;
-        
+
             try {
                 scriptRun = new UScriptRun(testString);
                 CheckScriptRuns(scriptRun, runStarts, test);
             } catch (IllegalArgumentException iae) {
                 errln("new UScriptRun(testString) produced an IllegalArgumentException!");
             }
-        
+
             try {
                 scriptRun.reset();
                 CheckScriptRuns(scriptRun, runStarts, test);
             } catch (IllegalArgumentException iae) {
                 errln("scriptRun.reset() on a valid UScriptRun produced an IllegalArgumentException!");
             }
-        
+
             try {
                 scriptRun = new UScriptRun(testString.toCharArray());
                 CheckScriptRuns(scriptRun, runStarts, test);
             } catch (IllegalArgumentException iae) {
                 errln("new UScriptRun(testString.toCharArray()) produced an IllegalArgumentException!");
             }
-        
+
             try {
                 scriptRun.reset();
                 CheckScriptRuns(scriptRun, runStarts, test);
             } catch (IllegalArgumentException iae) {
                 errln("scriptRun.reset() on a valid UScriptRun produced an IllegalArgumentException!");
             }
-        
+
             try {
                 scriptRun = new UScriptRun();
-            
+
                 if (scriptRun.next()) {
                     errln("scriptRun.next() on an empty UScriptRun returned true!");
                 }
             } catch (IllegalArgumentException iae) {
                 errln("new UScriptRun() produced an IllegalArgumentException!");
             }
-        
+
             try {
                 scriptRun.reset(testString, 0, testString.length());
                 CheckScriptRuns(scriptRun, runStarts, test);
@@ -401,11 +404,11 @@ public class TestUScriptRun extends TestFmwk
             String paddedTestString = padding + testString + padding;
             int startOffset = padding.length();
             int count = testString.length();
-            
+
             for (int run = 0; run < runStarts.length; run += 1) {
                 runStarts[run] += startOffset;
             }
-            
+
             try {
                 scriptRun.reset(paddedTestString, startOffset, count);
                 CheckScriptRuns(scriptRun, runStarts, test);
@@ -419,7 +422,7 @@ public class TestUScriptRun extends TestFmwk
             } catch (IllegalArgumentException iae) {
                 errln("scriptRun.reset(paddedTestString.toCharArray(), startOffset, count) produced an IllegalArgumentException!");
             }
-            
+
             /* Tests "public final void reset()" */
             // Tests when "while (stackIsNotEmpty())" is true
             try{
index 79f4139a39521d40453c27278582ae763dbbe94e..480c3180aaef4554e158ab84fe37d3abc3d9343b 100644 (file)
@@ -18,6 +18,8 @@ import java.util.List;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -38,6 +40,7 @@ import com.ibm.icu.util.ULocale;
 * @author Syn Wee Quek
 * @since march 14 2002
 */
+@RunWith(JUnit4.class)
 public final class UCharacterCaseTest extends TestFmwk
 {
     // constructor -----------------------------------------------------------
index cc25d8c5697cc29e2df41cfc3de51de54d80fdeb..04c897311045c8c911136978afccaab1152477f0 100644 (file)
@@ -8,6 +8,8 @@
 */
 package com.ibm.icu.dev.test.lang;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UCharacterCategory;
@@ -17,19 +19,20 @@ import com.ibm.icu.lang.UCharacterCategory;
 * @author Syn Wee Quek
 * @since April 02 2002
 */
+@RunWith(JUnit4.class)
 public class UCharacterCategoryTest extends TestFmwk
 {
     // constructor -----------------------------------------------------------
-    
+
     /**
     * Private constructor to prevent initialisation
     */
     public UCharacterCategoryTest()
     {
     }
-    
+
       // public methods --------------------------------------------------------
-      
+
     /**
     * Gets the name of the argument category
     * @returns category name
@@ -64,10 +67,10 @@ public class UCharacterCategoryTest extends TestFmwk
                            "Symbol, Math",
                            "Symbol, Currency",
                            "Symbol, Modifier",
-                           "Symbol, Other", 
+                           "Symbol, Other",
                            "Punctuation, Initial quote",
                            "Punctuation, Final quote"};
-        for (int i = UCharacterCategory.UNASSIGNED; 
+        for (int i = UCharacterCategory.UNASSIGNED;
                  i < UCharacterCategory.CHAR_CATEGORY_COUNT; i ++) {
              if (!UCharacterCategory.toString(i).equals(name[i])) {
                  errln("Error toString for category " + i + " expected " +
index ec49adeec6ab1cb7fb6b2362555a75b094aa5293..522432696f839ff0d9ca38df11604b1715edb5e1 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.lang;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UCharacterDirection;
@@ -18,19 +20,20 @@ import com.ibm.icu.lang.UCharacterDirection;
 * @author Syn Wee Quek
 * @since July 22 2002
 */
+@RunWith(JUnit4.class)
 public class UCharacterDirectionTest extends TestFmwk
-{    
+{
     // constructor -----------------------------------------------------------
-    
+
     /**
     * Private constructor to prevent initialization
     */
     public UCharacterDirectionTest()
     {
     }
-    
+
     // public methods --------------------------------------------------------
-      
+
     /**
     * Gets the name of the argument category
     * @returns category name
@@ -39,7 +42,7 @@ public class UCharacterDirectionTest extends TestFmwk
     public void TestToString()
     {
         String name[] = {"Left-to-Right",
-                         "Right-to-Left", 
+                         "Right-to-Left",
                          "European Number",
                          "European Number Separator",
                          "European Number Terminator",
@@ -62,7 +65,7 @@ public class UCharacterDirectionTest extends TestFmwk
                          "Right-to-Left Isolate",
                          "Pop Directional Isolate",
                          "Unassigned"};
-        
+
         for (int i = UCharacterDirection.LEFT_TO_RIGHT;
             // Placed <= because we need to consider 'Unassigned'
             // when it goes out of bounds of UCharacterDirection
index 2f935282773c7ecc4dd3861cb9cdcc2620a00d74..d8441cdeba25e6b121fe7adfef2af54542f3017d 100644 (file)
@@ -9,6 +9,10 @@
 
 package com.ibm.icu.dev.test.lang;
 
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
 import com.ibm.icu.lang.UCharacter;
@@ -17,14 +21,15 @@ import com.ibm.icu.text.UTF16;
 /**
  * Test JDK 1.5 cover APIs.
  */
+@RunWith(JUnit4.class)
 public final class UCharacterSurrogateTest extends TestFmwk {
-    @org.junit.Test
+    @Test
     public void TestUnicodeBlockForName() {
-      String[] names = {"Latin-1 Supplement", 
+      String[] names = {"Latin-1 Supplement",
                         "Optical Character Recognition",
-                        "CJK Unified Ideographs Extension A", 
+                        "CJK Unified Ideographs Extension A",
                         "Supplemental Arrows-B",
-                        "Supplemental arrows b", 
+                        "Supplemental arrows b",
                         "supp-lement-al arrowsb",
                         "Supplementary Private Use Area-B",
                         "supplementary_Private_Use_Area-b",
@@ -41,7 +46,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
         }
     }
 
-    @org.junit.Test
+    @Test
     public void TestIsValidCodePoint() {
         if (UCharacter.isValidCodePoint(-1))
             errln("-1");
@@ -53,7 +58,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
             errln("0x110000");
     }
 
-    @org.junit.Test
+    @Test
     public void TestIsSupplementaryCodePoint() {
         if (UCharacter.isSupplementaryCodePoint(-1))
             errln("-1");
@@ -71,7 +76,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
             errln("0x110000");
     }
 
-    @org.junit.Test
+    @Test
     public void TestIsHighSurrogate() {
         if (UCharacter
                 .isHighSurrogate((char) (UCharacter.MIN_HIGH_SURROGATE - 1)))
@@ -85,7 +90,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
             errln("0xdc00");
     }
 
-    @org.junit.Test
+    @Test
     public void TestIsLowSurrogate() {
         if (UCharacter
                 .isLowSurrogate((char) (UCharacter.MIN_LOW_SURROGATE - 1)))
@@ -99,7 +104,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
             errln("0xe000");
     }
 
-    @org.junit.Test
+    @Test
     public void TestIsSurrogatePair() {
         if (UCharacter.isSurrogatePair(
                 (char) (UCharacter.MIN_HIGH_SURROGATE - 1),
@@ -120,7 +125,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
             errln("0xd800,0xdc00");
     }
 
-    @org.junit.Test
+    @Test
     public void TestCharCount() {
         UCharacter.charCount(-1);
         UCharacter.charCount(UCharacter.MAX_CODE_POINT + 1);
@@ -130,7 +135,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
             errln("0x010000");
     }
 
-    @org.junit.Test
+    @Test
     public void TestToCodePoint() {
         final char[] pairs = {(char) (UCharacter.MIN_HIGH_SURROGATE + 0),
                 (char) (UCharacter.MIN_LOW_SURROGATE + 0),
@@ -155,7 +160,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
         }
     }
 
-    @org.junit.Test
+    @Test
     public void TestCodePointAtBefore() {
         String s = "" + UCharacter.MIN_HIGH_SURROGATE + // isolated high
                 UCharacter.MIN_HIGH_SURROGATE + // pair
@@ -201,7 +206,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
 
     }
 
-    @org.junit.Test
+    @Test
     public void TestToChars() {
         char[] chars = new char[3];
         int cp = UCharacter.toCodePoint(UCharacter.MIN_HIGH_SURROGATE,
@@ -221,7 +226,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
         }
     }
 
-    @org.junit.Test
+    @Test
     public void TestCodePointCount() {
         class Test {
             String str(String s, int start, int limit) {
@@ -282,7 +287,7 @@ public final class UCharacterSurrogateTest extends TestFmwk {
         test.test("\ud800\udc00\udc00", 0, 3, 2);
     }
 
-    @org.junit.Test
+    @Test
     public void TestOffsetByCodePoints() {
         class Test {
             String str(String s, int start, int count, int index, int offset) {
index a26120ce63c50cfc1d089ceb3a08ae97a03e6296..21af8b459d21006701145b89fddde54520a4799b 100644 (file)
@@ -15,6 +15,8 @@ import java.util.Arrays;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -44,6 +46,7 @@ import com.ibm.icu.util.VersionInfo;
 * @author Syn Wee Quek
 * @since nov 04 2000
 */
+@RunWith(JUnit4.class)
 public final class UCharacterTest extends TestFmwk
 {
     // private variables =============================================
index f89f6a28bdd8ec57d5c88f188ebea64af7919539..be9224f2773fcce4d5f2845139e462b5d33d1ab3 100644 (file)
@@ -13,6 +13,8 @@ import java.util.List;
 import java.util.ListIterator;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UCharacter;
@@ -21,18 +23,19 @@ import com.ibm.icu.lang.UCharacter;
  * @author aheninger
  *
  */
+@RunWith(JUnit4.class)
 public class UCharacterThreadTest extends TestFmwk {
   // constructor -----------------------------------------------------------
-    
+
     /**
     * Private constructor to prevent initialisation
     */
     public UCharacterThreadTest()
     {
     }
-    
+
       // public methods --------------------------------------------------------
-      
+
     //
     //  Test multi-threaded parallel calls to UCharacter.getName(codePoint)
     //  Regression test for ticket 6264.
@@ -67,6 +70,7 @@ public class UCharacterThreadTest extends TestFmwk {
            this.correctName = correctName;
         }
 
+        @Override
         public void run() {
           for(int i=0; i<10000; i++) {
             actualName = UCharacter.getName(codePoint);
index b1eb114fd0b2f91eb1e353560703164185c3ed05..9aab31b76b437b52fb89da45f4577181cd9e8091 100644 (file)
 package com.ibm.icu.dev.test.lang;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UCharacter;
 import com.ibm.icu.lang.UProperty;
 
+@RunWith(JUnit4.class)
 public class UPropertyAliasesTest extends TestFmwk {
-  
+
     public UPropertyAliasesTest() {}
-    
+
     /**
      * Test the property names and property value names API.
      */
@@ -109,20 +112,20 @@ public class UPropertyAliasesTest extends TestFmwk {
                 }
             }
         }
-        
+
         int i = UCharacter.getIntPropertyMinValue(
                                         UProperty.CANONICAL_COMBINING_CLASS);
         try {
             for (; i <= UCharacter.getIntPropertyMaxValue(
                                           UProperty.CANONICAL_COMBINING_CLASS);
-                 i ++) {   
+                 i ++) {
                  UCharacter.getPropertyValueName(
                                            UProperty.CANONICAL_COMBINING_CLASS,
                                            i, UProperty.NameChoice.LONG);
             }
-        }      
+        }
         catch (IllegalArgumentException e) {
-            errln("0x" + Integer.toHexString(i) 
+            errln("0x" + Integer.toHexString(i)
                   + " should have a null property value name");
         }
     }
index e01e66557ef7d0518d58afdd95bdf5215c321539..18d8a07bf77641d69cd8103a9cf3382dbc0cd714 100644 (file)
@@ -10,6 +10,8 @@
 package com.ibm.icu.dev.test.lang;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.UTF16Util;
@@ -24,6 +26,7 @@ import com.ibm.icu.text.UTF16.StringComparator;
 * @author Syn Wee Quek
 * @since feb 09 2001
 */
+@RunWith(JUnit4.class)
 public final class UTF16Test extends TestFmwk
 {
     // constructor ===================================================
@@ -230,7 +233,7 @@ public final class UTF16Test extends TestFmwk
         UTF16.charAt(replaceable, 13) != 0x10002) {
         errln("FAIL Getting character from replaceable error" );
           }
-          
+
           StringBuffer strbuffer = new StringBuffer("0xD805");
           UTF16.charAt((CharSequence)strbuffer, 0);
     }
@@ -1626,7 +1629,7 @@ public final class UTF16Test extends TestFmwk
         'A',
         -1,
     };
-    
+
 
     final String cpString = "" +
         UCharacter.MIN_HIGH_SURROGATE +
index 31de53e25b499a8fb42f53f29747af768d2e7179..d6313c8299cc088de7b47b4af98fd65fcb19f96c 100644 (file)
@@ -11,6 +11,8 @@ package com.ibm.icu.dev.test.lang;
 import java.util.Collection;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -23,6 +25,7 @@ import com.ibm.icu.util.OutputInt;
  * @test
  * @summary General test of UnicodeSet string span.
  */
+@RunWith(JUnit4.class)
 public class UnicodeSetStringSpanTest extends TestFmwk {
     // Simple test first, easier to debug.
     @Test
@@ -120,7 +123,7 @@ public class UnicodeSetStringSpanTest extends TestFmwk {
         }
 
         pattern = "[d{cd}{bcd}{ab}]";
-        set = (UnicodeSet)set.cloneAsThawed();
+        set = set.cloneAsThawed();
         set.applyPattern(pattern).freeze();
         s16 = "abbcdabcdabd";
         if (   set.spanBack(s16, 12, SpanCondition.CONTAINED) != 0
@@ -560,7 +563,7 @@ public class UnicodeSetStringSpanTest extends TestFmwk {
      * Verify that we get the same results whether we look at text with contains(), span() or spanBack(), using unfrozen
      * or frozen versions of the set, and using the set or its complement (switching the spanConditions accordingly).
      * The latter verifies that set.span(spanCondition) == set.complement().span(!spanCondition).
-     * 
+     *
      * The expectLimits[] are either provided by the caller (with expectCount>=0) or returned to the caller (with an
      * input expectCount<0).
      */
index 1229ab40f8b6397a319921f427b73587df2bab18..5ebaa91b70e9ab8be11ac3b7266f7d8a7cae9501 100644 (file)
@@ -25,6 +25,8 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.util.CollectionUtilities;
@@ -51,6 +53,7 @@ import com.ibm.icu.util.OutputInt;
  * @test
  * @summary General test of UnicodeSet
  */
+@RunWith(JUnit4.class)
 public class UnicodeSetTest extends TestFmwk {
 
     static final String NOT = "%%%%";
index 107ee60eed9b9a728e0080ed702bb040af6b8da2..0e7f9aef1b3ed2acdaf43c31e0024ff9b29a9f2e 100644 (file)
@@ -13,6 +13,8 @@ import java.text.StringCharacterIterator;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Norm2AllModes;
@@ -31,6 +33,7 @@ import com.ibm.icu.text.UnicodeSet;
 import com.ibm.icu.text.UnicodeSetIterator;
 
 
+@RunWith(JUnit4.class)
 public class BasicTest extends TestFmwk {
     String[][] canonTests = {
         // Input                Decomposed              Composed
index 75924f023adc49c29103c4e1f162f49d31632f9a..7513cb05db8ad5a6d2fe576a32889c48a25ce7ef 100644 (file)
@@ -15,6 +15,8 @@ import java.text.StringCharacterIterator;
 
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -23,6 +25,7 @@ import com.ibm.icu.text.Normalizer;
 import com.ibm.icu.text.UTF16;
 import com.ibm.icu.text.UnicodeSet;
 
+@RunWith(JUnit4.class)
 public class ConformanceTest extends TestFmwk {
 
     Normalizer normalizer;
index 685edbf82a420f16386dee26d8f9d7132bcda9b4..17b6caa58704f772e390ff33218bbca2b07bbf75 100644 (file)
@@ -12,6 +12,8 @@ package com.ibm.icu.dev.test.normalizer;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UCharacter;
@@ -19,6 +21,7 @@ import com.ibm.icu.lang.UCharacterCategory;
 import com.ibm.icu.text.Normalizer;
 import com.ibm.icu.text.UTF16;
 
+@RunWith(JUnit4.class)
 public class NormalizationMonkeyTest extends TestFmwk {
     int loopCount = 100;
     int maxCharCount = 20;
@@ -28,10 +31,10 @@ public class NormalizationMonkeyTest extends TestFmwk {
     UnicodeNormalizer unicode_NFC;
     UnicodeNormalizer unicode_NFKD;
     UnicodeNormalizer unicode_NFKC;
-    
+
     public NormalizationMonkeyTest() {
     }
-    
+
     @Test
     public void TestNormalize() {
         if (unicode_NFD == null) {
@@ -81,11 +84,11 @@ public class NormalizationMonkeyTest extends TestFmwk {
             if (!uncodeNorm.equals(icuNorm)) {
                 errln("NFKC: Unicode sample output => " + uncodeNorm + "; icu4j output=> " + icuNorm);
             }
-            
+
             i++;
         }
     }
-    
+
     String getTestSource() {
     if (random == null) {
         random = createRandom(); // use test framework's random seed
index 089d6ae4be925f0da8f874ffc70db319aaee1700..fea436386344291288006bdadf86d0953ef6e016 100644 (file)
 package com.ibm.icu.dev.test.normalizer;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.Normalizer;
 
+@RunWith(JUnit4.class)
 public class NormalizerRegressionTests extends TestFmwk {
     @Test
     public void TestJB4472() {
index ee0bb23d808532d5472693cb695943511a74bce1..2c484e0bf5f07d89d542c33d310d9df73bd57787 100644 (file)
@@ -15,6 +15,8 @@ import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -26,8 +28,9 @@ import com.ibm.icu.text.UTF16;
 
 // TODO: fit into test framework
 
+@RunWith(JUnit4.class)
 public class TestCanonicalIterator extends TestFmwk {
-    
+
     static final boolean SHOW_NAMES = false;
 
     static final String testArray[][] = {
@@ -67,19 +70,19 @@ public class TestCanonicalIterator extends TestFmwk {
             characterTest(s + "\u0345", i, it);
         }
     }
-    
+
     public int TestSpeed() {
          // skip unless verbose
         if (!isVerbose()) return 0;
 
            String s = "\uAC01\u0345";
-           
+
         CanonicalIterator it = new CanonicalIterator(s);
         double start, end;
         int x = 0; // just to keep code from optimizing away.
         int iterations = 10000;
         double slowDelta = 0;
-        
+
         /*
         CanonicalIterator slowIt = new CanonicalIterator(s);
         slowIt.SKIP_ZEROS = false;
@@ -110,14 +113,14 @@ public class TestCanonicalIterator extends TestFmwk {
         end = System.currentTimeMillis();
         double fastDelta = (end-start) / iterations;
         logln("Fast iteration: " + fastDelta + (slowDelta != 0 ? ", " + (fastDelta/slowDelta) : ""));
-        
-        
+
+
         return x;
     }
-    
+
     @Test
     public void TestBasic() {
-//      This is not interesting anymore as the data is already built 
+//      This is not interesting anymore as the data is already built
 //      beforehand
 
 //        check build
@@ -128,14 +131,14 @@ public class TestCanonicalIterator extends TestFmwk {
 //            new UnicodeSet("[\u00E0-\u00E5\u0101\u0103\u0105\u01CE\u01DF\u01E1\u01FB"
 //            + "\u0201\u0203\u0227\u1E01\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7]")
 //                );
-        
+
         // check permute
         // NOTE: we use a TreeSet below to sort the output, which is not guaranteed to be sorted!
-        
+
         Set results = new TreeSet();
         CanonicalIterator.permute("ABC", false, results);
         expectEqual("Simple permutation ", "", collectionToString(results), "ABC, ACB, BAC, BCA, CAB, CBA");
-        
+
         // try samples
         SortedSet set = new TreeSet();
         for (int i = 0; i < testArray.length; ++i) {
@@ -164,7 +167,7 @@ public class TestCanonicalIterator extends TestFmwk {
             }
         }
     }
-    
+
     private void expectEqual(String message, String item, Object a, Object b) {
         if (!a.equals(b)) {
             errln("FAIL: " + message + getReadable(item));
@@ -176,10 +179,10 @@ public class TestCanonicalIterator extends TestFmwk {
             logln("\t" + getReadable(b));
         }
     }
-    
+
     //Transliterator name = null;
     //Transliterator hex = null;
-        
+
     public String getReadable(Object obj) {
         if (obj == null) return "null";
         String s = obj.toString();
@@ -189,7 +192,7 @@ public class TestCanonicalIterator extends TestFmwk {
         //if (hex == null) hex = Transliterator.getInstance("[^\\ -\\u007F] hex");
         return "[" + (SHOW_NAMES ? hex(s) + "; " : "") + hex(s) + "]";
     }
-    
+
     private void characterTest(String s, int ch, CanonicalIterator it)
     {
         int mixedCounter = 0;
@@ -199,11 +202,11 @@ public class TestCanonicalIterator extends TestFmwk {
         boolean gotSource = false;
         String decomp = Normalizer.decompose(s, false);
         String comp = Normalizer.compose(s, false);
-        
+
         // skip characters that don't have either decomp.
         // need quick test for this!
         if (s.equals(decomp) && s.equals(comp)) return;
-        
+
         it.setSource(s);
 
         while (true) {
@@ -225,7 +228,7 @@ public class TestCanonicalIterator extends TestFmwk {
             }
 
         }
-        
+
         // check that zeros optimization doesn't mess up.
         /*
         if (true) {
@@ -248,7 +251,7 @@ public class TestCanonicalIterator extends TestFmwk {
             }
         }
         */
-        
+
         mixedCounter++;
         if (!gotSource || !gotDecomp || !gotComp) {
             errln("FAIL CanonicalIterator: " + s + " decomp: " +decomp+" comp: "+comp);
@@ -256,10 +259,10 @@ public class TestCanonicalIterator extends TestFmwk {
             for(String item=it.next();item!=null;item=it.next()){
                 err(item + "    ");
             }
-            errln("");   
+            errln("");
         }
     }
-    
+
     static String collectionToString(Collection col) {
         StringBuffer result = new StringBuffer();
         Iterator it = col.iterator();
index c6156059cfb6ea6796056edd33aeda5a3a818fac..43ba1b3532227bc37fe8576b9a4974f1fd8ef123 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.normalizer;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -18,8 +20,9 @@ import com.ibm.icu.text.ComposedCharIter;
 import com.ibm.icu.text.Normalizer;
 import com.ibm.icu.text.StringCharacterIterator;
 
+@RunWith(JUnit4.class)
 public class TestDeprecatedNormalizerAPI extends TestFmwk
-{     
+{
     public TestDeprecatedNormalizerAPI() {
     }
 
@@ -33,17 +36,17 @@ public class TestDeprecatedNormalizerAPI extends TestFmwk
         Normalizer norm = new Normalizer(iter, Normalizer.NFC,0);
         if(norm.next()!=0xe4) {
             errln("error in Normalizer(CharacterIterator).next()");
-        }       
+        }
         Normalizer norm2 = new Normalizer(s,Normalizer.NFC,0);
         if(norm2.next()!=0xe4) {
             errln("error in Normalizer(CharacterIterator).next()");
-        }       
+        }
         // test clone(), ==, and hashCode()
         Normalizer clone=(Normalizer)norm.clone();
         if(clone.getBeginIndex()!= norm.getBeginIndex()){
            errln("error in Normalizer.getBeginIndex()");
         }
-        
+
         if(clone.getEndIndex()!= norm.getEndIndex()){
            errln("error in Normalizer.getEndIndex()");
         }
index 174ce578f0efa5af597d48e880569910931b78ba..c33a911d96b1cc27c7f9540ad35cbf7e8a4b0b34 100644 (file)
@@ -18,6 +18,8 @@ import java.util.TreeMap;
 import java.util.regex.Pattern;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -30,6 +32,7 @@ import com.ibm.icu.text.IDNA;
  * @author Markus Scherer
  * @since 2010jul10
  */
+@RunWith(JUnit4.class)
 public class UTS46Test extends TestFmwk {
     public UTS46Test() {
         int commonOptions=
index fc79989f96ba7880fc516757979658d03bdb292a..62bc0a6a71c94c9f7c3016bca15ffd61f3e18e09 100644 (file)
@@ -14,6 +14,8 @@ import java.io.IOException;
 
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -21,6 +23,7 @@ import com.ibm.icu.text.UTF16;
 import com.ibm.icu.text.UnicodeSet;
 
 
+@RunWith(JUnit4.class)
 public class UnicodeNormalizerConformanceTest extends TestFmwk {
 
     UnicodeNormalizer normalizer_C, normalizer_D, normalizer_KC, normalizer_KD;
@@ -32,13 +35,13 @@ public class UnicodeNormalizerConformanceTest extends TestFmwk {
         normalizer_D = new UnicodeNormalizer(UnicodeNormalizer.D, false);
         normalizer_KC = new UnicodeNormalizer(UnicodeNormalizer.KC, false);
         normalizer_KD = new UnicodeNormalizer(UnicodeNormalizer.KD, false);
-        
+
     }
     // more interesting conformance test cases, not in the unicode.org NormalizationTest.txt
     static  String[] moreCases ={
         // Markus 2001aug30
         "0061 0332 0308;00E4 0332;0061 0332 0308;00E4 0332;0061 0332 0308; # Markus 0",
-    
+
         // Markus 2001oct26 - test edge case for iteration: U+0f73.cc==0 but decomposition.lead.cc==129
         "0061 0301 0F73;00E1 0F71 0F72;0061 0F71 0F72 0301;00E1 0F71 0F72;0061 0F71 0F72 0301; # Markus 1"
     };
@@ -82,10 +85,10 @@ public class UnicodeNormalizerConformanceTest extends TestFmwk {
 
                 // Parse out the fields
                 hexsplit(line, ';', fields, buf);
-                
+
                 // Remove a single code point from the "other" UnicodeSet
                 if(fields[0].length()==UTF16.moveCodePointOffset(fields[0],0, 1)) {
-                    c=UTF16.charAt(fields[0],0); 
+                    c=UTF16.charAt(fields[0],0);
                     if(0xac20<=c && c<=0xd73f) {
                         // not an exhaustive test run: skip most Hangul syllables
                         if(c==0xac20) {
@@ -126,7 +129,7 @@ public class UnicodeNormalizerConformanceTest extends TestFmwk {
             logln("Total: " + passCount + " lines passed");
         }
     }
-    
+
     /**
      * Verify the conformance of the given line of the Unicode
      * normalization (UTR 15) test suite file.  For each line,
@@ -151,26 +154,26 @@ public class UnicodeNormalizerConformanceTest extends TestFmwk {
             if (i<3) {
                 out = normalizer_C.normalize(field[i]);
                 pass &= assertEqual("C", field[i], out, field[1], "c2!=C(c" + (i+1));
-                 
+
                 out = normalizer_D.normalize(field[i]);
                 pass &= assertEqual("D", field[i], out, field[2], "c3!=D(c" + (i+1));
-                
+
             }
             out = normalizer_KC.normalize(field[i]);
             pass &= assertEqual("KC", field[i], out, field[3], "c4!=KC(c" + (i+1));
 
             out = normalizer_KD.normalize(field[i]);
             pass &= assertEqual("KD", field[i], out, field[4], "c5!=KD(c" + (i+1));
-              
+
         }
-        
+
         if (!pass) {
             errln("FAIL: " + line);
-        }     
-       
+        }
+
         return pass;
     }
-    
+
     /**
      * @param op name of normalization form, e.g., "KC"
      * @param s string being normalized
@@ -211,7 +214,7 @@ public class UnicodeNormalizerConformanceTest extends TestFmwk {
             }
             // Our field is from pos..delim-1.
             buf.setLength(0);
-            
+
             String toHex = s.substring(pos,delim);
             pos = delim;
             int index = 0;
@@ -230,7 +233,7 @@ public class UnicodeNormalizerConformanceTest extends TestFmwk {
                     index = spacePos+1;
                 }
             }
-            
+
             if (buf.length() < 1) {
                 throw new IllegalArgumentException("Empty field " + i + " in " + s);
             }
@@ -244,13 +247,13 @@ public class UnicodeNormalizerConformanceTest extends TestFmwk {
             throw new IllegalArgumentException("Out of range hex " +
                                                 hex + " in " + s);
         }else if (hex > 0xFFFF){
-            buf.append((char)((hex>>10)+0xd7c0)); 
+            buf.append((char)((hex>>10)+0xd7c0));
             buf.append((char)((hex&0x3ff)|0xdc00));
         }else{
             buf.append((char) hex);
         }
     }
-            
+
     // Specific tests for debugging.  These are generally failures
     // taken from the conformance file, but culled out to make
     // debugging easier.  These can be eliminated without affecting
@@ -268,6 +271,6 @@ public class UnicodeNormalizerConformanceTest extends TestFmwk {
         hexsplit(line, ';', fields, buf);
         checkConformance(fields, line);
     }
-    
+
 
 }
index baadfdca31d60dfa6bb2243364e44a5530afcabb..4ff797f7e6684782a77b877fd1e446a95d79a7fb 100644 (file)
@@ -11,6 +11,8 @@ import java.util.List;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.number.Endpoint;
@@ -24,6 +26,7 @@ import com.ibm.icu.impl.number.Properties;
 import com.ibm.icu.text.CompactDecimalFormat.CompactStyle;
 
 /** TODO: This is a temporary name for this class. Suggestions for a better name? */
+@RunWith(JUnit4.class)
 public class FormatQuantityTest extends TestFmwk {
 
   @Test
index 0ba50e8e941ca4f7aeeb8bc89a005573ae08087c..5f471cb1d57f489d2888e72fd84ed410238efccf 100644 (file)
@@ -6,6 +6,8 @@ import java.text.CharacterIterator;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.BreakIterator;
@@ -14,6 +16,7 @@ import com.ibm.icu.text.BreakIterator;
  * @author sgill
  *
  */
+@RunWith(JUnit4.class)
 public class AbstractBreakIteratorTests extends TestFmwk {
 
     private class AbstractBreakIterator extends BreakIterator {
index ef848d35b62cc04e1c6736403f0b270a7e8e1256..3b8860280c14d041e0579f30fd166b28f64da316 100644 (file)
@@ -13,10 +13,13 @@ import java.util.Arrays;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.BreakIterator;
 
+@RunWith(JUnit4.class)
 public class BreakIteratorRegTest extends TestFmwk
 {
     @Test
@@ -39,7 +42,7 @@ public class BreakIteratorRegTest extends TestFmwk
     Object key0 = BreakIterator.registerInstance((BreakIterator)twbi.clone(), foo_locale, BreakIterator.KIND_WORD);
     Object key1 = BreakIterator.registerInstance(sbi, Locale.US, BreakIterator.KIND_WORD);
     Object key2 = BreakIterator.registerInstance((BreakIterator)twbi.clone(), Locale.US, BreakIterator.KIND_WORD);
-    
+
     {
         BreakIterator test0 = BreakIterator.getWordInstance(Locale.JAPAN);
         BreakIterator test1 = BreakIterator.getWordInstance(Locale.US);
@@ -55,7 +58,7 @@ public class BreakIteratorRegTest extends TestFmwk
     }
 
     //Locale[] locales = BreakIterator.getAvailableLocales();
-    
+
     assertTrue(BreakIterator.unregister(key2), "unregister us word (thai word)");
     assertTrue(!BreakIterator.unregister(key2), "unregister second time");
     boolean error = false;
@@ -78,7 +81,7 @@ public class BreakIteratorRegTest extends TestFmwk
     assertTrue(BreakIterator.unregister(key0), "unregister foo word (thai word)");
     assertTrue(!Arrays.asList(BreakIterator.getAvailableLocales()).contains(foo_locale), "no foo_locale");
     assertEqual(BreakIterator.getWordInstance(Locale.US), usbi, "us word == us sentence");
-    
+
     assertTrue(BreakIterator.unregister(key1), "unregister us word (us sentence)");
     {
         BreakIterator test0 = BreakIterator.getWordInstance(Locale.JAPAN);
index 3e497ecf23bd2e63b4091023775375ddbcea41af..074c56494b35427a048c794ecc8c013ee72eaf75 100644 (file)
@@ -15,12 +15,15 @@ import java.util.Locale;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.BreakIterator;
 import com.ibm.icu.text.FilteredBreakIteratorBuilder;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class BreakIteratorTest extends TestFmwk
 {
     private BreakIterator characterBreak;
index a71613bb64b96d164281a7b7aa41aabcb7b27c88..05ede18660bbebdf9e35b74ba6c69fa6b23c35e6 100644 (file)
@@ -23,6 +23,8 @@ import java.util.List;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.BreakIterator;
@@ -32,7 +34,8 @@ import com.ibm.icu.util.ULocale;
 /**
  * API Test the RuleBasedBreakIterator class
  */
-public class RBBIAPITest extends com.ibm.icu.dev.test.TestFmwk {
+@RunWith(JUnit4.class)
+public class RBBIAPITest extends TestFmwk {
     /**
      * Tests clone() and equals() methods of RuleBasedBreakIterator
      **/
index 6feef9722e5907f85b1500aa223723e5c98a3ac6..9ddb73bd0db02e8ee28c33e76c8090c9d4974e83 100644 (file)
@@ -16,6 +16,8 @@ import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.UCharacterName;
@@ -31,6 +33,7 @@ import com.ibm.icu.util.ULocale;
  * older class RBBITestMonkey.
  */
 
+@RunWith(JUnit4.class)
 public class RBBIMonkeyTest extends TestFmwk {
 
 
index b3f6f45cf3d46d11c12a781a93ab8f87ade9c07d..9d025e7c8de321213531d242ca7946ea1317c6f7 100644 (file)
@@ -21,12 +21,15 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.BreakIterator;
 import com.ibm.icu.text.RuleBasedBreakIterator;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class RBBITest extends TestFmwk {
     public RBBITest() {
     }
index 422770ded1f6245f4c23021a80cce53018c7bab3..8be70120cedb4229494ab687631d3024d0641846 100644 (file)
@@ -15,6 +15,8 @@ import java.io.InputStreamReader;
 import java.util.Arrays;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -31,6 +33,7 @@ import com.ibm.icu.util.ULocale;
  *      See the data file for a description of the tests.
  *
  */
+@RunWith(JUnit4.class)
 public class RBBITestExtended extends TestFmwk {
 public RBBITestExtended() {
     }
index a93a8623e90843953469dc20f4fa8bb404724620..d508f88e13a3c6046acdd708db60f70950abf0a3 100644 (file)
@@ -19,6 +19,8 @@ import java.util.List;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UCharacter;
@@ -39,6 +41,7 @@ import com.ibm.icu.text.UnicodeSet;
  * Ported from ICU4C, original code in file source/test/intltest/rbbitst.cpp
  *
  */
+@RunWith(JUnit4.class)
 public class RBBITestMonkey extends TestFmwk {
     //
     //     class RBBIMonkeyKind
index 2abb4fbb31a6823807a459df7c2d683cdd892200..a71aaba8880129901e1c79291ea0d4d68e8f0c26 100644 (file)
@@ -12,6 +12,8 @@ package com.ibm.icu.dev.test.shaping;
 import java.lang.reflect.Method;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.ArabicShaping;
@@ -19,6 +21,7 @@ import com.ibm.icu.text.ArabicShaping;
 /**
  * Regression test for Arabic shaping.
  */
+@RunWith(JUnit4.class)
 public class ArabicShapingRegTest extends TestFmwk {
 
     /* constants copied from ArabicShaping for convenience */
index ad0f65ac663e1a1035a2b1616088b7d7c13133c4..5dcd8d91c8b708c666ba58058f86510e66ec3795 100644 (file)
@@ -20,6 +20,8 @@ import java.util.Set;
 import java.util.TreeMap;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -29,14 +31,15 @@ import com.ibm.icu.text.UTF16;
 
 /**
  * @author limaoyu
- * 
+ *
  */
+@RunWith(JUnit4.class)
 public class IDNAConformanceTest extends TestFmwk {
     @Test
     public void TestConformance() {
 
         TreeMap inputData = null;
-        
+
         try {
             inputData = ReadInput.getInputData();
         } catch (UnsupportedEncodingException e) {
@@ -46,7 +49,7 @@ public class IDNAConformanceTest extends TestFmwk {
             errln(e.getMessage());
             return;
         }
-        
+
         Set keyMap = inputData.keySet();
         for (Iterator iter = keyMap.iterator(); iter.hasNext();) {
             Long element = (Long) iter.next();
@@ -70,7 +73,7 @@ public class IDNAConformanceTest extends TestFmwk {
             boolean failed = false;
 
             if ("toascii".equals(tempHash.get("type"))) {
-                
+
                 //get the result
                 try {
                     //by default STD3 rules are not used, but if the description
@@ -87,12 +90,12 @@ public class IDNAConformanceTest extends TestFmwk {
                     //errln(e2.getMessage());
                     failed = true;
                 }
-                
-                
+
+
                 if ("pass".equals(passfail)) {
                     if (!namezone.equals(result)) {
                         printInfo(desc, namebase, nameutf8, namezone,
-                                failzone1, failzone2, result, type, passfail);                        
+                                failzone1, failzone2, result, type, passfail);
                         errln("\t pass fail standard is pass, but failed");
                     } else {
                         printInfo(desc, namebase, nameutf8, namezone,
@@ -108,7 +111,7 @@ public class IDNAConformanceTest extends TestFmwk {
                         logln("passed");
                     } else {
                         printInfo(desc, namebase, nameutf8, namezone,
-                                failzone1, failzone2, result, type, passfail);                        
+                                failzone1, failzone2, result, type, passfail);
                         errln("\t pass fail standard is fail, but no exception thrown out");
                     }
                 }
@@ -132,11 +135,11 @@ public class IDNAConformanceTest extends TestFmwk {
                     if (!namezone.equals(result)) {
                         printInfo(desc, namebase, nameutf8, namezone,
                                 failzone1, failzone2, result, type, passfail);
-                        
+
                         errln("\t Did not get the expected result. Expected: " + prettify(namezone) + " Got: " + prettify(result));
                     } else {
                         printInfo(desc, namebase, nameutf8, namezone,
-                                failzone1, failzone2, result, type, passfail);                        
+                                failzone1, failzone2, result, type, passfail);
                         logln("\tpassed");
                     }
                 }
@@ -145,12 +148,12 @@ public class IDNAConformanceTest extends TestFmwk {
                     if (failed || namebase.equals(result)) {
                         printInfo(desc, namebase, nameutf8, namezone,
                                 failzone1, failzone2, result, type, passfail);
-                        
+
                         logln("\tpassed");
                     } else {
                         printInfo(desc, namebase, nameutf8, namezone,
                                 failzone1, failzone2, result, type, passfail);
-                        
+
                         errln("\t pass fail standard is fail, but no exception thrown out");
                     }
                 }
@@ -220,7 +223,7 @@ public class IDNAConformanceTest extends TestFmwk {
                     String utf16String = UTF16.valueOf(toBeInserted);
                     char[] charsTemp = utf16String.toCharArray();
                     for (int j = 0; j < charsTemp.length; j++) {
-                        result.append((char) charsTemp[j]);
+                        result.append(charsTemp[j]);
                     }
                 }
             } else if ('>' == chars[i]) {//end when met with '>'
@@ -235,9 +238,9 @@ public class IDNAConformanceTest extends TestFmwk {
 
     /**
      * This class is used to read test data from TestInput file.
-     * 
+     *
      * @author limaoyu
-     *  
+     *
      */
     public static class ReadInput {
 
index f05f32ec0b1fb681d5fbd8ae1821f09cbb4d471d..f18bffacd201a969c8037aa11f35d5fb8ca2e60c 100644 (file)
@@ -12,6 +12,8 @@ import java.util.Random;
 
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -24,6 +26,7 @@ import com.ibm.icu.text.UTF16;
 /**
  * @author ram
  */
+@RunWith(JUnit4.class)
 public class TestIDNA extends TestFmwk {
     private StringPrepParseException unassignedException = new StringPrepParseException("",StringPrepParseException.UNASSIGNED_ERROR);
 
index 9bb859b6d44c32ecd8a08fd9a5cd3ec36b30277f..40260e8d4e59b164915350ec0029568a5a5fba11 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.stringprep;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.StringPrepParseException;
@@ -20,6 +22,7 @@ import com.ibm.icu.text.UCharacterIterator;
  * To change the template for this generated type comment go to
  * Window>Preferences>Java>Code Generation>Code and Comments
  */
+@RunWith(JUnit4.class)
 public class TestIDNARef extends TestFmwk {
     private StringPrepParseException unassignedException = new StringPrepParseException("",StringPrepParseException.UNASSIGNED_ERROR);
 
@@ -30,17 +33,17 @@ public class TestIDNARef extends TestFmwk {
                 // test StringBuffer toUnicode
                 doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.DEFAULT, null);
                 doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.ALLOW_UNASSIGNED, null);
-                //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.USE_STD3_RULES, null); 
-                //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.USE_STD3_RULES|IDNAReference.ALLOW_UNASSIGNED, null); 
-        
+                //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.USE_STD3_RULES, null);
+                //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.USE_STD3_RULES|IDNAReference.ALLOW_UNASSIGNED, null);
+
             }
         }catch(java.lang.ExceptionInInitializerError ex){
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
     }
-    
+
     @Test
     public void TestToASCII() throws Exception{
         try{
@@ -48,17 +51,17 @@ public class TestIDNARef extends TestFmwk {
                 // test StringBuffer toUnicode
                 doTestToASCII(new String(TestData.unicodeIn[i]),TestData.asciiIn[i],IDNAReference.DEFAULT, null);
                 doTestToASCII(new String(TestData.unicodeIn[i]),TestData.asciiIn[i],IDNAReference.ALLOW_UNASSIGNED, null);
-                //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.USE_STD3_RULES, null); 
-                //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.USE_STD3_RULES|IDNAReference.ALLOW_UNASSIGNED, null); 
-        
+                //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.USE_STD3_RULES, null);
+                //doTestToUnicode(TestData.asciiIn[i],new String(TestData.unicodeIn[i]),IDNAReference.USE_STD3_RULES|IDNAReference.ALLOW_UNASSIGNED, null);
+
             }
         }catch(java.lang.ExceptionInInitializerError ex){
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
     }
-    
+
     @Test
     public void TestIDNToASCII() throws Exception{
         try{
@@ -68,19 +71,19 @@ public class TestIDNARef extends TestFmwk {
                 doTestIDNToASCII(TestData.domainNames[i],TestData.domainNames[i],IDNAReference.USE_STD3_RULES, null);
                 doTestIDNToASCII(TestData.domainNames[i],TestData.domainNames[i],IDNAReference.ALLOW_UNASSIGNED|IDNAReference.USE_STD3_RULES, null);
             }
-            
+
             for(int i=0; i<TestData.domainNames1Uni.length; i++){
                 doTestIDNToASCII(TestData.domainNames1Uni[i],TestData.domainNamesToASCIIOut[i],IDNAReference.DEFAULT, null);
                 doTestIDNToASCII(TestData.domainNames1Uni[i],TestData.domainNamesToASCIIOut[i],IDNAReference.ALLOW_UNASSIGNED, null);
                 doTestIDNToASCII(TestData.domainNames1Uni[i],TestData.domainNamesToASCIIOut[i],IDNAReference.USE_STD3_RULES, null);
                 doTestIDNToASCII(TestData.domainNames1Uni[i],TestData.domainNamesToASCIIOut[i],IDNAReference.ALLOW_UNASSIGNED|IDNAReference.USE_STD3_RULES, null);
-    
+
             }
         }catch(java.lang.ExceptionInInitializerError ex){
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
     }
     @Test
     public void TestIDNToUnicode() throws Exception{
@@ -99,10 +102,10 @@ public class TestIDNARef extends TestFmwk {
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
     }
-    
-    private void doTestToUnicode(String src, String expected, int options, Object expectedException) 
+
+    private void doTestToUnicode(String src, String expected, int options, Object expectedException)
                 throws Exception{
 
         if (!IDNAReference.isReady()) {
@@ -113,10 +116,10 @@ public class TestIDNARef extends TestFmwk {
         StringBuffer inBuf = new StringBuffer(src);
         UCharacterIterator inIter = UCharacterIterator.getInstance(src);
         try{
-            
+
             StringBuffer out = IDNAReference.convertToUnicode(src,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
-                errln("convertToUnicode did not return expected result with options : "+ options + 
+                errln("convertToUnicode did not return expected result with options : "+ options +
                       " Expected: " + prettify(expected)+" Got: "+prettify(out));
             }
             if(expectedException!=null && !unassignedException.equals(expectedException)){
@@ -128,10 +131,10 @@ public class TestIDNARef extends TestFmwk {
             }
         }
         try{
-            
+
             StringBuffer out = IDNAReference.convertToUnicode(inBuf,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
-               errln("convertToUnicode did not return expected result with options : "+ options + 
+               errln("convertToUnicode did not return expected result with options : "+ options +
                      " Expected: " + prettify(expected)+" Got: "+out);
             }
             if(expectedException!=null && !unassignedException.equals(expectedException)){
@@ -142,7 +145,7 @@ public class TestIDNARef extends TestFmwk {
                 errln("convertToUnicode did not get the expected exception for source: " + prettify(src) +" Got:  "+ ex.toString());
             }
         }
-        
+
         try{
             StringBuffer out = IDNAReference.convertToUnicode(inIter,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
@@ -158,8 +161,8 @@ public class TestIDNARef extends TestFmwk {
             }
         }
     }
-    
-    private void doTestIDNToUnicode(String src, String expected, int options, Object expectedException) 
+
+    private void doTestIDNToUnicode(String src, String expected, int options, Object expectedException)
                 throws Exception{
 
         if (!IDNAReference.isReady()) {
@@ -170,10 +173,10 @@ public class TestIDNARef extends TestFmwk {
         StringBuffer inBuf = new StringBuffer(src);
         UCharacterIterator inIter = UCharacterIterator.getInstance(src);
         try{
-            
+
             StringBuffer out = IDNAReference.convertIDNToUnicode(src,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
-                errln("convertToUnicode did not return expected result with options : "+ options + 
+                errln("convertToUnicode did not return expected result with options : "+ options +
                       " Expected: " + prettify(expected)+" Got: "+prettify(out));
             }
             if(expectedException!=null && !unassignedException.equals(expectedException)){
@@ -187,7 +190,7 @@ public class TestIDNARef extends TestFmwk {
         try{
             StringBuffer out = IDNAReference.convertIDNToUnicode(inBuf,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
-               errln("convertToUnicode did not return expected result with options : "+ options + 
+               errln("convertToUnicode did not return expected result with options : "+ options +
                      " Expected: " + prettify(expected)+" Got: "+out);
             }
             if(expectedException!=null && !unassignedException.equals(expectedException)){
@@ -198,7 +201,7 @@ public class TestIDNARef extends TestFmwk {
                 errln("convertToUnicode did not get the expected exception for source: " +src +" Got:  "+ ex.toString());
             }
         }
-        
+
         try{
             StringBuffer out = IDNAReference.convertIDNToUnicode(inIter,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
@@ -214,7 +217,7 @@ public class TestIDNARef extends TestFmwk {
             }
         }
     }
-    private void doTestToASCII(String src, String expected, int options, Object expectedException) 
+    private void doTestToASCII(String src, String expected, int options, Object expectedException)
                 throws Exception{
 
         if (!IDNAReference.isReady()) {
@@ -225,12 +228,12 @@ public class TestIDNARef extends TestFmwk {
         StringBuffer inBuf = new StringBuffer(src);
         UCharacterIterator inIter = UCharacterIterator.getInstance(src);
         try{
-            
+
             StringBuffer out = IDNAReference.convertToASCII(src,options);
             if(!unassignedException.equals(expectedException) && expected!=null && out != null && expected!=null && out != null && !out.toString().equals(expected.toLowerCase())){
-                errln("convertToASCII did not return expected result with options : "+ options + 
+                errln("convertToASCII did not return expected result with options : "+ options +
                       " Expected: " + expected+" Got: "+out);
-            }           
+            }
             if(expectedException!=null && !unassignedException.equals(expectedException)){
                 errln("convertToASCII did not get the expected exception. The operation succeeded!");
             }
@@ -239,11 +242,11 @@ public class TestIDNARef extends TestFmwk {
                 errln("convertToASCII did not get the expected exception for source: " +src +" Got:  "+ ex.toString());
             }
         }
-        
-        try{            
+
+        try{
             StringBuffer out = IDNAReference.convertToASCII(inBuf,options);
             if(!unassignedException.equals(expectedException) && expected!=null && out != null && expected!=null && out != null && !out.toString().equals(expected.toLowerCase())){
-               errln("convertToASCII did not return expected result with options : "+ options + 
+               errln("convertToASCII did not return expected result with options : "+ options +
                      " Expected: " + expected+" Got: "+out);
             }
             if(expectedException!=null && !unassignedException.equals(expectedException)){
@@ -254,7 +257,7 @@ public class TestIDNARef extends TestFmwk {
                 errln("convertToASCII did not get the expected exception for source: " +src +" Got:  "+ ex.toString());
             }
         }
-        
+
         try{
             StringBuffer out = IDNAReference.convertToASCII(inIter,options);
             if(!unassignedException.equals(expectedException) && expected!=null && out != null && expected!=null && out != null && !out.toString().equals(expected.toLowerCase())){
@@ -270,7 +273,7 @@ public class TestIDNARef extends TestFmwk {
             }
         }
     }
-    private void doTestIDNToASCII(String src, String expected, int options, Object expectedException) 
+    private void doTestIDNToASCII(String src, String expected, int options, Object expectedException)
                 throws Exception{
 
         if (!IDNAReference.isReady()) {
@@ -281,10 +284,10 @@ public class TestIDNARef extends TestFmwk {
         StringBuffer inBuf = new StringBuffer(src);
         UCharacterIterator inIter = UCharacterIterator.getInstance(src);
         try{
-            
+
             StringBuffer out = IDNAReference.convertIDNToASCII(src,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
-                errln("convertToIDNAReferenceASCII did not return expected result with options : "+ options + 
+                errln("convertToIDNAReferenceASCII did not return expected result with options : "+ options +
                       " Expected: " + expected+" Got: "+out);
             }
             if(expectedException!=null && !unassignedException.equals(expectedException)){
@@ -298,9 +301,9 @@ public class TestIDNARef extends TestFmwk {
         try{
             StringBuffer out = IDNAReference.convertIDNtoASCII(inBuf,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
-               errln("convertToIDNAReferenceASCII did not return expected result with options : "+ options + 
+               errln("convertToIDNAReferenceASCII did not return expected result with options : "+ options +
                      " Expected: " + expected+" Got: "+out);
-            }           
+            }
             if(expectedException!=null && !unassignedException.equals(expectedException)){
                 errln("convertToIDNAReferenceSCII did not get the expected exception. The operation succeeded!");
             }
@@ -309,14 +312,14 @@ public class TestIDNARef extends TestFmwk {
                 errln("convertToIDNAReferenceSCII did not get the expected exception for source: " +src +" Got:  "+ ex.toString());
             }
         }
-        
+
         try{
             StringBuffer out = IDNAReference.convertIDNtoASCII(inIter,options);
             if(expected!=null && out != null && !out.toString().equals(expected)){
                errln("convertIDNToASCII did not return expected result with options : "+ options +
                      " Expected: " + expected+" Got: "+ out);
             }
-            
+
             if(expectedException!=null && !unassignedException.equals(expectedException)){
                 errln("convertIDNToASCII did not get the expected exception. The operation succeeded!");
             }
@@ -330,7 +333,7 @@ public class TestIDNARef extends TestFmwk {
     public void TestConformance()throws Exception{
         try{
             for(int i=0; i<TestData.conformanceTestCases.length;i++){
-                
+
                 TestData.ConformanceTestCase testCase = TestData.conformanceTestCases[i];
                 if(testCase.expected != null){
                     //Test toASCII
@@ -344,7 +347,7 @@ public class TestIDNARef extends TestFmwk {
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
     }
     @Test
     public void TestNamePrepConformance() throws Exception{
@@ -371,7 +374,7 @@ public class TestIDNARef extends TestFmwk {
                         errln("Did not get the expected exception for source: " +testCase.input +" Got:  "+ ex.toString());
                     }
                 }
-                
+
                 try{
                     iter.setToStart();
                     StringBuffer output = namePrep.prepare(iter,NamePrepTransform.ALLOW_UNASSIGNED);
@@ -392,8 +395,8 @@ public class TestIDNARef extends TestFmwk {
             warnln("Could not load NamePrepTransformData");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
-        
+        }
+
     }
     @Test
     public void TestErrorCases() throws Exception{
@@ -409,22 +412,22 @@ public class TestIDNARef extends TestFmwk {
                     }
                 }
                 if(errCase.useSTD3ASCIIRules!=true){
-                    
+
                     // Test IDNToASCII
                     doTestIDNToASCII(new String(errCase.unicode),errCase.ascii,IDNAReference.DEFAULT,errCase.expected);
                     doTestIDNToASCII(new String(errCase.unicode),errCase.ascii,IDNAReference.ALLOW_UNASSIGNED,errCase.expected);
-                    
+
                 }else{
                     doTestIDNToASCII(new String(errCase.unicode),errCase.ascii,IDNAReference.USE_STD3_RULES,errCase.expected);
                 }
-                
+
                 //TestToUnicode
                 if(errCase.testToUnicode==true){
                     if(errCase.useSTD3ASCIIRules!=true){
                         // Test IDNToUnicode
                         doTestIDNToUnicode(errCase.ascii,new String(errCase.unicode),IDNAReference.DEFAULT,errCase.expected);
                         doTestIDNToUnicode(errCase.ascii,new String(errCase.unicode),IDNAReference.ALLOW_UNASSIGNED,errCase.expected);
-                    
+
                     }else{
                         doTestIDNToUnicode(errCase.ascii,new String(errCase.unicode),IDNAReference.USE_STD3_RULES,errCase.expected);
                     }
@@ -434,7 +437,7 @@ public class TestIDNARef extends TestFmwk {
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
     }
     private void doTestCompare(String s1, String s2, boolean isEqual){
 
@@ -446,43 +449,43 @@ public class TestIDNARef extends TestFmwk {
         try{
             int retVal = IDNAReference.compare(s1,s2,IDNAReference.DEFAULT);
             if(isEqual==true && retVal != 0){
-                errln("Did not get the expected result for s1: "+ prettify(s1)+ 
+                errln("Did not get the expected result for s1: "+ prettify(s1)+
                       " s2: "+prettify(s2));
             }
             retVal = IDNAReference.compare(new StringBuffer(s1), new StringBuffer(s2), IDNAReference.DEFAULT);
             if(isEqual==true && retVal != 0){
-                errln("Did not get the expected result for s1: "+ prettify(s1)+ 
+                errln("Did not get the expected result for s1: "+ prettify(s1)+
                      " s2: "+prettify(s2));
             }
             retVal = IDNAReference.compare(UCharacterIterator.getInstance(s1), UCharacterIterator.getInstance(s2), IDNAReference.DEFAULT);
             if(isEqual==true && retVal != 0){
-                errln("Did not get the expected result for s1: "+ prettify(s1)+ 
+                errln("Did not get the expected result for s1: "+ prettify(s1)+
                      " s2: "+prettify(s2));
             }
         }catch(Exception e){
             e.printStackTrace();
             errln("Unexpected exception thrown by IDNAReference.compare");
         }
-        
+
         try{
             int retVal = IDNAReference.compare(s1,s2,IDNAReference.ALLOW_UNASSIGNED);
             if(isEqual==true && retVal != 0){
-                errln("Did not get the expected result for s1: "+ prettify(s1)+ 
+                errln("Did not get the expected result for s1: "+ prettify(s1)+
                       " s2: "+prettify(s2));
             }
             retVal = IDNAReference.compare(new StringBuffer(s1), new StringBuffer(s2), IDNAReference.ALLOW_UNASSIGNED);
             if(isEqual==true && retVal != 0){
-                errln("Did not get the expected result for s1: "+ prettify(s1)+ 
+                errln("Did not get the expected result for s1: "+ prettify(s1)+
                      " s2: "+prettify(s2));
             }
             retVal = IDNAReference.compare(UCharacterIterator.getInstance(s1), UCharacterIterator.getInstance(s2), IDNAReference.ALLOW_UNASSIGNED);
             if(isEqual==true && retVal != 0){
-                errln("Did not get the expected result for s1: "+ prettify(s1)+ 
+                errln("Did not get the expected result for s1: "+ prettify(s1)+
                      " s2: "+prettify(s2));
             }
         }catch(Exception e){
             errln("Unexpected exception thrown by IDNAReference.compare");
-        }     
+        }
     }
     @Test
     public void TestCompare() throws Exception{
@@ -507,19 +510,19 @@ public class TestIDNARef extends TestFmwk {
         ascii1.append(com);
         try{
             for(int i=0;i< TestData.unicodeIn.length; i++){
-    
+
                 // for every entry in unicodeIn array
                 // prepend www. and append .com
                 source.setLength(4);
                 source.append(TestData.unicodeIn[i]);
                 source.append(com);
-                
+
                 // a) compare it with itself
                 doTestCompare(source.toString(),source.toString(),true);
-            
+
                 // b) compare it with asciiIn equivalent
                 doTestCompare(source.toString(),www+TestData.asciiIn[i]+com,true);
-            
+
                 // c) compare it with unicodeIn not equivalent
                 if(i==0){
                     doTestCompare(source.toString(), uni1.toString(), false);
@@ -537,7 +540,7 @@ public class TestIDNARef extends TestFmwk {
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
     }
 
     //  test and ascertain
@@ -549,9 +552,9 @@ public class TestIDNARef extends TestFmwk {
             return;
         }
 
-        StringBuffer expected; 
+        StringBuffer expected;
         StringBuffer chained;
-        
+
         // test convertIDNToASCII
         expected = IDNAReference.convertIDNToASCII(source,IDNAReference.DEFAULT);
         chained = expected;
@@ -569,8 +572,8 @@ public class TestIDNARef extends TestFmwk {
         }
         if(!expected.toString().equals(chained.toString())){
             errln("Chaining test failed for convertToASCII");
-        } 
-        
+        }
+
     }
     //  test and ascertain
     //  func(func(func(src))) == func(src)
@@ -581,9 +584,9 @@ public class TestIDNARef extends TestFmwk {
             return;
         }
 
-        StringBuffer expected; 
+        StringBuffer expected;
         StringBuffer chained;
-        
+
         // test convertIDNToUnicode
         expected = IDNAReference.convertIDNToUnicode(source,IDNAReference.DEFAULT);
         chained = expected;
@@ -617,7 +620,7 @@ public class TestIDNARef extends TestFmwk {
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
     }
     @Test
     public void TestRootLabelSeparator() throws Exception{
@@ -642,19 +645,19 @@ public class TestIDNARef extends TestFmwk {
         ascii1.append(com);
         try{
             for(int i=0;i< TestData.unicodeIn.length; i++){
-    
+
                 // for every entry in unicodeIn array
                 // prepend www. and append .com
                 source.setLength(4);
                 source.append(TestData.unicodeIn[i]);
                 source.append(com);
-                
+
                 // a) compare it with itself
                 doTestCompare(source.toString(),source.toString(),true);
-            
+
                 // b) compare it with asciiIn equivalent
                 doTestCompare(source.toString(),www+TestData.asciiIn[i]+com,true);
-            
+
                 // c) compare it with unicodeIn not equivalent
                 if(i==0){
                     doTestCompare(source.toString(), uni1.toString(), false);
@@ -672,7 +675,7 @@ public class TestIDNARef extends TestFmwk {
             warnln("Could not load NamePrepTransform data");
         }catch(java.lang.NoClassDefFoundError ex){
             warnln("Could not load NamePrepTransform data");
-        } 
+        }
 
     }
 }
index 7801296036ae55adef5e1cc0f945b9cb9dd1d680..f4fbfb992bab23137c28f07f9666b0bf3f0d4108 100644 (file)
@@ -11,6 +11,8 @@ package com.ibm.icu.dev.test.stringprep;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.StringPrep;
@@ -20,6 +22,7 @@ import com.ibm.icu.text.StringPrepParseException;
  * @author ram
  *
  */
+@RunWith(JUnit4.class)
 public class TestStringPrep extends TestFmwk {
     /*
        There are several special identifiers ("who") which need to be
@@ -51,13 +54,13 @@ public class TestStringPrep extends TestFmwk {
     */
     private String[] mixed_prep_data ={
         "OWNER@",
-        "GROUP@",        
-        "EVERYONE@",     
-        "INTERACTIVE@",  
-        "NETWORK@",      
-        "DIALUP@",       
-        "BATCH@",        
-        "ANONYMOUS@",    
+        "GROUP@",
+        "EVERYONE@",
+        "INTERACTIVE@",
+        "NETWORK@",
+        "DIALUP@",
+        "BATCH@",
+        "ANONYMOUS@",
         "AUTHENTICATED@",
         "\u0930\u094D\u092E\u094D\u0915\u094D\u0937\u0947\u0924\u094D@slip129-37-118-146.nc.us.ibm.net",
         "\u0936\u094d\u0930\u0940\u092e\u0926\u094d@saratoga.pe.utexas.edu",
@@ -114,7 +117,7 @@ public class TestStringPrep extends TestFmwk {
             }catch(Exception e){
                 errln("mixed_prepare for string: " + mixed_prep_data[i] +" failed with " + e.toString());
             }
-        } 
+        }
         /* test the error condition */
         {
             String src = "OWNER@oss.software.ibm.com";
@@ -147,14 +150,14 @@ public class TestStringPrep extends TestFmwk {
                 if(!expected.equals(e)){
                     errln("Did not get the expected exception");
                 }
-            } 
+            }
 
         }
     }
 
     @Test
     public void TestCSPrep(){
-        
+
         // Checking for bidi is turned off
         String src = "\uC138\uACC4\uC758\uBAA8\uB4E0\uC0AC\uB78C\uB4E4\uC774\u0644\u064A\u0647\uD55C\uAD6D\uC5B4\uB97C\uC774\uD574\uD55C\uB2E4\uBA74";
         try{
@@ -162,7 +165,7 @@ public class TestStringPrep extends TestFmwk {
         }catch(Exception e){
             errln("Got unexpected exception: " + e.toString());
         }
-        
+
         // normalization is turned off
         try{
             src = "www.\u00E0\u00B3\u00AF.com";
@@ -175,7 +178,7 @@ public class TestStringPrep extends TestFmwk {
         }catch(Exception e){
             errln("Got unexpected exception: " + e.toString());
         }
-        
+
         // test case insensitive string
         try{
             src = "THISISATEST";
@@ -201,14 +204,14 @@ public class TestStringPrep extends TestFmwk {
             errln("Got unexpected exception: " + e.toString());
         }
     }
-    
+
     @Test
     public void TestCoverage(){
         if (new StringPrepParseException("coverage", 0, "", 0,0) == null){
             errln("Construct StringPrepParseException(String, int, String, int, int)");
         }
     }
-    
+
     /* Tests the method public static StringPrep getInstance(int profile) */
     @Test
     public void TestGetInstance(){
@@ -222,7 +225,7 @@ public class TestStringPrep extends TestFmwk {
             } catch(Exception e){
             }
         }
-        
+
         int[] max_profile_cases = {StringPrep.RFC4518_LDAP_CI+1, StringPrep.RFC4518_LDAP_CI+2, StringPrep.RFC4518_LDAP_CI+5, StringPrep.RFC4518_LDAP_CI+10};
         for(int i=0; i<max_profile_cases.length; i++){
             try{
@@ -232,7 +235,7 @@ public class TestStringPrep extends TestFmwk {
             } catch(Exception e){
             }
         }
-        
+
         // Tests when "if (instance == null)", "if (stream != null)", "if (instance != null)", and "if (ref != null)" is true
         int[] cases = {0, 1, StringPrep.RFC4518_LDAP_CI};
         for(int i=0; i<cases.length; i++){
@@ -244,7 +247,7 @@ public class TestStringPrep extends TestFmwk {
             }
         }
     }
-    
+
     /* Test the method public String prepare(String src, int options) */
     @Test
     public void TestPrepare() {
@@ -257,7 +260,7 @@ public class TestStringPrep extends TestFmwk {
             errln("StringPrep.prepare(String,int) was not suppose to return " + "an exception.");
         }
     }
-    
+
     /*
      * Tests the constructor public StringPrepParseException(String message, int error, String rules, int pos, int
      * lineNumber)
@@ -272,14 +275,14 @@ public class TestStringPrep extends TestFmwk {
             exceptions[i] = new StringPrepParseException(locales[i].toString(), i, rules, i, i);
         }
     }
-    
+
     /* Tests the method public boolean equals(Object other) for StringPrepParseException */
     @Test
     public void TestStringPrepParseExceptionEquals(){
         StringPrepParseException sppe = new StringPrepParseException("dummy",0,"dummy",0,0);
         StringPrepParseException sppe_clone = new StringPrepParseException("dummy",0,"dummy",0,0);
         StringPrepParseException sppe1 = new StringPrepParseException("dummy1",1,"dummy1",0,0);
-        
+
         // Tests when "if(!(other instanceof StringPrepParseException))" is true
         if(sppe.equals(0)){
             errln("StringPrepParseException.equals(Object) is suppose to return false when " +
@@ -293,7 +296,7 @@ public class TestStringPrep extends TestFmwk {
             errln("StringPrepParseException.equals(Object) is suppose to return false when " +
                     "passing string '0'");
         }
-        
+
         // Tests when "if(!(other instanceof StringPrepParseException))" is true
         if(!sppe.equals(sppe)){
             errln("StringPrepParseException.equals(Object) is suppose to return true when " +
@@ -308,7 +311,7 @@ public class TestStringPrep extends TestFmwk {
             "comparing to another object that isn't the same");
         }
     }
-    
+
     /* Tests the method public int getError() */
     @Test
     public void TestGetError(){
@@ -319,7 +322,7 @@ public class TestStringPrep extends TestFmwk {
             }
         }
     }
-    
+
     /* Tests the private void setPreContext(char[] str, int pos) */
     @Test
     public void TestSetPreContext(){
index 49d4454ecdbfe787eb302cc9a20fbb90630aadc2..9186ec3824b6a8045fe5532f5ca777055fb9c06e 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.stringprep;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.StringPrep;
@@ -18,6 +20,7 @@ import com.ibm.icu.text.StringPrepParseException;
  * @author Michael Ow
  *
  */
+@RunWith(JUnit4.class)
 public class TestStringPrepProfiles extends TestFmwk {
     /*
      * The format of the test cases should be the following:
@@ -28,8 +31,8 @@ public class TestStringPrepProfiles extends TestFmwk {
      *     src string2
      *     expected result2
      *     ...
-     * } 
-     * 
+     * }
+     *
      * *Note: For expected failures add FAIL to beginning of the source string and for expected result use "FAIL".
      */
     private static String[][] testCases = {
@@ -101,7 +104,7 @@ public class TestStringPrepProfiles extends TestFmwk {
             "suffixdomain \u007Ffiend"
         }
     };
-    
+
     private int getOptionFromProfileName(String profileName) {
         if (profileName.equals("RFC4013_SASLPREP")) {
             return StringPrep.RFC4013_SASLPREP;
@@ -129,12 +132,12 @@ public class TestStringPrepProfiles extends TestFmwk {
             return StringPrep.RFC3530_NFS4_MIXED_PREP_PREFIX;
         } else if (profileName.equals("RFC3530_NFS4_MIXED_PREP_SUFFIX")) {
             return StringPrep.RFC3530_NFS4_MIXED_PREP_SUFFIX;
-        } 
-        
+        }
+
         // Should not happen.
         return -1;
     }
-    
+
     @Test
     public void TestProfiles() {
         String profileName = null;
@@ -142,12 +145,12 @@ public class TestStringPrepProfiles extends TestFmwk {
         String result = null;
         String src = null;
         String expected = null;
-        
+
         for (int i = 0; i < testCases.length; i++) {
             for (int j = 0; j < testCases[i].length; j++) {
                 if (j == 0) {
                     profileName = testCases[i][j];
-                    
+
                     sprep = StringPrep.getInstance(getOptionFromProfileName(profileName));
                 } else {
                     src = testCases[i][j];
index d5fc3a0009da1acfee72280e525bc1721d766496..44bcfb0909c0324c97fd1f930de15a9efabc482f 100644 (file)
@@ -25,6 +25,8 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -38,6 +40,7 @@ import com.ibm.icu.text.SpoofChecker.RestrictionLevel;
 import com.ibm.icu.text.UnicodeSet;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class SpoofCheckerTest extends TestFmwk {
     /*
      * Identifiers for verifying that spoof checking is minimally alive and working.
index a0dfaaad9cf97dc76f6a81b0ef4b962ae1f89c65..8116f0f653272129cac85ccb24a7f3d84e89b3c4 100644 (file)
@@ -11,6 +11,8 @@
 package com.ibm.icu.dev.test.timescale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.math.BigDecimal;
@@ -19,28 +21,29 @@ import com.ibm.icu.util.UniversalTimeScale;
 /**
  * Test UniversalTimeScale API
  */
+@RunWith(JUnit4.class)
 public class TimeScaleAPITest extends TestFmwk
 {
 
     /**
-     * 
+     *
      */
     public TimeScaleAPITest()
     {
     }
-    
+
     @Test
     public void TestBigDecimalFromBigDecimal()
     {
         BigDecimal bigZero = new BigDecimal(0);
-        
+
         try {
             UniversalTimeScale.bigDecimalFrom(bigZero, -1);
             errln("bigDecimalFrom(bigZero, -1) did not throw IllegalArgumentException.");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.bigDecimalFrom failed as expected");
         }
-        
+
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             try {
                 UniversalTimeScale.bigDecimalFrom(bigZero, scale);
@@ -48,7 +51,7 @@ public class TimeScaleAPITest extends TestFmwk
                 errln("bigDecimalFrom(bigZero, " + scale + ") threw IllegalArgumentException.");
             }
         }
-        
+
         try {
             UniversalTimeScale.bigDecimalFrom(bigZero, UniversalTimeScale.MAX_SCALE);
             errln("from(bigZero, MAX_SCALE) did not throw IllegalArgumetException.");
@@ -56,7 +59,7 @@ public class TimeScaleAPITest extends TestFmwk
             logln("PASS: UniversalTimeScale.bigDecimalFrom failed as expected");
         }
     }
-    
+
     @Test
     public void TestBigDecimalFromDouble()
     {
@@ -66,7 +69,7 @@ public class TimeScaleAPITest extends TestFmwk
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.bigDecimalFrom failed as expected");
         }
-        
+
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             try {
                 UniversalTimeScale.bigDecimalFrom(0.0, scale);
@@ -74,7 +77,7 @@ public class TimeScaleAPITest extends TestFmwk
                 errln("bigDecimalFrom(0.0, " + scale + ") threw IllegalArgumentException.");
             }
        }
-        
+
         try {
             UniversalTimeScale.bigDecimalFrom(0.0, UniversalTimeScale.MAX_SCALE);
             errln("from(0.0, MAX_SCALE) did not throw IllegalArgumetException.");
@@ -82,7 +85,7 @@ public class TimeScaleAPITest extends TestFmwk
             logln("PASS: UniversalTimeScale.bigDecimalFrom failed as expected");
         }
     }
-    
+
     @Test
     public void TestBigDecimalFromLong()
     {
@@ -92,7 +95,7 @@ public class TimeScaleAPITest extends TestFmwk
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.bigDecimalFrom failed as expected");
         }
-        
+
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             try {
                 UniversalTimeScale.bigDecimalFrom(0L, scale);
@@ -100,7 +103,7 @@ public class TimeScaleAPITest extends TestFmwk
                 errln("bigDecimalFrom(0L, " + scale + ") threw IllegalArgumentException.");
             }
        }
-        
+
         try {
             UniversalTimeScale.bigDecimalFrom(0L, UniversalTimeScale.MAX_SCALE);
             errln("from(0L, MAX_SCALE) did not throw IllegalArgumetException.");
@@ -108,12 +111,12 @@ public class TimeScaleAPITest extends TestFmwk
             logln("PASS: UniversalTimeScale.bigDecimalFrom failed as expected");
         }
     }
-    
+
     @Test
     public void TestFromLong()
     {
         long result;
-        
+
         try {
             result = UniversalTimeScale.from(0L, -1);
             errln("from(0L, -1) did not throw IllegalArgumentException.");
@@ -124,7 +127,7 @@ public class TimeScaleAPITest extends TestFmwk
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             long fromMin = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.FROM_MIN_VALUE);
             long fromMax = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.FROM_MAX_VALUE);
-            
+
             try {
                 result = UniversalTimeScale.from(0L, scale);
                 logln("from(0L, " + scale + ") returned " + result);
@@ -138,7 +141,7 @@ public class TimeScaleAPITest extends TestFmwk
             } catch (IllegalArgumentException iae) {
                 errln("from(fromMin, " + scale + ") threw IllegalArgumentException.");
             }
-             
+
             if (fromMin > Long.MIN_VALUE) {
                 try {
                     result = UniversalTimeScale.from(fromMin - 1, scale);
@@ -147,14 +150,14 @@ public class TimeScaleAPITest extends TestFmwk
                     logln("PASS: UniversalTimeScale.from failed as expected");
                 }
             }
-             
+
             try {
                 result = UniversalTimeScale.from(fromMax, scale);
                 logln("from(fromMax, " + scale + ") returned " + result);
             } catch (IllegalArgumentException iae) {
                 errln("from(fromMax, " + scale + ") threw IllegalArgumentException.");
             }
-              
+
             if (fromMax < Long.MAX_VALUE) {
                 try {
                     result = UniversalTimeScale.from(fromMax + 1, scale);
@@ -164,7 +167,7 @@ public class TimeScaleAPITest extends TestFmwk
                }
             }
        }
-        
+
         try {
             result = UniversalTimeScale.from(0L, UniversalTimeScale.MAX_SCALE);
             errln("from(0L, MAX_SCALE) did not throw IllegalArgumetException.");
@@ -172,26 +175,26 @@ public class TimeScaleAPITest extends TestFmwk
             logln("PASS: UniversalTimeScale.from failed as expected");
         }
     }
-    
+
     @Test
     public void TestGetTimeScale()
     {
         long value;
-        
+
         try {
             value = UniversalTimeScale.getTimeScaleValue(-1, 0);
             errln("getTimeScaleValue(-1, 0) did not throw IllegalArgumentException.");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.getTimeScaleValue failed as expected");
         }
-        
+
         try {
             value = UniversalTimeScale.getTimeScaleValue(0, -1);
             errln("getTimeScaleValue(0, -1) did not throw IllegalArgumentException.");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.getTimeScaleValue failed as expected");
         }
-        
+
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             try {
                 value = UniversalTimeScale.getTimeScaleValue(scale, 0);
@@ -200,14 +203,14 @@ public class TimeScaleAPITest extends TestFmwk
                 errln("getTimeScaleValue(" + scale + ", 0) threw IllegalArgumentException.");
             }
         }
-        
+
         try {
             value = UniversalTimeScale.getTimeScaleValue(UniversalTimeScale.MAX_SCALE, 0);
             errln("getTimeScaleValue(MAX_SCALE, 0) did not throw IllegalArgumentException");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.getTimeScaleValue failed as expected");
         }
-        
+
         try {
             value = UniversalTimeScale.getTimeScaleValue(0, UniversalTimeScale.MAX_SCALE_VALUE);
             errln("getTimeScaleValue(0, MAX_SCALE_VALUE) did not throw IllegalArgumentException");
@@ -215,19 +218,19 @@ public class TimeScaleAPITest extends TestFmwk
             logln("PASS: UniversalTimeScale.getTimeScaleValue failed as expected");
         }
     }
-    
+
     @Test
     public void TestToBigDecimalFromBigDecimal()
     {
         BigDecimal bigZero = new BigDecimal(0);
-        
+
         try {
             UniversalTimeScale.toBigDecimal(bigZero, -1);
             errln("toBigDecimal(bigZero, -1) did not throw IllegalArgumentException.");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.toBigDecimal failed as expected");
         }
-        
+
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             try {
                 UniversalTimeScale.toBigDecimal(bigZero, scale);
@@ -235,7 +238,7 @@ public class TimeScaleAPITest extends TestFmwk
                 errln("toBigDecimal(bigZero, " + scale + ") threw IllegalArgumentException.");
             }
         }
-        
+
         try {
             UniversalTimeScale.toBigDecimal(bigZero, UniversalTimeScale.MAX_SCALE);
             errln("toBigDecimal(bigZero, MAX_SCALE) did not throw IllegalArgumetException.");
@@ -248,14 +251,14 @@ public class TimeScaleAPITest extends TestFmwk
     public void TestToBigDecimalTrunc()
     {
         BigDecimal bigZero = new BigDecimal(0);
-        
+
         try {
             UniversalTimeScale.toBigDecimalTrunc(bigZero, -1);
             errln("toBigDecimalTrunc(bigZero, -1) did not throw IllegalArgumentException.");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.toBigDecimalTrunc failed as expected");
         }
-        
+
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             try {
                 UniversalTimeScale.toBigDecimalTrunc(bigZero, scale);
@@ -263,7 +266,7 @@ public class TimeScaleAPITest extends TestFmwk
                 errln("toBigDecimalTrunc(bigZero, " + scale + ") threw IllegalArgumentException.");
             }
         }
-        
+
         try {
             UniversalTimeScale.toBigDecimalTrunc(bigZero, UniversalTimeScale.MAX_SCALE);
             errln("toBigDecimalTrunc(bigZero, MAX_SCALE) did not throw IllegalArgumetException.");
@@ -271,7 +274,7 @@ public class TimeScaleAPITest extends TestFmwk
             logln("PASS: UniversalTimeScale.toBigDecimalTrunc failed as expected");
         }
     }
-    
+
     @Test
     public void TestToBigDecimalFromLong()
     {
@@ -281,7 +284,7 @@ public class TimeScaleAPITest extends TestFmwk
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.toBigDecimal failed as expected");
         }
-        
+
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             try {
                 UniversalTimeScale.toBigDecimal(0L, scale);
@@ -289,7 +292,7 @@ public class TimeScaleAPITest extends TestFmwk
                 errln("toBigDecimal(0L, " + scale + ") threw IllegalArgumentException.");
             }
         }
-        
+
         try {
             UniversalTimeScale.toBigDecimal(0L, UniversalTimeScale.MAX_SCALE);
             errln("toBigDecimal(0L, MAX_SCALE) did not throw IllegalArgumetException.");
@@ -297,37 +300,37 @@ public class TimeScaleAPITest extends TestFmwk
             logln("PASS: UniversalTimeScale.toBigDecimal failed as expected");
         }
     }
-    
+
     @Test
     public void TestToLong()
     {
         long result;
-        
+
         try {
             result = UniversalTimeScale.toLong(0L, -1);
             errln("toLong(0L, -1) did not throw IllegalArgumentException.");
         } catch (IllegalArgumentException iae) {
             logln("PASS: UniversalTimeScale.toLong failed as expected");
         }
-        
+
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             long toMin = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.TO_MIN_VALUE);
             long toMax = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.TO_MAX_VALUE);
-            
+
             try {
                 result = UniversalTimeScale.toLong(0L, scale);
                 logln("toLong(0L, " + scale + ") returned " + result);
             } catch (IllegalArgumentException iae) {
                 errln("toLong(0L, " + scale + ") threw IllegalArgumentException.");
             }
-            
+
             try {
                 result = UniversalTimeScale.toLong(toMin, scale);
                 logln("toLong(toMin, " + scale + ") returned " + result);
             } catch (IllegalArgumentException iae) {
                 errln("toLong(toMin, " + scale + ") threw IllegalArgumentException.");
             }
-             
+
             if (toMin > Long.MIN_VALUE) {
                 try {
                     result = UniversalTimeScale.toLong(toMin - 1, scale);
@@ -336,14 +339,14 @@ public class TimeScaleAPITest extends TestFmwk
                     logln("PASS: UniversalTimeScale.toLong failed as expected");
                 }
             }
-             
+
             try {
                 result = UniversalTimeScale.toLong(toMax, scale);
                 logln("toLong(toMax, " + scale + ") returned " + result);
             } catch (IllegalArgumentException iae) {
                 errln("toLong(toMax, " + scale + ") threw IllegalArgumentException.");
             }
-              
+
             if (toMax < Long.MAX_VALUE) {
                 try {
                     result = UniversalTimeScale.toLong(toMax + 1, scale);
@@ -353,7 +356,7 @@ public class TimeScaleAPITest extends TestFmwk
                }
             }
        }
-        
+
         try {
             result = UniversalTimeScale.toLong(0L, UniversalTimeScale.MAX_SCALE);
             errln("toLong(0L, MAX_SCALE) did not throw IllegalArgumetException.");
index dc6d12dc6a41d498f4f512f8b74f037c2a24b747..de8d697c4aa3cfc3a6227749e46491acc782b2f4 100644 (file)
@@ -14,6 +14,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.GregorianCalendar;
@@ -27,6 +29,7 @@ import com.ibm.icu.util.UniversalTimeScale;
  * TODO To change the template for this generated type comment go to
  * Window - Preferences - Java - Code Style - Code Templates
  */
+@RunWith(JUnit4.class)
 public class TimeScaleDataTest extends TestFmwk
 {
 
@@ -36,63 +39,63 @@ public class TimeScaleDataTest extends TestFmwk
     public TimeScaleDataTest()
     {
     }
-    
+
     private void roundTripTest(long value, int scale)
     {
         long rt = UniversalTimeScale.toLong(UniversalTimeScale.from(value, scale), scale);
-        
+
         if (rt != value) {
             errln("Round-trip error: time scale = " + scale + ", value = " + value + ", round-trip = " + rt);
         }
     }
-    
+
     private void toLimitTest(long toLimit, long fromLimit, int scale)
     {
         long result = UniversalTimeScale.toLong(toLimit, scale);
-        
+
         if (result != fromLimit) {
             errln("toLimit failure: scale = " + scale + ", toLimit = " + toLimit +
                   ", toLong(toLimit, scale) = " + result + ", fromLimit = " + fromLimit);
         }
     }
-    
+
     private void epochOffsetTest(long epochOffset, long units, int scale)
     {
         long universalEpoch = epochOffset * units;
         long local = UniversalTimeScale.toLong(universalEpoch, scale);
-        
+
         if (local != 0) {
             errln("toLong(epochOffset, scale): scale = " + scale + ", epochOffset = " + universalEpoch +
                   ", result = " + local);
         }
-        
+
         local = UniversalTimeScale.toLong(0, scale);
-        
+
         if (local != -epochOffset) {
             errln("toLong(0, scale): scale = " + scale + ", result = " + local);
         }
-        
+
         long universal = UniversalTimeScale.from(-epochOffset, scale);
-        
+
         if (universal != 0) {
             errln("from(-epochOffest, scale): scale = " + scale + ", epochOffset = " + epochOffset +
                   ", result = " + universal);
         }
-        
+
         universal = UniversalTimeScale.from(0, scale);
-        
+
         if (universal != universalEpoch) {
             errln("from(0, scale): scale = " + scale + ", result = " + universal);
         }
     }
-    
+
     @Test
     public void TestEpochOffsets()
     {
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             long units       = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.UNITS_VALUE);
             long epochOffset = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.EPOCH_OFFSET_VALUE);
-            
+
             epochOffsetTest(epochOffset, units, scale);
         }
     }
@@ -103,12 +106,12 @@ public class TimeScaleDataTest extends TestFmwk
         for (int scale = 0; scale < UniversalTimeScale.MAX_SCALE; scale += 1) {
             long fromMin = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.FROM_MIN_VALUE);
             long fromMax = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.FROM_MAX_VALUE);
-            
+
             roundTripTest(fromMin, scale);
             roundTripTest(fromMax, scale);
         }
     }
-    
+
     @Test
     public void TestToLimits()
     {
@@ -117,7 +120,7 @@ public class TimeScaleDataTest extends TestFmwk
             long fromMax = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.FROM_MAX_VALUE);
             long toMin   = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.TO_MIN_VALUE);
             long toMax   = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.TO_MAX_VALUE);
-            
+
             toLimitTest(toMin, fromMin, scale);
             toLimitTest(toMax, fromMax, scale);
        }
index 4191012332c371c99119f67d50727823941322d3..5f4b24152c50bc2984801c22b4f58e6b6dc29437 100644 (file)
@@ -13,6 +13,8 @@ package com.ibm.icu.dev.test.timescale;
 import java.util.Random;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.math.BigDecimal;
@@ -23,6 +25,7 @@ import com.ibm.icu.util.UniversalTimeScale;
  * generating ramdon values in range and making sure
  * that they round-trip correctly.
  */
+@RunWith(JUnit4.class)
 public class TimeScaleMonkeyTest extends TestFmwk
 {
 
@@ -32,54 +35,54 @@ public class TimeScaleMonkeyTest extends TestFmwk
     public TimeScaleMonkeyTest()
     {
     }
-    
+
     private static final int LOOP_COUNT = 1000;
     private static final BigDecimal longMax = new BigDecimal(Long.MAX_VALUE);
-    
+
     private Random ran = null;
-    
+
     private long ranInt;
     private long ranMin;
     private long ranMax;
-    
+
     private void initRandom(long min, long max)
     {
         BigDecimal interval = new BigDecimal(max).subtract(new BigDecimal(min));
-        
+
         ranMin = min;
         ranMax = max;
         ranInt = 0;
-        
+
         if (ran == null) {
             ran = createRandom();
         }
-        
+
         if (interval.compareTo(longMax) < 0) {
             ranInt = interval.longValue();
         }
     }
-    
+
     private final long randomInRange()
     {
         long value;
-        
+
         if (ranInt != 0) {
             value = ran.nextLong() % ranInt;
-            
+
             if (value < 0) {
                 value = -value;
             }
-            
+
             value += ranMin;
         } else {
             do {
                 value = ran.nextLong();
             } while (value < ranMin || value > ranMax);
         }
-        
+
         return value;
     }
-    
+
     @Test
     public void TestRoundTrip()
     {
@@ -87,18 +90,18 @@ public class TimeScaleMonkeyTest extends TestFmwk
             long fromMin = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.FROM_MIN_VALUE);
             long fromMax = UniversalTimeScale.getTimeScaleValue(scale, UniversalTimeScale.FROM_MAX_VALUE);
             int i = 0;
-            
+
             initRandom(fromMin, fromMax);
-            
+
             while (i < LOOP_COUNT) {
                 long value = randomInRange();
-                                
+
                 long rt = UniversalTimeScale.toLong(UniversalTimeScale.from(value, scale), scale);
-                
+
                 if (rt != value) {
                     errln("Round-trip error: time scale = " + scale + ", value = " + value + ", round-trip = " + rt);
                 }
-                
+
                 i += 1;
             }
         }
index 54bcb820f904e679a421a18f2ffad160e18a9b51..becd08fe0d6966914486c7b954a7fb10dfeedfb5 100644 (file)
@@ -25,6 +25,8 @@ import java.util.TreeSet;
 
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.TimeZone;
@@ -32,8 +34,9 @@ import com.ibm.icu.util.TimeZone;
 /**
  * Class for testing TimeZones for consistency
  * @author Davis
- * 
+ *
  */
+@RunWith(JUnit4.class)
 public class TimeZoneAliasTest extends TestFmwk {
     /**
      * There are two things to check aliases for:<br>
@@ -51,7 +54,7 @@ public class TimeZoneAliasTest extends TestFmwk {
             if (id.indexOf('/') < 0 && (id.endsWith("ST") || id.endsWith("DT"))) {
                 if (zone.minRecentOffset != zone.maxRecentOffset) {
                     errln(
-                        "Standard or Daylight Time not constant: " + id 
+                        "Standard or Daylight Time not constant: " + id
                         + ": " + Zone.formatHours(zone.minRecentOffset)
                         + " != " + Zone.formatHours(zone.maxRecentOffset));
                 }
@@ -69,7 +72,7 @@ public class TimeZoneAliasTest extends TestFmwk {
                     errln(
                         "Aliases Unsymmetric: "
                         + id + " => " + Zone.bf.join(aliasesSet)
-                        + "; " 
+                        + "; "
                         + otherId + " => " + Zone.bf.join(otherAliases));
                 }
                 if (zone.findOffsetOrdering(otherZone, seconds) != 0) {
@@ -79,7 +82,7 @@ public class TimeZoneAliasTest extends TestFmwk {
             }
         }
     }
-    
+
     /**
      * We check to see that every timezone that is not an alias is actually different!
      */
@@ -88,14 +91,14 @@ public class TimeZoneAliasTest extends TestFmwk {
     @Test
     public void TestDifferences() {
         Zone last = null;
-        Zone.Seconds diffDate = new Zone.Seconds();        
+        Zone.Seconds diffDate = new Zone.Seconds();
         for (Iterator it = Zone.getZoneSet().iterator(); it.hasNext();) {
             Zone testZone = (Zone)it.next();
             if (last != null) {
                 String common = testZone + "\tvs " + last + ":\t";
                 int diff = testZone.findOffsetOrdering(last, diffDate);
                 if (diff != 0) {
-                    logln("\t" + common + "difference at: " + diffDate 
+                    logln("\t" + common + "difference at: " + diffDate
                         + ", " + Zone.formatHours(diff) + "hr");
                 } else if (testZone.isRealAlias(last)) {
                     logln("\t" + common + "alias, no difference");
@@ -106,7 +109,7 @@ public class TimeZoneAliasTest extends TestFmwk {
             last = testZone;
         }
     }
-    
+
     /**
      * Utility for printing out zones to be translated.
      */
@@ -117,7 +120,7 @@ public class TimeZoneAliasTest extends TestFmwk {
             System.out.println(zone.toString(count++));
         }
     }
-    
+
     /** Utility; ought to be someplace common
      */
     // remove dependency on bagformatter for now
@@ -138,7 +141,7 @@ public class TimeZoneAliasTest extends TestFmwk {
         }
     }
 
-        
+
     /**
      * The guts is in this subclass. It sucks in all the data from the zones,
      * and analyses it. It constructs some mappings for the unique ids,
@@ -165,7 +168,7 @@ public class TimeZoneAliasTest extends TestFmwk {
         static private final long endDate2 = getDate((currentYear+1),6,1).getTime();
         static private final long recentLimit = getDate((currentYear-1),6,1).getTime();
         static private final long startDate = getDate(1905,0,1).getTime();
-        
+
         static private final Map idToZone = new HashMap();
         static private final Set zoneSet = new TreeSet();
         static private final Set uniqueZoneSet = new TreeSet();
@@ -179,7 +182,7 @@ public class TimeZoneAliasTest extends TestFmwk {
             }
             Zone last = null;
             Zone.Seconds diffDate = new Zone.Seconds();
-            String lastUnique = "";      
+            String lastUnique = "";
             for (Iterator it = Zone.getZoneSet().iterator(); it.hasNext();) {
                 Zone testZone = (Zone)it.next();
                 if (last == null) {
@@ -202,11 +205,11 @@ public class TimeZoneAliasTest extends TestFmwk {
                 last = testZone;
             }
         }
-        
+
         static public Set getZoneSet() {
             return zoneSet;
         }
-        
+
         public static Set getUniqueZoneSet() {
             return uniqueZoneSet;
         }
@@ -218,20 +221,21 @@ public class TimeZoneAliasTest extends TestFmwk {
             idToZone.put(id, result);
             return result;
         }
-        
+
         static public String formatHours(int hours) {
             return nf.format(hours/DHOUR);
         }
-        
+
         // utility class for date return, because Date is clunky.
         public static class Seconds {
             public long seconds = Long.MIN_VALUE;
+            @Override
             public String toString() {
                 if (seconds == Long.MIN_VALUE) return "n/a";
                 return df.format(new Date(seconds));
             }
         }
-        
+
         // instance fields
         // we keep min/max offsets not only over all time (that we care about)
         // but also separate ones for recent years.
@@ -244,11 +248,11 @@ public class TimeZoneAliasTest extends TestFmwk {
         private int maxRecentOffset;
         private List inflectionPoints = new ArrayList();
         private Set purportedAliases = new TreeSet();
-    
+
         private Zone(String id) { // for interal use only; use make instead!
             zone = TimeZone.getTimeZone(id);
             this.id = id;
-            
+
             // get aliases
             int equivCount = TimeZone.countEquivalentIDs(id);
             for (int j = 0; j < equivCount; ++j) {
@@ -265,7 +269,7 @@ public class TimeZoneAliasTest extends TestFmwk {
             inflectionPoints.add(new Long(lastDate));
             int lastOffset = zone.getOffset(endDate);
             long lastInflection = endDate;
-            
+
             // we do a gross search, then narrow in when we find a difference from the last one
             for (long currentDate = endDate; currentDate >= startDate; currentDate -= GROSS_PERIOD) {
                 int currentOffset = zone.getOffset(currentDate);
@@ -294,7 +298,7 @@ public class TimeZoneAliasTest extends TestFmwk {
             }
             inflectionPoints.add(new Long(startDate)); // just to cap it off for comparisons.
         }
-        
+
         // we assume that places will not convert time zones then back within one day
         // so we go first by half
         public int findOffsetOrdering(Zone other, Seconds dateDiffFound) {
@@ -317,14 +321,14 @@ public class TimeZoneAliasTest extends TestFmwk {
                     if (result != 0) {
                         seconds = myIP;
                         break main;
-                    } 
+                    }
                     if (myIP == otherIP) continue; // test other if different
                     myIP = otherIP;
                     result = zone.getOffset(myIP) - other.zone.getOffset(myIP);
                     if (result != 0) {
                         seconds = myIP;
                         break main;
-                    } 
+                    }
                 }
                 // if they are equal so far, we don't care about the rest
                 result = 0;
@@ -335,10 +339,11 @@ public class TimeZoneAliasTest extends TestFmwk {
             if (dateDiffFound != null) dateDiffFound.seconds = seconds;
             return result;
         }
-        
+
         // internal buffer to avoid creation all the time.
         private Seconds diffDateReturn = new Seconds();
-        
+
+        @Override
         public int compareTo(Object o) {
             Zone other = (Zone)o;
             // first order by max and min offsets
@@ -358,55 +363,56 @@ public class TimeZoneAliasTest extends TestFmwk {
             }
             return id.compareTo(other.id);
         }
-        
+
         public Set getPurportedAliases() {
             return new TreeSet(purportedAliases); // clone for safety
         }
-        
+
         public boolean isPurportedAlias(String zoneID) {
             return purportedAliases.contains(zoneID);
         }
-        
+
         public boolean isRealAlias(Zone z) {
             return purportedAliases.contains(z.id);
         }
-        
+
         public String getPurportedAliasesAsString() {
             Set s = getPurportedAliases();
             if (s.size() == 0) return "";
             return " " + bf.join(s);
         }
-        
+
         public String getRealAliasesAsString() {
             Set s = (Set)idToRealAliases.get(id);
             if (s == null) return "";
             return " *" + bf.join(s);
         }
-        
+
         public String getCity() {
             int pos = id.lastIndexOf(('/'));
             String city = id.substring(pos+1);
             return city.replace('_',' ');
         }
 
+        @Override
         public String toString() {
             return toString(-1);
         }
-        
+
         /**
          * Where count > 0, returns string that is set up for translation
          */
         public String toString(int count) {
             String city = getCity();
             String hours = formatHours(minRecentOffset)
-                + (minRecentOffset != maxRecentOffset 
-                    ? "," + formatHours(maxRecentOffset) 
+                + (minRecentOffset != maxRecentOffset
+                    ? "," + formatHours(maxRecentOffset)
                     : "");
             if (count < 0) {
                 return id + getPurportedAliasesAsString() + " (" + hours + ")";
-            } 
+            }
             // for getting template for translation
-            return "\t{\t\"" + id + "\"\t// [" + count + "] " + hours 
+            return "\t{\t\"" + id + "\"\t// [" + count + "] " + hours
                 + getRealAliasesAsString() + "\r\n"
                 + "\t\t// translate the following!!\r\n"
                 + (minRecentOffset != maxRecentOffset
index 106126d9bd4f1cf4000f4e3b4ea6c1b3b406ff7b..a5fa09dc98dd1b81e8b8e292050a6768ae05cb63 100644 (file)
@@ -10,6 +10,8 @@ package com.ibm.icu.dev.test.timezone;
 import java.util.Date;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -23,6 +25,7 @@ import com.ibm.icu.util.TimeZone;
  * A test which discovers the boundaries of DST programmatically and verifies
  * that they are correct.
  */
+@RunWith(JUnit4.class)
 public class TimeZoneBoundaryTest extends TestFmwk
 {
     static final int ONE_SECOND = 1000;
@@ -181,7 +184,7 @@ public class TimeZoneBoundaryTest extends TestFmwk
         logln(tz.getID() + " After:  " + showDate(max, tz));
 
         long mindelta = expectedBoundary - min;
-        // not used long maxdelta = max - expectedBoundary; 
+        // not used long maxdelta = max - expectedBoundary;
         DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
         fmt.setTimeZone(tz);
         if (mindelta >= 0 && mindelta <= INTERVAL &&
@@ -200,10 +203,10 @@ public class TimeZoneBoundaryTest extends TestFmwk
     {
         java.util.Calendar cal = java.util.Calendar.getInstance();
         cal.setTime(d);
-        return "" + (cal.get(Calendar.YEAR) - 1900) + "/" + 
-               showNN(cal.get(Calendar.MONTH) + 1) + "/" + 
-               showNN(cal.get(Calendar.DAY_OF_MONTH)) + " " + 
-               showNN(cal.get(Calendar.HOUR_OF_DAY)) + ":" 
+        return "" + (cal.get(Calendar.YEAR) - 1900) + "/" +
+               showNN(cal.get(Calendar.MONTH) + 1) + "/" +
+               showNN(cal.get(Calendar.DAY_OF_MONTH)) + " " +
+               showNN(cal.get(Calendar.HOUR_OF_DAY)) + ":"
                + showNN(cal.get(Calendar.MINUTE)) + " \"" + d + "\" = " +
                d.getTime();
     }
@@ -219,10 +222,10 @@ public class TimeZoneBoundaryTest extends TestFmwk
         fmt.setTimeZone(zone);
         java.util.Calendar cal = java.util.Calendar.getInstance();
         cal.setTime(d);
-        return "" + (cal.get(Calendar.YEAR) - 1900) + "/" + 
-               showNN(cal.get(Calendar.MONTH) + 1) + "/" + 
-               showNN(cal.get(Calendar.DAY_OF_MONTH)) + " " + 
-               showNN(cal.get(Calendar.HOUR_OF_DAY)) + ":" + 
+        return "" + (cal.get(Calendar.YEAR) - 1900) + "/" +
+               showNN(cal.get(Calendar.MONTH) + 1) + "/" +
+               showNN(cal.get(Calendar.DAY_OF_MONTH)) + " " +
+               showNN(cal.get(Calendar.HOUR_OF_DAY)) + ":" +
                showNN(cal.get(Calendar.MINUTE)) + " \"" + d + "\" = " +
                fmt.format(d) + " = " + d.getTime();
     }
@@ -397,7 +400,7 @@ public class TimeZoneBoundaryTest extends TestFmwk
         verifyMapping(tempcal, 1997, Calendar.APRIL, 6,  0, 238976.0);
         verifyMapping(tempcal, 1997, Calendar.APRIL, 6,  1, 238977.0);
         verifyMapping(tempcal, 1997, Calendar.APRIL, 6,  3, 238978.0);
-        
+
         TimeZone utc = safeGetTimeZone("UTC");
         Calendar utccal = Calendar.getInstance(utc);
         verifyMapping(utccal, 1997, Calendar.APRIL, 6, 0, 238968.0);
index 08b5c3244661d3aa79e8728ed4e325688712f7af..05c4c9b2dba4d302d4af847f5bc6e7bb3a123eb1 100644 (file)
@@ -11,6 +11,8 @@ package com.ibm.icu.dev.test.timezone;
 import java.util.Date;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
@@ -27,6 +29,7 @@ import com.ibm.icu.util.TimeZone;
 /**
  * Testing getOffset APIs using local time
  */
+@RunWith(JUnit4.class)
 public class TimeZoneOffsetLocalTest extends TestFmwk {
     /*
      * Testing getOffset APIs around rule transition by local standard/wall time.
@@ -66,7 +69,7 @@ public class TimeZoneOffsetLocalTest extends TestFmwk {
             -8*HOUR,
         };
 
-        
+
         // Expected offsets by getOffset(long time, boolean local, int[] offsets) with local = true
         // or getOffsetFromLocal(long time, int nonExistingTimeOpt, int duplicatedTimeOpt, int[] offsets)
         // with nonExistingTimeOpt = LOCAL_STD/duplicatedTimeOpt = LOCAL_STD
index 2e9acb91f4557c99c7841a6062e89e333f1055bd..d14334006155bd31f4f4a433eac3e0168d3d6f8d 100644 (file)
@@ -24,6 +24,8 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.DateFormat;
@@ -34,6 +36,7 @@ import com.ibm.icu.util.SimpleTimeZone;
 import com.ibm.icu.util.TimeZone;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class TimeZoneRegressionTest extends TestFmwk {
     @Test
     public void Test4052967() {
@@ -77,7 +80,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
         Date d1 = tempcal.getTime();
         if (z.inDaylightTime(d1)) {
             errln("Fail: DST not working as expected");
-        } 
+        }
 
         tempcal.set(1997, Calendar.MARCH, 1);
         Date d2 = tempcal.getTime();
@@ -89,7 +92,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
         Date d3 = tempcal.getTime();
         if (z.inDaylightTime(d3)) {
             errln("Fail: DST not working as expected");
-        } 
+        }
     }
 
     /**
@@ -712,7 +715,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
     public void Test4162593() {
         SimpleDateFormat fmt = new SimpleDateFormat("z", Locale.US);
         final int ONE_HOUR = 60*60*1000;
-        final float H = (float) ONE_HOUR;
+        final float H = ONE_HOUR;
         TimeZone initialZone = TimeZone.getDefault();
         SimpleDateFormat sdf = new SimpleDateFormat("MMM dd yyyy HH:mm z");
 
@@ -903,7 +906,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
      */
     // Current orgnaization of data in zoneinfor.res allows negative
     // values from DOM so comment these tests out
-    
+
     @Test
     public void Test4184229() {
         SimpleTimeZone zone = null;
@@ -934,7 +937,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
         // Make a valid constructor call for subsequent tests.
 
         zone = new SimpleTimeZone(0, "A", 0, 1, 0, 0, 0, 1, 0, 0);
-        
+
         try {
             zone.setStartRule(0, -1, 0, 0);
             errln("Failed. No exception has been thrown for DOM -1 setStartRule +savings");
@@ -959,7 +962,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
         } catch(IllegalArgumentException e) {
             logln("(h) " + e.getMessage());
         }
-        
+
     }
 
     /**
@@ -1039,7 +1042,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
     @Test
     public void TestJ5134() {
         GregorianCalendar testCal = (GregorianCalendar)Calendar.getInstance();
-        TimeZone icuEastern = TimeZone.getTimeZone("America/New_York");        
+        TimeZone icuEastern = TimeZone.getTimeZone("America/New_York");
         testCal.setTimeZone(icuEastern);
         testCal.set(1900, Calendar.JANUARY, 1, 0, 0, 0);
         long time = testCal.getTimeInMillis();
@@ -1168,7 +1171,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
                     + tzid + ") [13-arg constructor]");
         }
     }
-    
+
     // test bug #4265
     @Test
     public void TestJohannesburg() {
@@ -1176,8 +1179,8 @@ public class TimeZoneRegressionTest extends TestFmwk {
         TimeZone johannesburg = TimeZone.getTimeZone(j_id);
         final int ONE_HOUR = 60*60*1000;
         int expectedOffset = ONE_HOUR*2;  // GMT+2 - NO DST
-        int offset = johannesburg.getOffset(GregorianCalendar.AD,2007,Calendar.JULY,5,Calendar.THURSDAY,0);        
-        
+        int offset = johannesburg.getOffset(GregorianCalendar.AD,2007,Calendar.JULY,5,Calendar.THURSDAY,0);
+
         if(offset != expectedOffset) {
             errln("FAIL: zone " + j_id +" returned offset in July " + offset +", expected "+expectedOffset);
         } else {
@@ -1198,6 +1201,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
         Thread[] workers = new Thread[20];
         for (int i = 0 ; i < workers.length; i++) {
             workers[i] = new Thread(new Runnable() {
+                @Override
                 public void run() {
                     for (int j = 0; j < 10000; j++) {
                         try {
@@ -1216,7 +1220,7 @@ public class TimeZoneRegressionTest extends TestFmwk {
             try {
                 wk.join();
             } catch (InterruptedException ie) {
-                
+
             }
         }
     }
index aee97ac18f653119993a34bbf4ee90f143034846..70f5d902cd44cb2d0a72d5cdd4d365cb8eb18f3f 100644 (file)
@@ -18,6 +18,8 @@ import java.io.StringWriter;
 import java.util.Date;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.AnnualTimeZoneRule;
@@ -38,6 +40,7 @@ import com.ibm.icu.util.VTimeZone;
 /**
  * Test cases for TimeZoneRule and RuleBasedTimeZone
  */
+@RunWith(JUnit4.class)
 public class TimeZoneRuleTest extends TestFmwk {
 
     private static final int HOUR = 60 * 60 * 1000;
@@ -61,7 +64,7 @@ public class TimeZoneRuleTest extends TestFmwk {
                 "RBTZ_Initial", // Initial time Name
                 -1*HOUR,        // Raw offset
                 1*HOUR);        // DST saving amount
-        
+
         // RBTZ
         RuleBasedTimeZone rbtz1 = new RuleBasedTimeZone("RBTZ1", ir);
         dtr = new DateTimeRule(Calendar.SEPTEMBER, 30, Calendar.SATURDAY, false,
@@ -151,7 +154,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         if (offsets[0] != -3600000) {
             errln("FAIL: Invalid time zone raw offset: " + offsets[0] + " /expected: -3600000");
         }
-        if (offsets[1] != 3600000) {            
+        if (offsets[1] != 3600000) {
             errln("FAIL: Invalid DST amount: " + offsets[1] + " /expected: 3600000");
         }
 
@@ -172,7 +175,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         if (offsets[0] != -3600000) {
             errln("FAIL: Invalid time zone raw offset: " + offsets[0] + " /expected: -3600000");
         }
-        if (offsets[1] != 0) {            
+        if (offsets[1] != 0) {
             errln("FAIL: Invalid DST amount: " + offsets[1] + " /expected: 0");
         }
 
@@ -240,7 +243,7 @@ public class TimeZoneRuleTest extends TestFmwk {
                 2*HOUR, DateTimeRule.WALL_TIME);    // January 6, at 2AM wall time
         tzr = new AnnualTimeZoneRule("EDT", -5*HOUR, 1*HOUR, dtr, 1974, 1974);
         rbtz.addTransitionRule(tzr);
-        
+
         dtr = new DateTimeRule(Calendar.FEBRUARY, 23,
                 2*HOUR, DateTimeRule.WALL_TIME);    // February 23, at 2AM wall time
         tzr = new AnnualTimeZoneRule("EDT", -5*HOUR, 1*HOUR, dtr, 1975, 1975);
@@ -264,7 +267,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         // hasEquivalentTransitions
         long jan1_1950 = getUTCMillis(1950, Calendar.JANUARY, 1);
         long jan1_1967 = getUTCMillis(1971, Calendar.JANUARY, 1);
-        long jan1_2010 = getUTCMillis(2010, Calendar.JANUARY, 1);        
+        long jan1_2010 = getUTCMillis(2010, Calendar.JANUARY, 1);
 
         if (!(((BasicTimeZone)ny).hasEquivalentTransitions(rbtz, jan1_1967, jan1_2010))) {
             errln("FAIL: The RBTZ must be equivalent to America/New_York between 1967 and 2010");
@@ -379,7 +382,7 @@ public class TimeZoneRuleTest extends TestFmwk {
                 // Descending/inclusive
                 compareTransitionsDescending(tz, rbtz, startTime + 1, until, true);
             }
-            
+
         }
     }
 
@@ -399,7 +402,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         long jan1_2006 = getUTCMillis(2006, Calendar.JANUARY, 1);
         long jan1_2007 = getUTCMillis(2007, Calendar.JANUARY, 1);
         long jan1_2011 = getUTCMillis(2010, Calendar.JANUARY, 1);
-        
+
         if (((BasicTimeZone)newyork).hasEquivalentTransitions(indianapolis, jan1_2005, jan1_2011)) {
             errln("FAIL: New_York is not equivalent to Indianapolis between 2005 and 2010, but returned true");
         }
@@ -690,7 +693,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         } catch (IOException ioe) {
             errln("FAIL: IO error while writing/reading VTIMEZONE data");
         }
-        
+
     }
 
     /*
@@ -743,7 +746,7 @@ public class TimeZoneRuleTest extends TestFmwk {
     }
 
     /*
-     * API coverage tests for TimeZoneRule 
+     * API coverage tests for TimeZoneRule
      */
     @Test
     public void TestTimeZoneRuleCoverage() {
@@ -766,11 +769,11 @@ public class TimeZoneRuleTest extends TestFmwk {
                 2000, AnnualTimeZoneRule.MAX_YEAR);
         AnnualTimeZoneRule a3 = new AnnualTimeZoneRule("a3", -3*HOUR, 1*HOUR, dtr1,
                 2000, 2010);
-        
+
         InitialTimeZoneRule i1 = new InitialTimeZoneRule("i1", -3*HOUR, 0);
         InitialTimeZoneRule i2 = new InitialTimeZoneRule("i2", -3*HOUR, 0);
         InitialTimeZoneRule i3 = new InitialTimeZoneRule("i3", -3*HOUR, 1*HOUR);
-        
+
         long[] emptytimes = {};
         long[] trtimes1 = {0};
         long[] trtimes2 = {0, 10000000};
@@ -787,7 +790,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         if (t0 != null) {
             errln("FAIL: TimeArrayTimeZoneRule constructor did not throw IllegalArgumentException for null times");
         }
-        
+
         try {
             // Try to construct TimeArrayTimeZoneRule with empty transition times
             t0 = new TimeArrayTimeZoneRule("nulltimes", -3*HOUR, 0,
@@ -810,7 +813,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         if (!a1.getRule().equals(a2.getRule())) {
             errln("FAIL: The same DateTimeRule must be returned from AnnualTimeZoneRule a1 and a2");
         }
-    
+
         // AnnualTimeZoneRule#getStartYear
         int startYear = a1.getStartYear();
         if (startYear != 2000) {
@@ -826,7 +829,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         if (endYear != 2010) {
             errln("FAIL: The start year of AnnualTimeZoneRule a3 must be 2010 - returned: " + endYear);
         }
-        
+
         // AnnualTimeZone#getStartInYear
         Date d1 = a1.getStartInYear(2005, -3*HOUR, 0);
         Date d2 = a3.getStartInYear(2005, -3*HOUR, 0);
@@ -950,8 +953,8 @@ public class TimeZoneRuleTest extends TestFmwk {
         } else {
             logln("InitialTimeZoneRule i1 : " + str);
         }
-        
-        
+
+
         // TimeArrayTimeZoneRule#getStartTimes
         long[] times = t1.getStartTimes();
         if (times == null || times.length == 0 || times[0] != 0) {
@@ -1123,7 +1126,7 @@ public class TimeZoneRuleTest extends TestFmwk {
             errln("FAIL: Bad transition returned by SimpleTimeZone#getNextTransition");
         }
     }
-    
+
     /*
      * API coverage test for VTimeZone
      */
@@ -1229,7 +1232,7 @@ public class TimeZoneRuleTest extends TestFmwk {
         if (rulesetAll.length < ruleset1.length || ruleset1.length < ruleset2.length) {
             errln("FAIL: Number of rules returned by getRules is invalid");
         }
-        
+
         int[] offsets_vtzc = new int[2];
         VTimeZone vtzc = VTimeZone.create("PST");
         vtzc.getOffsetFromLocal(Calendar.getInstance(vtzc).getTimeInMillis(), VTimeZone.LOCAL_STD, VTimeZone.LOCAL_STD, offsets_vtzc);
@@ -1271,10 +1274,10 @@ public class TimeZoneRuleTest extends TestFmwk {
             if (offsets[0] != 9*HOUR || offsets[1] != 0) {
                 errln("FAIL: Bad offsets returned by a VTimeZone created for Tokyo");
             }
-        }        
+        }
 
         // Create VTimeZone from VTIMEZONE data
-        String fooData = 
+        String fooData =
             "BEGIN:VCALENDAR\r\n" +
             "BEGIN:VTIMEZONE\r\n" +
             "TZID:FOO\r\n" +
@@ -1353,7 +1356,7 @@ public class TimeZoneRuleTest extends TestFmwk {
             "END:VCALENDAR";
 
         // Single final rule, no overlapping with another
-        String finalNonOverlap = 
+        String finalNonOverlap =
             "BEGIN:VCALENDAR\r\n" +
             "BEGIN:VTIMEZONE\r\n" +
             "TZID:FinalNonOverlap\r\n" +
@@ -1458,7 +1461,7 @@ public class TimeZoneRuleTest extends TestFmwk {
                     + tzt.getTime() + " Expected: " + expectedPrev);
         }
     }
-    
+
     @Test
     public void TestBasicTimeZoneCoverage() {
         TimeZone tz = TimeZone.getTimeZone("PST");
@@ -1511,7 +1514,7 @@ public class TimeZoneRuleTest extends TestFmwk {
                     (tzt0.getTo().getRawOffset() != tzt.getFrom().getRawOffset()
                     || tzt0.getTo().getDSTSavings() != tzt.getFrom().getDSTSavings())) {
                 errln("FAIL: TO rule of the previous transition does not match FROM rule of this transtion at "
-                        + time + " for " + icutz.getID());                
+                        + time + " for " + icutz.getID());
             }
             tzt0 = tzt;
         }
@@ -1539,7 +1542,7 @@ public class TimeZoneRuleTest extends TestFmwk {
                     (tzt0.getFrom().getRawOffset() != tzt.getTo().getRawOffset()
                     || tzt0.getFrom().getDSTSavings() != tzt.getTo().getDSTSavings())) {
                 errln("FAIL: TO rule of the next transition does not match FROM rule in this transtion at "
-                        + time + " for " + icutz.getID());                
+                        + time + " for " + icutz.getID());
             }
             tzt0 = tzt;
         }
@@ -1710,7 +1713,7 @@ public class TimeZoneRuleTest extends TestFmwk {
      * delta range.
      */
     private static boolean hasEquivalentTransitions(BasicTimeZone tz1, BasicTimeZone tz2,
-                                            long start, long end, 
+                                            long start, long end,
                                             boolean ignoreDstAmount, int maxTransitionTimeDelta) {
         if (tz1.hasSameRules(tz2)) {
             return true;
index ac018375bd22776886316542d21f954a382dfdcc..2508908013382cce07e4e676d7327c862fc21e33 100644 (file)
@@ -22,6 +22,8 @@ import java.util.Locale;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUData;
@@ -49,6 +51,7 @@ import com.ibm.icu.util.VersionInfo;
  * @summary test TimeZone
  * @build TimeZoneTest
  */
+@RunWith(JUnit4.class)
 public class TimeZoneTest extends TestFmwk
 {
     static final int millisPerHour = 3600000;
@@ -70,7 +73,7 @@ public class TimeZoneTest extends TestFmwk
      *
      * Bug 4130885
      * Certain short zone IDs, used since 1.1.x, are incorrect.
-     *  
+     *
      * The worst of these is:
      *
      * "CAT" (Central African Time) should be GMT+2:00, but instead returns a
@@ -226,6 +229,7 @@ public class TimeZoneTest extends TestFmwk
 
         public String getID() { return id; }
 
+        @Override
         public boolean equals(Object o) {
             ZoneDescriptor that = (ZoneDescriptor)o;
             return that != null &&
@@ -234,6 +238,7 @@ public class TimeZoneTest extends TestFmwk
                 daylight == that.daylight;
         }
 
+        @Override
         public String toString() {
             int min = offset;
             char sign = '+';
@@ -343,7 +348,7 @@ public class TimeZoneTest extends TestFmwk
         // THE FOLLOWING LINES MUST BE UPDATED IF THE LOCALE DATA CHANGES
         //*****************************************************************
 
-        // Test to allow the user to choose to get all the forms 
+        // Test to allow the user to choose to get all the forms
         // (z, zzzz, Z, ZZZZ, v, vvvv)
         // todo: check to see whether we can test for all of pst, pdt, pt
         Object[] DATA = {
@@ -356,7 +361,7 @@ public class TimeZoneTest extends TestFmwk
             Boolean.FALSE, new Integer(TimeZone.SHORT_GENERIC), "PT",
             Boolean.TRUE,  new Integer(TimeZone.SHORT_GENERIC), "PT",
             Boolean.FALSE, new Integer(TimeZone.LONG_GENERIC),  "Pacific Time",
-            Boolean.TRUE,  new Integer(TimeZone.LONG_GENERIC),  "Pacific Time",  
+            Boolean.TRUE,  new Integer(TimeZone.LONG_GENERIC),  "Pacific Time",
             // z and ZZZZ
             Boolean.FALSE, new Integer(TimeZone.SHORT_GMT), "-0800",
             Boolean.TRUE,  new Integer(TimeZone.SHORT_GMT), "-0700",
@@ -405,7 +410,7 @@ public class TimeZoneTest extends TestFmwk
         // If not, we expect the en fallback behavior.
 
         // in icu4j 2.1 we know we have the zh_CN locale data, though it's incomplete
-//    /"DateFormatZoneData", 
+//    /"DateFormatZoneData",
         UResourceBundle enRB = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,Locale.ENGLISH);
         UResourceBundle mtRB = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, mt_MT);
         boolean noZH = enRB == mtRB;
@@ -415,7 +420,7 @@ public class TimeZoneTest extends TestFmwk
             if (!name.equals("Pacific Standard Time"))
                 errln("Fail: Expected Pacific Standard Time for PST in mt_MT but got ");
         }
-        // dlf - we will use generic time, or if unavailable, GMT for standard time in the zone 
+        // dlf - we will use generic time, or if unavailable, GMT for standard time in the zone
         //     - we now (3.4.1) have localizations for this zone, so change test string
         else if(!name.equals("\u0126in ta\u2019 Los Angeles") &&
             !name.equals("GMT-08:00") &&
@@ -428,7 +433,7 @@ public class TimeZoneTest extends TestFmwk
                   "THE ABOVE FAILURE MAY JUST MEAN THE LOCALE DATA HAS CHANGED\n" +
                   "************************************************************");
         }
-        
+
         // Now try a non-existent zone
         zone2 = new SimpleTimeZone(90*60*1000, "xyzzy");
         name = zone2.getDisplayName(Locale.ENGLISH);
@@ -438,7 +443,7 @@ public class TimeZoneTest extends TestFmwk
             !name.equals("GMT+0130") &&
             !name.equals("GMT+130"))
             errln("Fail: Expected GMT+01:30 or something similar");
-        
+
         // cover getDisplayName() - null arg
         ULocale save = ULocale.getDefault();
         ULocale.setDefault(ULocale.US);
@@ -448,9 +453,9 @@ public class TimeZoneTest extends TestFmwk
             !name.equals("GMT+1:30") &&
             !name.equals("GMT+0130") &&
             !name.equals("GMT+130"))
-            errln("Fail: Expected GMT+01:30 or something similar");        
+            errln("Fail: Expected GMT+01:30 or something similar");
         ULocale.setDefault(save);
+
     }
 
 
@@ -479,7 +484,7 @@ public class TimeZoneTest extends TestFmwk
                         displayName0 = tz.getDisplayName(true, TimeZone.LONG_GENERIC, locale);
                     }
                     if (!displayName1.equals(displayName0)) {
-                        errln(locale.getDisplayName() + ", " + tz.getID() + 
+                        errln(locale.getDisplayName() + ", " + tz.getID() +
                                 ": expected " + displayName1 + " but got: " + displayName0);
                     }
                 }
@@ -1084,7 +1089,7 @@ public class TimeZoneTest extends TestFmwk
             // hack so test compiles and runs in both JDK 1.3 and JDK 1.4
             final Object[] args = new Object[0];
             final Class[] argtypes = new Class[0];
-            java.lang.reflect.Method m = tz_java.getClass().getMethod("getDSTSavings", argtypes); 
+            java.lang.reflect.Method m = tz_java.getClass().getMethod("getDSTSavings", argtypes);
             dst_java = ((Integer) m.invoke(tz_java, args)).intValue();
             if (dst_java <= 0 || dst_java >= 3600000) { // didn't get the fractional time zone we wanted
             errln("didn't get fractional time zone!");
@@ -1104,13 +1109,13 @@ public class TimeZoneTest extends TestFmwk
             warnln(e.getMessage());
             return;
         }
-        
+
         com.ibm.icu.util.TimeZone tz_icu = com.ibm.icu.util.TimeZone.getTimeZone(tzName);
         int dst_icu = tz_icu.getDSTSavings();
 
         if (dst_java != dst_icu) {
             warnln("java reports dst savings of " + dst_java +
-              " but icu reports " + dst_icu + 
+              " but icu reports " + dst_icu +
               " for tz " + tz_icu.getID());
         } else {
             logln("both java and icu report dst savings of " + dst_java + " for tz " + tz_icu.getID());
@@ -1139,7 +1144,7 @@ public class TimeZoneTest extends TestFmwk
 
     // jb4484
     @Test
-    public void TestSimpleTimeZoneSerialization() 
+    public void TestSimpleTimeZoneSerialization()
     {
         SimpleTimeZone stz0 = new SimpleTimeZone(32400000, "MyTimeZone");
         SimpleTimeZone stz1 = new SimpleTimeZone(32400000, "Asia/Tokyo");
@@ -1155,7 +1160,7 @@ public class TimeZoneTest extends TestFmwk
         SimpleTimeZone stz5 = new SimpleTimeZone(32400000, "Asia/Tokyo");
         stz5.setStartRule(2, 3, 4, 360000);
         stz5.setEndRule(6, 3, 4, 360000);
-        
+
         SimpleTimeZone[] stzs = { stz0, stz1, stz2, stz3, stz4, stz5, };
 
         for (int i = 0; i < stzs.length; ++i) {
@@ -1355,7 +1360,7 @@ public class TimeZoneTest extends TestFmwk
             }
         }
     }
-    
+
     @Test
     public void TestCoverage(){
         class StubTimeZone extends TimeZone{
@@ -1363,12 +1368,17 @@ public class TimeZoneTest extends TestFmwk
              * For serialization
              */
             private static final long serialVersionUID = 8658654217433379343L;
+            @Override
             public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) {return 0;}
+            @Override
             public void setRawOffset(int offsetMillis) {}
+            @Override
             public int getRawOffset() {return 0;}
+            @Override
             public boolean useDaylightTime() {return false;}
+            @Override
             public boolean inDaylightTime(Date date) {return false;}
-        } 
+        }
         StubTimeZone stub = new StubTimeZone();
         StubTimeZone stub2 = (StubTimeZone) stub.clone();
         if (stub.getDSTSavings() != 0){
@@ -1376,7 +1386,7 @@ public class TimeZoneTest extends TestFmwk
         }
         if (!stub.hasSameRules(stub2)){
             errln("TimeZone.clone() object should hasSameRules");
-     
+
         }
     }
     @Test
@@ -1964,7 +1974,7 @@ public class TimeZoneTest extends TestFmwk
             }
 
             // cloneAsThawed
-            TimeZone thawed = (TimeZone)thawedZones[i].cloneAsThawed();
+            TimeZone thawed = thawedZones[i].cloneAsThawed();
             if (thawed.isFrozen() || !thawedZones[i].equals(thawed)) {
                 errln("Fail: " + zaName + "[" + i + "] - cloneAsThawed does not work.");
             }
@@ -2071,7 +2081,7 @@ public class TimeZoneTest extends TestFmwk
             }
 
             // cloneAsThawed
-            TimeZone thawed = (TimeZone)frozenZones[i].cloneAsThawed();
+            TimeZone thawed = frozenZones[i].cloneAsThawed();
             if (thawed.isFrozen() || !frozenZones[i].equals(thawed)) {
                 errln("Fail: " + zaName + "[" + i + "] - cloneAsThawed does not work.");
             }
@@ -2210,7 +2220,7 @@ public class TimeZoneTest extends TestFmwk
             }
         }
     }
-    
+
     @Test
     public void Test11619_UnrecognizedTimeZoneID() {
         VTimeZone vzone = VTimeZone.create("ABadTimeZoneId");
index a09c48e1e8daab96c9c76533f2fd54dea8325a35..d3f88494f8edf257d937521c8496aa1144a05353 100644 (file)
@@ -16,12 +16,15 @@ import java.nio.ByteBuffer;
 import java.util.NoSuchElementException;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.BytesTrie;
 import com.ibm.icu.util.BytesTrieBuilder;
 import com.ibm.icu.util.StringTrieBuilder;
 
+@RunWith(JUnit4.class)
 public class BytesTrieTest extends TestFmwk {
     public BytesTrieTest() {}
 
index efff2e284095fbbb975a5078b62a1984a95e8013..6654e7ebbbc98080f40723463f57d46ba9645123 100644 (file)
@@ -15,6 +15,8 @@ package com.ibm.icu.dev.test.util;
 import java.util.NoSuchElementException;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.UnicodeSet;
@@ -23,6 +25,7 @@ import com.ibm.icu.util.CharsTrie;
 import com.ibm.icu.util.CharsTrieBuilder;
 import com.ibm.icu.util.StringTrieBuilder;
 
+@RunWith(JUnit4.class)
 public class CharsTrieTest extends TestFmwk {
     public CharsTrieTest() {}
 
index a2119afb20d7e02d29490ed020822213784a767f..fbe27c3947253ef436be74b84a91ae3e59f2085f 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.util;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -18,8 +20,9 @@ import com.ibm.icu.util.CompactCharArray;
 /**
  * @since release 2.2
  */
-public final class CompactArrayTest extends TestFmwk 
-{ 
+@RunWith(JUnit4.class)
+public final class CompactArrayTest extends TestFmwk
+{
     @Test
     public void TestByteArrayCoverage() {
     CompactByteArray cba = new CompactByteArray();
@@ -52,7 +55,7 @@ public final class CompactArrayTest extends TestFmwk
 
     logln("equals: " + cba4.equals(cba5));
     logln("equals: " + cba.equals(cba4));
-    
+
       cba4.compact(false);
     logln("equals: " + cba4.equals(cba5));
 
@@ -132,17 +135,17 @@ public final class CompactArrayTest extends TestFmwk
 
     cca3.setElementAt((char)0x405, (char)0xee); // different modification
     logln("different mod equals: " + cca.equals(cca3));
-    
+
     // after setElementAt isCompact is set to false
     cca3.compact(true);
     logln("different mod equals: " + cca.equals(cca3));
-    
+
     cca3.setElementAt((char)0x405, (char)0xee); // different modification
     logln("different mod equals: " + cca.equals(cca3));
         // after setElementAt isCompact is set to false
     cca3.compact();
     logln("different mod equals: " + cca.equals(cca3));
-    
+
     // v1.8 fails with extensive compaction, and defaults extensive, so don't compact
     // cca.compact();
     CompactCharArray cca6 = (CompactCharArray)cca.clone();
index 5416194be858330c7980967a092d64a8d0dfff86..9e4347feb7623886566155102d934658b432b17f 100644 (file)
@@ -21,6 +21,8 @@ import java.util.Locale;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -42,6 +44,7 @@ import com.ibm.icu.util.ULocale;
  * @test
  * @summary General test of Currency
  */
+@RunWith(JUnit4.class)
 public class CurrencyTest extends TestFmwk {
     /**
      * Test of basic API.
index 5dc8a95366340dd779ed795d44ea372d20a5b095..b6665020a4f36ce090eebade71beacfe4d8bd0a2 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.util;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 
@@ -16,6 +18,7 @@ import com.ibm.icu.dev.test.TestFmwk;
  * @author srl
  *
  */
+@RunWith(JUnit4.class)
 public class DebugUtilitiesTest extends TestFmwk {
 
     @Test
index 4be9459b0785e6a3412493ab5b3597ff80a35f1e..cd61579a87dcb0e46c8b89bedc7c132012db2e52 100644 (file)
@@ -20,6 +20,8 @@ import java.util.TreeSet;
 
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUResourceBundle;
@@ -32,9 +34,10 @@ import com.ibm.icu.util.UResourceBundle;
 
 // TODO(junit): test is broken in main branch
 
+@RunWith(JUnit4.class)
 public class DisplayNameTest extends TestFmwk {
     static final boolean SHOW_ALL = false;
-    
+
     interface DisplayNameGetter {
         public String get(ULocale locale, String code, Object context);
     }
@@ -43,12 +46,12 @@ public class DisplayNameTest extends TestFmwk {
     {
         for (int k = 0; k < codeToName.length; ++k) codeToName[k] = new HashMap();
     }
-    
+
     static final Object[] zoneFormats = {new Integer(0), new Integer(1), new Integer(2),
         new Integer(3), new Integer(4), new Integer(5), new Integer(6), new Integer(7)};
     static final Object[] currencyFormats = {new Integer(Currency.SYMBOL_NAME), new Integer(Currency.LONG_NAME)};
     static final Object[] NO_CONTEXT = {null};
-    
+
     static final Date JAN1;
     static final Date JULY1;
 
@@ -100,23 +103,27 @@ public class DisplayNameTest extends TestFmwk {
     private void checkLocale(ULocale locale) {
         logln("Checking " + locale);
         check("Language", locale, languages, null, new DisplayNameGetter() {
+            @Override
             public String get(ULocale loc, String code, Object context) {
                 return ULocale.getDisplayLanguage(code, loc);
             }
         });
         check("Script", locale, scripts, null, new DisplayNameGetter() {
+            @Override
             public String get(ULocale loc, String code, Object context) {
                 // TODO This is kinda a hack; ought to be direct way.
                 return ULocale.getDisplayScript("en_"+code, loc);
             }
         });
         check("Country", locale, countries, null, new DisplayNameGetter() {
+            @Override
             public String get(ULocale loc, String code, Object context) {
                 // TODO This is kinda a hack; ought to be direct way.
                 return ULocale.getDisplayCountry("en_"+code, loc);
             }
         });
         check("Currencies", locale, currencies, currencyFormats, new DisplayNameGetter() {
+            @Override
             public String get(ULocale loc, String code, Object context) {
                 Currency s = Currency.getInstance(code);
                 return s.getName(loc, ((Integer)context).intValue(), new boolean[1]);
@@ -127,15 +134,16 @@ public class DisplayNameTest extends TestFmwk {
 
         check("Zones", locale, zones, zoneFormats, new DisplayNameGetter() {
             // TODO replace once we have real API
+            @Override
             public String get(ULocale loc, String code, Object context) {
                 return getZoneString(loc, code, ((Integer)context).intValue());
             }
         });
 
     }
-    
+
     Map zoneData = new HashMap();
-    
+
     private String getZoneString(ULocale locale, String olsonID, int item) {
         Map data = (Map)zoneData.get(locale);
         if (data == null) {
@@ -163,7 +171,7 @@ public class DisplayNameTest extends TestFmwk {
         if (strings == null || item >= strings.length) return olsonID;
         return strings[item];
     }
-    
+
     static String[][] zonesAliases = {
         {"America/Atka", "America/Atka"},
         {"America/Ensenada", "America/Ensenada"},
@@ -351,9 +359,9 @@ public class DisplayNameTest extends TestFmwk {
         System.arraycopy(strings,0,result,2,strings.length);
         return result;
     }
-    
+
     Map bogusZones = null;
-    
+
     private Map getAliasMap() {
         if (bogusZones == null) {
             bogusZones = new TreeMap();
@@ -365,7 +373,7 @@ public class DisplayNameTest extends TestFmwk {
     }
 
 
-    private void check(String type, ULocale locale, 
+    private void check(String type, ULocale locale,
       String[] codes, Object[] contextList, DisplayNameGetter getter) {
         if (contextList == null) contextList = NO_CONTEXT;
         for (int k = 0; k < contextList.length; ++k) codeToName[k].clear();
@@ -381,7 +389,7 @@ public class DisplayNameTest extends TestFmwk {
                         + ":\t" + locale + " [" + locale.getDisplayName(ULocale.ENGLISH) + "]"
                         + "\t" + code + " [" + getter.get(ULocale.ENGLISH, code, context) + "]"
                     );
-                    continue;            
+                    continue;
                 }
                 String otherCode = (String) codeToName[k].get(name);
                 if (otherCode != null) {
@@ -395,11 +403,11 @@ public class DisplayNameTest extends TestFmwk {
                 } else {
                     codeToName[k].put(name, code);
                     if (SHOW_ALL) logln(
-                        type 
+                        type
                         + " (" + ((context != null) ? context : "") + ")"
                         + "\t" + locale + " [" + locale.getDisplayName(ULocale.ENGLISH) + "]"
                         + "\t" + code + "[" + getter.get(ULocale.ENGLISH, code, context) + "]"
-                        + "\t=> " + name 
+                        + "\t=> " + name
                     );
                 }
             }
index 9f263a4d074dbaf94417025f566c989bcb2a5adc..cd1ca030dea953602f027f5e8c3af873e2f323de 100644 (file)
@@ -12,12 +12,15 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.GenderInfo;
 import com.ibm.icu.util.GenderInfo.Gender;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class GenderInfoTest extends TestFmwk {
     public static GenderInfo NEUTRAL_LOCALE = GenderInfo.getInstance(ULocale.ENGLISH);
     public static GenderInfo MIXED_NEUTRAL_LOCALE = GenderInfo.getInstance(new ULocale("is"));
@@ -43,7 +46,7 @@ public class GenderInfoTest extends TestFmwk {
         check(Gender.OTHER, Gender.MALE, Gender.MALE, Gender.MALE, Gender.MALE);
         check(Gender.OTHER, Gender.OTHER, Gender.MALE, Gender.MALE, Gender.FEMALE);
         check(Gender.OTHER, Gender.OTHER, Gender.MALE, Gender.MALE, Gender.OTHER);
-    
+
         check(Gender.OTHER, Gender.OTHER, Gender.MALE, Gender.FEMALE, Gender.MALE);
         check(Gender.OTHER, Gender.FEMALE, Gender.FEMALE, Gender.FEMALE, Gender.FEMALE);
         check(Gender.OTHER, Gender.OTHER, Gender.MALE, Gender.FEMALE, Gender.OTHER);
@@ -59,7 +62,7 @@ public class GenderInfoTest extends TestFmwk {
         assertEquals("mixed neutral " + mixed0, mixed, MIXED_NEUTRAL_LOCALE.getListGender(mixed0));
         assertEquals("male taints " + mixed0, taints, MALE_TAINTS_LOCALE.getListGender(mixed0));
     }
-    
+
     @Test
     public void TestFallback() {
         assertEquals("Strange locale = root", GenderInfo.getInstance(ULocale.ROOT), GenderInfo.getInstance(new ULocale("xxx")));
index 6af7547b5f067d7302920b06f8304e692c458feb..645a672e1ff8800392bc3691a785a56acd9288bf 100644 (file)
@@ -13,30 +13,33 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUBinary;
 
 /**
-* Testing class for Trie. Tests here will be simple, since both CharTrie and 
+* Testing class for Trie. Tests here will be simple, since both CharTrie and
 * IntTrie are very similar and are heavily used in other parts of ICU4J.
 * Codes using Tries are expected to have detailed tests.
 * @author Syn Wee Quek
 * @since release 2.1 Jan 01 2002
 */
-public final class ICUBinaryTest extends TestFmwk 
-{ 
+@RunWith(JUnit4.class)
+public final class ICUBinaryTest extends TestFmwk
+{
     // constructor ---------------------------------------------------
-  
+
     /**
     * Constructor
     */
     public ICUBinaryTest()
     {
     }
-      
+
     // public methods -----------------------------------------------
-    
+
     /**
      * Testing the constructors of the Tries
      */
@@ -71,6 +74,7 @@ public final class ICUBinaryTest extends TestFmwk
         ByteBuffer bytes = ByteBuffer.wrap(array);
         ICUBinary.Authenticate authenticate
                 = new ICUBinary.Authenticate() {
+                    @Override
                     public boolean isDataVersionAcceptable(byte version[])
                     {
                         return version[0] == 1;
index 60f1f9572a595ed0b38f41260b6acd71c80ad741..28f77b7dc8ea81dba33a899d07f003187571aaa2 100644 (file)
@@ -24,6 +24,8 @@ import java.util.TreeSet;
 import java.util.jar.JarEntry;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUData;
@@ -38,6 +40,7 @@ import com.ibm.icu.util.UResourceBundle;
 import com.ibm.icu.util.UResourceBundleIterator;
 import com.ibm.icu.util.UResourceTypeMismatchException;
 
+@RunWith(JUnit4.class)
 public final class ICUResourceBundleTest extends TestFmwk {
     private static final ClassLoader testLoader = ICUResourceBundleTest.class.getClassLoader();
 
index e081e66906ddb71548fc7d3df634682bf6ff609c..cd00d29c60f51ad645d2e23b4f077d323e7c7f60 100644 (file)
@@ -23,6 +23,8 @@ import java.util.Set;
 import java.util.SortedMap;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICULocaleService;
@@ -40,6 +42,7 @@ import com.ibm.icu.impl.ICUService.SimpleFactory;
 import com.ibm.icu.impl.LocaleUtility;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class ICUServiceTest extends TestFmwk
 {
     private String lrmsg(String message, Object lhs, Object rhs) {
@@ -99,6 +102,7 @@ public class ICUServiceTest extends TestFmwk
             super("Test Service");
         }
 
+    @Override
     public Key createKey(String id) {
         return LocaleKey.createWithCanonicalFallback(id, null); // no fallback locale
     }
@@ -197,13 +201,16 @@ public class ICUServiceTest extends TestFmwk
     // an anonymous factory than handles all ids
     {
         Factory factory = new Factory() {
+            @Override
             public Object create(Key key, ICUService unusedService) {
                 return new ULocale(key.currentID());
             }
 
+            @Override
             public void updateVisibleIDs(Map unusedResult) {
             }
 
+            @Override
             public String getDisplayName(String id, ULocale l) {
                 return null;
             }
@@ -420,7 +427,8 @@ public class ICUServiceTest extends TestFmwk
         {
             logln("display names in reverse order: " +
                   service.getDisplayNames(ULocale.US, new Comparator() {
-                          public int compare(Object lhs, Object rhs) {
+                          @Override
+                        public int compare(Object lhs, Object rhs) {
                               return -String.CASE_INSENSITIVE_ORDER.compare((String)lhs, (String)rhs);
                           }
                       }));
@@ -478,6 +486,7 @@ public class ICUServiceTest extends TestFmwk
         ICULocaleService ls = new ICULocaleService();
         ServiceListener l1 = new ServiceListener() {
             private int n;
+            @Override
             public void serviceChanged(ICUService s) {
             logln("listener 1 report " + n++ + " service changed: " + s);
             }
@@ -485,6 +494,7 @@ public class ICUServiceTest extends TestFmwk
         ls.addListener(l1);
         ServiceListener l2 = new ServiceListener() {
             private int n;
+            @Override
             public void serviceChanged(ICUService s) {
             logln("listener 2 report " + n++ + " service changed: " + s);
             }
@@ -517,6 +527,7 @@ public class ICUServiceTest extends TestFmwk
         // since in a separate thread, we can callback and not deadlock
         ServiceListener l3 = new ServiceListener() {
             private int n;
+            @Override
             public void serviceChanged(ICUService s) {
             logln("listener 3 report " + n++ + " service changed...");
             if (s.get("en_BOINK") == null) { // don't recurse on ourselves!!!
@@ -549,10 +560,12 @@ public class ICUServiceTest extends TestFmwk
             this.factoryID = factoryID + ": ";
     }
 
+    @Override
     protected Object handleCreate(ULocale loc, int kind, ICUService service) {
             return factoryID + loc.toString();
     }
 
+    @Override
     protected Set getSupportedIDs() {
             return ids;
     }
@@ -624,10 +637,12 @@ public class ICUServiceTest extends TestFmwk
             supportedIDs = Collections.unmodifiableSet(result);
         }
 
+    @Override
     public Set getSupportedIDs() {
             return supportedIDs;
     }
 
+    @Override
     public String getDisplayName(String id, ULocale locale) {
         String prefix = "";
         String suffix = "";
@@ -770,6 +785,7 @@ public class ICUServiceTest extends TestFmwk
         {
             SortedMap map = service.getDisplayNames(ULocale.US,
                             new Comparator() {
+                                @Override
                                 public int compare(Object lhs, Object rhs) {
                                 return -String.CASE_INSENSITIVE_ORDER.compare((String)lhs, (String)rhs);
                                 }
@@ -791,6 +807,7 @@ public class ICUServiceTest extends TestFmwk
         logln("test one: " + service.get(greetingID));
 
         class WrapFactory implements Factory {
+            @Override
             public Object create(Key key, ICUService serviceArg) {
                 if (key.currentID().equals(greetingID)) {
                     Object previous = serviceArg.getKey(key, null, this);
@@ -799,10 +816,12 @@ public class ICUServiceTest extends TestFmwk
                 return null;
             }
 
+            @Override
             public void updateVisibleIDs(Map result) {
                 result.put("greeting", this);
             }
 
+            @Override
             public String getDisplayName(String id, ULocale locale) {
                 return "wrap '" + id + "'";
             }
@@ -991,11 +1010,13 @@ public class ICUServiceTest extends TestFmwk
     }
 
     static class ICUNSubclass extends ICUNotifier {
+        @Override
         public boolean acceptsListener(EventListener l) {
             return l instanceof MyListener;
         }
-    
+
         // not used, just needed to implement abstract base
+        @Override
         public void notifyListener(EventListener l) {
         }
     }
@@ -1005,6 +1026,7 @@ public class ICUServiceTest extends TestFmwk
         super(visible ? VISIBLE : INVISIBLE);
     }
 
+    @Override
     protected Set getSupportedIDs() {
             return Collections.EMPTY_SET;
     }
index 81f9f08b3d7a1b4bf8df901f8207301cc49934c2..c5405e283d06b1cff8b7c41fe856504b8e26edc2 100644 (file)
@@ -25,6 +25,8 @@ import java.util.Set;
 import java.util.SortedMap;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICULocaleService;
@@ -33,6 +35,7 @@ import com.ibm.icu.impl.ICUService.Factory;
 import com.ibm.icu.impl.ICUService.SimpleFactory;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class ICUServiceThreadTest extends TestFmwk
 {
     private static final boolean PRINTSTATS = false;
@@ -52,10 +55,12 @@ public class ICUServiceThreadTest extends TestFmwk
             super(new ULocale(id), id, true);
         }
 
+        @Override
         public String getDisplayName(String idForDisplay, ULocale locale) {
             return (visible && idForDisplay.equals(this.id)) ? "(" + locale.toString() + ") " + idForDisplay : null;
         }
 
+        @Override
         public String toString() {
             return "Factory_" + id;
         }
@@ -121,6 +126,7 @@ public class ICUServiceThreadTest extends TestFmwk
             this.setDaemon(true);
         }
 
+        @Override
         public void run() {
             while (WAIT) {
                 Thread.yield();
@@ -189,6 +195,7 @@ public class ICUServiceThreadTest extends TestFmwk
             super("REG " + name, service, delay);
         }
 
+        @Override
         protected void iterate() {
             Factory f = new TestFactory(getCLV());
             service.registerFactory(f);
@@ -207,6 +214,7 @@ public class ICUServiceThreadTest extends TestFmwk
             factories = service.factories();
         }
 
+        @Override
         public void iterate() {
             int s = factories.size();
             if (s == 0) {
@@ -230,6 +238,7 @@ public class ICUServiceThreadTest extends TestFmwk
             this.factories = factories;
         }
 
+        @Override
         public void iterate() {
             if (n < factories.length) {
                 Factory f = factories[n++];
@@ -245,6 +254,7 @@ public class ICUServiceThreadTest extends TestFmwk
             super("VIS " + name, service, delay);
         }
 
+        @Override
         protected void iterate() {
             Set ids = service.getVisibleIDs();
             Iterator iter = ids.iterator();
@@ -266,6 +276,7 @@ public class ICUServiceThreadTest extends TestFmwk
             this.locale = locale;
         }
 
+        @Override
         protected void iterate() {
             Map names = getDisplayNames(service,locale);
             Iterator iter = names.entrySet().iterator();
@@ -298,6 +309,7 @@ public class ICUServiceThreadTest extends TestFmwk
             actualID = new String[1];
         }
 
+        @Override
         protected void iterate() {
             String id = getCLV();
             Object o = service.get(id, actualID);
@@ -317,6 +329,7 @@ public class ICUServiceThreadTest extends TestFmwk
             this.list = list;
         }
 
+        @Override
         protected void iterate() {
             if (--n < 0) {
                 n = list.length - 1;
@@ -420,6 +433,7 @@ public class ICUServiceThreadTest extends TestFmwk
 
         Factory[] factories = (Factory[])fc.toArray(new Factory[fc.size()]);
         Comparator comp = new Comparator() {
+                @Override
                 public int compare(Object lhs, Object rhs) {
                     return lhs.toString().compareTo(rhs.toString());
                 }
index 4c17cceece93fc6be9e79f3959fae617ad70e0b9..2c7934920d917e42414ba9f9609992bfde9b0849 100644 (file)
@@ -18,6 +18,8 @@ import java.util.HashMap;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUData;
@@ -26,6 +28,7 @@ import com.ibm.icu.util.Calendar;
 import com.ibm.icu.util.ULocale;
 import com.ibm.icu.util.UResourceBundle;
 
+@RunWith(JUnit4.class)
 public class LocaleAliasTest extends TestFmwk {
     private static final ULocale[][] _LOCALES = {
 
@@ -35,7 +38,7 @@ public class LocaleAliasTest extends TestFmwk {
             {new ULocale("iw"), new ULocale("he")},
             {new ULocale("iw", "IL"), new ULocale("he", "IL")},
             {new ULocale("ji"), new ULocale("yi")},
-            
+
             {new ULocale("en", "BU"), new ULocale("en", "MM")},
             {new ULocale("en", "DY"), new ULocale("en", "BJ")},
             {new ULocale("en", "HV"), new ULocale("en", "BF")},
@@ -43,15 +46,15 @@ public class LocaleAliasTest extends TestFmwk {
             {new ULocale("en", "TP"), new ULocale("en", "TL")},
             {new ULocale("en", "ZR"), new ULocale("en", "CD")}
     };
-    
+
     private static final int _LOCALE_NUMBER = _LOCALES.length;
     private static ULocale[] available = null;
     private HashMap availableMap = new HashMap();
     private static final ULocale _DEFAULT_LOCALE = ULocale.US;
-    
+
     public LocaleAliasTest() {
     }
-    
+
     @Before
     public void init() {
         available = ULocale.getAvailableLocales();
@@ -82,7 +85,7 @@ public class LocaleAliasTest extends TestFmwk {
     //                    +firstDayOfWeek1+"   new:"+firstDayOfWeek2);
     //            pass = false;
     //        }
-                    
+
             //Test function "getLocale(ULocale.VALID_LOCALE)"
             ULocale l1 = c1.getLocale(ULocale.VALID_LOCALE);
             ULocale l2 = c2.getLocale(ULocale.VALID_LOCALE);
@@ -95,11 +98,11 @@ public class LocaleAliasTest extends TestFmwk {
             if(!c1.equals(c2)){
                 errln("CalendarTest: c1!=c2.  newLoc= "+newLoc +" oldLoc= "+oldLoc);
             }
-            logln("Calendar(getLocale) old:"+l1+"   new:"+l2);    
+            logln("Calendar(getLocale) old:"+l1+"   new:"+l2);
         }
         ULocale.setDefault(defLoc);
     }
-    
+
     @Test
     public void  TestDateFormat() {
         ULocale defLoc = ULocale.getDefault();
@@ -113,7 +116,7 @@ public class LocaleAliasTest extends TestFmwk {
             }
             DateFormat df1 = DateFormat.getDateInstance(DateFormat.FULL, oldLoc);
             DateFormat df2 = DateFormat.getDateInstance(DateFormat.FULL, newLoc);
-            
+
             //Test function "getLocale"
             ULocale l1 = df1.getLocale(ULocale.VALID_LOCALE);
             ULocale l2 = df2.getLocale(ULocale.VALID_LOCALE);
@@ -127,7 +130,7 @@ public class LocaleAliasTest extends TestFmwk {
                 errln("DateFormatTest: df1!=df2: newLoc= "+newLoc +" oldLoc= "+oldLoc);
             }
             TestFmwk.logln("DateFormat(getLocale) old:"+l1+"   new:"+l2);
-            
+
             //Test function "format"
     //        Date d = new Date();
     //        String d1 = df1.format(d);
@@ -139,7 +142,7 @@ public class LocaleAliasTest extends TestFmwk {
         }
         ULocale.setDefault(defLoc);
     }
-    
+
     @Test
     public void TestULocale() {
         ULocale defLoc = ULocale.getDefault();
@@ -153,7 +156,7 @@ public class LocaleAliasTest extends TestFmwk {
             }
             ULocale ul1 = new ULocale(oldLoc.toString());
             ULocale ul2 = new ULocale(newLoc.toString());
-            
+
             String name1 = ul1.getDisplayName();
             String name2 = ul2.getDisplayName();
             if (!name1.equals(name2)) {
@@ -163,7 +166,7 @@ public class LocaleAliasTest extends TestFmwk {
         }
         ULocale.setDefault(defLoc);
     }
-    
+
     @Test
     public void TestDisplayName() {
         ULocale defLoc = ULocale.getDefault();
@@ -177,14 +180,14 @@ public class LocaleAliasTest extends TestFmwk {
                String newCountry = newLoc.getDisplayCountry(available[j]);
                String oldLang = oldLoc.getDisplayLanguage(available[j]);
                String newLang = newLoc.getDisplayLanguage(available[j]);
-               
-               // is  there  display name for the current country ID               
+
+               // is  there  display name for the current country ID
                if(!newCountry.equals(newLoc.getCountry())){
                    if(!oldCountry.equals(newCountry)){
                        errln("getCountry() failed for "+ oldLoc +" oldCountry= "+ prettify(oldCountry) +" newCountry = "+prettify(newCountry)+ " in display locale "+ available[j].toString());
                    }
                }
-               //there is a display name for the current lang ID               
+               //there is a display name for the current lang ID
                if(!newLang.equals(newLoc.getLanguage())){
                    if(!oldLang.equals(newLang)){
                        errln("getLanguage() failed for " + oldLoc + " oldLang = "+ prettify(oldLang) +" newLang = "+prettify(newLang)+ " in display locale "+ available[j].toString());
@@ -208,11 +211,11 @@ public class LocaleAliasTest extends TestFmwk {
             ULocale newLoc = _LOCALES[i][1];
             UResourceBundle urb1 = null;
             UResourceBundle urb2 = null;
-            
+
             urb1 = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, oldLoc);
             urb2 = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, newLoc);
             ULocale l1 = urb1.getULocale();
-            ULocale l2 = urb2.getULocale();        
+            ULocale l2 = urb2.getULocale();
             if (!newLoc.equals(l1)) {
                 errln("ResourceBundleTest: newLoc!=l1: newLoc= "+newLoc +" l1= "+l1);
             }
index 5c762980237d578002b7f500726a6b0e116ea20c..772d0eab26b20e3001e08da5783a4504cc4d6e96 100644 (file)
@@ -11,6 +11,8 @@ package com.ibm.icu.dev.test.util;
 import java.util.Arrays;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.IllformedLocaleException;
@@ -20,6 +22,7 @@ import com.ibm.icu.util.ULocale.Builder;
 /**
  * Test cases for ULocale.LocaleBuilder
  */
+@RunWith(JUnit4.class)
 public class LocaleBuilderTest extends TestFmwk {
     @Test
     public void TestLocaleBuilder() {
@@ -178,12 +181,12 @@ public class LocaleBuilderTest extends TestFmwk {
             if (expected != null) {
                 ULocale loc = bld.build();
                 if (!expected[1].equals(loc.toString())) {
-                    errln("FAIL: Wrong locale ID - " + loc + 
+                    errln("FAIL: Wrong locale ID - " + loc +
                             " for test case: " + Arrays.toString(TESTCASE[tidx]));
                 }
                 String langtag = loc.toLanguageTag();
                 if (!expected[0].equals(langtag)) {
-                    errln("FAIL: Wrong language tag - " + langtag + 
+                    errln("FAIL: Wrong language tag - " + langtag +
                             " for test case: " + Arrays.toString(TESTCASE[tidx]));
                 }
                 ULocale loc1 = ULocale.forLanguageTag(langtag);
@@ -209,7 +212,7 @@ public class LocaleBuilderTest extends TestFmwk {
             ULocale loc2 = bld.build();
             if (!loc.equals(loc2)) {
                 errln("FAIL: Locale loc2 " + loc2 + " was returned by the builder.  Expected " + loc);
-            }            
+            }
         } catch (IllformedLocaleException e) {
             errln("FAIL: IllformedLocaleException: " + e.getMessage());
         }
index c38a1e23f51dfd7c1e7f7e8dc93faf009f5e6490..7c2c14724454989d55ce1f84e1181c0d498331a6 100644 (file)
@@ -13,6 +13,8 @@ import java.util.HashSet;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUResourceBundle;
@@ -29,17 +31,18 @@ import com.ibm.icu.util.ULocale;
  * To change the template for this generated type comment go to
  * Window>Preferences>Java>Code Generation>Code and Comments
  */
+@RunWith(JUnit4.class)
 public class LocaleDataTest extends TestFmwk{
     private ULocale[] availableLocales = null;
 
     public LocaleDataTest(){
     }
-    
+
     @Before
     public void init() {
         availableLocales = ICUResourceBundle.getAvailableULocales();
     }
-    
+
     @Test
     public void TestPaperSize(){
         for(int i = 0; i < availableLocales.length; i++){
@@ -70,7 +73,7 @@ public class LocaleDataTest extends TestFmwk{
                 if(paperSize.getHeight()!= 297 || paperSize.getWidth() != 210 ){
                     errln("PaperSize did not return the expected value for locale "+ locale +
                             " Expected height: 297 width: 210."+
-                            " Got height: "+paperSize.getHeight() +" width: "+paperSize.getWidth() 
+                            " Got height: "+paperSize.getHeight() +" width: "+paperSize.getWidth()
                             );
                 }else{
                     logln("PaperSize returned the expected values for locale " + locale);
@@ -87,7 +90,7 @@ public class LocaleDataTest extends TestFmwk{
             String lang = locale.getLanguage();
             if(lang.equals("in")){
                 continue;
-            }           
+            }
             ULocale fullLoc = ULocale.addLikelySubtags(locale);
             if(fullLoc.toString().indexOf("_US") >= 0 || fullLoc.toString().indexOf("_MM") >= 0 || fullLoc.toString().indexOf("_LR") >= 0){
                 if(ms == LocaleData.MeasurementSystem.US){
@@ -106,7 +109,7 @@ public class LocaleDataTest extends TestFmwk{
                     logln("Got the expected measurement system for locale: " + locale);
                 }else{
                     errln("Did not get the expected measurement system for locale: "+ locale);
-                } 
+                }
             }
         }
     }
@@ -177,13 +180,15 @@ public class LocaleDataTest extends TestFmwk{
             set = s;
             scs = scriptCodes;
         }
+        @Override
         public int hashCode() {
             int hash = 0;
             for (int i=0; i<scs.length && i<4; i++) {
                 hash = (hash<<8)+scs[i];
             }
             return hash;
-        }        
+        }
+        @Override
         public boolean equals(Object other) {
             ExemplarGroup o = (ExemplarGroup)other;
             boolean r = Arrays.equals(scs, o.scs) &&
@@ -205,7 +210,7 @@ public class LocaleDataTest extends TestFmwk{
                 // such a broken hack !!!!!
                 // so in effect I can never test the script code for Indonesian :(
                 if(locale.toString().indexOf(("in"))<0){
-                    errln("UScript.getCode returned null for locale: " + locale); 
+                    errln("UScript.getCode returned null for locale: " + locale);
                 }
                 continue;
             }
@@ -224,7 +229,7 @@ public class LocaleDataTest extends TestFmwk{
                     }
                     boolean existsInScript = false;
                     UnicodeSetIterator iter = new UnicodeSetIterator(exemplarSet);
-                    // iterate over the 
+                    // iterate over the
                     while (!existsInScript && iter.nextRange()) {
                         if (iter.codepoint != UnicodeSetIterator.IS_STRING) {
                             for(int j=0; j<sets.length; j++){
@@ -273,7 +278,7 @@ public class LocaleDataTest extends TestFmwk{
             int[] scriptCodes = UScript.getCode(locale);
             if (scriptCodes==null) {
                 if(locale.toString().indexOf(("in"))<0){
-                    errln("UScript.getCode returned null for locale: "+ locale); 
+                    errln("UScript.getCode returned null for locale: "+ locale);
                 }
                 continue;
             }
@@ -281,7 +286,7 @@ public class LocaleDataTest extends TestFmwk{
 
             for (int k=0; k<2; ++k) {  // for casing option in (normal, uncased)
                 int option = (k==0) ? 0 : UnicodeSet.CASE;
-                for(int h=0; h<2; ++h){  
+                for(int h=0; h<2; ++h){
                     int type = (h==0) ? LocaleData.ES_STANDARD : LocaleData.ES_AUXILIARY;
 
                     UnicodeSet exemplarSet = ld.getExemplarSet(option, type);
@@ -297,7 +302,7 @@ public class LocaleDataTest extends TestFmwk{
                         }
                         boolean existsInScript = false;
                         UnicodeSetIterator iter = new UnicodeSetIterator(exemplarSet);
-                        // iterate over the 
+                        // iterate over the
                         while (!existsInScript && iter.nextRange()) {
                             if (iter.codepoint != UnicodeSetIterator.IS_STRING) {
                                 for(int j=0; j<sets.length; j++){
index 9c82ba59d598adb815dbd5c09625de05d12b29e0..060b28d703538fb1589f29106d8befe73d32618b 100644 (file)
@@ -15,6 +15,8 @@ import java.util.Set;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.LocaleMatcher;
@@ -29,6 +31,7 @@ import com.ibm.icu.util.ULocale;
  * @author markdavis
  */
 @SuppressWarnings("deprecation")
+@RunWith(JUnit4.class)
 public class LocaleMatcherTest extends TestFmwk {
 
 
index 14282a1e2d8d27b411a14b76f533f124e44c1afc..98185fd27564e64f120ac17596990597f096f95f 100644 (file)
@@ -10,6 +10,8 @@
 package com.ibm.icu.dev.test.util;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.LocalePriorityList;
@@ -19,6 +21,7 @@ import com.ibm.icu.util.ULocale;
  * Test the LanguagePriorityList
  * @author markdavis@google.com
  */
+@RunWith(JUnit4.class)
 public class LocalePriorityListTest extends TestFmwk {
   @Test
   public void testLanguagePriorityList() {
@@ -40,12 +43,12 @@ public class LocalePriorityListTest extends TestFmwk {
         .build();
     assertEquals(expected, list3.toString());
     assertEquals(list, list3);
-    
+
     LocalePriorityList list4 = LocalePriorityList
     .add(list).build();
     assertEquals(expected, list4.toString());
     assertEquals(list, list4);
-    
+
     LocalePriorityList list5 = LocalePriorityList.add("af, fr;q=0.9, en").build(true);
     assertEquals("af, en, fr;q=0.9", list5.toString());
   }
index 9d349f4e26163a767b8bd27f9056526639634991..bd4117a5d1a651d19f7cba0364208651896e05eb 100644 (file)
@@ -17,6 +17,8 @@ import java.util.List;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.Region;
@@ -27,6 +29,7 @@ import com.ibm.icu.util.Region.RegionType;
  * @summary General test of Regions
  */
 
+@RunWith(JUnit4.class)
 public class RegionTest extends TestFmwk {
     String[][] knownRegions = {
             //   Code  , Numeric , Parent, Type, Containing Continent
@@ -332,7 +335,7 @@ public class RegionTest extends TestFmwk {
 
     /**
      * Test for known regions.
-     */    
+     */
     @Test
     public void TestKnownRegions() {
 
@@ -435,7 +438,7 @@ public class RegionTest extends TestFmwk {
     }
 
     @Test
-    public void TestGetContainedRegions() {        
+    public void TestGetContainedRegions() {
         for (String [] rd : knownRegions ) {
             try {
                 Region r = Region.getInstance(rd[0]);
@@ -445,7 +448,7 @@ public class RegionTest extends TestFmwk {
                 Set<Region> containedRegions = r.getContainedRegions();
                 for (Region cr : containedRegions ) {
                     if ( cr.getContainingRegion() != r) {
-                        errln("Region: " + r.toString() + " contains region: " + cr.toString() + ". Expected containing region of this region to be the original region, but got: " + 
+                        errln("Region: " + r.toString() + " contains region: " + cr.toString() + ". Expected containing region of this region to be the original region, but got: " +
                                 ( cr.getContainingRegion() == null ? "NULL" : cr.getContainingRegion().toString()));
                     }
                 }
@@ -456,7 +459,7 @@ public class RegionTest extends TestFmwk {
     }
 
     @Test
-    public void TestGetContainedRegionsWithType() {        
+    public void TestGetContainedRegionsWithType() {
         for (String [] rd : knownRegions ) {
             try {
                 Region r = Region.getInstance(rd[0]);
@@ -466,7 +469,7 @@ public class RegionTest extends TestFmwk {
                 Set<Region> containedRegions = r.getContainedRegions(Region.RegionType.TERRITORY);
                 for (Region cr : containedRegions ) {
                     if ( cr.getContainingRegion(Region.RegionType.CONTINENT) != r) {
-                        errln("Continent: " + r.toString() + " contains territory: " + cr.toString() + ". Expected containing continent of this region to be the original continent, but got: " + 
+                        errln("Continent: " + r.toString() + " contains territory: " + cr.toString() + ". Expected containing continent of this region to be the original continent, but got: " +
                                 ( cr.getContainingRegion() == null ? "NULL" : cr.getContainingRegion().toString()));
                     }
                 }
@@ -477,17 +480,17 @@ public class RegionTest extends TestFmwk {
     }
 
     @Test
-    public void TestGetContainingRegionWithType() {        
+    public void TestGetContainingRegionWithType() {
         for (String [] rd : knownRegions ) {
             try {
                 Region r = Region.getInstance(rd[0]);
                 Region c = r.getContainingRegion(Region.RegionType.CONTINENT);
-                if (rd[4] == null) {                   
+                if (rd[4] == null) {
                     if ( c != null) {
                         errln("Containing continent for " + r.toString() + " should have been NULL.  Got: " + c.toString());
                     }
                 } else {
-                    Region p = Region.getInstance(rd[4]);                   
+                    Region p = Region.getInstance(rd[4]);
                     if ( !p.equals(c)) {
                         errln("Expected containing continent of region " + r.toString() + " to be " + p.toString() + ". Got: " + ( c == null ? "NULL" : c.toString()) );
                     }
@@ -499,17 +502,17 @@ public class RegionTest extends TestFmwk {
     }
 
     @Test
-    public void TestGetContainingRegion() {        
+    public void TestGetContainingRegion() {
         for (String [] rd : knownRegions ) {
             try {
                 Region r = Region.getInstance(rd[0]);
                 Region c = r.getContainingRegion();
-                if (rd[2] == null) {                   
+                if (rd[2] == null) {
                     if ( c != null) {
                         errln("Containing region for " + r.toString() + " should have been NULL.  Got: " + c.toString());
                     }
                 } else {
-                    Region p = Region.getInstance(rd[2]);                   
+                    Region p = Region.getInstance(rd[2]);
                     if ( !p.equals(c)) {
                         errln("Expected containing region of region " + r.toString() + " to be " + p.toString() + ". Got: " + ( c == null ? "NULL" : c.toString()) );
                     }
@@ -545,7 +548,7 @@ public class RegionTest extends TestFmwk {
                         }
                     } catch (IllegalArgumentException ex ) {
                         errln("Known region " + data[i] + " was not recognized.");
-                    }                    
+                    }
                 }
             } catch (IllegalArgumentException ex ) {
                 errln("Known region " + inputID + " was not recognized.");
@@ -554,7 +557,7 @@ public class RegionTest extends TestFmwk {
     }
 
     @Test
-    public void TestContains() {        
+    public void TestContains() {
         for (String [] rd : knownRegions ) {
             try {
                 Region r = Region.getInstance(rd[0]);
index e65c7aadede025802286210dc1178f40187f19dd..23a525c7d2d9e6e91a7933c440770fbe1861a1bd 100644 (file)
@@ -9,12 +9,15 @@
 package com.ibm.icu.dev.test.util;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.MessageFormat;
 import com.ibm.icu.text.SimpleFormatter;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class SimpleFormatterTest extends TestFmwk {
 
     /**
@@ -23,9 +26,9 @@ public class SimpleFormatterTest extends TestFmwk {
      public SimpleFormatterTest()
      {
      }
-       
+
      // public methods -----------------------------------------------
-     
+
      @Test
      public void TestWithNoArguments() {
          SimpleFormatter fmt = SimpleFormatter.compile("This doesn''t have templates '{0}");
@@ -102,7 +105,7 @@ public class SimpleFormatterTest extends TestFmwk {
                  SimpleFormatter.compile(
                          "Templates {1}{2} and {3} are here.").getTextWithNoArguments());
      }
-     
+
      @Test
      public void TestTooFewArgumentValues() {
          SimpleFormatter fmt = SimpleFormatter.compile(
@@ -128,7 +131,7 @@ public class SimpleFormatterTest extends TestFmwk {
              // Expected
          }
      }
-     
+
      @Test
      public void TestWithArguments() {
          SimpleFormatter fmt = SimpleFormatter.compile(
@@ -136,12 +139,12 @@ public class SimpleFormatterTest extends TestFmwk {
          assertEquals(
                  "getArgumentLimit",
                  5,
-                 fmt.getArgumentLimit()); 
+                 fmt.getArgumentLimit());
          assertEquals(
                  "toString",
                  "Templates {2}{1} and {4} are out of order.",
                  fmt.toString());
-        int[] offsets = new int[6]; 
+        int[] offsets = new int[6];
         assertEquals(
                  "format",
                  "123456: Templates frogtommy and {0} are out of order.",
@@ -149,11 +152,11 @@ public class SimpleFormatterTest extends TestFmwk {
                          new StringBuilder("123456: "),
                          offsets,
                          "freddy", "tommy", "frog", "leg", "{0}").toString());
-         
+
          int[] expectedOffsets = {-1, 22, 18, -1, 32, -1};
          verifyOffsets(expectedOffsets, offsets);
      }
-     
+
      @Test
      public void TestFormatUseAppendToAsArgument() {
          SimpleFormatter fmt = SimpleFormatter.compile(
@@ -166,7 +169,7 @@ public class SimpleFormatterTest extends TestFmwk {
              // expected.
          }
      }
-     
+
      @Test
      public void TestFormatReplaceNoOptimization() {
          SimpleFormatter fmt = SimpleFormatter.compile("{2}, {0}, {1} and {3}");
@@ -179,12 +182,12 @@ public class SimpleFormatterTest extends TestFmwk {
                          result,
                          offsets,
                          result, "freddy", "frog", "by").toString());
-         
+
          int[] expectedOffsets = {6, 16, 0, 27};
          verifyOffsets(expectedOffsets, offsets);
      }
-     
-     
+
+
      @Test
      public void TestFormatReplaceNoOptimizationLeadingText() {
          SimpleFormatter fmt = SimpleFormatter.compile("boo {2}, {0}, {1} and {3}");
@@ -197,11 +200,11 @@ public class SimpleFormatterTest extends TestFmwk {
                          result,
                          offsets,
                          "freddy", "frog", result, "by").toString());
-         
+
          int[] expectedOffsets = {14, 22, 4, 31};
          verifyOffsets(expectedOffsets, offsets);
      }
-     
+
      @Test
      public void TestFormatReplaceOptimization() {
          SimpleFormatter fmt = SimpleFormatter.compile("{2}, {0}, {1} and {3}");
@@ -214,11 +217,11 @@ public class SimpleFormatterTest extends TestFmwk {
                          result,
                          offsets,
                          "freddy", "frog", result, "by").toString());
-         
+
          int[] expectedOffsets = {10, 18, 0, 27};
-         verifyOffsets(expectedOffsets, offsets);  
+         verifyOffsets(expectedOffsets, offsets);
      }
-     
+
      @Test
      public void TestFormatReplaceOptimizationNoOffsets() {
          SimpleFormatter fmt = SimpleFormatter.compile("{2}, {0}, {1} and {3}");
@@ -230,9 +233,9 @@ public class SimpleFormatterTest extends TestFmwk {
                          result,
                          null,
                          "freddy", "frog", result, "by").toString());
-         
+
      }
-     
+
      @Test
      public void TestFormatReplaceNoOptimizationNoOffsets() {
          SimpleFormatter fmt = SimpleFormatter.compile(
@@ -243,7 +246,7 @@ public class SimpleFormatterTest extends TestFmwk {
                  "Arguments previous: and frog",
                  fmt.formatAndReplace(result, null, result, "frog").toString());
      }
-     
+
      @Test
      public void TestFormatReplaceNoOptimizationLeadingArgumentUsedTwice() {
          SimpleFormatter fmt = SimpleFormatter.compile(
@@ -276,7 +279,7 @@ public class SimpleFormatterTest extends TestFmwk {
              if (expected[i] != actual[i]) {
                  errln("Expected "+expected[i]+", got " + actual[i]);
              }
-         } 
+         }
      }
-     
+
 }
index f3201eedfc70c8df7c2d401d288188be78453372..30cd5ad85d81002b3e2d42ba79d5ad7a09b823a9 100644 (file)
@@ -10,6 +10,8 @@
 package com.ibm.icu.dev.test.util;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -22,19 +24,20 @@ import com.ibm.icu.util.StringTokenizer;
 * @author Syn Wee Quek
 * @since oct 26 2002
 */
+@RunWith(JUnit4.class)
 public final class StringTokenizerTest extends TestFmwk
-{ 
+{
       // constructor ===================================================
-  
+
       /**
       * Constructor
       */
       public StringTokenizerTest()
       {
       }
-  
+
       // public methods --------------------------------------------------------
-    
+
     /**
      * Testing constructors
      */
@@ -43,7 +46,7 @@ public final class StringTokenizerTest extends TestFmwk
     {
         String str = "this\tis\na\rstring\ftesting\tStringTokenizer\nconstructors!";
         String delimiter = " \t\n\r\f";
-        String expected[] = {"this", "is", "a", "string", "testing", 
+        String expected[] = {"this", "is", "a", "string", "testing",
                              "StringTokenizer", "constructors!"};
         StringTokenizer defaultst = new StringTokenizer(str);
         StringTokenizer stdelimiter = new StringTokenizer(str, delimiter);
@@ -51,11 +54,11 @@ public final class StringTokenizerTest extends TestFmwk
                                                                 false);
         UnicodeSet delimiterset = new UnicodeSet("[" + delimiter + "]", false);
         StringTokenizer stdelimiterset = new StringTokenizer(str, delimiterset);
-        StringTokenizer stdelimitersetreturn = new StringTokenizer(str, 
+        StringTokenizer stdelimitersetreturn = new StringTokenizer(str,
                                                                 delimiterset,
                                                                 false);
         for (int i = 0; i < expected.length; i ++) {
-            if (!(defaultst.nextElement().equals(expected[i]) 
+            if (!(defaultst.nextElement().equals(expected[i])
                   && stdelimiter.nextElement().equals(expected[i])
                   && stdelimiterreturn.nextElement().equals(expected[i])
                   && stdelimiterset.nextElement().equals(expected[i])
@@ -63,13 +66,13 @@ public final class StringTokenizerTest extends TestFmwk
                 errln("Constructor with default delimiter gives wrong results");
             }
         }
-        
+
         UnicodeSet delimiterset1 = new UnicodeSet("[" + delimiter + "]", true);
         StringTokenizer stdelimiterset1 = new StringTokenizer(str, delimiterset1);
         if(!(stdelimiterset1.nextElement().equals(str)))
             errln("Constructor with a UnicodeSet to ignoreWhiteSpace is " +
                     "to return the same string.");
-        
+
         String expected1[] = {"this", "\t", "is", "\n", "a", "\r", "string", "\f",
                             "testing", "\t", "StringTokenizer", "\n",
                             "constructors!"};
@@ -81,34 +84,34 @@ public final class StringTokenizerTest extends TestFmwk
                 errln("Constructor with default delimiter and delimiter tokens gives wrong results");
             }
         }
-                            
+
         stdelimiter = new StringTokenizer(str, (String)null);
         stdelimiterreturn = new StringTokenizer(str, (String)null, false);
         delimiterset = null;
         stdelimiterset = new StringTokenizer(str, delimiterset);
         stdelimitersetreturn = new StringTokenizer(str, delimiterset, false);
-        
+
         if (!(stdelimiter.nextElement().equals(str)
               && stdelimiterreturn.nextElement().equals(str)
               && stdelimiterset.nextElement().equals(str)
               && stdelimitersetreturn.nextElement().equals(str))) {
             errln("Constructor with null delimiter gives wrong results");
         }
-        
+
         delimiter = "";
         stdelimiter = new StringTokenizer(str, delimiter);
         stdelimiterreturn = new StringTokenizer(str, delimiter, false);
         delimiterset = new UnicodeSet();
         stdelimiterset = new StringTokenizer(str, delimiterset);
         stdelimitersetreturn = new StringTokenizer(str, delimiterset, false);
-        
+
         if (!(stdelimiter.nextElement().equals(str)
               && stdelimiterreturn.nextElement().equals(str)
               && stdelimiterset.nextElement().equals(str)
               && stdelimitersetreturn.nextElement().equals(str))) {
             errln("Constructor with empty delimiter gives wrong results");
         }
-        
+
         try {
             defaultst = new StringTokenizer(null);
             errln("null string should throw an exception");
@@ -141,7 +144,7 @@ public final class StringTokenizerTest extends TestFmwk
             logln("PASS: Constructor with null string failed as expected");
         }
     }
-    
+
     /**
      * Testing supplementary
      */
@@ -151,7 +154,7 @@ public final class StringTokenizerTest extends TestFmwk
         String str = "bmp string \ud800 with a unmatched surrogate character";
         String delimiter = "\ud800\udc00";
         String expected[] = {str};
-            
+
         StringTokenizer tokenizer = new StringTokenizer(str, delimiter);
         if (!tokenizer.nextElement().equals(expected[0])) {
             errln("Error parsing \"" + Utility.hex(str) + "\"");
@@ -160,7 +163,7 @@ public final class StringTokenizerTest extends TestFmwk
             errln("Number of tokens exceeded expected");
         }
         delimiter = "\ud800";
-        String expected1[] = {"bmp string ", 
+        String expected1[] = {"bmp string ",
                               " with a unmatched surrogate character"};
         tokenizer = new StringTokenizer(str, delimiter);
         int i = 0;
@@ -172,7 +175,7 @@ public final class StringTokenizerTest extends TestFmwk
         if (tokenizer.hasMoreElements()) {
             errln("Number of tokens exceeded expected");
         }
-        
+
         str = "string \ud800\udc00 with supplementary character";
         delimiter = "\ud800";
         String expected2[] = {str};
@@ -183,7 +186,7 @@ public final class StringTokenizerTest extends TestFmwk
         if (tokenizer.hasMoreElements()) {
             errln("Number of tokens exceeded expected");
         }
-  
+
         delimiter = "\ud800\udc00";
         String expected3[] = {"string ", " with supplementary character"};
         tokenizer = new StringTokenizer(str, delimiter);
@@ -196,7 +199,7 @@ public final class StringTokenizerTest extends TestFmwk
         if (tokenizer.hasMoreElements()) {
             errln("Number of tokens exceeded expected");
         }
-        
+
         str = "\ud800 \ud800\udc00 \ud800 \ud800\udc00";
         delimiter = "\ud800";
         String expected4[] = {" \ud800\udc00 ", " \ud800\udc00"};
@@ -209,7 +212,7 @@ public final class StringTokenizerTest extends TestFmwk
         if (tokenizer.hasMoreElements()) {
             errln("Number of tokens exceeded expected");
         }
-        
+
         delimiter = "\ud800\udc00";
         String expected5[] = {"\ud800 ", " \ud800 "};
         i = 0;
@@ -222,7 +225,7 @@ public final class StringTokenizerTest extends TestFmwk
             errln("Number of tokens exceeded expected");
         }
     }
-  
+
       /**
       * Testing next api
       */
@@ -230,10 +233,10 @@ public final class StringTokenizerTest extends TestFmwk
       public void TestNextNonDelimiterToken()
       {
         String str = "  ,  1 2 3  AHHHHH! 5.5 6 7    ,        8\n";
-        String expected[] = {",", "1", "2", "3", "AHHHHH!", "5.5", "6", "7", 
+        String expected[] = {",", "1", "2", "3", "AHHHHH!", "5.5", "6", "7",
                              ",", "8\n"};
         String delimiter = " ";
-                           
+
         StringTokenizer tokenizer = new StringTokenizer(str, delimiter);
         int currtoken = 0;
         while (tokenizer.hasMoreElements()) {
@@ -246,7 +249,7 @@ public final class StringTokenizerTest extends TestFmwk
         if (currtoken != expected.length) {
             errln("Didn't get correct number of tokens");
         }
-        
+
         tokenizer = new StringTokenizer("", delimiter);
         if (tokenizer.hasMoreElements()) {
             errln("Empty string should not have any tokens");
@@ -257,7 +260,7 @@ public final class StringTokenizerTest extends TestFmwk
         } catch (Exception e) {
             logln("PASS: empty string failed as expected");
         }
-        
+
         tokenizer = new StringTokenizer(", ,", ", ");
         if (tokenizer.hasMoreElements()) {
             errln("String with only delimiters should not have any tokens");
@@ -275,7 +278,7 @@ public final class StringTokenizerTest extends TestFmwk
         }
         if (!tokenizer.nextElement().equals("q")) {
             errln("String that does not begin with delimiters should have some tokens");
-        } 
+        }
         try {
             tokenizer.nextElement();
             errln("String has only one token");
@@ -335,7 +338,7 @@ public final class StringTokenizerTest extends TestFmwk
                              "AHHHHH!", " ", "5.5", " ", "6", " ", "7", "    ",
                              ",", "        ", "8\n"};
         String delimiter = " ";
-                           
+
         StringTokenizer tokenizer = new StringTokenizer(str, delimiter, true, true);
 
         int currtoken = 0;
@@ -349,7 +352,7 @@ public final class StringTokenizerTest extends TestFmwk
         if (currtoken != expected.length) {
             errln("Didn't get correct number of tokens");
         }
-        
+
         tokenizer = new StringTokenizer("", delimiter, true);
         if (tokenizer.hasMoreElements()) {
             errln("Empty string should not have any tokens");
@@ -360,7 +363,7 @@ public final class StringTokenizerTest extends TestFmwk
         } catch (Exception e) {
             logln("PASS: Empty string failed as expected");
         }
-        
+
         tokenizer = new StringTokenizer(", ,", ", ", true, true);
         if (!tokenizer.hasMoreElements()) {
             errln("String with only delimiters should have tokens when delimiter is treated as tokens");
@@ -370,14 +373,14 @@ public final class StringTokenizerTest extends TestFmwk
         }
 
         tokenizer = new StringTokenizer("q, ,", ", ", true, true);
-        
+
         if (!tokenizer.hasMoreElements()) {
             errln("String should have some tokens");
         }
-        if (!tokenizer.nextElement().equals("q") 
+        if (!tokenizer.nextElement().equals("q")
             || !tokenizer.nextElement().equals(", ,")) {
             errln("String tokens do not match expected results");
-        } 
+        }
 
         try {
             tokenizer = new StringTokenizer(null, delimiter, true);
@@ -391,7 +394,7 @@ public final class StringTokenizerTest extends TestFmwk
             errln("Should have recieved the same string when there are no delimiters");
         }
     }
-    
+
     /**
      * Testing count tokens
      */
@@ -400,10 +403,10 @@ public final class StringTokenizerTest extends TestFmwk
     {
         String str = "this\tis\na\rstring\ftesting\tStringTokenizer\nconstructors!";
         String delimiter = " \t\n\r\f";
-        String expected[] = {"this", "is", "a", "string", "testing", 
+        String expected[] = {"this", "is", "a", "string", "testing",
                              "StringTokenizer", "constructors!"};
-        String expectedreturn[] = {"this", "\t", "is", "\n", "a", "\r", 
-                                   "string", "\f", "testing", "\t", 
+        String expectedreturn[] = {"this", "\t", "is", "\n", "a", "\r",
+                                   "string", "\f", "testing", "\t",
                                    "StringTokenizer", "\n", "constructors!"};
         StringTokenizer st = new StringTokenizer(str, delimiter);
         StringTokenizer streturn = new StringTokenizer(str, delimiter, true);
@@ -424,9 +427,9 @@ public final class StringTokenizerTest extends TestFmwk
                 || streturn.countTokens() != expectedreturn.length - i - 1) {
                 errln("CountTokens with default delimiter and delimiter tokens gives wrong results");
             }
-        }    
+        }
     }
-        
+
     /**
      * Next token with new delimiters
      */
@@ -448,15 +451,15 @@ public final class StringTokenizerTest extends TestFmwk
                 if (!st.nextToken(delimiter[j]).equals(expected[j][i])) {
                     errln("nextToken() with delimiters error " + i + " " + j);
                 }
-                if (st.countTokens() != expected[j].length - i) {            
+                if (st.countTokens() != expected[j].length - i) {
                     errln("countTokens() after nextToken() with delimiters error"
                           + i + " " + j);
                 }
             }
-        }    
+        }
         st = new StringTokenizer(str);
         String delimiter1[] = {"0", "2", "4"};
-        String expected1[] = {"abc", "def1ghi", "jkl3mno", "pqr", "stu1vwx", 
+        String expected1[] = {"abc", "def1ghi", "jkl3mno", "pqr", "stu1vwx",
                               "yza3bcd", "efg", "hij1klm", "nop3qrs", "tuv"};
         for (int i = 0; i < expected1.length; i ++) {
             if (!st.nextToken(delimiter1[i % delimiter1.length]).equals(
@@ -465,7 +468,7 @@ public final class StringTokenizerTest extends TestFmwk
             }
         }
     }
-    
+
     @Test
     public void TestBug4423()
     {
@@ -474,7 +477,7 @@ public final class StringTokenizerTest extends TestFmwk
         String s1 = "This is a test";
         StringTokenizer tzr = new StringTokenizer(s1);
         int  tokenCount = 0;
-        
+
         int t = tzr.countTokens();
         if (t!= 4) {
             errln("tzr.countTokens() returned " + t + ".  Expected 4");
@@ -489,7 +492,7 @@ public final class StringTokenizerTest extends TestFmwk
         if (tokenCount != 4) {
             errln("Incorrect number of tokens found = " + tokenCount);
         }
-        
+
         // Precomputed tokens arrays can grow.  Check for edge cases around
         //  boundary where growth is forced.  Array grows in increments of 100 tokens.
         String s2 = "";
@@ -517,7 +520,7 @@ public final class StringTokenizerTest extends TestFmwk
                 break;
             }
         }
-        
+
     }
 
     @Test
@@ -561,13 +564,13 @@ public final class StringTokenizerTest extends TestFmwk
         } catch(Exception e){
             errln("UnicodeSet._generatePattern is not suppose to return an exception.");
         }
-        
+
         try{
             us._generatePattern(null, true);
             errln("UnicodeSet._generatePattern is suppose to return an exception.");
         } catch(Exception e){}
     }
-    
+
     /* Tests the method
      *      public int matches(Replaceable text, int[] offset, int limit, boolean incremental)
      */
@@ -577,20 +580,20 @@ public final class StringTokenizerTest extends TestFmwk
         ReplaceableString rs = new ReplaceableString("dummy");
         UnicodeSet us = new UnicodeSet(0,100000); // Create a large Unicode set
         us.add("dummy");
-        
+
         int[] offset = {0};
         int limit = 0;
-        
+
         if(us.matches(null, offset, limit, true) != UnicodeSet.U_PARTIAL_MATCH){
             errln("UnicodeSet.matches is suppose to return " + UnicodeSet.U_PARTIAL_MATCH +
                     " but got " + us.matches(null, offset, limit, true));
         }
-        
+
         if(us.matches(null, offset, limit, false) != UnicodeSet.U_MATCH){
             errln("UnicodeSet.matches is suppose to return " + UnicodeSet.U_MATCH +
                     " but got " + us.matches(null, offset, limit, false));
         }
-        
+
         // Tests when "int maxLen = forward ? limit-offset[0] : offset[0]-limit;" is true and false
         try{
             offset[0] = 0; // Takes the letter "d"
@@ -600,10 +603,10 @@ public final class StringTokenizerTest extends TestFmwk
         } catch(Exception e) {
             errln("UnicodeSet.matches is not suppose to return an exception");
         }
-        
+
         // TODO: Tests when "if (forward && length < highWaterLength)" is true
     }
-    
+
     /* Tests the method
      *      private static int matchRest (Replaceable text, int start, int limit, String s)
      * from public int matches(Replaceable text, ...
@@ -612,26 +615,26 @@ public final class StringTokenizerTest extends TestFmwk
     public void TestMatchRest(){
         // TODO: Tests when "if (maxLen > slen) maxLen = slen;" is true and false
     }
-    
+
     /* Tests the method
      *      public int matchesAt(CharSequence text, int offset)
      */
     @Test
     public void TestMatchesAt(){
         UnicodeSet us = new UnicodeSet();           // Empty set
-        us.matchesAt((CharSequence)"dummy", 0);
+        us.matchesAt("dummy", 0);
         us.add("dummy");                            // Add an item
-        
-        us.matchesAt((CharSequence)"dummy", 0);
+
+        us.matchesAt("dummy", 0);
         us.add("dummy2");                           // Add another item
-        
-        us.matchesAt((CharSequence)"yummy", 0);     //charAt(0) >
-        us.matchesAt((CharSequence)"amy", 0);       //charAt(0) <
-        
+
+        us.matchesAt("yummy", 0);     //charAt(0) >
+        us.matchesAt("amy", 0);       //charAt(0) <
+
         UnicodeSet us1 = new UnicodeSet(0,100000);  // Increase the set
-        us1.matchesAt((CharSequence)"dummy", 0);
+        us1.matchesAt("dummy", 0);
     }
-    
+
     /* Tests the method
      *      public int indexOf(int c)
      */
@@ -641,9 +644,9 @@ public final class StringTokenizerTest extends TestFmwk
         UnicodeSet us = new UnicodeSet();
         int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                 UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-        int[] valid = {UnicodeSet.MIN_VALUE, UnicodeSet.MIN_VALUE+1, 
+        int[] valid = {UnicodeSet.MIN_VALUE, UnicodeSet.MIN_VALUE+1,
                 UnicodeSet.MAX_VALUE, UnicodeSet.MAX_VALUE-1};
-        
+
         for(int i=0; i < invalid.length; i++){
             try{
                 us.indexOf(invalid[i]);
@@ -651,7 +654,7 @@ public final class StringTokenizerTest extends TestFmwk
                         "for a value of " + invalid[i]);
             } catch(Exception e){}
         }
-        
+
         for(int i=0; i < valid.length; i++){
             try{
                 us.indexOf(valid[i]);
@@ -661,14 +664,14 @@ public final class StringTokenizerTest extends TestFmwk
             }
         }
     }
-    
+
     /* Tests the method
      *      public int charAt(int index)
      */
     @Test
     public void TestCharAt(){
         UnicodeSet us = new UnicodeSet();
-        
+
         // Test when "if (index >= 0)" is false
         int[] invalid = {-100,-10,-5,-2,-1};
         for(int i=0; i < invalid.length; i++){
@@ -678,7 +681,7 @@ public final class StringTokenizerTest extends TestFmwk
             }
         }
     }
-    
+
     /* Tests the method
      *      private UnicodeSet add_unchecked(int start, int end)
      * from public UnicodeSet add(int start, int end)
@@ -688,7 +691,7 @@ public final class StringTokenizerTest extends TestFmwk
          UnicodeSet us = new UnicodeSet();
          int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                  UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-         
+
          // Tests when "if (start < MIN_VALUE || start > MAX_VALUE)" is true
          for(int i=0; i < invalid.length; i++){
              try{
@@ -698,7 +701,7 @@ public final class StringTokenizerTest extends TestFmwk
                          + invalid[i]);
              } catch (Exception e){}
          }
-         
+
          // Tests when "if (end < MIN_VALUE || end > MAX_VALUE)" is true
          for(int i=0; i < invalid.length; i++){
              try{
@@ -708,19 +711,19 @@ public final class StringTokenizerTest extends TestFmwk
                          + invalid[i]);
              } catch (Exception e){}
          }
-         
+
          // Tests when "else if (start == end)" is false
          if(!(us.add(UnicodeSet.MIN_VALUE+1, UnicodeSet.MIN_VALUE).equals(us)))
              errln("UnicodeSet.add(int start, int end) was suppose to return "
                      + "the same object because start of value " + (UnicodeSet.MIN_VALUE+1)
                      + " is greater than end of value " + UnicodeSet.MIN_VALUE);
-         
+
          if(!(us.add(UnicodeSet.MAX_VALUE, UnicodeSet.MAX_VALUE-1).equals(us)))
              errln("UnicodeSet.add(int start, int end) was suppose to return "
                      + "the same object because start of value " + UnicodeSet.MAX_VALUE
                      + " is greater than end of value " + (UnicodeSet.MAX_VALUE-1));
      }
-     
+
      /* Tests the method
       *     private final UnicodeSet add_unchecked(int c)
       * from public final UnicodeSet add(int c)
@@ -730,7 +733,7 @@ public final class StringTokenizerTest extends TestFmwk
          UnicodeSet us = new UnicodeSet();
          int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                  UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-         
+
          // Tests when "if (c < MIN_VALUE || c > MAX_VALUE)" is true
          for(int i=0; i < invalid.length; i++){
              try{
@@ -740,11 +743,11 @@ public final class StringTokenizerTest extends TestFmwk
                          + invalid[i]);
              } catch (Exception e){}
          }
-         
+
          // Tests when "if (c == MAX_VALUE)" is true
          // TODO: Check comment in UnicodeSet.java
      }
-     
+
      /* Tests the method
       *     private static int getSingleCP(String s)
       * from public final boolean contains(String s)
@@ -758,15 +761,15 @@ public final class StringTokenizerTest extends TestFmwk
              errln("UnicodeSet.getSingleCP is suppose to give an exception for " +
                      "an empty string.");
          } catch (Exception e){}
-         
+
          try{
              us.contains((String)null);
              errln("UnicodeSet.getSingleCP is suppose to give an exception for " +
              "a null string.");
          } catch (Exception e){}
-         
+
          // Tests when "if (cp > 0xFFFF)" is true
-         String[] cases = {"\uD811\uDC00","\uD811\uDC11","\uD811\uDC22"}; 
+         String[] cases = {"\uD811\uDC00","\uD811\uDC11","\uD811\uDC22"};
          for(int i=0; i<cases.length; i++){
              try{
                  us.contains(cases[i]);
@@ -776,7 +779,7 @@ public final class StringTokenizerTest extends TestFmwk
              }
          }
      }
-     
+
      /* Tests the method
       *     public final UnicodeSet removeAllStrings()
       */
@@ -791,7 +794,7 @@ public final class StringTokenizerTest extends TestFmwk
                      "exception for a strings size of 0");
          }
      }
-     
+
      /* Tests the method
       *     public UnicodeSet retain(int start, int end)
       */
@@ -800,7 +803,7 @@ public final class StringTokenizerTest extends TestFmwk
           UnicodeSet us = new UnicodeSet();
           int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                   UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-          
+
           // Tests when "if (start < MIN_VALUE || start > MAX_VALUE)" is true
           for(int i=0; i < invalid.length; i++){
               try{
@@ -810,7 +813,7 @@ public final class StringTokenizerTest extends TestFmwk
                           + invalid[i]);
               } catch (Exception e){}
           }
-          
+
           // Tests when "if (end < MIN_VALUE || end > MAX_VALUE)" is true
           for(int i=0; i < invalid.length; i++){
               try{
@@ -820,7 +823,7 @@ public final class StringTokenizerTest extends TestFmwk
                           + invalid[i]);
               } catch (Exception e){}
           }
-          
+
           // Tests when "if (start <= end)" is false
           try{
               us.retain(UnicodeSet.MIN_VALUE+1, UnicodeSet.MIN_VALUE);
@@ -828,7 +831,7 @@ public final class StringTokenizerTest extends TestFmwk
               errln("UnicodeSet.retain(int start, int end) was not suppose to give "
                       + "an exception.");
           }
-          
+
           try{
               us.retain(UnicodeSet.MAX_VALUE, UnicodeSet.MAX_VALUE-1);
           } catch(Exception e){
@@ -836,7 +839,7 @@ public final class StringTokenizerTest extends TestFmwk
                       + "an exception.");
           }
       }
-      
+
       /* Tests the method
        *        public final UnicodeSet retain(String s)
        */
@@ -850,7 +853,7 @@ public final class StringTokenizerTest extends TestFmwk
                       "same UnicodeSet since the string was found in the original.");
           }
       }
-      
+
       /* Tests the method
        *     public UnicodeSet remove(int start, int end)
        */
@@ -859,7 +862,7 @@ public final class StringTokenizerTest extends TestFmwk
            UnicodeSet us = new UnicodeSet();
            int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                    UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-           
+
            // Tests when "if (start < MIN_VALUE || start > MAX_VALUE)" is true
            for(int i=0; i < invalid.length; i++){
                try{
@@ -869,7 +872,7 @@ public final class StringTokenizerTest extends TestFmwk
                            + invalid[i]);
                } catch (Exception e){}
            }
-           
+
            // Tests when "if (end < MIN_VALUE || end > MAX_VALUE)" is true
            for(int i=0; i < invalid.length; i++){
                try{
@@ -879,7 +882,7 @@ public final class StringTokenizerTest extends TestFmwk
                            + invalid[i]);
                } catch (Exception e){}
            }
-           
+
            // Tests when "if (start <= end)" is false
            try{
                us.remove(UnicodeSet.MIN_VALUE+1, UnicodeSet.MIN_VALUE);
@@ -887,7 +890,7 @@ public final class StringTokenizerTest extends TestFmwk
                errln("UnicodeSet.remove(int start, int end) was not suppose to give "
                        + "an exception.");
            }
-           
+
            try{
                us.remove(UnicodeSet.MAX_VALUE, UnicodeSet.MAX_VALUE-1);
            } catch(Exception e){
@@ -895,7 +898,7 @@ public final class StringTokenizerTest extends TestFmwk
                        + "an exception.");
            }
        }
-       
+
        /* Tests the method
         *     public UnicodeSet complement(int start, int end)
         */
@@ -904,7 +907,7 @@ public final class StringTokenizerTest extends TestFmwk
             UnicodeSet us = new UnicodeSet();
             int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                     UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-            
+
             // Tests when "if (start < MIN_VALUE || start > MAX_VALUE)" is true
             for(int i=0; i < invalid.length; i++){
                 try{
@@ -914,7 +917,7 @@ public final class StringTokenizerTest extends TestFmwk
                             + invalid[i]);
                 } catch (Exception e){}
             }
-            
+
             // Tests when "if (end < MIN_VALUE || end > MAX_VALUE)" is true
             for(int i=0; i < invalid.length; i++){
                 try{
@@ -924,7 +927,7 @@ public final class StringTokenizerTest extends TestFmwk
                             + invalid[i]);
                 } catch (Exception e){}
             }
-            
+
             // Tests when "if (start <= end)" is false
             try{
                 us.complement(UnicodeSet.MIN_VALUE+1, UnicodeSet.MIN_VALUE);
@@ -932,7 +935,7 @@ public final class StringTokenizerTest extends TestFmwk
                 errln("UnicodeSet.complement(int start, int end) was not suppose to give "
                         + "an exception.");
             }
-            
+
             try{
                 us.complement(UnicodeSet.MAX_VALUE, UnicodeSet.MAX_VALUE-1);
             } catch(Exception e){
@@ -940,7 +943,7 @@ public final class StringTokenizerTest extends TestFmwk
                         + "an exception.");
             }
         }
-        
+
         /* Tests the method
          *      public final UnicodeSet complement(String s)
          */
@@ -955,7 +958,7 @@ public final class StringTokenizerTest extends TestFmwk
                 errln("UnicodeSet.complement(String s) was not suppose to give "
                         + "an exception for 'dummy'.");
             }
-            
+
             // Tests when "if (strings.contains(s))" is true
             us = new UnicodeSet();
             us.add("\uDC11");
@@ -966,7 +969,7 @@ public final class StringTokenizerTest extends TestFmwk
                         + "an exception for '\uDC11'.");
             }
         }
-        
+
         /* Tests the method
          *      public boolean contains(int c)
          */
@@ -975,7 +978,7 @@ public final class StringTokenizerTest extends TestFmwk
             UnicodeSet us = new UnicodeSet();
             int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                     UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-            
+
             // Tests when "if (c < MIN_VALUE || c > MAX_VALUE)" is true
             for(int i=0; i < invalid.length; i++){
                 try{
@@ -986,7 +989,7 @@ public final class StringTokenizerTest extends TestFmwk
                 } catch (Exception e){}
             }
         }
-        
+
         /* Tests the method
          *     public boolean contains(int start, int end)
          */
@@ -995,7 +998,7 @@ public final class StringTokenizerTest extends TestFmwk
              UnicodeSet us = new UnicodeSet();
              int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                      UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-             
+
              // Tests when "if (start < MIN_VALUE || start > MAX_VALUE)" is true
              for(int i=0; i < invalid.length; i++){
                  try{
@@ -1005,7 +1008,7 @@ public final class StringTokenizerTest extends TestFmwk
                              + invalid[i]);
                  } catch (Exception e){}
              }
-             
+
              // Tests when "if (end < MIN_VALUE || end > MAX_VALUE)" is true
              for(int i=0; i < invalid.length; i++){
                  try{
@@ -1016,7 +1019,7 @@ public final class StringTokenizerTest extends TestFmwk
                  } catch (Exception e){}
              }
          }
-         
+
          /* Tests the method
           *     public String getRegexEquivalent()
           */
@@ -1028,7 +1031,7 @@ public final class StringTokenizerTest extends TestFmwk
                  errln("UnicodeSet.getRegexEquivalent is suppose to return '[]' " +
                          "but got " + res);
          }
-         
+
          /* Tests the method
           *     public boolean containsNone(int start, int end)
           */
@@ -1037,7 +1040,7 @@ public final class StringTokenizerTest extends TestFmwk
               UnicodeSet us = new UnicodeSet();
               int[] invalid = {UnicodeSet.MIN_VALUE-1, UnicodeSet.MIN_VALUE-2,
                       UnicodeSet.MAX_VALUE+1, UnicodeSet.MAX_VALUE+2};
-              
+
               // Tests when "if (start < MIN_VALUE || start > MAX_VALUE)" is true
               for(int i=0; i < invalid.length; i++){
                   try{
@@ -1047,7 +1050,7 @@ public final class StringTokenizerTest extends TestFmwk
                               + invalid[i]);
                   } catch (Exception e){}
               }
-              
+
               // Tests when "if (end < MIN_VALUE || end > MAX_VALUE)" is true
               for(int i=0; i < invalid.length; i++){
                   try{
@@ -1057,7 +1060,7 @@ public final class StringTokenizerTest extends TestFmwk
                               + invalid[i]);
                   } catch (Exception e){}
               }
-              
+
               // Tests when "if (start < list[++i])" is false
               try{
                   us.add(0);
index 42c9f10d235379775945714c30a153d883814319..7a411b86484333521b5609acc745ff8caadeac11 100644 (file)
@@ -16,6 +16,8 @@ import java.util.Map.Entry;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ValidIdentifiers;
@@ -31,6 +33,7 @@ import com.ibm.icu.util.ULocale;
  * @author markdavis
  *
  */
+@RunWith(JUnit4.class)
 public class TestLocaleValidity extends TestFmwk {
     @Test
     public void testBasic() {
index d95812a66bf8cc1cadc6d1e9c8050e14792a82a2..4266d9c37d6ad73277230dcdfe676ac123da31ba 100644 (file)
@@ -12,10 +12,13 @@ import java.util.Arrays;
 import java.util.Iterator;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.TextTrieMap;
 
+@RunWith(JUnit4.class)
 public class TextTrieMapTest extends TestFmwk {
 
     private static final Integer SUN = new Integer(1);
index 9d37181254baccab52c46170542688b242a77655..843272aba72e49ac8ed4c9d3f91b13704e1409df 100644 (file)
@@ -17,6 +17,8 @@ import java.nio.ByteBuffer;
 import java.util.Iterator;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.ICUBinary;
@@ -25,6 +27,7 @@ import com.ibm.icu.impl.Trie2Writable;
 import com.ibm.icu.impl.Trie2_16;
 import com.ibm.icu.impl.Trie2_32;
 
+@RunWith(JUnit4.class)
 public class Trie2Test extends TestFmwk {
     /**
      * Constructor
@@ -32,9 +35,9 @@ public class Trie2Test extends TestFmwk {
      public Trie2Test()
      {
      }
-       
+
      // public methods -----------------------------------------------
-     
+
      //
      //  TestAPI.  Check that all API methods can be called, and do at least some minimal
      //            operation correctly.  This is not a full test of correct behavior.
@@ -42,11 +45,11 @@ public class Trie2Test extends TestFmwk {
     @Test
      public void TestTrie2API() {
          // Trie2.createFromSerialized()
-         //   This function is well exercised by TestRanges().   
-         
+         //   This function is well exercised by TestRanges().
+
          // Trie2.getVersion(InputStream is, boolean anyEndianOk)
          //
-         
+
          try {
              Trie2Writable trie = new Trie2Writable(0,0);
              ByteArrayOutputStream os = new ByteArrayOutputStream();
@@ -54,9 +57,9 @@ public class Trie2Test extends TestFmwk {
              ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
              assertEquals(null, 2, Trie2.getVersion(is, true));
          } catch (IOException e) {
-             errln(where() + e.toString());            
+             errln(where() + e.toString());
          }
-         
+
          // Equals & hashCode
          //
          {
@@ -77,28 +80,28 @@ public class Trie2Test extends TestFmwk {
              assertEquals("", trieA, trieB);
              assertEquals("", trieA.hashCode(), trieB.hashCode());
          }
-         
-         // 
+
+         //
          // Iterator creation
          //
          {
              Trie2Writable trie = new Trie2Writable(17,0);
              Iterator<Trie2.Range>   it;
              it = trie.iterator();
-             
+
              Trie2.Range r = it.next();
              assertEquals("", 0, r.startCodePoint);
              assertEquals("", 0x10ffff, r.endCodePoint);
              assertEquals("", 17, r.value);
              assertEquals("", false, r.leadSurrogate);
-             
+
              r = it.next();
              assertEquals("", 0xd800, r.startCodePoint);
              assertEquals("", 0xdbff, r.endCodePoint);
              assertEquals("", 17, r.value);
              assertEquals("", true, r.leadSurrogate);
-             
-        
+
+
              int i = 0;
              for (Trie2.Range rr: trie) {
                  switch (i) {
@@ -120,15 +123,16 @@ public class Trie2Test extends TestFmwk {
                  i++;
              }
          }
-         
+
          // Iteration with a value mapping function
          //
          {
              Trie2Writable trie = new Trie2Writable(0xbadfeed, 0);
              trie.set(0x10123, 42);
-             
+
              Trie2.ValueMapper vm = new Trie2.ValueMapper() {
-                 public int map(int v) {
+                 @Override
+                public int map(int v) {
                      if (v == 0xbadfeed) {
                          v = 42;
                      }
@@ -142,8 +146,8 @@ public class Trie2Test extends TestFmwk {
              assertEquals("", 42, r.value);
              assertEquals("", false, r.leadSurrogate);
          }
-         
-         
+
+
          // Iteration over a leading surrogate range.
          //
          {
@@ -155,7 +159,7 @@ public class Trie2Test extends TestFmwk {
              assertEquals("", 0x2f80f,  r.endCodePoint);
              assertEquals("", 0xdefa17, r.value);
              assertEquals("", false,    r.leadSurrogate);
-             
+
              r = it.next();
              assertEquals("", 0x2f810, r.startCodePoint);
              assertEquals("", 0x2f810, r.endCodePoint);
@@ -167,22 +171,23 @@ public class Trie2Test extends TestFmwk {
              assertEquals("", 0x2fbff,  r.endCodePoint);
              assertEquals("", 0xdefa17, r.value);
              assertEquals("", false,    r.leadSurrogate);
-             
+
              assertFalse("", it.hasNext());
          }
-         
+
          // Iteration over a leading surrogate range with a ValueMapper.
          //
          {
              Trie2Writable trie = new Trie2Writable(0xdefa17, 0);
              trie.set(0x2f810, 10);
              Trie2.ValueMapper m = new Trie2.ValueMapper() {
-                 public int map(int in) {
+                 @Override
+                public int map(int in) {
                      if (in==10) {
-                         in = 0xdefa17;                         
+                         in = 0xdefa17;
                      }
                      return in;
-                 }               
+                 }
              };
              Iterator<Trie2.Range> it = trie.iteratorForLeadSurrogate((char)0xd87e, m);
              Trie2.Range r = it.next();
@@ -193,7 +198,7 @@ public class Trie2Test extends TestFmwk {
 
              assertFalse("", it.hasNext());
          }
-         
+
          // Trie2.serialize()
          //     Test the implementation in Trie2, which is used with Read Only Tries.
          //
@@ -212,7 +217,7 @@ public class Trie2Test extends TestFmwk {
                  Trie2 unserialized16 = Trie2.createFromSerialized(ByteBuffer.wrap(os.toByteArray()));
                  assertEquals("", trie, unserialized16);
                  assertEquals("", Trie2_16.class, unserialized16.getClass());
-                 
+
                  os.reset();
                  frozen32.serialize(os);
                  Trie2 unserialized32 = Trie2.createFromSerialized(ByteBuffer.wrap(os.toByteArray()));
@@ -221,26 +226,26 @@ public class Trie2Test extends TestFmwk {
              } catch (IOException e) {
                  errln(where() + " Unexpected exception:  " + e);
              }
-                 
-             
+
+
          }
      }
-     
-     
+
+
     @Test
      public void TestTrie2WritableAPI() {
          //
-         //   Trie2Writable methods.  Check that all functions are present and 
+         //   Trie2Writable methods.  Check that all functions are present and
          //      nominally working.  Not an in-depth test.
          //
-                 
+
          // Trie2Writable constructor
          Trie2 t1 = new Trie2Writable(6, 666);
-         
+
          // Constructor from another Trie2
          Trie2 t2 = new Trie2Writable(t1);
          assertTrue("", t1.equals(t2));
-         
+
          // Set / Get
          Trie2Writable t1w = new Trie2Writable(10, 666);
          t1w.set(0x4567, 99);
@@ -248,8 +253,8 @@ public class Trie2Test extends TestFmwk {
          assertEquals("", 99, t1w.get(0x4567));
          assertEquals("", 666, t1w.get(-1));
          assertEquals("", 666, t1w.get(0x110000));
-         
-         
+
+
          // SetRange
          t1w = new Trie2Writable(10, 666);
          t1w.setRange(13 /*start*/, 6666 /*end*/, 7788 /*value*/, false  /*overwrite */);
@@ -261,7 +266,7 @@ public class Trie2Test extends TestFmwk {
          assertEquals("", 9900, t1w.get(7000));
          assertEquals("",   10, t1w.get(7001));
          assertEquals("",  666, t1w.get(0x110000));
-         
+
          // setRange from a Trie2.Range
          //    (Ranges are more commonly created by iterating over a Trie2,
          //     but create one by hand here)
@@ -276,8 +281,8 @@ public class Trie2Test extends TestFmwk {
          assertEquals("", 0x12345678, t1w.get(50));
          assertEquals("", 0x12345678, t1w.get(52));
          assertEquals("", 0, t1w.get(53));
-         
-         
+
+
          // setForLeadSurrogateCodeUnit / getFromU16SingleLead
          t1w = new Trie2Writable(10, 0xbad);
          assertEquals("", 10, t1w.getFromU16SingleLead((char)0x0d801));
@@ -285,10 +290,10 @@ public class Trie2Test extends TestFmwk {
          t1w.set(0xd801, 6000);
          assertEquals("", 5000, t1w.getFromU16SingleLead((char)0x0d801));
          assertEquals("", 6000, t1w.get(0x0d801));
-         
+
          // get().  Is covered by nearly every other test.
-                 
-         
+
+
          // Trie2_16 getAsFrozen_16()
          t1w = new Trie2Writable(10, 666);
          t1w.set(42, 5555);
@@ -300,7 +305,7 @@ public class Trie2Test extends TestFmwk {
          t1_16 = t1w.toTrie2_16();
          assertTrue("", t1w.equals(t1_16));
          assertEquals("", 129, t1w.get(152));
-         
+
          // Trie2_32 getAsFrozen_32()
          //
          t1w = new Trie2Writable(10, 666);
@@ -314,10 +319,10 @@ public class Trie2Test extends TestFmwk {
          t1_32 = t1w.toTrie2_32();
          assertTrue("", t1w.equals(t1_32));
          assertEquals("", 129, t1w.get(152));
-         
-         
+
+
          // serialize(OutputStream os, ValueWidth width)
-         // 
+         //
          ByteArrayOutputStream os = new ByteArrayOutputStream();
          t1w = new Trie2Writable(0, 0xbad);
          t1w.set(0x41, 0x100);
@@ -336,7 +341,7 @@ public class Trie2Test extends TestFmwk {
              Trie2 t1ws16 = Trie2.createFromSerialized(ByteBuffer.wrap(os.toByteArray()));
              assertEquals("", t1ws16.getClass(), Trie2_16.class);
              assertEquals("", t1w, t1ws16);
-             
+
              // Serialize to 32 bits
              os.reset();
              serializedLen = t1w.toTrie2_32().serialize(os);
@@ -349,15 +354,15 @@ public class Trie2Test extends TestFmwk {
          } catch (IOException e) {
              errln(where() + e.toString());
          }
-         
-                
+
+
      }
-     
+
     @Test
      public void TestCharSequenceIterator() {
          String text = "abc123\ud800\udc01 ";    // Includes a Unicode supplemental character
          String vals = "LLLNNNX?S";
-         
+
          Trie2Writable  tw = new Trie2Writable(0, 666);
          tw.setRange('a', 'z', 'L', false);
          tw.setRange('1', '9', 'N', false);
@@ -365,7 +370,7 @@ public class Trie2Test extends TestFmwk {
          tw.set(0x10001, 'X');
 
          Trie2.CharSequenceIterator it = tw.charSequenceIterator(text, 0);
-         
+
          // Check forwards iteration.
          Trie2.CharSequenceValues ir;
          int i;
@@ -380,22 +385,22 @@ public class Trie2Test extends TestFmwk {
              }
          }
          assertEquals("", text.length(), i);
-         
+
          // Check reverse iteration, starting at an intermediate point.
          it.set(5);
          for (i=5; it.hasPrevious(); ) {
              ir = it.previous();
              int expectedCP = Character.codePointBefore(text, i);
-             i -= (expectedCP < 0x10000? 1 : 2);            
+             i -= (expectedCP < 0x10000? 1 : 2);
              assertEquals("" + " i="+i, expectedCP,     ir.codePoint);
              assertEquals("" + " i="+i, i,              ir.index);
              assertEquals("" + " i="+i, vals.charAt(i), ir.value);
          }
          assertEquals("", 0, i);
-         
+
      }
-     
-     
+
+
      //
      //  Port of Tests from ICU4C ...
      //
@@ -407,16 +412,16 @@ public class Trie2Test extends TestFmwk {
      //
      //     checkRanges array elemets are
      //        { limit code point, value}
-     // 
+     //
      //     The expected value range is from the previous boundary's limit to before
      //        this boundary's limit
 
-     // 
+     //
      String[] trieNames = {"setRanges1", "setRanges2", "setRanges3", "setRangesEmpty", "setRangesSingleValue"};
      /* set consecutive ranges, even with value 0 */
-          
-    
-         
+
+
+
      private static int[][] setRanges1 ={
          { 0,        0,        0,      0 },
          { 0,        0x40,     0,      0 },
@@ -579,14 +584,14 @@ public class Trie2Test extends TestFmwk {
          int i = 0;
          int initialValue = 0;
          int errorValue   = 0x0bad;
-         
+
          if (ranges[i][1] < 0) {
              errorValue = ranges[i][2];
              i++;
          }
          initialValue = ranges[i++][2];
          Trie2Writable trie = new Trie2Writable(initialValue, errorValue);
-         
+
          for (; i<ranges.length; i++) {
              int     rangeStart = ranges[i][0];
              int     rangeEnd   = ranges[i][1]-1;
@@ -594,23 +599,23 @@ public class Trie2Test extends TestFmwk {
              boolean overwrite = (ranges[i][3] != 0);
              trie.setRange(rangeStart, rangeEnd, value, overwrite);
          }
-         
+
          // Insert some non-default values for lead surrogates.
          //   TODO:  this should be represented in the data.
          trie.setForLeadSurrogateCodeUnit((char)0xd800, 90);
          trie.setForLeadSurrogateCodeUnit((char)0xd999, 94);
          trie.setForLeadSurrogateCodeUnit((char)0xdbff, 99);
-         
+
          return trie;
      }
 
-     
+
      //
      //  Check the expected values from a single Trie2.
      //
      private void trieGettersTest(String           testName,
                                   Trie2            trie,         // The Trie2 to test.
-                                  int[][]          checkRanges)  // Expected data. 
+                                  int[][]          checkRanges)  // Expected data.
                                                                  //   Tuples of (value, high limit code point)
                                                                  //   High limit is first code point following the range
                                                                  //   with the indicated value.
@@ -639,7 +644,7 @@ public class Trie2Test extends TestFmwk {
              while(start<limit) {
                  value2=trie.get(start);
                  if (value != value2) {
-                     // The redundant if, outside of the assert, is for speed.  
+                     // The redundant if, outside of the assert, is for speed.
                      // It makes a significant difference for this test.
                      assertEquals("wrong value for " + testName + " of " + Integer.toHexString(start), value, value2);
                  }
@@ -675,7 +680,7 @@ public class Trie2Test extends TestFmwk {
                  value2 = trie.getFromU16SingleLead((char)start);
                  if(value2!=value) {
                      errln(where() + " testName: " + testName + " getFromU16SingleLead() failed." +
-                             "char, exected, actual = " + Integer.toHexString(start) + ", " + 
+                             "char, exected, actual = " + Integer.toHexString(start) + ", " +
                              Integer.toHexString(value) + ", " + Integer.toHexString(value2));
                  }
              }
@@ -688,7 +693,7 @@ public class Trie2Test extends TestFmwk {
              errln("trie2.get() error value test.  Expected, actual1, actual2 = " +
                      errorValue + ", " + value + ", " + value2);
          }
-         
+
          // Check that Trie enumeration produces the same contents as simple get()
          for (Trie2.Range range: trie) {
              for (int cp=range.startCodePoint; cp<=range.endCodePoint; cp++) {
@@ -701,15 +706,15 @@ public class Trie2Test extends TestFmwk {
              }
          }
      }
-                     
+
      // Was testTrieRanges in ICU4C.  Renamed to not conflict with ICU4J test framework.
      private void checkTrieRanges(String testName, String serializedName, boolean withClone,
              int[][] setRanges, int [][] checkRanges) throws IOException {
-         
+
          // Run tests against Tries that were built by ICU4C and serialized.
          String fileName16 = "Trie2Test." + serializedName + ".16.tri2";
          String fileName32 = "Trie2Test." + serializedName + ".32.tri2";
-         
+
          InputStream is = Trie2Test.class.getResourceAsStream(fileName16);
          Trie2 trie16;
          try {
@@ -733,29 +738,29 @@ public class Trie2Test extends TestFmwk {
          trieGettersTest(testName, trieW,  checkRanges);
          assertEquals("", trieW, trie16);   // Locally built tries must be
          assertEquals("", trieW, trie32);   //   the same as those imported from ICU4C
-         
-         
+
+
          Trie2_32 trie32a = trieW.toTrie2_32();
          trieGettersTest(testName, trie32a, checkRanges);
 
          Trie2_16 trie16a = trieW.toTrie2_16();
          trieGettersTest(testName, trie16a, checkRanges);
-         
+
      }
-     
-     // Was "TrieTest" in trie2test.c 
+
+     // Was "TrieTest" in trie2test.c
     @Test
      public void TestRanges() throws IOException {
-         checkTrieRanges("set1",           "setRanges1",     false, setRanges1,     checkRanges1);         
+         checkTrieRanges("set1",           "setRanges1",     false, setRanges1,     checkRanges1);
          checkTrieRanges("set2-overlap",   "setRanges2",     false, setRanges2,     checkRanges2);
          checkTrieRanges("set3-initial-9", "setRanges3",     false, setRanges3,     checkRanges3);
          checkTrieRanges("set-empty",      "setRangesEmpty", false, setRangesEmpty, checkRangesEmpty);
-         checkTrieRanges("set-single-value", "setRangesSingleValue", false, setRangesSingleValue, 
+         checkTrieRanges("set-single-value", "setRangesSingleValue", false, setRangesSingleValue,
              checkRangesSingleValue);
          checkTrieRanges("set2-overlap.withClone", "setRanges2", true, setRanges2,     checkRanges2);
      }
 
-     
+
      private String where() {
          StackTraceElement[] st = new Throwable().getStackTrace();
          String w = "File: " + st[1].getFileName() + ", Line " + st[1].getLineNumber();
index c56752bac4936cc003743dbef14da602cbf8adef..2b1476e68feb5a2aed9357d3a38e61565443a8c9 100644 (file)
@@ -21,6 +21,8 @@ import java.util.TreeMap;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.util.TrieMap.Style;
@@ -35,6 +37,7 @@ import com.ibm.icu.text.UnicodeSet;
 import com.ibm.icu.util.StringTrieBuilder.Option;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class TrieMapTest extends TestFmwk {
     static final boolean SHORT = false;
     static final boolean HACK_TO_MAKE_TESTS_PASS = false;
@@ -98,7 +101,7 @@ public class TrieMapTest extends TestFmwk {
                     }
                 }
             }
-            int charCount = 0; 
+            int charCount = 0;
             for (String key : unicodeTestMap.keySet()) {
                 charCount += key.length();
             }
@@ -145,7 +148,7 @@ public class TrieMapTest extends TestFmwk {
                     assertEquals(style + "\tGet of '" + key + "' = {" + Utility.hex(key) + "}", value, foundValue);
                 }
             }
-        }        
+        }
     }
 
     @Ignore
@@ -168,6 +171,7 @@ public class TrieMapTest extends TestFmwk {
             Map<String, Integer> map = comparisonTime == 0 ? new TreeMap<String, Integer>(testMap) : new HashMap<String, Integer>(testMap);
 
             long mapTime = t.timeIterations(new MyLoop() {
+                @Override
                 public void time(int repeat) {
                     for (int tt = 0; tt < repeat; ++tt) {
                         for (Entry<String, Integer> entry : map.entrySet()) {
@@ -175,7 +179,7 @@ public class TrieMapTest extends TestFmwk {
                             Integer value = entry.getValue();
                         }
                     }
-                } 
+                }
             }, null, map);
             if (comparisonTime == 0) {
                 logln("\titeration time\tTREEMAP\tn/a\t" + t.toString(testMap.size()) + "\t\titerations=" + t.getIterations());
@@ -185,6 +189,7 @@ public class TrieMapTest extends TestFmwk {
             return mapTime;
         } else {
             long trieTime = t.timeIterations(new MyLoop() {
+                @Override
                 public void time(int repeat) {
                     for (int tt = 0; tt < repeat; ++tt) {
                         for (Entry<CharSequence, Integer> entry : trieMap) {
@@ -192,7 +197,7 @@ public class TrieMapTest extends TestFmwk {
                             Integer value = entry.getValue();
                         }
                     }
-                } 
+                }
             }, null, trieMap);
             logln("\titeration time\t" + style + "\tn/a\t" + t.toString(testMap.size(), comparisonTime) + "\titerations=" + t.getIterations());
             if (!useSmallList && trieTime > ratioToMap * comparisonTime) {
@@ -281,7 +286,7 @@ public class TrieMapTest extends TestFmwk {
             } while (hasMore);
         } while (matcher.nextStart());
         assertEquals(style + "\tTrieMap matcher", expectedList, actualList);
-        //        logln(bytes + "\tValue <" + value + "> at " 
+        //        logln(bytes + "\tValue <" + value + "> at "
         //                + start + ".." + end + ", "
         //                + string.substring(0, start) + "|"
         //                + string.substring(start, end) + "|"
@@ -307,32 +312,35 @@ public class TrieMapTest extends TestFmwk {
         if (style == null) {
             if (comparisonTime == 0) {
                 long mapTime = t.timeIterations(new MyLoop() {
+                    @Override
                     public void time(int repeat) {
                         for (int tt = 0; tt < repeat; ++tt) {
                             Map<String, Integer> map2 = new TreeMap<String, Integer>(map);
                         }
-                    } 
+                    }
                 }, null, testmap);
                 logln("\tbuild time\tTREEMAP\tn/a\t" + t.toString(testmap.size()) + "\t\titerations=" + t.getIterations());
                 return mapTime;
             } else {
                 long mapTime = t.timeIterations(new MyLoop() {
+                    @Override
                     public void time(int repeat) {
                         for (int tt = 0; tt < repeat; ++tt) {
                             Map<String, Integer> map2 = new HashMap<String, Integer>(map);
                         }
-                    } 
+                    }
                 }, null, testmap);
                 logln("\tbuild time\tHASHMAP\tn/a\t" + t.toString(testmap.size(), comparisonTime) + "\titerations=" + t.getIterations());
                 return mapTime;
             }
         } else {
             long trieTime = t.timeIterations(new MyLoop() {
+                @Override
                 public void time(int repeat) {
                     for (int tt = 0; tt < repeat; ++tt) {
                         trieMap = TrieMap.BytesBuilder.with(style, option, map).build();
                     }
-                } 
+                }
             }, null, testmap, style, option);
 
             logln("\tbuild time\t" + style + "\t" + option + "\t" + t.toString(testmap.size(), comparisonTime) + "\titerations=" + t.getIterations());
@@ -363,7 +371,7 @@ public class TrieMapTest extends TestFmwk {
             int mapKeyByteSize = 0;
             TreeMap<String, Integer> map = new TreeMap<String, Integer>(unicodeTestMap);
             for (Entry<String, Integer> entry : map.entrySet()) {
-                mapKeyByteSize += 8 * (int) ((((entry.getKey().length()) * 2) + 45) / 8);
+                mapKeyByteSize += 8 * ((((entry.getKey().length()) * 2) + 45) / 8);
             }
             logln("\tkey byte size\tTREEMAP\tn/a\t" + nf.format(mapKeyByteSize));
             return mapKeyByteSize;
@@ -423,13 +431,14 @@ public class TrieMapTest extends TestFmwk {
             Map<String, Integer> map = comparisonTime == 0 ? new TreeMap<String, Integer>(testmap) : new HashMap<String, Integer>(testmap);
 
             long mapTime = t.timeIterations(new MyLoop() {
+                @Override
                 public void time(int repeat) {
                     for (int tt = 0; tt < repeat; ++tt) {
                         for (String key : keys) {
                             Integer foundValue = map.get(key);
                         }
                     }
-                } 
+                }
             }, keys, map);
             if (comparisonTime == 0) {
                 logln("\tget() time\tTREEMAP\tn/a\t" + t.toString(keys.size()) + "\t\titerations=" + t.getIterations());
@@ -439,13 +448,14 @@ public class TrieMapTest extends TestFmwk {
             return mapTime;
         } else {
             long trieTime = t.timeIterations(new MyLoop() {
+                @Override
                 public void time(int repeat) {
                     for (int tt = 0; tt < repeat; ++tt) {
                         for (String key : keys) {
                             Integer foundValue = trieMap.get(key);
                         }
                     }
-                } 
+                }
             }, keys, trieMap);
 
             //            System.gc();
@@ -470,6 +480,7 @@ public class TrieMapTest extends TestFmwk {
         Map<String, Integer> map;
         Style style;
         Option option;
+        @Override
         public void init(Object... params) {
             if (params.length > 0) {
                 keys = (ArrayList<String>) params[0];
@@ -488,6 +499,7 @@ public class TrieMapTest extends TestFmwk {
                 option = (Option) params[3];
             }
         }
+        @Override
         abstract public void time(int repeat);
     }
 
index 498160ca03ef84a075c0b2363989f87c2e007170..5fefdb333f8a8044fe3fb3e73e20f8192ec50624 100644 (file)
@@ -10,6 +10,8 @@
 package com.ibm.icu.dev.test.util;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.CharTrie;
@@ -22,29 +24,30 @@ import com.ibm.icu.text.UTF16;
 import com.ibm.icu.util.RangeValueIterator;
 
 /**
-* Testing class for Trie. Tests here will be simple, since both CharTrie and 
+* Testing class for Trie. Tests here will be simple, since both CharTrie and
 * IntTrie are very similar and are heavily used in other parts of ICU4J.
 * Codes using Tries are expected to have detailed tests.
 * @author Syn Wee Quek
 * @since release 2.1 Jan 01 2002
 */
-public final class TrieTest extends TestFmwk 
-{ 
+@RunWith(JUnit4.class)
+public final class TrieTest extends TestFmwk
+{
     // constructor ---------------------------------------------------
-  
+
     /**
     * Constructor
     */
     public TrieTest()
     {
     }
-      
+
     // public methods -----------------------------------------------
-    
-    /** 
+
+    /**
      * Values for setting possibly overlapping, out-of-order ranges of values
      */
-    private static final class SetRange 
+    private static final class SetRange
     {
         SetRange(int start, int limit, int value, boolean overwrite)
         {
@@ -53,37 +56,38 @@ public final class TrieTest extends TestFmwk
             this.value = value;
             this.overwrite = overwrite;
         }
-        
+
         int start, limit;
         int value;
         boolean overwrite;
     }
-    
+
     /**
      * Values for testing:
      * value is set from the previous boundary's limit to before
      * this boundary's limit
      */
-    private static final class CheckRange 
+    private static final class CheckRange
     {
         CheckRange(int limit, int value)
         {
             this.limit = limit;
             this.value = value;
         }
-        
+
         int limit;
         int value;
     }
-    
-    private static final class _testFoldedValue 
-                                        implements TrieBuilder.DataManipulate  
+
+    private static final class _testFoldedValue
+                                        implements TrieBuilder.DataManipulate
     {
         public _testFoldedValue(IntTrieBuilder builder)
         {
             m_builder_ = builder;
         }
-        
+
+        @Override
         public int getFoldedValue(int start, int offset)
         {
             int foldedValue = 0;
@@ -92,46 +96,48 @@ public final class TrieTest extends TestFmwk
                 int value = m_builder_.getValue(start);
                 if (m_builder_.isInZeroBlock(start)) {
                     start += TrieBuilder.DATA_BLOCK_LENGTH;
-                } 
+                }
                 else {
                     foldedValue |= value;
                     ++ start;
                 }
             }
-        
+
             if (foldedValue != 0) {
                 return (offset << 16) | foldedValue;
-            } 
+            }
             return 0;
         }
-        
+
         private IntTrieBuilder m_builder_;
     }
-    
-    private static final class _testFoldingOffset 
-                                                implements Trie.DataManipulate 
+
+    private static final class _testFoldingOffset
+                                                implements Trie.DataManipulate
     {
+        @Override
         public int getFoldingOffset(int value)
         {
             return value >>> 16;
         }
     }
-    
+
     private static final class _testEnumValue extends TrieIterator
     {
         public _testEnumValue(Trie data)
         {
             super(data);
         }
-        
+
+        @Override
         protected int extract(int value)
         {
             return value ^ 0x5555;
         }
     }
-    
+
     private void _testTrieIteration(IntTrie trie, CheckRange checkRanges[],
-                                    int countCheckRanges) 
+                                    int countCheckRanges)
     {
         // write a string
         int countValues = 0;
@@ -154,20 +160,20 @@ public final class TrieTest extends TestFmwk
             p += UTF16.getCharCount(c);
             int value = trie.getCodePointValue(c);
             if (value != values[i]) {
-                errln("wrong value from UTRIE_NEXT(U+" 
-                      + Integer.toHexString(c) + "): 0x" 
+                errln("wrong value from UTRIE_NEXT(U+"
+                      + Integer.toHexString(c) + "): 0x"
                       + Integer.toHexString(value) + " instead of 0x"
                       + Integer.toHexString(values[i]));
             }
             // unlike the c version lead is 0 if c is non-supplementary
             char lead = UTF16.getLeadSurrogate(c);
-            char trail = UTF16.getTrailSurrogate(c); 
-            if (lead == 0 
-                ? trail != s.charAt(p - 1) 
-                : !UTF16.isLeadSurrogate(lead) 
-                  || !UTF16.isTrailSurrogate(trail) || lead != s.charAt(p - 2) 
+            char trail = UTF16.getTrailSurrogate(c);
+            if (lead == 0
+                ? trail != s.charAt(p - 1)
+                : !UTF16.isLeadSurrogate(lead)
+                  || !UTF16.isTrailSurrogate(trail) || lead != s.charAt(p - 2)
                   || trail != s.charAt(p - 1)) {
-                errln("wrong (lead, trail) from UTRIE_NEXT(U+" 
+                errln("wrong (lead, trail) from UTRIE_NEXT(U+"
                       + Integer.toHexString(c));
                 continue;
             }
@@ -176,8 +182,8 @@ public final class TrieTest extends TestFmwk
                 value = trie.getTrailValue(value, trail);
                 if (value != trie.getSurrogateValue(lead, trail)
                     && value != values[i]) {
-                    errln("wrong value from getting supplementary " 
-                          + "values (U+" 
+                    errln("wrong value from getting supplementary "
+                          + "values (U+"
                           + Integer.toHexString(c) + "): 0x"
                           + Integer.toHexString(value) + " instead of 0x"
                           + Integer.toHexString(values[i]));
@@ -186,16 +192,16 @@ public final class TrieTest extends TestFmwk
             ++ i;
         }
     }
-    
-    private void _testTrieRanges(SetRange setRanges[], int countSetRanges, 
+
+    private void _testTrieRanges(SetRange setRanges[], int countSetRanges,
                                  CheckRange checkRanges[], int countCheckRanges,
-                                 boolean latin1Linear) 
+                                 boolean latin1Linear)
     {
         IntTrieBuilder newTrie = new IntTrieBuilder(null, 2000,
-                                                    checkRanges[0].value, 
+                                                    checkRanges[0].value,
                                                     checkRanges[0].value,
                                                     latin1Linear);
-    
+
         // set values from setRanges[]
         boolean ok = true;
         for (int i = 0; i < countSetRanges; ++ i) {
@@ -205,7 +211,7 @@ public final class TrieTest extends TestFmwk
             boolean overwrite = setRanges[i].overwrite;
             if ((limit - start) == 1 && overwrite) {
                 ok &= newTrie.setValue(start, value);
-            } 
+            }
             else {
                 ok &= newTrie.setRange(start, limit, value, overwrite);
             }
@@ -214,70 +220,70 @@ public final class TrieTest extends TestFmwk
             errln("setting values into a trie failed");
             return;
         }
-    
+
         // verify that all these values are in the new Trie
         int start = 0;
         for (int i = 0; i < countCheckRanges; ++ i) {
             int limit = checkRanges[i].limit;
             int value = checkRanges[i].value;
-    
+
             while (start < limit) {
                 if (value != newTrie.getValue(start)) {
-                    errln("newTrie [U+" 
-                          + Integer.toHexString(start) + "]==0x" 
-                          + Integer.toHexString(newTrie.getValue(start)) 
+                    errln("newTrie [U+"
+                          + Integer.toHexString(start) + "]==0x"
+                          + Integer.toHexString(newTrie.getValue(start))
                           + " instead of 0x" + Integer.toHexString(value));
                 }
                 ++ start;
             }
         }
-    
-        IntTrie trie = newTrie.serialize(new _testFoldedValue(newTrie), 
+
+        IntTrie trie = newTrie.serialize(new _testFoldedValue(newTrie),
                                          new _testFoldingOffset());
-    
+
         // test linear Latin-1 range from utrie_getData()
         if (latin1Linear) {
             start = 0;
             for (int i = 0; i < countCheckRanges && start <= 0xff; ++ i) {
                 int limit = checkRanges[i].limit;
                 int value = checkRanges[i].value;
-    
+
                 while (start < limit && start <= 0xff) {
                     if (value != trie.getLatin1LinearValue((char)start)) {
-                        errln("IntTrie.getLatin1LinearValue[U+" 
+                        errln("IntTrie.getLatin1LinearValue[U+"
                               + Integer.toHexString(start) + "]==0x"
                               + Integer.toHexString(
-                                        trie.getLatin1LinearValue((char) start)) 
+                                        trie.getLatin1LinearValue((char) start))
                               + " instead of 0x" + Integer.toHexString(value));
                     }
                     ++ start;
                 }
             }
         }
-    
+
         if (latin1Linear != trie.isLatin1Linear()) {
             errln("trie serialization did not preserve "
                   + "Latin-1-linearity");
         }
-    
+
         // verify that all these values are in the serialized Trie
         start = 0;
         for (int i = 0; i < countCheckRanges; ++ i) {
             int limit = checkRanges[i].limit;
             int value = checkRanges[i].value;
-    
+
             if (start == 0xd800) {
                 // skip surrogates
                 start = limit;
                 continue;
             }
-    
+
             while (start < limit) {
                 if (start <= 0xffff) {
                     int value2 = trie.getBMPValue((char)start);
                     if (value != value2) {
                         errln("serialized trie.getBMPValue(U+"
-                              + Integer.toHexString(start) + " == 0x" 
+                              + Integer.toHexString(start) + " == 0x"
                               + Integer.toHexString(value2) + " instead of 0x"
                               + Integer.toHexString(value));
                     }
@@ -285,7 +291,7 @@ public final class TrieTest extends TestFmwk
                         value2 = trie.getLeadValue((char)start);
                         if (value != value2) {
                             errln("serialized trie.getLeadValue(U+"
-                              + Integer.toHexString(start) + " == 0x" 
+                              + Integer.toHexString(start) + " == 0x"
                               + Integer.toHexString(value2) + " instead of 0x"
                               + Integer.toHexString(value));
                         }
@@ -294,79 +300,79 @@ public final class TrieTest extends TestFmwk
                 int value2 = trie.getCodePointValue(start);
                 if (value != value2) {
                     errln("serialized trie.getCodePointValue(U+"
-                          + Integer.toHexString(start) + ")==0x" 
-                          + Integer.toHexString(value2) + " instead of 0x" 
+                          + Integer.toHexString(start) + ")==0x"
+                          + Integer.toHexString(value2) + " instead of 0x"
                           + Integer.toHexString(value));
                 }
                 ++ start;
             }
         }
-    
+
         // enumerate and verify all ranges
-        
+
         int enumRanges = 1;
         TrieIterator iter  = new _testEnumValue(trie);
         RangeValueIterator.Element result = new RangeValueIterator.Element();
         while (iter.next(result)) {
-            if (result.start != checkRanges[enumRanges -1].limit 
+            if (result.start != checkRanges[enumRanges -1].limit
                 || result.limit != checkRanges[enumRanges].limit
                 || (result.value ^ 0x5555) != checkRanges[enumRanges].value) {
                 errln("utrie_enum() delivers wrong range [U+"
-                      + Integer.toHexString(result.start) + "..U+" 
-                      + Integer.toHexString(result.limit) + "].0x" 
-                      + Integer.toHexString(result.value ^ 0x5555) 
+                      + Integer.toHexString(result.start) + "..U+"
+                      + Integer.toHexString(result.limit) + "].0x"
+                      + Integer.toHexString(result.value ^ 0x5555)
                       + " instead of [U+"
-                      + Integer.toHexString(checkRanges[enumRanges -1].limit) 
-                      + "..U+" 
-                      + Integer.toHexString(checkRanges[enumRanges].limit) 
-                      + "].0x" 
+                      + Integer.toHexString(checkRanges[enumRanges -1].limit)
+                      + "..U+"
+                      + Integer.toHexString(checkRanges[enumRanges].limit)
+                      + "].0x"
                       + Integer.toHexString(checkRanges[enumRanges].value));
             }
             enumRanges ++;
         }
-    
+
         // test linear Latin-1 range
         if (trie.isLatin1Linear()) {
             for (start = 0; start < 0x100; ++ start) {
-                if (trie.getLatin1LinearValue((char)start) 
+                if (trie.getLatin1LinearValue((char)start)
                     != trie.getLeadValue((char)start)) {
                     errln("trie.getLatin1LinearValue[U+"
                           + Integer.toHexString(start) + "]=0x"
                           + Integer.toHexString(
                                         trie.getLatin1LinearValue((char)start))
-                          + " instead of 0x" 
+                          + " instead of 0x"
                           + Integer.toHexString(
                                         trie.getLeadValue((char)start)));
                 }
             }
         }
-    
+
         _testTrieIteration(trie, checkRanges, countCheckRanges);
     }
-    
-    private void _testTrieRanges2(SetRange setRanges[], 
-                                  int countSetRanges, 
-                                  CheckRange checkRanges[], 
-                                  int countCheckRanges) 
+
+    private void _testTrieRanges2(SetRange setRanges[],
+                                  int countSetRanges,
+                                  CheckRange checkRanges[],
+                                  int countCheckRanges)
     {
         _testTrieRanges(setRanges, countSetRanges, checkRanges, countCheckRanges,
                         false);
-        
+
         _testTrieRanges(setRanges, countSetRanges, checkRanges, countCheckRanges,
                         true);
     }
-    
+
     private void _testTrieRanges4(SetRange setRanges[], int countSetRanges,
-                                  CheckRange checkRanges[], 
-                                  int countCheckRanges) 
+                                  CheckRange checkRanges[],
+                                  int countCheckRanges)
     {
-        _testTrieRanges2(setRanges, countSetRanges, checkRanges, 
+        _testTrieRanges2(setRanges, countSetRanges, checkRanges,
                          countCheckRanges);
     }
-    
+
     // test data ------------------------------------------------------------
-    
-    /** 
+
+    /**
      * set consecutive ranges, even with value 0
      */
     private static SetRange setRanges1[]={
@@ -376,7 +382,7 @@ public final class TrieTest extends TestFmwk
         new SetRange(0x3400, 0x9fa6,     0x6162, false),
         new SetRange(0x9fa6, 0xda9e,     0x3132, false),
         // try to disrupt _testFoldingOffset16()
-        new SetRange(0xdada, 0xeeee,     0x87ff, false), 
+        new SetRange(0xdada, 0xeeee,     0x87ff, false),
         new SetRange(0xeeee, 0x11111,    1,      false),
         new SetRange(0x11111, 0x44444,   0x6162, false),
         new SetRange(0x44444, 0x60003,   0,      false),
@@ -386,7 +392,7 @@ public final class TrieTest extends TestFmwk
         new SetRange(0xf0007, 0xf0020,   0x12,   false),
         new SetRange(0xf0020, 0x110000,  0,      false)
     };
-    
+
     private static CheckRange checkRanges1[]={
         new CheckRange(0,      0), // dummy start range to make _testEnumRange() simpler
         new CheckRange(0x20,   0),
@@ -405,8 +411,8 @@ public final class TrieTest extends TestFmwk
         new CheckRange(0xf0020,0x12),
         new CheckRange(0x110000, 0)
     };
-    
-    /** 
+
+    /**
      * set some interesting overlapping ranges
      */
     private static SetRange setRanges2[]={
@@ -419,10 +425,10 @@ public final class TrieTest extends TestFmwk
         new SetRange(0x2f900,0x2ffee,    1,      false),
         new SetRange(0x2ffee,0x2ffef,    2,      true)
     };
-    
+
     private static CheckRange checkRanges2[]={
         // dummy start range to make _testEnumRange() simpler
-        new CheckRange(0,      0),       
+        new CheckRange(0,      0),
         new CheckRange(0x21,   0),
         new CheckRange(0x72,   0x5555),
         new CheckRange(0xdd,   3),
@@ -435,8 +441,8 @@ public final class TrieTest extends TestFmwk
         new CheckRange(0x2ffef,2),
         new CheckRange(0x110000, 0)
     };
-    
-    /** 
+
+    /**
      * use a non-zero initial value
      */
     private static SetRange setRanges3[]={
@@ -445,10 +451,10 @@ public final class TrieTest extends TestFmwk
         new SetRange(0x30000,0x34567,9,  true),
         new SetRange(0x45678,0x56789,3,  true)
     };
-    
+
     private static CheckRange checkRanges3[]={
         // dummy start range, also carries the initial value
-        new CheckRange(0,      9),  
+        new CheckRange(0,      9),
         new CheckRange(0x31,   9),
         new CheckRange(0xa4,   1),
         new CheckRange(0x3400, 9),
@@ -457,19 +463,20 @@ public final class TrieTest extends TestFmwk
         new CheckRange(0x56789,3),
         new CheckRange(0x110000,9)
     };
-    
+
     @Test
-    public void TestIntTrie() 
+    public void TestIntTrie()
     {
-        _testTrieRanges4(setRanges1, setRanges1.length, checkRanges1, 
+        _testTrieRanges4(setRanges1, setRanges1.length, checkRanges1,
                          checkRanges1.length);
-        _testTrieRanges4(setRanges2, setRanges2.length, checkRanges2, 
-                         checkRanges2.length); 
-        _testTrieRanges4(setRanges3, setRanges3.length, checkRanges3, 
+        _testTrieRanges4(setRanges2, setRanges2.length, checkRanges2,
+                         checkRanges2.length);
+        _testTrieRanges4(setRanges3, setRanges3.length, checkRanges3,
                          checkRanges3.length);
     }
 
     private static class DummyGetFoldingOffset implements Trie.DataManipulate {
+        @Override
         public int getFoldingOffset(int value) {
             return -1; /* never get non-initialValue data for supplementary code points */
         }
@@ -478,7 +485,7 @@ public final class TrieTest extends TestFmwk
     @Test
     public void TestDummyCharTrie() {
         CharTrie trie;
-        final int initialValue=0x313, leadUnitValue=0xaffe; 
+        final int initialValue=0x313, leadUnitValue=0xaffe;
         int value;
         int c;
         trie=new CharTrie(initialValue, leadUnitValue, new DummyGetFoldingOffset());
@@ -503,7 +510,7 @@ public final class TrieTest extends TestFmwk
     @Test
     public void TestDummyIntTrie() {
         IntTrie trie;
-        final int initialValue=0x01234567, leadUnitValue=0x89abcdef; 
+        final int initialValue=0x01234567, leadUnitValue=0x89abcdef;
         int value;
         int c;
         trie=new IntTrie(initialValue, leadUnitValue, new DummyGetFoldingOffset());
index d5d35a47d9fbec550298a5108fd93d63a9cb6bb1..1cb66698fa8176036660b02ed7ea36c63cf0cefa 100644 (file)
@@ -25,6 +25,8 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -48,6 +50,7 @@ import com.ibm.icu.util.ULocale.Minimize;
 import com.ibm.icu.util.UResourceBundle;
 import com.ibm.icu.util.VersionInfo;
 
+@RunWith(JUnit4.class)
 public class ULocaleTest extends TestFmwk {
 
     // Ticket #8078 and #11674
index d2f3771e26d555e2042eab8a68bbc498121f0be5..708c61103beedf558196667d51bf370f0e698e3d 100644 (file)
@@ -18,6 +18,8 @@ import java.util.List;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Assert;
@@ -31,13 +33,14 @@ import com.ibm.icu.util.CaseInsensitiveString;
  * @test
  * @summary Test of internal Utility class
  */
+@RunWith(JUnit4.class)
 public class UtilityTest extends TestFmwk {
     @Test
     public void TestUnescape() {
         final String input =
             "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\e\\cC\\n \\x1b\\x{263a}";
 
-        final String expect = 
+        final String expect =
             "Sch\u00F6nes Auto: \u20AC 11240.\u000CPrivates Zeichen: \uDBC8\uDF45\u001B\u0003\012 \u001B\u263A";
 
         String result = Utility.unescape(input);
@@ -45,7 +48,7 @@ public class UtilityTest extends TestFmwk {
             errln("FAIL: Utility.unescape() returned " + result + ", exp. " + expect);
         }
     }
-    
+
     @Test
     public void TestFormat()
     {
@@ -70,7 +73,7 @@ public class UtilityTest extends TestFmwk {
             "\"testing weird supplementary characters \\uD800\\uDC00\"",
             "\"testing control characters \\001 and line breaking!! \\n are we done yet?\""
         };
-        
+
         for (int i = 0; i < data.length; i ++) {
             assertEquals("formatForSource(\"" + data[i] + "\")",
                          result[i], Utility.formatForSource(data[i]));
@@ -80,7 +83,7 @@ public class UtilityTest extends TestFmwk {
                          result1[i], Utility.format1ForSource(data[i]));
         }
     }
-    
+
     @Test
     public void TestHighBit()
     {
@@ -88,23 +91,23 @@ public class UtilityTest extends TestFmwk {
         byte result[] = {-1, -1, -1, 15, 12};
         for (int i = 0; i < data.length; i ++) {
             if (Utility.highBit(data[i]) != result[i]) {
-                errln("Fail: Highest bit of \\u" 
+                errln("Fail: Highest bit of \\u"
                       + Integer.toHexString(data[i]) + " should be "
                       + result[i]);
             }
         }
     }
-    
+
     @Test
     public void TestCompareUnsigned()
     {
-        int data[] = {0, 1, 0x8fffffff, -1, Integer.MAX_VALUE, 
+        int data[] = {0, 1, 0x8fffffff, -1, Integer.MAX_VALUE,
                       Integer.MIN_VALUE, 2342423, -2342423};
         for (int i = 0; i < data.length; i ++) {
             for (int j = 0; j < data.length; j ++) {
-                if (Utility.compareUnsigned(data[i], data[j]) 
+                if (Utility.compareUnsigned(data[i], data[j])
                     != compareLongUnsigned(data[i], data[j])) {
-                    errln("Fail: Unsigned comparison failed with " + data[i] 
+                    errln("Fail: Unsigned comparison failed with " + data[i]
                           + " " + data[i + 1]);
                 }
             }
@@ -123,15 +126,15 @@ public class UtilityTest extends TestFmwk {
 
         java.nio.ByteBuffer buffer = java.nio.ByteBuffer.wrap(ba);
         ByteArrayWrapper x = new ByteArrayWrapper(buffer);
-        
+
         ByteArrayWrapper y = new ByteArrayWrapper(ba, 3);
         ByteArrayWrapper z = new ByteArrayWrapper(bb, 3);
 
-        
+
         if (!y.toString().equals("00 01 02")){
             errln("FAIL: test toString : Failed!");
         }
-        
+
         // test equality
         if (!x.equals(y) || !x.equals(z))
             errln("FAIL: test (operator ==): Failed!");
@@ -222,7 +225,7 @@ public class UtilityTest extends TestFmwk {
             logln("Assert.fail works");
         }
     }
-    
+
     @Test
     public void TestCaseInsensitiveString() {
         CaseInsensitiveString str1 = new CaseInsensitiveString("ThIs is A tEst");
@@ -234,7 +237,7 @@ public class UtilityTest extends TestFmwk {
             errln("FAIL: str1("+str1+") != str2("+str2+")");
         }
     }
-    
+
     @Test
     public void TestSourceLocation() {
         String here = TestFmwk.sourceLocation();
@@ -242,7 +245,7 @@ public class UtilityTest extends TestFmwk {
         String hereAgain = TestFmwk.sourceLocation();
         assertTrue("here < there < hereAgain", here.compareTo(there) < 0 && there.compareTo(hereAgain) < 0);
     }
-    
+
     public String CheckSourceLocale() {
         return TestFmwk.sourceLocation();
     }
index 40b5199f9bc1b3eed672b0c88de21029d9ebf3e5..40410154338282186b7e33f4cea9928f35385903 100644 (file)
@@ -14,6 +14,8 @@ package com.ibm.icu.dev.test.util;
 import java.util.Arrays;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.VersionInfo;
@@ -24,6 +26,7 @@ import com.ibm.icu.util.VersionInfo;
 * @author Syn Wee Quek
 * @since release 2.1 March 01 2002
 */
+@RunWith(JUnit4.class)
 public final class VersionInfoTest extends TestFmwk
 {
     // constructor ---------------------------------------------------
index 3f3b24b589e7f2ffc5727a344da866f817012d76..9b44eba431336e021249ed7460dccd6e8758b869 100644 (file)
@@ -10,6 +10,8 @@ import java.util.Map.Entry;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.locale.XLikelySubtags.LSR;
@@ -26,6 +28,7 @@ import com.ibm.icu.util.ULocale;
  *
  * @author markdavis
  */
+@RunWith(JUnit4.class)
 public class XLocaleDistanceTest extends TestFmwk {
     private static final boolean REFORMAT = false; // set to true to get a reformatted data file listed
 
index 0ba886598c2924a62c1c76adce3143bb37e7f2fb..9fc94b1abb817101871e9b0518ecaf2ef8a8b7ef 100644 (file)
@@ -11,6 +11,8 @@ import java.util.TreeSet;
 import java.util.regex.Pattern;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.locale.XCldrStub.Joiner;
@@ -29,6 +31,7 @@ import com.ibm.icu.util.ULocale;
  *
  * @author markdavis
  */
+@RunWith(JUnit4.class)
 public class XLocaleMatcherTest extends TestFmwk {
     private static final boolean REFORMAT = false; // set to true to get a reformatted data file listed
 
index cc385f8889b1e30b1494281ea4b9796de44718e6..d84a6a11e4d3fd0462fd11c179f7faf7407b5b6c 100644 (file)
@@ -5,10 +5,13 @@ package com.ibm.icu.text;
 
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 
 
+@RunWith(JUnit4.class)
 public class DigitListTest extends TestFmwk {
 
     private static DigitList digitList = new DigitList();
index 85c92a5dbf3e0c0269f532a2ec8c7dad0875132b..f2c04cbd2e4cd83983d580e8521dc48dfe2389c0 100644 (file)
@@ -12,9 +12,12 @@ import java.text.BreakIterator;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 
+@RunWith(JUnit4.class)
 public class BreakIteratorTest extends TestFmwk {
     private static final int CHARACTER_BRK = 0;
     private static final int WORD_BRK = 1;
@@ -72,7 +75,7 @@ public class BreakIteratorTest extends TestFmwk {
         } else {
             if (isIcuImpl) {
                 logln("INFO: " + method + " returned ICU BreakIterator for locale " + loc);
-            } 
+            }
             BreakIterator brkitrIcu = null;
             Locale iculoc = TestUtil.toICUExtendedLocale(loc);
             switch (type) {
@@ -171,7 +174,7 @@ public class BreakIteratorTest extends TestFmwk {
             jdkBrkItrs[1] = BreakIterator.getWordInstance(iculoc);
             jdkBrkItrs[2] = BreakIterator.getLineInstance(iculoc);
             jdkBrkItrs[3] = BreakIterator.getSentenceInstance(iculoc);
+
             icuBrkItrs[0] = com.ibm.icu.text.BreakIterator.getCharacterInstance(iculoc);
             icuBrkItrs[1] = com.ibm.icu.text.BreakIterator.getWordInstance(iculoc);
             icuBrkItrs[2] = com.ibm.icu.text.BreakIterator.getLineInstance(iculoc);
index fef8b30bb983bad3074ce9a5a794d42854af0fbc..01dd9812524e421d13a8e6bfb13c584fc323d538 100644 (file)
@@ -13,11 +13,14 @@ import java.text.Collator;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.jdkadapter.CollatorICU;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class CollatorTest extends TestFmwk {
     /*
      * Check if getInstance returns the ICU implementation.
index 8b113c701d0cbdf5c62717d8ead94bedf3296eaf..d7f0bd26f19abb03b566d09a30bba85e30b08e0a 100644 (file)
@@ -16,10 +16,13 @@ import java.util.Locale;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 
 @SuppressWarnings("unchecked")
+@RunWith(JUnit4.class)
 public class CurrencyNameTest extends TestFmwk {
     private static final Set<Currency> AVAILABLE_CURRENCIES;
     private static final Method GETDISPLAYNAME_METHOD;
index d4b1fed8402df0b9bb6c3dc267f95722cef83700..c403fd104bd4adff733523637ae7662001957d52 100644 (file)
@@ -12,10 +12,13 @@ import java.text.DateFormatSymbols;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class DateFormatSymbolsTest extends TestFmwk {
     /*
      * Check if getInstance returns the ICU implementation.
index f55be470e680647f7f90eefccfcef48dc9f72fdd..02a668115d5aba1a0e738566808d8013d3fd120d 100644 (file)
@@ -15,11 +15,14 @@ import java.util.Date;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.jdkadapter.CalendarICU;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class DateFormatTest extends TestFmwk {
     /*
      * Check if getInstance returns the ICU implementation.
index fcd3e94f67076751d0a482d3b68281ce10836995..526eb1c7e8473e2deac0998f8e067755396dc376 100644 (file)
@@ -13,10 +13,13 @@ import java.util.Currency;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class DecimalFormatSymbolsTest extends TestFmwk {
     /*
      * Check if getInstance returns the ICU implementation.
index d24ab0dfec3eddd3db9b5b61a277d2dff22d38fa..651f436fd90865a74e60a0d3b2c878f2f24a4513 100644 (file)
@@ -14,10 +14,13 @@ import java.util.Locale;
 import java.util.Set;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class LocaleNameTest extends TestFmwk {
     private static final Method GETDISPLAYSCRIPT_METHOD;
 
@@ -78,7 +81,7 @@ public class LocaleNameTest extends TestFmwk {
                     }
                 } else {
                     if (!name.equals(icuname)) {
-                        logln("INFO: Language name by JDK is " + name + ", but " + icuname + 
+                        logln("INFO: Language name by JDK is " + name + ", but " + icuname +
                               " by ICU, for locale " + forLocale + " in locale " + inLocale);
                     }
                     // Try explicit ICU locale (xx_yy_ICU)
@@ -135,7 +138,7 @@ public class LocaleNameTest extends TestFmwk {
                 } else {
                     // The name might be taken from JDK
                     if (!name.equals(icuname)) {
-                        logln("INFO: Script name by JDK is " + name + ", but " + icuname + 
+                        logln("INFO: Script name by JDK is " + name + ", but " + icuname +
                                 " in ICU, for locale " + forLocale + " in locale " + inLocale);
                     }
                     // Try explicit ICU locale (xx_yy_ICU)
@@ -186,7 +189,7 @@ public class LocaleNameTest extends TestFmwk {
                 } else {
                     // The name might be taken from JDK
                     if (!name.equals(icuname)) {
-                        logln("INFO: Country name by JDK is " + name + ", but " + icuname + 
+                        logln("INFO: Country name by JDK is " + name + ", but " + icuname +
                               " in ICU, for locale " + forLocale + " in locale " + inLocale);
                     }
                     // Try explicit ICU locale (xx_yy_ICU)
@@ -259,7 +262,7 @@ public class LocaleNameTest extends TestFmwk {
                         }
                     } else {
                         if (!name.equals(icuname)) {
-                            logln("INFO: Variant name by JDK is " + name + ", but " + icuname + 
+                            logln("INFO: Variant name by JDK is " + name + ", but " + icuname +
                                   " in ICU, for locale " + forLocaleSingleVar + " in locale " + inLocale);
                         }
                         // Try explicit ICU locale (xx_yy_ICU)
index 7c99767053b5acaea5ff2287fab93a3be7c6f0c5..6d4e2e1cc11ae537a926ca5cc4f5d497fe5cec51 100644 (file)
@@ -15,10 +15,13 @@ import java.text.ParseException;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class NumberFormatTest extends TestFmwk {
     private static final int DEFAULT_TYPE = 0;
     private static final int NUMBER_TYPE = 1;
index 4c9ec3c435df1fcadbd5583d061336cd69cdd500..0db2c26f3edd123f6d4024ae5115edd6eac92e2a 100644 (file)
@@ -15,12 +15,15 @@ import java.util.Set;
 import java.util.TimeZone;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.TimeZoneNames;
 import com.ibm.icu.text.TimeZoneNames.NameType;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class TimeZoneNameTest extends TestFmwk {
 
     private static final Set<String> ProblematicZones = new HashSet<String>();
@@ -52,7 +55,7 @@ public class TimeZoneNameTest extends TestFmwk {
             for (String tzid : tzids) {
                 // Java has a problem when a provider does not supply all 4 names
                 // for a zone. For this reason, ICU TimeZoneName provider does not return
-                // localized names unless these 4 names are available. 
+                // localized names unless these 4 names are available.
 
                 String icuStdLong = getIcuDisplayName(tzid, false, TimeZone.LONG, loc);
                 String icuDstLong = getIcuDisplayName(tzid, true, TimeZone.LONG, loc);
@@ -72,13 +75,13 @@ public class TimeZoneNameTest extends TestFmwk {
 
     private void checkDisplayNamePair(int style, String tzid, Locale loc, boolean warnOnly) {
         /* Note: There are two problems here.
-         * 
+         *
          * It looks Java 6 requires a TimeZoneNameProvider to return both standard name and daylight name
          * for a zone.  If the provider implementation only returns either of them, Java 6 also ignore
          * the other.  In ICU, there are zones which do not have daylight names, especially zones which
          * do not use daylight time.  This test case does not check a standard name if its daylight name
          * is not available because of the Java 6 implementation problem.
-         * 
+         *
          * Another problem is that ICU always use a standard name for a zone which does not use daylight
          * saving time even daylight name is requested.
          */
@@ -126,7 +129,7 @@ public class TimeZoneNameTest extends TestFmwk {
                     logln("WARNING: TimeZone name by ICU is " + icuname + ", but got " + name
                             + " for time zone " + tz.getID() + " in locale " + loc
                             + " (daylight=" + daylight + ", style=" + styleStr + ")");
-                    
+
                 } else {
                     errln("FAIL: TimeZone name by ICU is " + icuname + ", but got " + name
                             + " for time zone " + tz.getID() + " in locale " + loc
index 38f2be4d52b88ae7ffbd5c7cf36ed37a3087db86..e062b7243e087cfd94d1e4b0c3a3ab17ec40d7ef 100644 (file)
@@ -14,12 +14,15 @@ import static com.ibm.icu.impl.LocaleDisplayNamesImpl.DataTableType.REGION;
 import java.util.Locale;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.impl.LocaleDisplayNamesImpl;
 import com.ibm.icu.text.LocaleDisplayNames;
 import com.ibm.icu.text.LocaleDisplayNames.DialectHandling;
 import com.ibm.icu.util.ULocale;
 
+@RunWith(JUnit4.class)
 public class TestLocaleNamePackaging extends TestFmwk {
     public TestLocaleNamePackaging() {
     }
@@ -77,7 +80,7 @@ public class TestLocaleNamePackaging extends TestFmwk {
             "DE",
             "TH",
         };
-        String[] expected = LocaleDisplayNamesImpl.haveData(REGION) ? 
+        String[] expected = LocaleDisplayNamesImpl.haveData(REGION) ?
             expectedWithRegionData : expectedWithoutRegionData;
 
         int n = 0;
@@ -224,15 +227,15 @@ public class TestLocaleNamePackaging extends TestFmwk {
                : "en (GB)");
         assertEquals("dialect 2", target, dn.localeDisplayName("en_GB"));
     }
-    
+
     @Test
     public void testLocaleKeywords() {
         LocaleDisplayNames dn = LocaleDisplayNames.getInstance(ULocale.US,
                 DialectHandling.DIALECT_NAMES);
         String name = dn.localeDisplayName("de@collation=phonebook");
-        String target = LocaleDisplayNamesImpl.haveData(LANG) ? 
+        String target = LocaleDisplayNamesImpl.haveData(LANG) ?
                 "German (Phonebook Sort Order)" : "de (collation=phonebook)";
         assertEquals("collation", target, name);
-        
+
     }
 }
index 601d77386c518d9b81665b6a836b4841897839d6..37b538430ffed96ea6d3803aacc17351def21b1f 100644 (file)
@@ -9,6 +9,8 @@
 package com.ibm.icu.dev.test.translit;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.lang.UScript;
@@ -22,7 +24,8 @@ import com.ibm.icu.util.ULocale;
  * @author markdavis
  *
  */
-public class AnyScriptTest extends TestFmwk {    
+@RunWith(JUnit4.class)
+public class AnyScriptTest extends TestFmwk {
     @Test
     public void TestContext() {
         Transliterator t = Transliterator.createFromRules("foo", "::[bc]; a{b}d > B;", Transliterator.FORWARD);
@@ -33,7 +36,7 @@ public class AnyScriptTest extends TestFmwk {
     @Test
     public void TestScripts(){
         // get a couple of characters of each script for testing
-        
+
         StringBuffer testBuffer = new StringBuffer();
         for (int script = 0; script < UScript.CODE_LIMIT; ++script) {
             UnicodeSet test = new UnicodeSet().applyPropertyAlias("script", UScript.getName(script));
@@ -44,10 +47,10 @@ public class AnyScriptTest extends TestFmwk {
         }
         String test = testBuffer.toString();
         logln("Test line: " + test);
-        
+
         int inclusion = TestFmwk.getExhaustiveness();
         boolean testedUnavailableScript = false;
-        
+
         for (int script = 0; script < UScript.CODE_LIMIT; ++script) {
             if (script == UScript.COMMON || script == UScript.INHERITED) {
                 continue;
@@ -55,7 +58,7 @@ public class AnyScriptTest extends TestFmwk {
             // if the inclusion rate is not 10, skip all but a small number of items.
             // Make sure, however, that we test at least one unavailable script
             if (inclusion < 10 && script != UScript.LATIN
-                    && script != UScript.HAN 
+                    && script != UScript.HAN
                     && script != UScript.HIRAGANA
                     && testedUnavailableScript
                     ) {
@@ -103,25 +106,25 @@ public class AnyScriptTest extends TestFmwk {
         UnicodeSet ASCII = new UnicodeSet("[:ascii:]");
         String lettersAndSpace = "abc def";
         final String punctOnly = "( )";
-        
+
         String wideLettersAndSpace = widen.transform(lettersAndSpace);
         String widePunctOnly = widen.transform(punctOnly);
         assertContainsNone("Should be wide", ASCII, wideLettersAndSpace);
         assertContainsNone("Should be wide", ASCII, widePunctOnly);
-        
+
         String back;
         back = narrow.transform(wideLettersAndSpace);
         assertEquals("Should be narrow", lettersAndSpace, back);
         back = narrow.transform(widePunctOnly);
         assertEquals("Should be narrow", punctOnly, back);
-        
+
         Transliterator latin = Transliterator.getInstance("any-Latn");
         back = latin.transform(wideLettersAndSpace);
         assertEquals("Should be ascii", lettersAndSpace, back);
-        
+
         back = latin.transform(widePunctOnly);
         assertEquals("Should be ascii", punctOnly, back);
-       
+
         // Han-Latin is now forward-only per CLDR ticket #5630
         //Transliterator t2 = Transliterator.getInstance("any-Han");
         //back = t2.transform(widePunctOnly);
@@ -129,7 +132,7 @@ public class AnyScriptTest extends TestFmwk {
 
 
     }
-    
+
     @Test
     public void TestCommonDigits() {
         UnicodeSet westernDigitSet = new UnicodeSet("[0-9]");
index cbbe2367d8d014c6b3f24631ccebe062b1171ac5..3450f21ac3f982029d9fd2d7e30c2fccd693f760 100644 (file)
@@ -7,7 +7,10 @@
  *******************************************************************************
  */
 package com.ibm.icu.dev.test.translit;
+
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -20,6 +23,7 @@ import com.ibm.icu.text.Transliterator;
  * @test
  * @summary General test of CompoundTransliterator
  */
+@RunWith(JUnit4.class)
 public class CompoundTransliteratorTest extends TestFmwk {
     @Test
     public void TestConstruction(){
@@ -35,15 +39,15 @@ public class CompoundTransliteratorTest extends TestFmwk {
             errln("FAIL: Transliterator construction failed" + ex.getMessage());
             throw ex;
         }
-  
+
         final String IDs[]={
-            names[0], 
-            names[0]+";"+names[3], 
-            names[3]+";"+names[1]+";"+names[2], 
-            names[0]+";"+names[1]+";"+names[2]+";"+names[3] 
+            names[0],
+            names[0]+";"+names[3],
+            names[3]+";"+names[1]+";"+names[2],
+            names[0]+";"+names[1]+";"+names[2]+";"+names[3]
         };
 
-   
+
         for(int i=0; i<4; i++){
             try{
                 Transliterator.getInstance(IDs[i]);
@@ -74,8 +78,8 @@ public class CompoundTransliteratorTest extends TestFmwk {
 //                        "UnicodeFilter adoptedFilter=0) failed for " + IDs[i]);
 //                throw ex4;
 //            }
-//  
-//       
+//
+//
 //            try{
 //                CompoundTransliterator cpdtrans2=new CompoundTransliterator(transarray[i], null);
 //                cpdtrans2 = null;
@@ -85,11 +89,11 @@ public class CompoundTransliteratorTest extends TestFmwk {
 //                throw ex5;
 //            }
 
-            
+
         }
-   
+
     }
+
     @Test
     public void TestGetTransliterator(){
         logln("Testing the getTransliterator() API of CompoundTransliterator");
@@ -119,10 +123,10 @@ public class CompoundTransliteratorTest extends TestFmwk {
             }
         }
 
-        
+
     }
-       
+
+
     @Test
     public void TestTransliterate(){
         logln("Testing the handleTransliterate() API of CompoundTransliterator");
@@ -133,7 +137,7 @@ public class CompoundTransliteratorTest extends TestFmwk {
             errln("FAIL: construction using CompoundTransliterator(String ID) failed for " + "Any-Hex;Hex-Any");
             throw iae;
         }
-    
+
         String s="abcabc";
         expect(ct1, s, s);
         Transliterator.Position index = new Transliterator.Position();
@@ -143,31 +147,31 @@ public class CompoundTransliteratorTest extends TestFmwk {
         ct1.finishTransliteration(rsource2, index);
         String result=rsource2.toString();
         expectAux(ct1.getID() + ":ReplaceableString, index(0,0,0,0)", s + "->" + rsource2, result.equals(expectedResult), expectedResult);
-     
+
         Transliterator.Position index2 = new Transliterator.Position(1,3,2,3);
         ReplaceableString rsource3=new ReplaceableString(s);
-        ct1.transliterate(rsource3, index2); 
+        ct1.transliterate(rsource3, index2);
         ct1.finishTransliteration(rsource3, index2);
         result=rsource3.toString();
         expectAux(ct1.getID() + ":String, index2(1,2,2,3)", s + "->" + rsource3, result.equals(expectedResult), expectedResult);
 
-       
+
         String Data[]={
              //ID, input string, transliterated string
-             "Any-Hex;Hex-Any;Any-Hex",     "hello",  "\\u0068\\u0065\\u006C\\u006C\\u006F", 
+             "Any-Hex;Hex-Any;Any-Hex",     "hello",  "\\u0068\\u0065\\u006C\\u006C\\u006F",
              "Any-Hex;Hex-Any",                 "hello! How are you?",  "hello! How are you?",
              "Devanagari-Latin;Latin-Devanagari",       "\u092D\u0948'\u0930'\u0935",  "\u092D\u0948\u0930\u0935", // quotes lost
              "Latin-Cyrillic;Cyrillic-Latin",           "a'b'k'd'e'f'g'h'i'j'Shch'shch'zh'h", "a'b'k'd'e'f'g'h'i'j'Shch'shch'zh'h",
              "Latin-Greek;Greek-Latin",                 "ABGabgAKLMN", "ABGabgAKLMN",
              //"Latin-Arabic;Arabic-Latin",               "Ad'r'a'b'i'k'dh'dd'gh", "Adrabikdhddgh",
-             "Hiragana-Katakana",                       "\u3041\u308f\u3099\u306e\u304b\u3092\u3099", 
-                                                                 "\u30A1\u30f7\u30ce\u30ab\u30fa",  
-             "Hiragana-Katakana;Katakana-Hiragana",     "\u3041\u308f\u3099\u306e\u304b\u3051", 
+             "Hiragana-Katakana",                       "\u3041\u308f\u3099\u306e\u304b\u3092\u3099",
+                                                                 "\u30A1\u30f7\u30ce\u30ab\u30fa",
+             "Hiragana-Katakana;Katakana-Hiragana",     "\u3041\u308f\u3099\u306e\u304b\u3051",
                                                                  "\u3041\u308f\u3099\u306e\u304b\u3051",
-             "Katakana-Hiragana;Hiragana-Katakana",     "\u30A1\u30f7\u30ce\u30f5\u30f6", 
-                                                                 "\u30A1\u30f7\u30ce\u30ab\u30b1",  
-             "Latin-Katakana;Katakana-Latin",                   "vavivuvevohuzizuzoninunasesuzezu", 
-                                                                 "vavivuvevohuzizuzoninunasesuzezu",  
+             "Katakana-Hiragana;Hiragana-Katakana",     "\u30A1\u30f7\u30ce\u30f5\u30f6",
+                                                                 "\u30A1\u30f7\u30ce\u30ab\u30b1",
+             "Latin-Katakana;Katakana-Latin",                   "vavivuvevohuzizuzoninunasesuzezu",
+                                                                 "vavivuvevohuzizuzoninunasesuzezu",
         };
         Transliterator ct2=null;
         for(int i=0; i<Data.length; i+=3){
@@ -179,9 +183,9 @@ public class CompoundTransliteratorTest extends TestFmwk {
             }
         expect(ct2, Data[i+1], Data[i+2]);
         }
-   
+
     }
+
 
     //======================================================================
     // Support methods
@@ -191,13 +195,13 @@ public class CompoundTransliteratorTest extends TestFmwk {
      * Splits a string,
     */
     private static String[] split(String s, char divider) {
-      
+
     // see how many there are
         int count = 1;
     for (int i = 0; i < s.length(); ++i) {
        if (s.charAt(i) == divider) ++count;
     }
-        
+
     // make an array with them
     String[] result = new String[count];
     int last = 0;
@@ -242,7 +246,7 @@ public class CompoundTransliteratorTest extends TestFmwk {
                 append('|').
                 append(s.substring(index.start));
         }
-        
+
         // As a final step in keyboard transliteration, we must call
         // transliterate to finish off any pending partial matches that
         // were waiting for more input.
@@ -269,6 +273,6 @@ public class CompoundTransliteratorTest extends TestFmwk {
                 + Utility.escape(summary)
                 + ", expected " + Utility.escape(expectedResult));
         }
-    }  
+    }
 }
 
index d234b7a379e4f0693b0ad68c72d995193d736312..ec13d5b1a239b6e5c8c5e17bf755ac461913c37e 100644 (file)
@@ -7,7 +7,10 @@
  *******************************************************************************
  */
 package com.ibm.icu.dev.test.translit;
+
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.ReplaceableString;
@@ -18,6 +21,7 @@ import com.ibm.icu.text.UnicodeSet;
  * @test
  * @summary Error condition test of Transliterator
  */
+@RunWith(JUnit4.class)
 public class ErrorTest extends TestFmwk {
 
     @Test
index 3c7496541b3c89e95c199c1b02abacec5c2b65b4..7a8d409d035aea49367b97c85e134d841ecf2d9f 100644 (file)
@@ -12,6 +12,8 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -21,6 +23,7 @@ import com.ibm.icu.text.Transliterator;
  * @test
  * @summary Test the Latin-Jamo transliterator
  */
+@RunWith(JUnit4.class)
 public class JamoTest extends TestFmwk {
     @Test
     public void TestJamo() {
@@ -36,7 +39,7 @@ public class JamoTest extends TestFmwk {
 
             // Column 3 is expected value of L2.  If the expected
             // value of L2 is L1, then L2 is null.
+
                 // add tests for the update to fix problems where it didn't follow the standard
                 // see also http://www.unicode.org/cldr/data/charts/transforms/Latin-Hangul.html
                 "gach", "(Gi)(A)(Cf)", null,
@@ -74,7 +77,7 @@ public class JamoTest extends TestFmwk {
 
             // 'r' in a final position is treated like 'l'
             "karka", "(Ki)(A)(L)(Ki)(A)", "kalka",
-            
+
         };
 
         for (int i=0; i<CASE.length; i+=3) {
@@ -97,7 +100,7 @@ public class JamoTest extends TestFmwk {
     public void TestRoundTrip() {
         String HANGUL[] = { "\uAC03\uC2F8",
                             "\uC544\uC5B4"};
-        
+
         Transliterator latinJamo = Transliterator.getInstance("Latin-Jamo");
         Transliterator jamoLatin = latinJamo.getInverse();
         Transliterator jamoHangul = Transliterator.getInstance("NFC");
@@ -203,7 +206,7 @@ public class JamoTest extends TestFmwk {
                                    + " => " + hangul2 +
                                    "; but " + hangul + " =cpd=> " + jamoToName(hangulX)
                                    );
-                        errln(Utility.escape(buf.toString()));                        
+                        errln(Utility.escape(buf.toString()));
                     } else if (jamo.equals(jamo2)) {
                         buf.setLength(0);
                         buf.append("FAIL (Jamo<>Hangul problem): ");
@@ -215,7 +218,7 @@ public class JamoTest extends TestFmwk {
                                    latin + " => " + jamoToName(jamo2)
                                    + " => " + hangul2
                                    );
-                        errln(Utility.escape(buf.toString()));                        
+                        errln(Utility.escape(buf.toString()));
                     } else {
                         buf.setLength(0);
                         buf.append("FAIL: ");
@@ -253,7 +256,7 @@ public class JamoTest extends TestFmwk {
         "\uc0c1\uad00\uc5c6\uc774 \uc720\ub2c8\ucf54\ub4dc\ub294 \ubaa8\ub4e0 " +
         "\ubb38\uc790\uc5d0 \ub300\ud574 \uace0\uc720 \ubc88\ud638\ub97c " +
         "\uc81c\uacf5\ud569\ub2c8\ub2e4. " +
-        
+
         "\uae30\ubcf8\uc801\uc73c\ub85c \ucef4\ud4e8\ud130\ub294 " +
         "\uc22b\uc790\ub9cc \ucc98\ub9ac\ud569\ub2c8\ub2e4. \uae00\uc790\ub098 " +
         "\ub2e4\ub978 \ubb38\uc790\uc5d0\ub3c4 \uc22b\uc790\ub97c " +
@@ -277,7 +280,7 @@ public class JamoTest extends TestFmwk {
         "\ud14c\ud06c\ub2c8\uceec \uae30\ud638\uc5d0 \ub9de\ub294 \ub2e8\uc77c " +
         "\uae30\ud638\ud654 \ubc29\ubc95\uc744 \uac16\uace0 \uc788\uc9c0 " +
         "\ubabb\ud558\uc600\uc2b5\ub2c8\ub2e4. " +
-        
+
         "\uc774\ub7ec\ud55c \uae30\ud638\ud654 \uc2dc\uc2a4\ud15c\uc740 " +
         "\ub610\ud55c \ub2e4\ub978 \uae30\ud638\ud654 \uc2dc\uc2a4\ud15c\uacfc " +
         "\ucda9\ub3cc\ud569\ub2c8\ub2e4. \uc989 \ub450 \uac00\uc9c0 " +
@@ -294,7 +297,7 @@ public class JamoTest extends TestFmwk {
         "\ud50c\ub7ab\ud3fc \uac04\uc5d0 \uc804\ub2ec\ud560 \ub54c\ub9c8\ub2e4 " +
         "\uadf8 \ub370\uc774\ud130\ub294 \ud56d\uc0c1 \uc190\uc0c1\uc758 " +
         "\uc704\ud5d8\uc744 \uacaa\uac8c \ub429\ub2c8\ub2e4. " +
-        
+
         "\uc720\ub2c8\ucf54\ub4dc\ub85c \ubaa8\ub4e0 \uac83\uc744 " +
         "\ud574\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4! " +
         "\uc720\ub2c8\ucf54\ub4dc\ub294 \uc0ac\uc6a9 \uc911\uc778 " +
@@ -303,7 +306,7 @@ public class JamoTest extends TestFmwk {
         "\uc22b\uc790\ub97c " +
         "\uc81c\uacf5\ud569\ub2c8\ub2e4. \uc720\ub2c8\ucf54\ub4dc " +
         "\ud45c\uc900\uc740 " + // "Apple, HP, IBM, JustSystem, Microsoft, Oracle, SAP, " +
-        // "Sun, Sybase, Unisys " + 
+        // "Sun, Sybase, Unisys " +
         "\ubc0f \uae30\ud0c0 \uc5ec\ub7ec " +
         "\ud68c\uc0ac\uc640 \uac19\uc740 \uc5c5\uacc4 " +
         "\uc120\ub450\uc8fc\uc790\uc5d0 \uc758\ud574 " +
@@ -323,7 +326,7 @@ public class JamoTest extends TestFmwk {
         "\ucd5c\uadfc \uc804 \uc138\uacc4\uc5d0 \ubd88\uace0 \uc788\ub294 " +
         "\uae30\uc220 \uacbd\ud5a5\uc5d0\uc11c \uac00\uc7a5 \uc911\uc694\ud55c " +
         "\ubd80\ubd84\uc744 \ucc28\uc9c0\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. " +
-        
+
         "\uc720\ub2c8\ucf54\ub4dc\ub97c " +
 // Replaced a hyphen with a space to make the test case work with CLDR1.5
 //        "\ud074\ub77c\uc774\uc5b8\ud2b8-\uc11c\ubc84 \ub610\ub294 " +
@@ -345,7 +348,7 @@ public class JamoTest extends TestFmwk {
         "\ub370\uc774\ud130\ub97c \uc190\uc0c1 \uc5c6\uc774 \uc5ec\ub7ec " +
         "\uc2dc\uc2a4\ud15c\uc744 \ud1b5\ud574 \uc804\uc1a1\ud560 \uc218 " +
         "\uc788\uc2b5\ub2c8\ub2e4. " +
-        
+
         "\uc720\ub2c8\ucf54\ub4dc \ucf58\uc18c\uc2dc\uc5c4\uc5d0 \ub300\ud574 " +
         "\uc720\ub2c8\ucf54\ub4dc \ucf58\uc18c\uc2dc\uc5c4\uc740 " +
         "\ube44\uc601\ub9ac \uc870\uc9c1\uc73c\ub85c\uc11c \ud604\ub300 " +
@@ -369,7 +372,7 @@ public class JamoTest extends TestFmwk {
         "\uc9c0\uc6d0\ud558\uace0\uc790\ud558\ub294 \uc870\uc9c1\uacfc " +
         "\uac1c\uc778\uc5d0\uac8c \uac1c\ubc29\ub418\uc5b4 " +
         "\uc788\uc2b5\ub2c8\ub2e4. " +
-        
+
         "\ub354 \uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \uc6a9\uc5b4\uc9d1, " +
         "\uc608\uc81c \uc720\ub2c8\ucf54\ub4dc \uc0ac\uc6a9 \uac00\ub2a5 " +
         "\uc81c\ud488, \uae30\uc220 \uc815\ubcf4 \ubc0f \uae30\ud0c0 " +
@@ -406,7 +409,7 @@ public class JamoTest extends TestFmwk {
         "(Ti)", "\u1110",
         "(Pi)", "\u1111",
         "(Hi)", "\u1112",
-        
+
         "(A)", "\u1161",
         "(AE)", "\u1162",
         "(YA)", "\u1163",
index 3646358359ce70dd721203a2f8dbf678f458e769..5ce5d411e4495d6abee666ec3ae9f1818ab4715f 100644 (file)
@@ -14,6 +14,8 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.UnicodeRegex;
@@ -27,6 +29,7 @@ import com.ibm.icu.text.UnicodeSet;
 /**
  * @author markdavis
  */
+@RunWith(JUnit4.class)
 public class RegexUtilitiesTest extends TestFmwk {
     /**
      * Check basic construction.
@@ -49,7 +52,7 @@ public class RegexUtilitiesTest extends TestFmwk {
             String expected = tests[i].length == 1 ? source : tests[i][1];
             String actual = UnicodeRegex.fix(source);
             assertEquals(source, expected, actual);
-        } 
+        }
     }
 
     Transliterator hex = Transliterator.getInstance("hex");
index 482fcef5a005546d73509ce55da10125d1323e07..901bf369ae72f2007f4c6ccbdb99fc5720cdefa2 100644 (file)
@@ -8,6 +8,10 @@
  */
 package com.ibm.icu.dev.test.translit;
 
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
 import com.ibm.icu.text.Replaceable;
@@ -18,8 +22,9 @@ import com.ibm.icu.text.Transliterator;
  * @test
  * @summary Round trip test of Transliterator
  */
+@RunWith(JUnit4.class)
 public class ReplaceableTest extends TestFmwk {
-    @org.junit.Test
+    @Test
     public void Test() {
         check("Lower", "ABCD", "1234");
         check("Upper", "abcd\u00DF", "123455"); // must map 00DF to SS
@@ -35,11 +40,11 @@ public class ReplaceableTest extends TestFmwk {
         check("*x > a", "\uFFFFxy", "_33"); // expect "_23"?
         check("*(x) > A $1 B", "\uFFFFxy", "__223");
     }
-    
+
     void check(String transliteratorName, String test, String shouldProduceStyles) {
         TestReplaceable tr = new TestReplaceable(test, null);
         String original = tr.toString();
-        
+
         Transliterator t;
         if (transliteratorName.startsWith("*")) {
             transliteratorName = transliteratorName.substring(1);
@@ -56,13 +61,13 @@ public class ReplaceableTest extends TestFmwk {
         } else {
             logln("OK: " + transliteratorName + " ( " + original + " ) => " + tr.toString());
         }
-        
-        if (!tr.hasMetaData() || tr.chars.hasMetaData() 
+
+        if (!tr.hasMetaData() || tr.chars.hasMetaData()
             || tr.styles.hasMetaData()) {
             errln("Fail hasMetaData()");
         }
     }
-    
+
 
     /**
      * This is a test class that simulates styled text.
@@ -77,11 +82,11 @@ public class ReplaceableTest extends TestFmwk {
     static class TestReplaceable implements Replaceable {
         ReplaceableString chars;
         ReplaceableString styles;
-        
+
         static final char NO_STYLE = '_';
 
         static final char NO_STYLE_MARK = 0xFFFF;
-        
+
         TestReplaceable (String text, String styles) {
             chars = new ReplaceableString(text);
             StringBuffer s = new StringBuffer();
@@ -98,11 +103,12 @@ public class ReplaceableTest extends TestFmwk {
             }
             this.styles = new ReplaceableString(s.toString());
         }
-        
+
         public String getStyles() {
             return styles.toString();
         }
-        
+
+        @Override
         public String toString() {
             return chars.toString() + "{" + styles.toString() + "}";
         }
@@ -111,22 +117,27 @@ public class ReplaceableTest extends TestFmwk {
             return chars.substring(start, limit);
         }
 
+        @Override
         public int length() {
             return chars.length();
         }
 
+        @Override
         public char charAt(int offset) {
             return chars.charAt(offset);
         }
 
+        @Override
         public int char32At(int offset) {
             return chars.char32At(offset);
         }
 
+        @Override
         public void getChars(int srcStart, int srcLimit, char dst[], int dstStart) {
             chars.getChars(srcStart, srcLimit, dst, dstStart);
         }
 
+        @Override
         public void replace(int start, int limit, String text) {
             if (substring(start,limit).equals(text)) return; // NO ACTION!
             if (DEBUG) System.out.print(Utility.escape(toString() + " -> replace(" + start +
@@ -135,7 +146,8 @@ public class ReplaceableTest extends TestFmwk {
             fixStyles(start, limit, text.length());
             if (DEBUG) System.out.println(Utility.escape(toString()));
         }
-        
+
+        @Override
         public void replace(int start, int limit, char[] charArray,
                             int charsStart, int charsLen) {
             if (substring(start,limit).equals(new String(charArray, charsStart, charsLen-charsStart))) return; // NO ACTION!
@@ -167,18 +179,20 @@ public class ReplaceableTest extends TestFmwk {
             styles.replace(start, limit, s.toString());
         }
 
+        @Override
         public void copy(int start, int limit, int dest) {
             chars.copy(start, limit, dest);
             styles.copy(start, limit, dest);
         }
-        
+
+        @Override
         public boolean hasMetaData() {
             return true;
         }
 
         static final boolean DEBUG = false;
     }
-    
+
     @org.junit.Test
     public void Test5789() {
         String rules =
index c3f5734d5d0e9774a762a445abd6b6214e553f56..a6305abd1b295a511a081255a0ed258851cd5899 100644 (file)
@@ -20,6 +20,8 @@ import java.io.UnsupportedEncodingException;
 import java.util.MissingResourceException;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.impl.Utility;
@@ -37,6 +39,7 @@ import com.ibm.icu.util.ULocale;
  * @test
  * @summary Round trip test of Transliterator
  */
+@RunWith(JUnit4.class)
 public class RoundTripTest extends TestFmwk {
 
     //TODO - revisit test cases referencing FIX_ME
@@ -88,6 +91,7 @@ public class RoundTripTest extends TestFmwk {
             abbreviated = false;
         }
 
+        @Override
         public void reset(UnicodeSet newSet) {
             reset(newSet, false);
         }
@@ -105,6 +109,7 @@ public class RoundTripTest extends TestFmwk {
             }
         }
 
+        @Override
         protected void loadRange(int myRange) {
             super.loadRange(myRange);
             if (abbreviated && (endElement > nextElement + perRange)) {
@@ -167,7 +172,7 @@ public class RoundTripTest extends TestFmwk {
     public void TestHangul() throws IOException {
         long start = System.currentTimeMillis();
         TransliterationTest t = new TransliterationTest("Latin-Hangul", 5);
-        boolean TEST_ALL = getBooleanProperty("HangulRoundTripAll", false); 
+        boolean TEST_ALL = getBooleanProperty("HangulRoundTripAll", false);
         if (TEST_ALL && TestFmwk.getExhaustiveness() == 10) {
             t.setPairLimit(Integer.MAX_VALUE); // only go to the limit if we have TEST_ALL and getInclusion
         }
@@ -344,7 +349,7 @@ public class RoundTripTest extends TestFmwk {
             logln("TestGreek needs to be updated to remove delete the section marked [:Age=4.0:] filter");
         }
 
-        return 
+        return
                 "[\u003B\u00B7[[:Greek:]&[:Letter:]]-[" +
                 "\u1D26-\u1D2A" + // L&   [5] GREEK LETTER SMALL CAPITAL GAMMA..GREEK LETTER SMALL CAPITAL PSI
                 "\u1D5D-\u1D61" + // Lm   [5] MODIFIER LETTER SMALL BETA..MODIFIER LETTER SMALL CHI
@@ -422,15 +427,15 @@ public class RoundTripTest extends TestFmwk {
         if (FIX_ME) {
             new TransliterationTest("Latin-Thai")
             .test("[a-zA-Z\u0142\u1ECD\u00E6\u0131\u0268\u02CC]",
-                    "[\u0E01-\u0E3A\u0E40-\u0E5B]", 
+                    "[\u0E01-\u0E3A\u0E40-\u0E5B]",
                     "[a-zA-Z\u0142\u1ECD\u00E6\u0131\u0268\u02B9\u02CC]",
                     null, this, new LegalThai());
         } else {
             new TransliterationTest("Latin-Thai")
             .test("[a-zA-Z\u0142\u1ECD\u00E6\u0131\u0268\u02CC]",
-                    "[\u0E01-\u0E3A\u0E40-\u0E5B]", 
+                    "[\u0E01-\u0E3A\u0E40-\u0E5B]",
                     "[a-zA-Z\u0142\u1ECD\u00E6\u0131\u0268\u02B9\u02CC]",
-                    "[\u0E4F]", this, new LegalThai());   
+                    "[\u0E4F]", this, new LegalThai());
         }
 
         showElapsed(start, "TestThai");
@@ -459,6 +464,7 @@ public class RoundTripTest extends TestFmwk {
         String virama = "\u094d\u09cd\u0a4d\u0acd\u0b4d\u0bcd\u0c4d\u0ccd\u0d4d";
         String sanskritStressSigns = "\u0951\u0952\u0953\u0954\u097d";
         String chandrabindu = "\u0901\u0981\u0A81\u0b01\u0c01";
+        @Override
         public boolean is(String sourceString){
             int cp=sourceString.charAt(0);
 
@@ -922,6 +928,7 @@ public class RoundTripTest extends TestFmwk {
         // any medial must follow an initial (or medial)
         // any final must follow a medial (or final)
 
+        @Override
         public boolean is(String sourceString) {
             try {
                 int t;
@@ -959,6 +966,7 @@ public class RoundTripTest extends TestFmwk {
     //static BreakIterator thaiBreak = BreakIterator.getWordInstance(new Locale("th", "TH"));
     // anything is legal except word ending with Logical-order-exception
     public static class LegalThai extends Legal {
+        @Override
         public boolean is(String sourceString) {
             if (sourceString.length() == 0) return true;
             char ch = sourceString.charAt(sourceString.length() - 1); // don't worry about surrogates.
@@ -985,6 +993,7 @@ public class RoundTripTest extends TestFmwk {
         static UnicodeSet FINAL = new UnicodeSet("[\u05DA\u05DD\u05DF\u05E3\u05E5]");
         static UnicodeSet NON_FINAL = new UnicodeSet("[\u05DB\u05DE\u05E0\u05E4\u05E6]");
         static UnicodeSet LETTER = new UnicodeSet("[:letter:]");
+        @Override
         public boolean is(String sourceString) {
             if (sourceString.length() == 0) return true;
             // don't worry about surrogates.
@@ -1022,6 +1031,7 @@ public class RoundTripTest extends TestFmwk {
             return "\u03C1\u03A1".indexOf(c) >= 0;
         }
 
+        @Override
         public boolean is(String sourceString) {
             try {
                 String decomp = Normalizer.normalize(sourceString, Normalizer.NFD);
@@ -1179,7 +1189,7 @@ public class RoundTripTest extends TestFmwk {
         }
 
         /**
-         * Will test 
+         * Will test
          * that everything in sourceRange maps to targetRange,
          * that everything in targetRange maps to backtoSourceRange
          * that everything roundtrips from target -> source -> target, except roundtripExceptions
@@ -1625,7 +1635,7 @@ public class RoundTripTest extends TestFmwk {
             StringBuffer result = new StringBuffer();
             result.append("\u200E").append(s).append("\u200E (").append(TestUtility.hex(s)).append("/");
             if (false) { // append age, as a check
-                int cp = 0;    
+                int cp = 0;
                 for (int i = 0; i < s.length(); i += UTF16.getCharCount(cp)) {
                     cp = UTF16.charAt(s, i);
                     if (i > 0) result.append(", ");
@@ -1636,7 +1646,7 @@ public class RoundTripTest extends TestFmwk {
             return result.toString();
         }
 
-        final void logWrongScript(String label, String from, String to, 
+        final void logWrongScript(String label, String from, String to,
                 UnicodeSet shouldContainAll, UnicodeSet shouldNotContainAny) {
             if (++errorCount > errorLimit) {
                 throw new TestTruncated("Test truncated; too many failures");
index 1e0b263268d1ca638bf6003ba637fee0051a83d2..5441c20e57bc641b8b194ad1534920fb51bda4c8 100644 (file)
@@ -11,6 +11,8 @@ package com.ibm.icu.dev.test.translit;
 import java.util.ArrayList;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.text.Transliterator;
@@ -18,17 +20,18 @@ import com.ibm.icu.text.Transliterator;
 // Test for ICU Ticket #7201.  With threading bugs in RuleBasedTransliterator, this
 //   test would reliably crash.
 
+@RunWith(JUnit4.class)
 public class ThreadTest extends TestFmwk {
     private ArrayList<Worker> threads = new ArrayList<Worker>();
     private int iterationCount = 50000;
-    
+
     @Test
     public void TestThreads()  {
         if (TestFmwk.getExhaustiveness() >= 9) {
             // Exhaustive test.  Run longer.
             iterationCount = 1000000;
         }
-        
+
         for (int i = 0; i < 8; i++) {
             Worker thread = new Worker();
             threads.add(thread);
@@ -50,32 +53,34 @@ public class ThreadTest extends TestFmwk {
             }
         }
     }
-    
+
     private static final String [] WORDS = {"edgar", "allen", "poe"};
-   
-    private class Worker extends Thread {   
+
+    private class Worker extends Thread {
         public long count = 0;
+        @Override
         public void run() {
-            Transliterator tx = Transliterator.getInstance("Latin-Thai");        
+            Transliterator tx = Transliterator.getInstance("Latin-Thai");
             for (int loop = 0; loop < iterationCount; loop++) {
                 for (String s : WORDS) {
                     count += tx.transliterate(s).length();
-                }                
+                }
             }
         }
     }
-    
+
     // Test for ticket #10673, race in cache code in AnyTransliterator.
     // It's difficult to make the original unsafe code actually fail, but
-    // this test will fairly reliably take the code path for races in 
+    // this test will fairly reliably take the code path for races in
     // populating the cache.
-    // 
+    //
     @Test
     public void TestAnyTranslit() {
         final Transliterator tx = Transliterator.getInstance("Any-Latin");
         ArrayList<Thread> threads = new ArrayList<Thread>();
         for (int i=0; i<8; i++) {
             threads.add(new Thread() {
+                @Override
                 public void run() {
                     tx.transliterate("διαφορετικούς");
                 }
index dd48b7ff6fab7023ff7779a435e2196f021e85cc..090f280f52cd6c1540a2c8f97eee2e703dd18d82 100644 (file)
@@ -18,6 +18,8 @@ import java.util.Locale;
 import java.util.Map.Entry;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.test.TestUtil;
@@ -89,6 +91,7 @@ The Management
  * @test
  * @summary General test of Transliterator
  */
+@RunWith(JUnit4.class)
 public class TransliteratorTest extends TestFmwk {
     @Test
     public void TestHangul() {
index 0f824f74e9845458194c8d4e845103805399337a..e277a600faa90bdd1994991f0b4a9ceb31a7fa9a 100644 (file)
@@ -22,6 +22,8 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestBoilerplate;
 import com.ibm.icu.dev.test.TestFmwk;
@@ -39,6 +41,7 @@ import com.ibm.icu.text.UnicodeSet;
  * @test
  * @summary General test of UnicodeSet
  */
+@RunWith(JUnit4.class)
 public class UnicodeMapTest extends TestFmwk {
 
     static final int MODIFY_TEST_LIMIT = 32;
@@ -66,7 +69,7 @@ public class UnicodeMapTest extends TestFmwk {
         assertEquals("EntryRange<T>", expected, CollectionUtilities.join(foo.entryRanges(), "\n") + (foo.size() == 0 ? "" : "\n"));
         assertEquals("EntryRange<T>", expected, foo.toString());
     }
-    
+
     @Test
     public void TestRemove() {
         UnicodeMap<Double> foo = new UnicodeMap()
@@ -81,14 +84,14 @@ public class UnicodeMapTest extends TestFmwk {
         .put("abc", 3d)
         .put("mark", 999d)
         .freeze();
-        
+
         UnicodeMap<Double> afterFiiRemoval = new UnicodeMap()
         .put(0x20, -2d)
         .putAll(0x26, 0x29, -2d)
         .put("xy", 2d)
         .put("mark", 4d)
         .freeze();
-        
+
         UnicodeMap<Double> afterFiiRetained = new UnicodeMap()
         .putAll(0x21, 0x25, -2d)
         .put("abc", 3d)
@@ -97,7 +100,7 @@ public class UnicodeMapTest extends TestFmwk {
         UnicodeMap<Double> test = new UnicodeMap<Double>().putAll(foo)
                 .removeAll(fii);
         assertEquals("removeAll", afterFiiRemoval, test);
-        
+
         test = new UnicodeMap<Double>().putAll(foo)
                 .retainAll(fii);
         assertEquals("retainAll", afterFiiRetained, test);
@@ -160,9 +163,9 @@ public class UnicodeMapTest extends TestFmwk {
     }
 
     /**
-     * @param rand 
+     * @param rand
      * @param nextInt
-     * @param test 
+     * @param test
      * @return
      */
     private SortedMap<String, Integer> fillRandomMap(Random rand, int max, SortedMap<String, Integer> test) {
@@ -218,6 +221,7 @@ public class UnicodeMapTest extends TestFmwk {
     }
 
     static Comparator<String> OneFirstComparator = new Comparator<String>() {
+        @Override
         public int compare(String o1, String o2) {
             int cp1 = UnicodeSet.getSingleCodePoint(o1);
             int cp2 = UnicodeSet.getSingleCodePoint(o2);
@@ -234,14 +238,14 @@ public class UnicodeMapTest extends TestFmwk {
     };
 
     /**
-     * @param rand 
+     * @param rand
      * @param others
      * @return
      */
     private String getRandomKey(Random rand) {
         int r = rand.nextInt(30);
         if (r == 0) {
-            return UTF16.valueOf(r); 
+            return UTF16.valueOf(r);
         } else if (r < 10) {
             return UTF16.valueOf('A'-1+r);
         } else if (r < 20) {
@@ -296,7 +300,7 @@ public class UnicodeMapTest extends TestFmwk {
         }
         return true;
     }
-    
+
     @Test
     public void TestCloneAsThawed11721 () {
         UnicodeMap<Integer> test = new UnicodeMap().put("abc", 3).freeze();
@@ -456,6 +460,7 @@ public class UnicodeMapTest extends TestFmwk {
     }
 
     static Comparator<Map.Entry<Integer, String>> ENTRY_COMPARATOR = new Comparator<Map.Entry<Integer, String>>() {
+        @Override
         public int compare(Map.Entry<Integer, String> o1, Map.Entry<Integer, String> o2) {
             if (o1 == o2) return 0;
             if (o1 == null) return -1;
index 50ff6bab3680bd0459e7813e6c3d537c4bfe140c..08fb32dad9481ceb262bf914b0fd4fe13c76a46d 100644 (file)
@@ -14,10 +14,13 @@ import java.util.Set;
 import java.util.TreeSet;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
 
 import com.ibm.icu.dev.test.TestFmwk;
 import com.ibm.icu.dev.util.CollectionUtilities;
 
+@RunWith(JUnit4.class)
 public class TestUtilities extends TestFmwk {
     @Test
     public void TestCollectionUtilitySpeed() {