Java Code Examples for org.junit.runners.Parameterized.Parameters

The following are Jave code examples for showing how to use Parameters of the org.junit.runners.Parameterized class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: TOSCAna   File: HelpTest.java   View Source Code Vote up 5 votes
@Parameterized.Parameters(name = "{index}: contains({0})")
public static Iterable<Object[]> data() {
    return Arrays.asList(new Object[][]{
        {"csar", true},
        {"platform", true},
        {"status", true},
        {"transformation", true}
    });
}
 
Example 2
Project: timber-junit-rule   File: LogTestWithMinPriorityRules.java   View Source Code Vote up 5 votes
@Parameterized.Parameters
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][]{
            {LogTester.LogType.VERBOSE, "Test", ""},
            {LogTester.LogType.DEBUG, "Test", ""},
            {LogTester.LogType.INFO, "Test", "I/LogTester: Test"},
            {LogTester.LogType.WARN, "Test", "W/LogTester: Test"},
            {LogTester.LogType.ERROR, "Test", "E/LogTester: Test"},
    });
}
 
Example 3
Project: aws-codecommit-trigger-plugin   File: JenkinsERIT.java   View Source Code Vote up 5 votes
@Parameterized.Parameters(name = "{0}")
public static List<Object[]> fixtures() {
    String gitUrl = defaultSCMUrl + "_diff";
    return Arrays.asList(new Object[][]{
        {
            "git url & branch matched",
            new ProjectFixture()
                .setSendBranches("refs/heads/foo")
                .setScm(MockGitSCM.fromUrlAndBranchSpecs(defaultSCMUrl, Collections.singletonList(new BranchSpec("refs/heads/foo"))))
                .setScmConfigs(scmConfigFactory.createERs(defaultSCMUrl, "refs/heads/foo"))
                .setShouldStarted(true)
        },
        {
            "git url match but branch not matched",
            new ProjectFixture()
                .setSendBranches("refs/heads/foo")
                .setScm(MockGitSCM.fromUrlAndBranchSpecs(defaultSCMUrl, Collections.singletonList(new BranchSpec("refs/heads/foo"))))
                .setScmConfigs(scmConfigFactory.createERs(defaultSCMUrl, "refs/heads/bar"))
                .setShouldStarted(false)
        },
        {
            "git url not match but branch matched",
            new ProjectFixture()
                .setSendBranches("refs/heads/foo")
                .setScm(MockGitSCM.fromUrlAndBranchSpecs(defaultSCMUrl, Collections.singletonList(new BranchSpec("refs/heads/foo"))))
                .setScmConfigs(scmConfigFactory.createERs(gitUrl, "refs/heads/foo"))
                .setShouldStarted(false)
        },
        {
            "no job scm configured",
            new ProjectFixture()
                .setSendBranches("refs/heads/foo")
                .setScmConfigs(scmConfigFactory.createERs(defaultSCMUrl, "refs/heads/foo"))
                .setShouldStarted(true)
        },
    });
}
 
Example 4
Project: cis501   File: InorderPipelineFullTest.java   View Source Code Vote up 5 votes
/** The memory latencies to test. */
@Parameterized.Parameters
public static Collection memLatenciesBypasses() {
    // returns a Collection of Object[], each Object[] holds ctor arguments
    List<Object[]> args = new LinkedList<>();
    for (EnumSet<Bypass> mx : Arrays.asList(NO_BYPASS, EnumSet.of(MX))) {
        for (Object aml : new Object[]{0, 1, 3}) {
            args.add(new Object[]{aml, mx});
        }
    }
    return args;
}
 
Example 5
Project: intellij-randomness   File: IntegerInsertActionTest.java   View Source Code Vote up 5 votes
@Parameterized.Parameters
public static Collection<Object[]> params() {
    return Arrays.asList(new Object[][] {
            {0, 0, "0"},
            {1, 1, "1"},
            {-5, -5, "-5"},
            {488, 488, "488"},
            {-876, -876, "-876"},
    });
}
 
