1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -627,53 +627,47 @@ public void testParseLocaleWithMultiSpecialCharactersInVariant() throws Exceptio
627
627
assertEquals ("Multi-valued variant portion of the Locale not extracted correctly." , variant , locale .getVariant ());
628
628
}
629
629
630
- // SPR-3671
631
- @ Test
630
+ @ Test // SPR-3671
632
631
public void testParseLocaleWithMultiValuedVariant () throws Exception {
633
632
final String variant = "proper_northern" ;
634
633
final String localeString = "en_GB_" + variant ;
635
634
Locale locale = StringUtils .parseLocaleString (localeString );
636
635
assertEquals ("Multi-valued variant portion of the Locale not extracted correctly." , variant , locale .getVariant ());
637
636
}
638
637
639
- // SPR-3671
640
- @ Test
638
+ @ Test // SPR-3671
641
639
public void testParseLocaleWithMultiValuedVariantUsingSpacesAsSeparators () throws Exception {
642
640
final String variant = "proper northern" ;
643
641
final String localeString = "en GB " + variant ;
644
642
Locale locale = StringUtils .parseLocaleString (localeString );
645
643
assertEquals ("Multi-valued variant portion of the Locale not extracted correctly." , variant , locale .getVariant ());
646
644
}
647
645
648
- // SPR-3671
649
- @ Test
646
+ @ Test // SPR-3671
650
647
public void testParseLocaleWithMultiValuedVariantUsingMixtureOfUnderscoresAndSpacesAsSeparators () throws Exception {
651
648
final String variant = "proper northern" ;
652
649
final String localeString = "en_GB_" + variant ;
653
650
Locale locale = StringUtils .parseLocaleString (localeString );
654
651
assertEquals ("Multi-valued variant portion of the Locale not extracted correctly." , variant , locale .getVariant ());
655
652
}
656
653
657
- // SPR-3671
658
- @ Test
654
+ @ Test // SPR-3671
659
655
public void testParseLocaleWithMultiValuedVariantUsingSpacesAsSeparatorsWithLotsOfLeadingWhitespace () throws Exception {
660
656
final String variant = "proper northern" ;
661
657
final String localeString = "en GB " + variant ; // lots of whitespace
662
658
Locale locale = StringUtils .parseLocaleString (localeString );
663
659
assertEquals ("Multi-valued variant portion of the Locale not extracted correctly." , variant , locale .getVariant ());
664
660
}
665
661
666
- // SPR-3671
667
- @ Test
662
+ @ Test // SPR-3671
668
663
public void testParseLocaleWithMultiValuedVariantUsingUnderscoresAsSeparatorsWithLotsOfLeadingWhitespace () throws Exception {
669
664
final String variant = "proper_northern" ;
670
665
final String localeString = "en_GB_____" + variant ; // lots of underscores
671
666
Locale locale = StringUtils .parseLocaleString (localeString );
672
667
assertEquals ("Multi-valued variant portion of the Locale not extracted correctly." , variant , locale .getVariant ());
673
668
}
674
669
675
- // SPR-7779
676
- @ Test
670
+ @ Test // SPR-7779
677
671
public void testParseLocaleWithInvalidCharacters () {
678
672
try {
679
673
StringUtils .parseLocaleString ("%0D%0AContent-length:30%0D%0A%0D%0A%3Cscript%3Ealert%28123%29%3C/script%3E" );
@@ -684,20 +678,23 @@ public void testParseLocaleWithInvalidCharacters() {
684
678
}
685
679
}
686
680
687
- // SPR-9420
688
- @ Test
681
+ @ Test // SPR-9420
689
682
public void testParseLocaleWithSameLowercaseTokenForLanguageAndCountry () {
690
683
assertEquals ("tr_TR" , StringUtils .parseLocaleString ("tr_tr" ).toString ());
691
684
assertEquals ("bg_BG_vnt" , StringUtils .parseLocaleString ("bg_bg_vnt" ).toString ());
692
685
}
693
686
694
- // SPR-11806
695
- @ Test
687
+ @ Test // SPR-11806
696
688
public void testParseLocaleWithVariantContainingCountryCode () {
697
689
String variant = "GBtest" ;
698
690
String localeString = "en_GB_" + variant ;
699
691
Locale locale = StringUtils .parseLocaleString (localeString );
700
692
assertEquals ("Variant containing country code not extracted correctly" , variant , locale .getVariant ());
701
693
}
702
694
695
+ @ Test // SPR-14718
696
+ public void testParseJava7Variant () {
697
+ assertEquals ("sr_#LATN" , StringUtils .parseLocaleString ("sr_#LATN" ).toString ());
698
+ }
699
+
703
700
}
0 commit comments