org.junit.runners.Parameterized Java Examples

The following examples show how to use org.junit.runners.Parameterized. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GetErrorDetailsAuthorizationTest.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Parameterized.Parameters(name = "Scenario {index}")
public static Collection<AuthorizationScenario[]> scenarios() {
  return AuthorizationTestRule.asParameters(
      scenario()
          .withoutAuthorizations()
          .failsDueToRequired(
              grant(Resources.PROCESS_INSTANCE, "processInstanceId", "userId", Permissions.READ),
              grant(Resources.PROCESS_DEFINITION, "oneExternalTaskProcess", "userId", Permissions.READ_INSTANCE)),
      scenario()
          .withAuthorizations(
              grant(Resources.PROCESS_INSTANCE, "processInstanceId", "userId", Permissions.READ))
          .succeeds(),
      scenario()
          .withAuthorizations(
              grant(Resources.PROCESS_INSTANCE, "*", "userId", Permissions.READ))
          .succeeds(),
      scenario()
          .withAuthorizations(
              grant(Resources.PROCESS_DEFINITION, "processDefinitionKey", "userId", Permissions.READ_INSTANCE))
          .succeeds(),
      scenario()
          .withAuthorizations(
              grant(Resources.PROCESS_DEFINITION, "*", "userId", Permissions.READ_INSTANCE))
          .succeeds()
  );
}
 
Example #2
Source File: DeleteProcessDefinitionAuthorizationTest.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Parameterized.Parameters(name = "Scenario {index}")
public static Collection<AuthorizationScenario[]> scenarios() {
  return AuthorizationTestRule.asParameters(
    scenario()
      .withoutAuthorizations()
      .failsDueToRequired(
        grant(Resources.PROCESS_DEFINITION, PROCESS_DEFINITION_KEY, "userId", Permissions.DELETE)),
    scenario()
      .withAuthorizations(
        grant(Resources.PROCESS_DEFINITION, PROCESS_DEFINITION_KEY, "userId", Permissions.DELETE))
      .succeeds(),
    scenario()
      .withAuthorizations(
        grant(Resources.PROCESS_DEFINITION, "*", "userId", Permissions.DELETE))
      .succeeds()
    );
}
 
Example #3
Source File: DspIntegrationTest.java    From RDFUnit with Apache License 2.0 6 votes vote down vote up
@Parameterized.Parameters(name = "{index}: {0} ({1})")
public static Collection<Object[]> resources() {
    return Arrays.asList(new Object[][]{

            {"dsp/standalone_class_Correct.ttl", 0},
            {"dsp/standalone_class_Wrong.ttl", 1},
            {"dsp/property_cardinality_Correct.ttl", 0},
            {"dsp/property_cardinality_Wrong.ttl", 5},
            {"dsp/valueClass_Correct.ttl", 0},
            {"dsp/valueClass_Wrong.ttl", 1},
            {"dsp/valueClass-miss_Wrong.ttl", 1},
            {"dsp/languageOccurrence_Correct.ttl", 0},
            {"dsp/languageOccurrence_Wrong.ttl", 2},
            {"dsp/language_Correct.ttl", 0},
            {"dsp/language_Wrong.ttl", 3},
            {"dsp/isLiteral_Wrong.ttl", 1},
            {"dsp/literal_Correct.ttl", 0},
            {"dsp/literal_Wrong.ttl", 4},
    });

}
 
Example #4
Source File: TargetWithOutputsTypeCoercerTest.java    From buck with Apache License 2.0 6 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static Collection<Object> data() {
  return Arrays.asList(
      new Object[][] {
        {
          new UnconfiguredBuildTargetWithOutputsTypeCoercer(
              new UnconfiguredBuildTargetTypeCoercer(
                  new ParsingUnconfiguredBuildTargetViewFactory())),
          EXPECTED_UNCONFIGURED_BUILD_TARGET_WITH_OUTPUTS_BI_FUNCTION
        },
        {
          new BuildTargetWithOutputsTypeCoercer(
              new UnconfiguredBuildTargetWithOutputsTypeCoercer(
                  new UnconfiguredBuildTargetTypeCoercer(
                      new ParsingUnconfiguredBuildTargetViewFactory()))),
          EXPECTED_BUILD_TARGET_WITH_OUTPUTS_BI_FUNCTION
        }
      });
}
 
