Search in sources :

Example 56 with Parameters

use of org.junit.runners.Parameterized.Parameters in project netty by netty.

the class HpackTest method data.

@Parameters(name = "{0}")
public static Collection<Object[]> data() {
    URL url = HpackTest.class.getResource(TEST_DIR);
    File[] files = new File(url.getFile()).listFiles();
    if (files == null) {
        throw new NullPointerException("files");
    }
    ArrayList<Object[]> data = new ArrayList<Object[]>();
    for (File file : files) {
        data.add(new Object[] { file.getName() });
    }
    return data;
}
Also used : ArrayList(java.util.ArrayList) File(java.io.File) URL(java.net.URL) Parameters(org.junit.runners.Parameterized.Parameters)

Example 57 with Parameters

use of org.junit.runners.Parameterized.Parameters in project opennms by OpenNMS.

the class SyslogMessageLogDTOTest method data.

@Parameters
public static Collection<Object[]> data() throws ParseException, UnknownHostException {
    SyslogMessageLogDTO messageLog = new SyslogMessageLogDTO();
    messageLog.setLocation("loc");
    messageLog.setSystemId("99");
    messageLog.setSourceAddress(InetAddress.getByName("127.0.0.1"));
    messageLog.setSourcePort(1514);
    SyslogMessageDTO message = new SyslogMessageDTO();
    message.setTimestamp(new Date(0));
    message.setBytes(ByteBuffer.wrap(new byte[] { 0, 1, 2, 3 }));
    messageLog.getMessages().add(message);
    return Arrays.asList(new Object[][] { { messageLog, "<syslog-message-log source-address=\"127.0.0.1\" source-port=\"1514\" system-id=\"99\" location=\"loc\">\n" + "   <messages timestamp=\"" + StringUtils.iso8601OffsetString(new Date(0), ZoneId.systemDefault(), ChronoUnit.SECONDS) + "\">AAECAw==</messages>\n" + "</syslog-message-log>", null } });
}
Also used : Date(java.util.Date) Parameters(org.junit.runners.Parameterized.Parameters)

Example 58 with Parameters

use of org.junit.runners.Parameterized.Parameters in project opennms by OpenNMS.

the class MinionIdentityDTOTest method data.

@Parameters
public static Collection<Object[]> data() throws ParseException {
    Date timestamp = new Date(0);
    MinionIdentityDTO identity = new MinionIdentityDTO();
    identity.setId("idx");
    identity.setLocation("locationx");
    identity.setTimestamp(timestamp);
    return Arrays.asList(new Object[][] { { identity, "<minion>\n" + "<id>idx</id>\n" + "<location>locationx</location>\n" + "<timestamp>" + StringUtils.iso8601LocalOffsetString(timestamp) + "</timestamp>\n" + "</minion>", null } });
}
Also used : Date(java.util.Date) Parameters(org.junit.runners.Parameterized.Parameters)

Example 59 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 60 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)

Aggregations

Parameters (org.junit.runners.Parameterized.Parameters)77 ArrayList (java.util.ArrayList)43 File (java.io.File)24 TestCaseContext (org.apache.asterix.testframework.context.TestCaseContext)6 Date (java.util.Date)5 SslContext (io.netty.handler.ssl.SslContext)4 IOException (java.io.IOException)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 InputStream (java.io.InputStream)2 Field (java.lang.reflect.Field)2