Search in sources :

Example 26 with Parameters

use of org.junit.runners.Parameterized.Parameters in project asterixdb by apache.

the class AbstractExecutionIT method tests.

@Parameters
public static Collection<Object[]> tests() throws Exception {
    Collection<Object[]> testArgs = new ArrayList<Object[]>();
    TestCaseContext.Builder b = new TestCaseContext.Builder();
    for (TestCaseContext ctx : b.build(new File(PATH_BASE))) {
        testArgs.add(new Object[] { ctx });
    }
    return testArgs;
}
Also used : TestCaseContext(org.apache.asterix.testframework.context.TestCaseContext) ArrayList(java.util.ArrayList) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Example 27 with Parameters

use of org.junit.runners.Parameterized.Parameters in project asterixdb by apache.

the class OptimizerParserTest method tests.

@Parameters(name = "OptimizerParserTest {index}: {0}")
public static Collection<Object[]> tests() {
    Collection<Object[]> testArgs = new ArrayList<>();
    ParserTestUtil.suiteBuild(new File(PATH_QUERIES), testArgs, "", File.separator, EXTENSION_QUERY, EXTENSION_RESULT, PATH_EXPECTED, PATH_ACTUAL);
    return testArgs;
}
Also used : ArrayList(java.util.ArrayList) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Example 28 with Parameters

use of org.junit.runners.Parameterized.Parameters in project calcite-avatica by apache.

the class AvaticaSpnegoTest method parameters.

@Parameters
public static List<Object[]> parameters() throws Exception {
    final ArrayList<Object[]> parameters = new ArrayList<>();
    // Start the KDC
    setupKdc();
    // Create a LocalService around HSQLDB
    final JdbcMeta jdbcMeta = new JdbcMeta(CONNECTION_SPEC.url, CONNECTION_SPEC.username, CONNECTION_SPEC.password);
    final LocalService localService = new LocalService(jdbcMeta);
    for (Driver.Serialization serialization : new Driver.Serialization[] { Driver.Serialization.JSON, Driver.Serialization.PROTOBUF }) {
        // Build and start the server
        HttpServer httpServer = new HttpServer.Builder().withPort(0).withAutomaticLogin(serverKeytab).withSpnego(SpnegoTestUtil.SERVER_PRINCIPAL, SpnegoTestUtil.REALM).withHandler(localService, serialization).build();
        httpServer.start();
        SERVERS_TO_STOP.add(httpServer);
        final String url = "jdbc:avatica:remote:url=http://" + SpnegoTestUtil.KDC_HOST + ":" + httpServer.getPort() + ";authentication=SPNEGO;serialization=" + serialization;
        LOG.info("JDBC URL {}", url);
        parameters.add(new Object[] { url });
    }
    return parameters;
}
Also used : ArrayList(java.util.ArrayList) JdbcMeta(org.apache.calcite.avatica.jdbc.JdbcMeta) HttpServer(org.apache.calcite.avatica.server.HttpServer) Driver(org.apache.calcite.avatica.remote.Driver) LocalService(org.apache.calcite.avatica.remote.LocalService) Parameters(org.junit.runners.Parameterized.Parameters)

Example 29 with Parameters

use of org.junit.runners.Parameterized.Parameters in project poi by apache.

the class TestPPTX2PNG method data.

@Parameters(name = "{0}")
public static Collection<String> data() {
    final Set<String> data = new TreeSet<String>();
    for (String f : files.split(", ?")) {
        if (basedir == null) {
            data.add(f);
        } else {
            final Pattern p = Pattern.compile(f);
            basedir.listFiles(new FileFilter() {

                public boolean accept(File pathname) {
                    String name = pathname.getName();
                    if (p.matcher(name).matches()) {
                        data.add(name);
                    }
                    return false;
                }
            });
        }
    }
    return data;
}
Also used : Pattern(java.util.regex.Pattern) TreeSet(java.util.TreeSet) FileFilter(java.io.FileFilter) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Example 30 with Parameters

use of org.junit.runners.Parameterized.Parameters in project poi by apache.

the class TestRVA method data.

@Parameters(name = "{1}")
public static Collection<Object[]> data() throws Exception {
    poifs = new NPOIFSFileSystem(HSSFTestDataSamples.getSampleFile("testRVA.xls"), true);
    workbook = new HSSFWorkbook(poifs);
    sheet = workbook.getSheetAt(0);
    List<Object[]> data = new ArrayList<Object[]>();
    for (int rowIdx = 0; true; rowIdx++) {
        HSSFRow row = sheet.getRow(rowIdx);
        if (row == null) {
            break;
        }
        HSSFCell cell = row.getCell(0);
        if (cell == null || cell.getCellTypeEnum() == CellType.BLANK) {
            break;
        }
        String formula = cell.getCellFormula();
        data.add(new Object[] { cell, formula });
    }
    return data;
}
Also used : NPOIFSFileSystem(org.apache.poi.poifs.filesystem.NPOIFSFileSystem) HSSFCell(org.apache.poi.hssf.usermodel.HSSFCell) ArrayList(java.util.ArrayList) HSSFRow(org.apache.poi.hssf.usermodel.HSSFRow) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook) 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