/** * Determine the Loader Type to load the test data * * @param testData the {@link DataLoader} annotation instance * @param dataFiles the list of test data Files * @return {@link LoaderType} to use */ private static final LoaderType determineLoaderType(DataLoader testData, String[] dataFiles) { LoaderType loaderType = testData.loaderType(); if (LoaderType.NONE.equals(loaderType)) { // Identify the file extension if (dataFiles == null || dataFiles.length == 0) { // assume it is custom loader and return return LoaderType.CUSTOM; } // Since we currently support only a single file type in the FilePaths attribute, // we can safely pick one of the file, determine its extension and assume that other files // have the same // extension return resolveFileExtension(dataFiles[0]); } return loaderType; }