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;
}
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 } });
}
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 } });
}
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 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;
}
Aggregations