use of org.junit.runners.Parameterized.Parameters in project jetty.project by eclipse.
the class AliasedConstraintTest method data.
@Parameters(name = "{0}: {1}")
public static Collection<Object[]> data() {
List<Object[]> data = new ArrayList<>();
final String OPENCONTENT = "this is open content";
data.add(new Object[] { "/ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
data.add(new Object[] { "/ctx/ALL/index.txt", HttpStatus.NOT_FOUND_404, null });
data.add(new Object[] { "/ctx/ALL/Fred/../index.txt", HttpStatus.NOT_FOUND_404, null });
data.add(new Object[] { "/ctx/../bar/../ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
data.add(new Object[] { "/ctx/forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
data.add(new Object[] { "/ctx/all/../forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
data.add(new Object[] { "/ctx/FoRbId/index.txt", HttpStatus.NOT_FOUND_404, null });
return data;
}
use of org.junit.runners.Parameterized.Parameters in project jetty.project by eclipse.
the class TestUseCases method getCases.
@Parameters(name = "{0}")
public static List<Object[]> getCases() throws Exception {
File usecases = MavenTestingUtils.getTestResourceDir("usecases/");
File[] cases = usecases.listFiles((dir, name) -> name.endsWith(".assert.txt"));
Arrays.sort(cases);
List<Object[]> ret = new ArrayList<>();
for (File assertTxt : cases) {
String caseName = assertTxt.getName().replace(".assert.txt", "");
ret.add(new Object[] { caseName });
}
return ret;
}
use of org.junit.runners.Parameterized.Parameters in project hazelcast by hazelcast.
the class CacheUtilTest method parameters.
// each entry is Object[] with
// {URI, ClassLoader, expected prefix, expected prefixed cache name, expected distributed object name}
@Parameters(name = "{index}: uri={0}, classLoader={1}")
public static Collection<Object[]> parameters() throws URISyntaxException {
final URI uri = new URI(URI_SCOPE);
final ClassLoader classLoader = mock(ClassLoader.class);
when(classLoader.toString()).thenReturn(CLASSLOADER_SCOPE);
return Arrays.asList(new Object[] { null, null, null, CACHE_NAME, CACHE_MANAGER_PREFIX + CACHE_NAME }, new Object[] { uri, null, URI_SCOPE + "/", URI_SCOPE + "/" + CACHE_NAME, CACHE_MANAGER_PREFIX + URI_SCOPE + "/" + CACHE_NAME }, new Object[] { null, classLoader, CLASSLOADER_SCOPE + "/", CLASSLOADER_SCOPE + "/" + CACHE_NAME, CACHE_MANAGER_PREFIX + CLASSLOADER_SCOPE + "/" + CACHE_NAME }, new Object[] { uri, classLoader, URI_SCOPE + "/" + CLASSLOADER_SCOPE + "/", URI_SCOPE + "/" + CLASSLOADER_SCOPE + "/" + CACHE_NAME, CACHE_MANAGER_PREFIX + URI_SCOPE + "/" + CLASSLOADER_SCOPE + "/" + CACHE_NAME });
}
use of org.junit.runners.Parameterized.Parameters in project hadoop by apache.
the class TestAMRMTokens method configs.
@Parameters
public static Collection<Object[]> configs() {
Configuration conf = new Configuration();
Configuration confWithSecurity = new Configuration();
confWithSecurity.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
return Arrays.asList(new Object[][] { { conf }, { confWithSecurity } });
}
use of org.junit.runners.Parameterized.Parameters in project hadoop by apache.
the class TestContainerManagerSecurity method configs.
@Parameters
public static Collection<Object[]> configs() {
Configuration configurationWithoutSecurity = new Configuration();
configurationWithoutSecurity.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, "simple");
Configuration configurationWithSecurity = new Configuration();
configurationWithSecurity.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
configurationWithSecurity.set(YarnConfiguration.RM_WEBAPP_SPNEGO_USER_NAME_KEY, httpSpnegoPrincipal);
configurationWithSecurity.set(YarnConfiguration.RM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY, httpSpnegoKeytabFile.getAbsolutePath());
configurationWithSecurity.set(YarnConfiguration.NM_WEBAPP_SPNEGO_USER_NAME_KEY, httpSpnegoPrincipal);
configurationWithSecurity.set(YarnConfiguration.NM_WEBAPP_SPNEGO_KEYTAB_FILE_KEY, httpSpnegoKeytabFile.getAbsolutePath());
return Arrays.asList(new Object[][] { { configurationWithoutSecurity }, { configurationWithSecurity } });
}
Aggregations