Example 6
Project: hadoop   File: BaseTestHttpFSWith.java   View Source Code Vote up 5 votes
@Parameterized.Parameters
public static Collection operations() {
  Object[][] ops = new Object[Operation.values().length][];
  for (int i = 0; i < Operation.values().length; i++) {
    ops[i] = new Object[]{Operation.values()[i]};
  }
  //To test one or a subset of operations do:
  //return Arrays.asList(new Object[][]{ new Object[]{Operation.APPEND}});
  return Arrays.asList(ops);
}
 
Example 7
Project: apache-tomcat-7.0.73-with-comment   File: Bug53367.java   View Source Code Vote up 5 votes
@Parameterized.Parameters
public static Collection parameters() {
    return Arrays.asList(new Object[][]{
        new Object[] {Boolean.TRUE},
        new Object[] {Boolean.FALSE},
    });
}
 
Example 8
Project: timber-junit-rule   File: LogTestWithMinPriorityRules.java   View Source Code Vote up 5 votes
@Parameterized.Parameters
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][]{
            {LogTester.LogType.VERBOSE, "Test", ""},
            {LogTester.LogType.DEBUG, "Test", "D/LogTester: Test"},
            {LogTester.LogType.INFO, "Test", "I/LogTester: Test"},
            {LogTester.LogType.WARN, "Test", "W/LogTester: Test"},
            {LogTester.LogType.ERROR, "Test", "E/LogTester: Test"},
    });
}
 
Example 9
Project: vertx-prometheus-metrics   File: ExposeTest.java   View Source Code Vote up 5 votes
@Parameterized.Parameters
public static @NotNull Iterable<CollectorRegistry> data() {
  return Arrays.asList(
      CollectorRegistry.defaultRegistry,
      new CollectorRegistry(false) // custom registry
  );
}
 
Example 10
Project: scanning   File: AbstractAbortingMalcolmTest.java   View Source Code Vote up 4 votes
@Parameterized.Parameters
public static List<Object[]> data() {
    return Arrays.asList(new Object[REPEAT_COUNT][0]);
}
 
Example 11
Project: chart-parser   File: RaceTypeNameBlackTypeBreedTest.java   View Source Code Vote up 4 votes
@Parameterized.Parameters(name = "{0}")
public static Collection races() {
    return Arrays.asList(new Object[][]{
                    {"MAIDEN - Quarter Horse",
                            new RaceTypeNameBlackTypeBreed("MAIDEN", QUARTER_HORSE)},
                    {"MAIDEN SPECIAL WEIGHT - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("MAIDEN SPECIAL WEIGHT",
                                    THOROUGHBRED)},
                    {"STAKES Mount Elbert S. - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("STAKES", "Mount Elbert S.",
                                    THOROUGHBRED)},
                    {"STAKES Juvenile Turf Sprint S. Listed - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("STAKES", "Juvenile Turf Sprint S.",
                                    "Listed", THOROUGHBRED)},
                    {"STAKES Golden State Juvenile S. Black Type - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("STAKES", "Golden State Juvenile S.",
                                    "Black Type", THOROUGHBRED)},
                    {"STAKES Senator Ken Maddy S. Grade 3 - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("STAKES", "Senator Ken Maddy S.", 3,
                                    "Grade 3", THOROUGHBRED)},
                    {"STAKES Breeders' Cup Classic Grade 1 - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("STAKES", "Breeders' Cup Classic", 1,
                                    "Grade 1", THOROUGHBRED)},
                    {"STAKES 14 Hands Winery Breeders' Cup Juvenile Fillies Grade 1 - " +
                            "Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("STAKES", "14 Hands Winery " +
                                    "Breeders' Cup Juvenile Fillies", 1, "Grade 1",
                                    THOROUGHBRED)},
                    {"DERBY Prairie Meadows Derby Challenge - Quarter Horse",
                            new RaceTypeNameBlackTypeBreed("DERBY", "Prairie Meadows Derby " +
                                    "Challenge", QUARTER_HORSE)},
                    {"STAKES CTBA Derby - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("STAKES", "CTBA Derby",
                                    THOROUGHBRED)},
                    {"STAKES WA Cup Two Year Old Colts and Geldings S. Presented by Redhook " +
                            "ESL Black Type - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("STAKES", "WA Cup Two Year Old " +
                                    "Colts and Geldings S. Presented by Redhook ESL", null,
                                    "Black Type", THOROUGHBRED)},
                    {"Claiming stake Big Country 93.1 XX FM Deal or No Deal S. - Thoroughbred",
                            new RaceTypeNameBlackTypeBreed("CLAIMING STAKES", "Big Country " +
                                    "93.1 XX FM Deal or No Deal S.", null, null, THOROUGHBRED)},
                    {"HANDICAP STAKES James S. Smith Memorial H. - Quarter Horse",
                            new RaceTypeNameBlackTypeBreed("HANDICAP STAKES", "James S. Smith" +
                                    " Memorial H.", null, null, QUARTER_HORSE)},
                    {"STAKES Ajc California S. - Colts & Geldings - Arabian",
                            new RaceTypeNameBlackTypeBreed("STAKES", "Ajc California S. - " +
                                    "Colts & Geldings", null, null, ARABIAN)}
            }
    );
}
 
