コード例 #1
0
 private static Loader getCustomLoaderInstance(DataLoader testData) {
   Loader dataLoader = null;
   LOG.info("User specified to use custom Loader. Trying to get the custom loader.");
   if (testData.loader() == null) {
     Assert.fail(
         "Specified the LoaderType as CUSTOM but did not specify loader"
             + " attribute. A loaderType of CUSTOM requires the loader "
             + "attribute specifying "
             + "the Custom Loader Class which implements Loader interface.");
   } else {
     try {
       Class<? extends Loader> loaderClass = testData.loader();
       dataLoader = loaderClass.newInstance();
     } catch (Exception e) {
       throw new RuntimeException(
           "Exception occured while trying to instantiate a class of type :" + testData.loader(),
           e);
     }
   }
   return dataLoader;
 }