use of org.junit.runners.Parameterized.Parameters in project cas by apereo.
the class X509SubjectPrincipalResolverTests method getTestParameters.
/**
* Gets the unit test parameters.
*
* @return Test parameter data.
*/
@Parameters
public static Collection<Object[]> getTestParameters() throws Exception {
final Collection<Object[]> params = new ArrayList<>();
// Test case #1
// Use CN for principal ID
params.add(new Object[] { new ClassPathResource("x509-ctop-resolver-hizzy.crt").getFile().getCanonicalPath(), "$CN", "Hizzogarthington I.S. Pleakinsense" });
// Test case #2
// Use email address for principal ID
params.add(new Object[] { new ClassPathResource("x509-ctop-resolver-hizzy.crt").getFile().getCanonicalPath(), "$EMAILADDRESS", "hizzy@vt.edu" });
// Test case #2
// Use combination of ou and cn for principal ID
params.add(new Object[] { new ClassPathResource("x509-ctop-resolver-hizzy.crt").getFile().getCanonicalPath(), "$OU $CN", "Middleware Hizzogarthington I.S. Pleakinsense" });
// Test case #3
// Use combination of serial number and cn for principal ID
params.add(new Object[] { new ClassPathResource("x509-ctop-resolver-gazzo.crt").getFile().getCanonicalPath(), "$CN:$SERIALNUMBER", "Gazzaloddi P. Wishwashington:271828183" });
// Test case #4
// Build principal ID from multivalued attributes
params.add(new Object[] { new ClassPathResource("x509-ctop-resolver-jacky.crt").getFile().getCanonicalPath(), "$UID@$DC.$DC", "jacky@vt.edu" });
return params;
}
use of org.junit.runners.Parameterized.Parameters in project opennms by OpenNMS.
the class DataSourceConfigurationTest method data.
@Parameters
public static Collection<Object[]> data() throws Exception {
DataSourceConfiguration config = new DataSourceConfiguration();
ConnectionPool connectionPool = new ConnectionPool();
connectionPool.setFactory("org.opennms.core.db.HikariCPConnectionFactory");
connectionPool.setIdleTimeout(600);
connectionPool.setLoginTimeout(3);
connectionPool.setMinPool(50);
connectionPool.setMaxPool(50);
connectionPool.setMaxSize(50);
config.setConnectionPool(connectionPool);
JdbcDataSource opennmsDs = new JdbcDataSource();
opennmsDs.setName("opennms");
opennmsDs.setClassName("org.postgresql.Driver");
opennmsDs.setUrl(System.getProperty("mock.db.url", "jdbc:postgresql://localhost:5432/") + "template1");
opennmsDs.setUserName("opennms");
opennmsDs.setPassword("opennms");
config.addJdbcDataSource(opennmsDs);
JdbcDataSource opennmsDeuceDs = new JdbcDataSource();
opennmsDeuceDs.setName("opennms2");
opennmsDeuceDs.setClassName("org.postgresql.Driver");
opennmsDeuceDs.setUrl(System.getProperty("mock.db.url", "jdbc:postgresql://localhost:5432/") + "template1");
opennmsDeuceDs.addParam(new Param("user", "opennms"));
opennmsDeuceDs.addParam(new Param("password", "opennms"));
config.addJdbcDataSource(opennmsDeuceDs);
return Arrays.asList(new Object[][] { { config, new File("src/test/resources/org/opennms/core/db/opennms-datasources.xml") } });
}
use of org.junit.runners.Parameterized.Parameters in project jetty.project by eclipse.
the class TestABCase3 method data.
@Parameters
public static Collection<WebSocketFrame[]> data() {
List<WebSocketFrame[]> data = new ArrayList<>();
// @formatter:off
data.add(new WebSocketFrame[] { new PingFrame().setFin(false) });
data.add(new WebSocketFrame[] { new PingFrame().setRsv1(true) });
data.add(new WebSocketFrame[] { new PingFrame().setRsv2(true) });
data.add(new WebSocketFrame[] { new PingFrame().setRsv3(true) });
data.add(new WebSocketFrame[] { new PongFrame().setFin(false) });
data.add(new WebSocketFrame[] { new PingFrame().setRsv1(true) });
data.add(new WebSocketFrame[] { new PongFrame().setRsv2(true) });
data.add(new WebSocketFrame[] { new PongFrame().setRsv3(true) });
data.add(new WebSocketFrame[] { new CloseInfo().asFrame().setFin(false) });
data.add(new WebSocketFrame[] { new CloseInfo().asFrame().setRsv1(true) });
data.add(new WebSocketFrame[] { new CloseInfo().asFrame().setRsv2(true) });
data.add(new WebSocketFrame[] { new CloseInfo().asFrame().setRsv3(true) });
// @formatter:on
return data;
}
use of org.junit.runners.Parameterized.Parameters in project jetty.project by eclipse.
the class ClientAnnotatedEndpointScanner_GoodSignaturesTest method data.
@Parameters
public static Collection<Case[]> data() throws Exception {
List<Case[]> data = new ArrayList<>();
Field fOpen = findFieldRef(AnnotatedEndpointMetadata.class, "onOpen");
Field fClose = findFieldRef(AnnotatedEndpointMetadata.class, "onClose");
Field fError = findFieldRef(AnnotatedEndpointMetadata.class, "onError");
Field fText = findFieldRef(AnnotatedEndpointMetadata.class, "onText");
Field fBinary = findFieldRef(AnnotatedEndpointMetadata.class, "onBinary");
Field fBinaryStream = findFieldRef(AnnotatedEndpointMetadata.class, "onBinaryStream");
Field fPong = findFieldRef(AnnotatedEndpointMetadata.class, "onPong");
// @formatter:off
// -- Open Events
Case.add(data, BasicOpenSocket.class, fOpen);
Case.add(data, BasicOpenSessionSocket.class, fOpen, Session.class);
// -- Close Events
Case.add(data, CloseSocket.class, fClose);
Case.add(data, CloseReasonSocket.class, fClose, CloseReason.class);
Case.add(data, CloseReasonSessionSocket.class, fClose, CloseReason.class, Session.class);
Case.add(data, CloseSessionReasonSocket.class, fClose, Session.class, CloseReason.class);
// -- Error Events
Case.add(data, BasicErrorSocket.class, fError);
Case.add(data, BasicErrorSessionSocket.class, fError, Session.class);
Case.add(data, BasicErrorSessionThrowableSocket.class, fError, Session.class, Throwable.class);
Case.add(data, BasicErrorThrowableSocket.class, fError, Throwable.class);
Case.add(data, BasicErrorThrowableSessionSocket.class, fError, Throwable.class, Session.class);
// -- Text Events
Case.add(data, BasicTextMessageStringSocket.class, fText, String.class);
// -- Binary Events
Case.add(data, BasicBinaryMessageByteBufferSocket.class, fBinary, ByteBuffer.class);
// -- Pong Events
Case.add(data, BasicPongMessageSocket.class, fPong, PongMessage.class);
// -- InputStream Events
Case.add(data, BasicInputStreamSocket.class, fBinaryStream, InputStream.class);
Case.add(data, BasicInputStreamWithThrowableSocket.class, fBinaryStream, InputStream.class);
return data;
}
use of org.junit.runners.Parameterized.Parameters in project hackpad by dropbox.
the class DoctestsTest method doctestValues.
@Parameters
public static Collection<Object[]> doctestValues() throws IOException {
File[] doctests = getDoctestFiles();
List<Object[]> result = new ArrayList<Object[]>();
for (File f : doctests) {
String contents = loadFile(f);
result.add(new Object[] { f.getName(), contents, -1 });
result.add(new Object[] { f.getName(), contents, 0 });
result.add(new Object[] { f.getName(), contents, 9 });
}
return result;
}
Aggregations