Example 12
Project: GitHub   File: ManagedRealmCollectionTests.java   View Source Code Vote up 4 votes
@Parameterized.Parameters(name = "{0}")
public static List<ManagedCollection> data() {
    return Arrays.asList(ManagedCollection.values());
}
 
Example 13
Project: kjsonpatch   File: ReplaceOperationTest.java   View Source Code Vote up 4 votes
@Parameterized.Parameters
public static Collection<PatchTestCase> data() throws IOException {
    return PatchTestCase.load("replace");
}
 
Example 14
Project: incubator-ratis   File: ParameterizedBaseTest.java   View Source Code Vote up 4 votes
/** Subclasses should override this method to provide real data parameters. */
@Parameterized.Parameters
public static Collection<Object[]> data() throws IOException {
  return Collections.emptyList();
}
 
Example 15
Project: scanning   File: AbstractCommunicationMalcolmTest.java   View Source Code Vote up 4 votes
@Parameterized.Parameters
public static List<Object[]> data() {
    return Arrays.asList(new Object[REPEAT_COUNT][0]);
}
 
Example 16
Project: JRediClients   File: RedissonMapReduceTest.java   View Source Code Vote up 4 votes
@Parameterized.Parameters(name = "{index} - {0}")
public static Iterable<Object[]> mapClasses() {
    return Arrays.asList(new Object[][]{
        {RMap.class}, {RMapCache.class}
    });
}
 
Example 17
Project: coffee-gb   File: CgbSoundTest.java   View Source Code Vote up 4 votes
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> data() throws IOException {
    return ParametersProvider.getParameters("blargg/cgb_sound");
}
 
Example 18
Project: obevo   File: SybaseIqDeployerMainIT.java   View Source Code Vote up 4 votes
@Parameterized.Parameters
public static Collection<Object[]> params() {
    return SybaseIqParamReader.getParamReader().getAppContextAndJdbcDsParams();
}
 
Example 19
Project: aws-lambda-proxy-java   File: LambdaProxyHandlerTest.java   View Source Code Vote up 4 votes
@Parameterized.Parameters
public static Collection<Object[]> data() {
    return Stream.of(true, false)
            .map(b -> singleton(b).toArray())
            .collect(toList());
}
 
Example 20
Project: coffee-gb   File: BitsTest.java   View Source Code Vote up 4 votes
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> data() throws IOException {
    return ParametersProvider.getParameters("mooneye/acceptance/bits", EXCLUDES, 1);
}