Example #5
Source File: MethodReturnTest.java    From byte-buddy with Apache License 2.0 6 votes vote down vote up
@Parameterized.Parameters
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][]{
            {void.class, Opcodes.RETURN, 0},
            {Object.class, Opcodes.ARETURN, 1},
            {Object[].class, Opcodes.ARETURN, 1},
            {long.class, Opcodes.LRETURN, 2},
            {double.class, Opcodes.DRETURN, 2},
            {float.class, Opcodes.FRETURN, 1},
            {int.class, Opcodes.IRETURN, 1},
            {char.class, Opcodes.IRETURN, 1},
            {short.class, Opcodes.IRETURN, 1},
            {byte.class, Opcodes.IRETURN, 1},
            {boolean.class, Opcodes.IRETURN, 1},
    });
}
 
Example #6
Source File: StandardEhCacheStatisticsQueryTest.java    From ehcache3 with Apache License 2.0 6 votes vote down vote up
@Parameterized.Parameters
public static Collection<Object[]> data() {
  return asList(new Object[][] {
  //1 tier
  { newResourcePoolsBuilder().heap(1, MB), singletonList("OnHeap:HitCount"), singletonList(CACHE_HIT_TOTAL), CACHE_HIT_TOTAL },
  { newResourcePoolsBuilder().offheap(1, MB), singletonList("OffHeap:HitCount"), singletonList(CACHE_HIT_TOTAL), CACHE_HIT_TOTAL },
  { newResourcePoolsBuilder().disk(1, MB), singletonList("Disk:HitCount"), singletonList(CACHE_HIT_TOTAL), CACHE_HIT_TOTAL },

  //2 tiers
  { newResourcePoolsBuilder().heap(1, MB).offheap(2, MB), Arrays.asList("OnHeap:HitCount","OffHeap:HitCount"), Arrays.asList(2L,2L), CACHE_HIT_TOTAL},
  { newResourcePoolsBuilder().heap(1, MB).disk(2, MB), Arrays.asList("OnHeap:HitCount","Disk:HitCount"), Arrays.asList(2L,2L), CACHE_HIT_TOTAL},

  //3 tiers
  { newResourcePoolsBuilder().heap(1, MB).offheap(2, MB).disk(3, MB), Arrays.asList("OnHeap:HitCount","OffHeap:HitCount","Disk:HitCount"), Arrays.asList(2L,0L,2L), CACHE_HIT_TOTAL},
  { newResourcePoolsBuilder().heap(1, ENTRIES).offheap(2, MB).disk(3, MB), Arrays.asList("OnHeap:HitCount","OffHeap:HitCount","Disk:HitCount"), Arrays.asList(1L,1L,2L), CACHE_HIT_TOTAL},
  });
}
 
Example #7
Source File: TestGeoTiffWriter.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static List<Object[]> getTestParameters() {
  List<Object[]> result = new ArrayList<>();

  result
      .add(new Object[] {TestDir.cdmUnitTestDir + "gribCollections/tp/GFS_Global_onedeg_ana_20150326_0600.grib2.ncx4",
          FeatureType.GRID, "Temperature_sigma"}); // SRC // TP
  result.add(new Object[] {TestDir.cdmUnitTestDir + "gribCollections/tp/GFSonedega.ncx4", FeatureType.GRID,
      "Pressure_surface"}); // TP
  result.add(new Object[] {TestDir.cdmUnitTestDir + "gribCollections/gfs_2p5deg/gfs_2p5deg.ncx4", FeatureType.GRID,
      "Best/Soil_temperature_depth_below_surface_layer"}); // TwoD Best
  result.add(new Object[] {TestDir.cdmUnitTestDir + "gribCollections/gfs_2p5deg/gfs_2p5deg.ncx4", FeatureType.FMRC,
      "TwoD/Soil_temperature_depth_below_surface_layer"}); // TwoD

  result.add(new Object[] {TestDir.cdmUnitTestDir + "ft/coverage/testCFwriter.nc", FeatureType.GRID, "Temperature"});

  return result;
}
 
