Search in sources :

Example 41 with Parameters

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;
}
Also used : ArrayList(java.util.ArrayList) Matchers.containsString(org.hamcrest.Matchers.containsString) Parameters(org.junit.runners.Parameterized.Parameters)

Example 42 with Parameters

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;
}
Also used : ArrayList(java.util.ArrayList) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Example 43 with Parameters

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 });
}
Also used : URI(java.net.URI) Parameters(org.junit.runners.Parameterized.Parameters)

Example 44 with Parameters

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 } });
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Parameters(org.junit.runners.Parameterized.Parameters)

Example 45 with Parameters

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 } });
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) 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