use of org.junit.runners.Parameterized.Parameters in project jena by apache.
the class TestResultSetIO method data.
@Parameters(name = "{index}: {0}")
public static Collection<Object[]> data() {
Lang[] langs = { SPARQLResultSetXML, SPARQLResultSetJSON, SPARQLResultSetCSV, SPARQLResultSetTSV };
List<Object[]> x = new ArrayList<>();
for (Lang lang : langs) {
x.add(new Object[] { "test:" + lang.getName(), lang });
}
return x;
}
use of org.junit.runners.Parameterized.Parameters in project jena by apache.
the class SourceParameterTest method testParameters.
/***********************************/
/* Constants */
/***********************************/
/** Test parameters are formed from the schemagen options
**/
@Parameters
public static Collection<Object[]> testParameters() {
Collection<Object[]> params = new ArrayList<>();
for (OPT opt : OPT.values()) {
Object[] par = new Object[2];
par[0] = opt;
par[1] = opt.name();
params.add(par);
}
return params;
}
use of org.junit.runners.Parameterized.Parameters in project poi by apache.
the class TestAllFiles method files.
@Parameters(name = "{index}: {0} using {1}")
public static Iterable<Object[]> files() {
DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(ROOT_DIR);
scanner.setExcludes(SCAN_EXCLUDES);
scanner.scan();
System.out.println("Handling " + scanner.getIncludedFiles().length + " files");
List<Object[]> files = new ArrayList<Object[]>();
for (String file : scanner.getIncludedFiles()) {
// ... failures/handlers lookup doesn't work on windows otherwise
file = file.replace('\\', '/');
if (IGNORED.contains(file)) {
System.out.println("Ignoring " + file);
continue;
}
FileHandler handler = HANDLERS.get(getExtension(file));
files.add(new Object[] { file, handler });
// for some file-types also run OPCFileHandler
if (handler instanceof XSSFFileHandler || handler instanceof XWPFFileHandler || handler instanceof XSLFFileHandler || handler instanceof XDGFFileHandler) {
files.add(new Object[] { file, new OPCFileHandler() });
}
if (handler instanceof HSSFFileHandler || handler instanceof HSLFFileHandler || handler instanceof HWPFFileHandler || handler instanceof HDGFFileHandler) {
files.add(new Object[] { file, new HPSFFileHandler() });
}
}
return files;
}
use of org.junit.runners.Parameterized.Parameters in project poi by apache.
the class TestReadAllFiles method files.
@Parameters(name = "{index}: {0} using {1}")
public static Iterable<Object[]> files() {
final List<Object[]> files = new ArrayList<Object[]>();
_samples.getFile("").listFiles(new FileFilter() {
@Override
public boolean accept(final File f) {
if (f.getName().startsWith("Test")) {
// && f.getName().equals("TestCorel.shw")
files.add(new Object[] { f });
}
return false;
}
});
return files;
}
use of org.junit.runners.Parameterized.Parameters in project poi by apache.
the class TestFormulasFromSpreadsheet method data.
@Parameters(name = "{0}")
public static Collection<Object[]> data() throws Exception {
// Function "Text" uses custom-formats which are locale specific
// can't set the locale on a per-testrun execution, as some settings have been
// already set, when we would try to change the locale by then
userLocale = LocaleUtil.getUserLocale();
LocaleUtil.setUserLocale(Locale.ROOT);
workbook = HSSFTestDataSamples.openSampleWorkbook(SS.FILENAME);
sheet = workbook.getSheetAt(0);
evaluator = new HSSFFormulaEvaluator(workbook);
List<Object[]> data = new ArrayList<Object[]>();
processFunctionGroup(data, SS.START_OPERATORS_ROW_INDEX, null);
processFunctionGroup(data, SS.START_FUNCTIONS_ROW_INDEX, null);
return data;
}
Aggregations