Example #8
Source File: MobTest.java    From hamcrest-pojo-matcher-generator with Apache License 2.0 6 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static Collection<String> matchers() {
    return Arrays.asList(
        "withValByte",
        "withValueByte",
        "withValChar",
        "withValueCharacter",
        "withValInt",
        "withValueInteger",
        "withValLong",
        "withValueLong",
        "withValFloat",
        "withValueFloat",
        "withValDouble",
        "withValueDouble",
        "withValBoolean",
        "withValueBoolean"
    );
}
 
Example #9
Source File: TestMetricsRowGroupFilterTypes.java    From iceberg with Apache License 2.0 6 votes vote down vote up
@Parameterized.Parameters
public static Object[][] parameters() {
  return new Object[][] {
      new Object[] { "boolean", false, true },
      new Object[] { "int", 5, 55 },
      new Object[] { "long", 5_000_000_049L, 5_000L },
      new Object[] { "float", 1.97f, 2.11f },
      new Object[] { "double", 2.11d, 1.97d },
      new Object[] { "date", "2018-06-29", "2018-05-03" },
      new Object[] { "time", "10:02:34.000000", "10:02:34.000001" },
      new Object[] { "timestamp",
          "2018-06-29T10:02:34.000000",
          "2018-06-29T15:02:34.000000" },
      new Object[] { "timestamptz",
          "2018-06-29T10:02:34.000000+00:00",
          "2018-06-29T10:02:34.000000-07:00" },
      new Object[] { "string", "tapir", "monthly" },
      // new Object[] { "uuid", uuid, UUID.randomUUID() }, // not supported yet
      new Object[] { "fixed", "abcd".getBytes(Charsets.UTF_8), new byte[] { 0, 1, 2, 3 } },
      new Object[] { "binary", "xyz".getBytes(Charsets.UTF_8), new byte[] { 0, 1, 2, 3, 4, 5 } },
      new Object[] { "int_decimal", "77.77", "12.34" },
      new Object[] { "long_decimal", "88.88", "12.34" },
      new Object[] { "fixed_decimal", "99.99", "12.34" },
  };
}
 
Example #10
Source File: JavaCartridgeAgentTest.java    From attic-stratos with Apache License 2.0 6 votes vote down vote up
/**
 * This method returns a collection of {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent}
 * objects as parameters to the test
 *
 * @return
 */
@Parameterized.Parameters
public static Collection getArtifactUpdatedEventsAsParams() {
    ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();

    ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
    privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
    privateRepoEvent.setRepoUserName("testapache2211");
    privateRepoEvent.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");

    ArtifactUpdatedEvent privateRepoEvent2 = createTestArtifactUpdatedEvent();
    privateRepoEvent2.setRepoURL("https://[email protected]/testapache2211/testrepo.git");
    privateRepoEvent2.setRepoUserName("testapache2211");
    privateRepoEvent2.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");

    return Arrays.asList(new Object[][]{
            {publicRepoEvent, true},
            {privateRepoEvent, true},
            {privateRepoEvent2, true}
    });

}
 
Example #11
Source File: AbstractJerseyStreamingHttpServiceTest.java    From servicetalk with Apache License 2.0 5 votes vote down vote up
/**
 * Some test classes eg. {@link ExecutionStrategyTest} come with their own parameters, JUnit only supports
 * a single level of parameters.
 */
