2323
2424/*
2525 * @test
26- * @bug 5097015 8130181 8279222
26+ * @bug 5097015 8130181 8279222 8292739
2727 * @summary make sure we correctly treat Provider string entries as case insensitive
2828 * @author Andreas Sterbenz
2929 */
@@ -42,15 +42,23 @@ public class CaseSensitiveServices extends Provider {
4242 put ("MESSAGEDIGEST.BAZ" , "com.Baz" );
4343 // reassign the DEF alias to algorithm Bar
4444 put ("ALg.aliaS.MESSAGEdigest.DEF" , "Bar" );
45+ // invalid entry since it misses the corresponding impl class info
46+ // e.g. put("MessageDigest.Invalid", "implClass");
47+ put ("MessageDigest.Invalid xYz" , "aBc" );
4548 }
4649
4750 public static void main (String [] args ) throws Exception {
4851 Provider p = new CaseSensitiveServices ();
49- System .out .println (p .getServices ());
52+
53+ System .out .println ("Services: " + p .getServices ());
54+
5055 if (p .getServices ().size () != 3 ) {
5156 throw new Exception ("services.size() should be 3" );
5257 }
5358
59+ if (p .getService ("MessageDigest" , "Invalid" ) != null ) {
60+ throw new Exception ("Invalid service returned" );
61+ }
5462 Service s = testService (p , "MessageDigest" , "fOO" );
5563 String val = s .getAttribute ("Xyz" );
5664 if ("aBc" .equals (val ) == false ) {
@@ -70,7 +78,8 @@ public static void main(String[] args) throws Exception {
7078 System .out .println ("OK" );
7179 }
7280
73- private static Service testService (Provider p , String type , String alg ) throws Exception {
81+ private static Service testService (Provider p , String type , String alg )
82+ throws Exception {
7483 System .out .println ("Getting " + type + "." + alg + "..." );
7584 Service s = p .getService (type , alg );
7685 System .out .println (s );
0 commit comments