Search in sources :

Example 66 with Parameters

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;
}
Also used : ArrayList(java.util.ArrayList) Lang(org.apache.jena.riot.Lang) Parameters(org.junit.runners.Parameterized.Parameters)

Example 67 with Parameters

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;
}
Also used : OPT(jena.schemagen.SchemagenOptions.OPT) ArrayList(java.util.ArrayList) Parameters(org.junit.runners.Parameterized.Parameters)

Example 68 with Parameters

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;
}
Also used : XDGFFileHandler(org.apache.poi.stress.XDGFFileHandler) XSSFFileHandler(org.apache.poi.stress.XSSFFileHandler) HPSFFileHandler(org.apache.poi.stress.HPSFFileHandler) ArrayList(java.util.ArrayList) XWPFFileHandler(org.apache.poi.stress.XWPFFileHandler) OPCFileHandler(org.apache.poi.stress.OPCFileHandler) POIFSFileHandler(org.apache.poi.stress.POIFSFileHandler) HSLFFileHandler(org.apache.poi.stress.HSLFFileHandler) HDGFFileHandler(org.apache.poi.stress.HDGFFileHandler) HMEFFileHandler(org.apache.poi.stress.HMEFFileHandler) AbstractFileHandler(org.apache.poi.stress.AbstractFileHandler) XSSFBFileHandler(org.apache.poi.stress.XSSFBFileHandler) HWPFFileHandler(org.apache.poi.stress.HWPFFileHandler) HSMFFileHandler(org.apache.poi.stress.HSMFFileHandler) XSLFFileHandler(org.apache.poi.stress.XSLFFileHandler) XWPFFileHandler(org.apache.poi.stress.XWPFFileHandler) FileHandler(org.apache.poi.stress.FileHandler) HSSFFileHandler(org.apache.poi.stress.HSSFFileHandler) HPBFFileHandler(org.apache.poi.stress.HPBFFileHandler) XDGFFileHandler(org.apache.poi.stress.XDGFFileHandler) XSSFFileHandler(org.apache.poi.stress.XSSFFileHandler) HPSFFileHandler(org.apache.poi.stress.HPSFFileHandler) OPCFileHandler(org.apache.poi.stress.OPCFileHandler) HSLFFileHandler(org.apache.poi.stress.HSLFFileHandler) HWPFFileHandler(org.apache.poi.stress.HWPFFileHandler) XSLFFileHandler(org.apache.poi.stress.XSLFFileHandler) DirectoryScanner(org.apache.tools.ant.DirectoryScanner) HDGFFileHandler(org.apache.poi.stress.HDGFFileHandler) HSSFFileHandler(org.apache.poi.stress.HSSFFileHandler) Parameters(org.junit.runners.Parameterized.Parameters)

Example 69 with Parameters

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;
}
Also used : ArrayList(java.util.ArrayList) FileFilter(java.io.FileFilter) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Example 70 with Parameters

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;
}
Also used : HSSFFormulaEvaluator(org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator) ArrayList(java.util.ArrayList) Parameters(org.junit.runners.Parameterized.Parameters)

Aggregations

Parameters (org.junit.runners.Parameterized.Parameters)70 ArrayList (java.util.ArrayList)41 File (java.io.File)20 TestCaseContext (org.apache.asterix.testframework.context.TestCaseContext)6 Date (java.util.Date)5 SslContext (io.netty.handler.ssl.SslContext)4 ExpiredCRLException (org.apereo.cas.adaptors.x509.authentication.ExpiredCRLException)4 ThresholdExpiredCRLRevocationPolicy (org.apereo.cas.adaptors.x509.authentication.revocation.policy.ThresholdExpiredCRLRevocationPolicy)4 RunWith (org.junit.runner.RunWith)4 ClassPathResource (org.springframework.core.io.ClassPathResource)4 ZonedDateTime (java.time.ZonedDateTime)3 Configuration (org.apache.hadoop.conf.Configuration)3 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)3 RevokedCertificateException (org.apereo.cas.adaptors.x509.authentication.revocation.RevokedCertificateException)3 Parameterized (org.junit.runners.Parameterized)3 CollectionAgentDTO (org.opennms.netmgt.collection.dto.CollectionAgentDTO)3 FileFilter (java.io.FileFilter)2 Field (java.lang.reflect.Field)2 BigInteger (java.math.BigInteger)2 GeneralSecurityException (java.security.GeneralSecurityException)2