@SuppressWarnings("unused")
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> data() {
    return Arrays.stream(AbstractJerseyStreamingHttpServiceTest.RouterApi.values())
            .map(api -> new Object[]{api}).collect(Collectors.toList());
}
 
Example #12
Source File: RSIntegrationTest.java    From RDFUnit with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "{index}: {0} ({1})")
public static Collection<Object[]> resources() {
    return Arrays.asList(new Object[][]{

            {"rs/valueType_Correct.ttl", 0},
            {"rs/valueType_Wrong.ttl", 11},
            {"rs/occurs_Correct.ttl", 0},
            {"rs/occurs_Wrong.ttl", 4},
            {"rs/range_Correct.ttl", 0},
            {"rs/range_Wrong.ttl", 4},
            {"rs/allowedValue_Correct.ttl", 0},
            {"rs/allowedValue_Wrong.ttl", 9},
    });

}
 
Example #13
Source File: PathProcessorStrategyTest.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> generateTestParameters() {

    return Arrays.asList(new Object[][]{
            // select("a")
            {__.select("a"), __.select("a"), Collections.emptyList()},
            {__.select("a").by(), __.select("a").by(), Collections.emptyList()},
            {__.select("a").by(__.outE().count()), __.select("a").map(__.outE().count()), Collections.emptyList()},
            {__.select("a").by("name"), __.select("a").map(new ValueTraversal<>("name")), Collections.emptyList()},
            {__.select("a").out(), __.select("a").out(), Collections.emptyList()},
            {__.select(Pop.all, "a").by(__.values("name")), __.select(Pop.all, "a").by("name"), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.select(Pop.last, "a").by(__.values("name")), __.select(Pop.last, "a").map(__.values("name")), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.select(Pop.first, "a").by(__.values("name")), __.select(Pop.first, "a").map(__.values("name")), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            // select("a","b")
            {__.select("a", "b"), __.select("a", "b"), Collections.emptyList()},
            {__.select("a", "b").by(), __.select("a", "b").by(), Collections.emptyList()},
            {__.select("a", "b", "c").by(), __.select("a", "b", "c").by(), Collections.emptyList()},
            {__.select("a", "b").by().by("age"), __.select("b").map(new ValueTraversal<>("age")).as("b").select("a").map(new IdentityTraversal<>()).as("a").select(Pop.last, "a", "b"), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.select("a", "b").by("name").by("age"), __.select("b").map(new ValueTraversal<>("age")).as("b").select("a").map(new ValueTraversal<>("name")).as("a").select(Pop.last, "a", "b"), Collections.emptyList()},
            {__.select("a", "b", "c").by("name").by(__.outE().count()), __.select("c").map(new ValueTraversal<>("name")).as("c").select("b").map(__.outE().count()).as("b").select("a").map(new ValueTraversal<>("name")).as("a").select(Pop.last, "a", "b", "c"), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.select(Pop.first, "a", "b").by("name").by("age"), __.select(Pop.first, "b").map(new ValueTraversal<>("age")).as("b").select(Pop.first, "a").map(new ValueTraversal<>("name")).as("a").select(Pop.last, "a", "b"), Collections.emptyList()},
            {__.select(Pop.last, "a", "b").by("name").by("age"), __.select(Pop.last, "b").map(new ValueTraversal<>("age")).as("b").select(Pop.last, "a").map(new ValueTraversal<>("name")).as("a").select(Pop.last, "a", "b"), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.select(Pop.all, "a", "b").by("name").by("age"), __.select(Pop.all, "a", "b").by("name").by("age"), Collections.emptyList()},
            {__.select(Pop.mixed, "a", "b").by("name").by("age"), __.select(Pop.mixed, "a", "b").by("name").by("age"), Collections.emptyList()},
            // where(as("a")...)
            {__.where(__.out("knows")), __.where(__.outE("knows")), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.where(__.as("a").out("knows")), __.identity().as("xyz").select(Pop.last, "a").filter(__.out("knows")).select(Pop.last, "xyz"), Collections.emptyList()},
            {__.where(__.as("a").has("age", P.gt(10))), __.identity().as("xyz").select(Pop.last, "a").has("age", P.gt(10)).select(Pop.last, "xyz"), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.select("b").where(__.as("a").has("age", P.gt(10))), __.select("b").as("xyz").select(Pop.last, "a").has("age", P.gt(10)).select(Pop.last, "xyz"), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.where(__.as("a").out("knows").as("b")), __.identity().as("xyz").select(Pop.last, "a").where(__.out("knows").as("b")).select(Pop.last, "xyz"), Collections.emptyList()},
            {__.where("a", P.eq("b")), __.where("a", P.eq("b")), Collections.emptyList()},
            {__.as("a").out().where(__.as("a").has("age", P.gt(10))).in(), __.as("a").out().as("xyz").select(Pop.last, "a").has("age", P.gt(10)).select(Pop.last, "xyz").in(), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
            {__.as("a").out().where(__.as("a").has("age", P.gt(10))).in().path(), __.as("a").out().where(__.as("a").has("age", P.gt(10))).in().path(), TraversalStrategies.GlobalCache.getStrategies(Graph.class).toList()},
    });
}
 
Example #14
Source File: PredicateSimplificationIT.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
@Parameterized.Parameters
public static Collection<Object[]> data() {
    Collection<Object[]> params = Lists.newArrayListWithCapacity(2);
    params.add(new Object[]{true});
    params.add(new Object[]{false});
    return params;
}
 
Example #15
Source File: MemorySegmentTestBase.java    From flink with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "segment-size = {0}")
public static Collection<Object[]> executionModes(){
	return Arrays.asList(
			new Object[] { 32 * 1024 },
			new Object[] { 4 * 1024 },
			new Object[] { 512 * 1024 });
}
 
Example #16
Source File: CsharpLibraryIntegrationTest.java    From buck with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "configure_csc={0}, rule_analysis_rules={1}")
public static Collection<Object[]> data() {
  return ParameterizedTests.getPermutations(
      ImmutableList.of(false, true),
      ImmutableList.of(
          RuleAnalysisComputationMode.DISABLED, RuleAnalysisComputationMode.PROVIDER_COMPATIBLE));
}
 
