コード例 #1
0
 private static void checkProviderInfoEntries(Provider p) throws Exception {
   String value = (String) p.get("Provider.id name");
   if (!SampleProvider.NAME.equalsIgnoreCase(value) || !p.getName().equalsIgnoreCase(value)) {
     throw new Exception("Test Failed: incorrect name!");
   }
   value = (String) p.get("Provider.id info");
   if (!SampleProvider.INFO.equalsIgnoreCase(value) || !p.getInfo().equalsIgnoreCase(value)) {
     throw new Exception("Test Failed: incorrect info!");
   }
   value = (String) p.get("Provider.id className");
   if (!p.getClass().getName().equalsIgnoreCase(value)) {
     throw new Exception("Test Failed: incorrect className!");
   }
   double dvalue = Double.parseDouble((String) p.get("Provider.id version"));
   if ((SampleProvider.VERSION != dvalue) || p.getVersion() != dvalue) {
     throw new Exception("Test Failed: incorrect version!");
   }
   System.out.println("Test Passed");
 }