Example #17
Source File: AbstractResourceTest.java    From servicetalk with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "{1} server-no-offloads = {0}")
public static Collection<Object[]> data() {
    List<Object[]> params = new ArrayList<>();
    AbstractJerseyStreamingHttpServiceTest.data().forEach(oa -> {
        params.add(new Object[]{false, oa[0]});
        params.add(new Object[]{true, oa[0]});
    });
    return params;
}
 
Example #18
Source File: AbstractPartitionDiscovererTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "KafkaTopicsDescriptor = {0}")
@SuppressWarnings("unchecked")
public static Collection<KafkaTopicsDescriptor[]> timeCharacteristic(){
	return Arrays.asList(
		new KafkaTopicsDescriptor[]{new KafkaTopicsDescriptor(Collections.singletonList(TEST_TOPIC), null)},
		new KafkaTopicsDescriptor[]{new KafkaTopicsDescriptor(null, Pattern.compile(TEST_TOPIC_PATTERN))});
}
 
Example #19
Source File: FeaturesConventionTest.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "{0}.test()")
public static Iterable<Object[]> data() {
    return Arrays.asList(new Object[][]{
            {Graph.Features.EdgeFeatures.class},
            {Graph.Features.EdgePropertyFeatures.class},
            {Graph.Features.GraphFeatures.class},
            {Graph.Features.VariableFeatures.class},
            {Graph.Features.PropertyFeatures.class},
            {Graph.Features.VertexFeatures.class}
    });
}
 
Example #20
Source File: TestGribCdmIndexMain.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static List<Object[]> getTestParameters() {
  List<Object[]> result = new ArrayList<>();

  // file partition
  result.add(new Object[] {TestDir.cdmTestDataDir + "ucar/nc2/grib/collection/gfs80fc.xml"});

  // timeUnit option
  result.add(new Object[] {TestDir.cdmTestDataDir + "ucar/nc2/grib/collection/hrrrConus3surface.xml"});

  return result;
}
 
Example #21
Source File: VertxUnitRunnerWithParameters.java    From vertx-unit with Apache License 2.0 5 votes vote down vote up
@Override
protected void validateFields(List<Throwable> errors) {
  super.validateFields(errors);
  if (fieldsAreAnnotated()) {
    List<FrameworkField> annotatedFieldsByParameter = getAnnotatedFieldsByParameter();
    int[] usedIndices = new int[annotatedFieldsByParameter.size()];
    for (FrameworkField each : annotatedFieldsByParameter) {
      int index = each.getField().getAnnotation(Parameterized.Parameter.class)
          .value();
      if (index < 0 || index > annotatedFieldsByParameter.size() - 1) {
        errors.add(new Exception("Invalid @Parameter value: "
            + index + ". @Parameter fields counted: "
            + annotatedFieldsByParameter.size()
            + ". Please use an index between 0 and "
            + (annotatedFieldsByParameter.size() - 1) + "."));
      } else {
        usedIndices[index]++;
      }
    }
    for (int index = 0; index < usedIndices.length; index++) {
      int numberOfUse = usedIndices[index];
      if (numberOfUse == 0) {
        errors.add(new Exception("@Parameter(" + index
            + ") is never used."));
      } else if (numberOfUse > 1) {
        errors.add(new Exception("@Parameter(" + index
            + ") is used more than once (" + numberOfUse + ")."));
      }
    }
  }
}
 
Example #22
Source File: Trigger_Referencing_Clause_IT.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
@Parameterized.Parameters
public static Collection<Object[]> data() {
    Collection<Object[]> params = Lists.newArrayListWithCapacity(2);
    params.add(new Object[]{"jdbc:splice://localhost:1527/splicedb;user=splice;password=admin"});
    params.add(new Object[]{"jdbc:splice://localhost:1527/splicedb;user=splice;password=admin;useSpark=true"});
    return params;
}
 
Example #23
Source File: Mqtt311ConnectDecoderInvalidFixedHeadersTest.java    From hivemq-community-edition with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters
public static Collection<Byte> parameters() {
    return Arrays.asList(
            (byte) 0b0001_0001, (byte) 0b0001_0011, (byte) 0b0001_0111, (byte) 0b0001_1111,
            (byte) 0b0001_0010, (byte) 0b0001_0110, (byte) 0b0001_1110,
            (byte) 0b0001_0100, (byte) 0b0001_1100,
            (byte) 0b0001_1000);
}
 
Example #24
Source File: TestManifestWriter.java    From iceberg with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters
public static Object[][] parameters() {
  return new Object[][] {
      new Object[] { 1 },
      new Object[] { 2 },
  };
}
 
Example #25
Source File: TransformationFactoryRotationTest.java    From javascad with GNU General Public License v2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> testCases() {
	List<Object[]> result = new ArrayList<Object[]>();
	for (TestCase testCase : createTestSubjects()) {
		result.add(new Object[] { testCase });
	}
	return result;
}
 
Example #26
Source File: ScoringTest.java    From zxcvbn4j with MIT License 5 votes vote down vote up
@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> data() throws Exception {
    BaseGuess baseGuess = new BaseGuess() {
        @Override
        public double exec(Match match) {
            return 0;
        }
    };
    Method method = BaseGuess.class.getDeclaredMethod("nCk", int.class, int.class);
    method.setAccessible(true);

    return Arrays.asList(new Object[][]{
            {"", 1, Collections.emptyMap()},
            {"a", 1, Collections.emptyMap()},
            {"4", 2, Collections.singletonMap('4', 'a')},
            {"4pple", 2, Collections.singletonMap('4', 'a')},
            {"abcet", 1, Collections.emptyMap()},
            {"4bcet", 2, Collections.singletonMap('4', 'a')},
            {"a8cet", 2, Collections.singletonMap('8', 'b')},
            {"abce+", 2, Collections.singletonMap('+', 't')},
            {"48cet", 4, new HashMap<Character, Character>() {{
                put('4', 'a');
                put('8', 'b');
            }}},
            {"a4a4aa", (int) method.invoke(baseGuess, 6, 2) + (int) method.invoke(baseGuess, 6, 1), Collections.singletonMap('4', 'a')},
            {"4a4a44", (int) method.invoke(baseGuess, 6, 2) + (int) method.invoke(baseGuess, 6, 1), Collections.singletonMap('4', 'a')},
            {"a44att+", ((int) method.invoke(baseGuess, 4, 2) + (int) method.invoke(baseGuess, 4, 1)) * (int) method.invoke(baseGuess, 3, 1),
                    new HashMap<Character, Character>() {{
                        put('4', 'a');
                        put('+', 't');
                    }}},
            {"Aa44aA", (int) method.invoke(baseGuess, 6, 2) + (int) method.invoke(baseGuess, 6, 1), Collections.singletonMap('4', 'a')}
    });
}
 
Example #27
Source File: TraversalInterruptionTest.java    From tinkerpop with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters(name = "expectInterruption({0})")
public static Iterable<Object[]> data() {
    return Arrays.asList(new Object[][]{
            {"g_V", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.V(), (UnaryOperator<GraphTraversal<?,?>>) t -> t},
            {"g_V_out", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.V(), (UnaryOperator<GraphTraversal<?,?>>) t -> t.out()},
            {"g_V_outE", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.V(), (UnaryOperator<GraphTraversal<?,?>>) t -> t.outE()},
            {"g_V_in", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.V(), (UnaryOperator<GraphTraversal<?,?>>) t -> t.in()},
            {"g_V_inE", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.V(), (UnaryOperator<GraphTraversal<?,?>>) t -> t.inE()},
            {"g_V_properties", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.V(), (UnaryOperator<GraphTraversal<?,?>>) t -> t.properties()},
            {"g_E", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.E(), (UnaryOperator<GraphTraversal<?,?>>) t -> t},
            {"g_E_outV", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.E(), (UnaryOperator<GraphTraversal<?,?>>) t -> t.outV()},
            {"g_E_inV", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.E(), (UnaryOperator<GraphTraversal<?,?>>) t -> t.inV()},
            {"g_E_properties", (Function<GraphTraversalSource, GraphTraversal<?,?>>) g -> g.E(), (UnaryOperator<GraphTraversal<?,?>>) t -> t.properties()},
    });
}
 
Example #28
Source File: Bug53367.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Parameterized.Parameters
public static Collection<Object[]> parameters() {
    return Arrays.asList(new Object[][]{
        new Object[] {Boolean.TRUE},
        new Object[] {Boolean.FALSE},
    });
}
 
Example #29
Source File: BoundedSourceRestoreTest.java    From beam with Apache License 2.0 5 votes vote down vote up
@Parameterized.Parameters
public static Collection<Object[]> data() {
  /* Parameters for initializing the tests: {numTasks, numSplits} */
  return Arrays.asList(
      new Object[][] {
        {1, 1}, {1, 2}, {1, 4},
      });
}
 
Example #30
Source File: GetManagerTest.java    From ambry with Apache License 2.0 5 votes vote down vote up
/**
 * Running for both regular and encrypted blobs, and versions 2 and 3 of MetadataContent
 * @return an array with all four different choices
 */
@Parameterized.Parameters
public static List<Object[]> data() {
  return Arrays.asList(new Object[][]{{false, MessageFormatRecord.Metadata_Content_Version_V2},
      {false, MessageFormatRecord.Metadata_Content_Version_V3},
      {true, MessageFormatRecord.Metadata_Content_Version_V2},
      {true, MessageFormatRecord.Metadata_Content_Version_V3}});
}