org.junit.jupiter.params.provider.Arguments Java Examples

The following examples show how to use org.junit.jupiter.params.provider.Arguments. 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: KVNamespaceTest.java    From jetcd with Apache License 2.0 6 votes vote down vote up
static Stream<Arguments> namespaceProvider() {
    return Stream.of(
        // namespace, key, end, wKey, wEnd
        // 1. single key
        Arguments.of(bytesOf("pfx/"), byteStringOf("a"), null, byteStringOf("pfx/a"), null),
        // 2. range
        Arguments.of(bytesOf("pfx/"), byteStringOf("abc"), byteStringOf("def"), byteStringOf("pfx/abc"),
            byteStringOf("pfx/def")),
        // 3. one-sided range
        Arguments.of(bytesOf("pfx/"), byteStringOf("abc"), ByteString.copyFrom(new byte[] { 0 }),
            byteStringOf("pfx/abc"), byteStringOf("pfx0")),
        // 4. one-sided range, end of key space
        Arguments.of(ByteSequence.from(new byte[] { (byte) 0xff, (byte) 0xff }), byteStringOf("abc"),
            ByteString.copyFrom(new byte[] { 0 }),
            ByteString.copyFrom(new byte[] { (byte) 0xff, (byte) 0xff, 'a', 'b', 'c' }),
            ByteString.copyFrom(new byte[] { 0 })));
}
 
Example #2
Source File: UInt32Test.java    From incubator-tuweni with Apache License 2.0 6 votes vote down vote up
private static Stream<Arguments> addLongProvider() {
  return Stream
      .of(
          Arguments.of(v(1), 0, v(1)),
          Arguments.of(v(5), 0, v(5)),
          Arguments.of(v(0), 1, v(1)),
          Arguments.of(v(0), 100, v(100)),
          Arguments.of(v(2), 2, v(4)),
          Arguments.of(v(100), 90, v(190)),
          Arguments.of(UInt32.MAX_VALUE, 1, v(0)),
          Arguments.of(UInt32.MAX_VALUE, 2, v(1)),
          Arguments.of(hv("0xFFFFFFF0"), 1, hv("0xFFFFFFF1")),
          Arguments.of(hv("0xFFFFFFFE"), 1, UInt32.MAX_VALUE),
          Arguments.of(v(10), -5, v(5)),
          Arguments.of(v(0), -1, UInt32.MAX_VALUE));
}
 
Example #3
Source File: UsersRepositoryContract.java    From james-project with Apache License 2.0 6 votes vote down vote up
static Stream<Arguments> illegalCharacters() {
    return Stream.of(
        "\"",
        "(",
        ")",
        ",",
        ":",
        ";",
        "<",
        ">",
        "@",
        "[",
        "\\",
        "]",
        " ")
        .map(Arguments::of);
}
 
Example #4
Source File: UInt64Test.java    From cava with Apache License 2.0 6 votes vote down vote up
private static Stream<Arguments> longValueProvider() {
  return Stream.of(
      Arguments.of(hv("0x"), 0L),
      Arguments.of(hv("0x00"), 0L),
      Arguments.of(hv("0x00000000"), 0L),
      Arguments.of(hv("0x01"), 1L),
      Arguments.of(hv("0x0001"), 1L),
      Arguments.of(hv("0x000001"), 1L),
      Arguments.of(hv("0x00000001"), 1L),
      Arguments.of(hv("0x0000000001"), 1L),
      Arguments.of(hv("0x000000000001"), 1L),
      Arguments.of(hv("0x0100"), 256L),
      Arguments.of(hv("0x000100"), 256L),
      Arguments.of(hv("0x00000100"), 256L),
      Arguments.of(hv("0x00000100"), 256L),
      Arguments.of(hv("0x000000000100"), 256L),
      Arguments.of(hv("0x00000000000100"), 256L),
      Arguments.of(hv("0x00000000000100"), 256L),
      Arguments.of(hv("0xFFFFFFFF"), (1L << 32) - 1));
}
 
Example #5
Source File: FluentPathTests.java    From org.hl7.fhir.core with Apache License 2.0 6 votes vote down vote up
public static Stream<Arguments> data() throws ParserConfigurationException, SAXException, IOException {
  Document dom = XMLUtil.parseFileToDom("C:\\work\\fluentpath\\tests\\stu3\\tests-fhir-r3.xml");

  List<Element> list = new ArrayList<Element>();
  List<Element> groups = new ArrayList<Element>();
  XMLUtil.getNamedChildren(dom.getDocumentElement(), "group", groups);
  for (Element g : groups) {
    XMLUtil.getNamedChildren(g, "test", list);
  }

  List<Arguments> objects = new ArrayList<>();
  for (Element e : list) {
    objects.add(Arguments.of(getName(e), e));
  }
  return objects.stream();
}
 
Example #6
Source File: TestNumberBlockIndex.java    From yosegi with Apache License 2.0 6 votes vote down vote up
public static Stream<Arguments> data1() throws IOException{
  IBlockIndex[] byteClassNames = createBlockIndex();

  Object[] filter = new Object[6];
  filter[0] = createByteFilter();
  filter[1] = createShortFilter();
  filter[2] = createIntegerFilter();
  filter[3] = createLongFilter();
  filter[4] = createFloatFilter();
  filter[5] = createDoubleFilter();

  Arguments[] result = new Arguments[byteClassNames.length * filter.length];
  for( int i = 0 ; i < byteClassNames.length ; i++ ){
    int index = i * filter.length;
    for( int ii = 0 ; ii < filter.length ; ii++ ){
      result[index+ii] = arguments( byteClassNames[i] , filter[ii] );
    }
  }
  return Stream.of( result );
}
 
Example #7
Source File: BaseUInt256ValueTest.java    From incubator-tuweni with Apache License 2.0 6 votes vote down vote up
private static Stream<Arguments> multiplyProvider() {
  return Stream
      .of(
          Arguments.of(v(0), v(1), v(0)),
          Arguments.of(v(1), v(0), v(0)),
          Arguments.of(v(1), v(20), v(20)),
          Arguments.of(v(20), v(1), v(20)),
          Arguments.of(hv("0x0a0000000000"), v(1), hv("0x0a0000000000")),
          Arguments.of(v(1), hv("0x0a0000000000"), hv("0x0a0000000000")),
          Arguments.of(v(0), v(2), v(0)),
          Arguments.of(v(1), v(2), v(2)),
          Arguments.of(v(2), v(2), v(4)),
          Arguments.of(v(3), v(2), v(6)),
          Arguments.of(v(4), v(2), v(8)),
          Arguments.of(v(10), v(18), v(180)),
          Arguments.of(biv("13492324908428420834234908341"), v(2), biv("26984649816856841668469816682")),
          Arguments.of(biv("13492324908428420834234908342"), v(2), biv("26984649816856841668469816684")),
          Arguments.of(v(2), v(8), v(16)),
          Arguments.of(v(7), v(8), v(56)),
          Arguments.of(v(8), v(8), v(64)),
          Arguments.of(v(17), v(8), v(136)),
          Arguments.of(biv("13492324908428420834234908342"), v(8), biv("107938599267427366673879266736")),
          Arguments.of(biv("13492324908428420834234908342"), v(2048), biv("27632281412461405868513092284416")),
          Arguments.of(biv("13492324908428420834234908342"), v(131072), biv("1768466010397529975584837906202624")),
          Arguments.of(v(22), v(0), v(0)));
}
 
Example #8
Source File: MetricRecordingValidatorApiChannelTest.java    From teku with Apache License 2.0 6 votes vote down vote up
public static Stream<Arguments> getNoResponseCallArguments() {
  final DataStructureUtil dataStructureUtil = new DataStructureUtil();
  return Stream.of(
      noResponseTest(
          "subscribeToBeaconCommitteeForAggregation",
          channel -> channel.subscribeToBeaconCommitteeForAggregation(1, UnsignedLong.ZERO),
          MetricRecordingValidatorApiChannel.AGGREGATION_SUBSCRIPTION_COUNTER_NAME),
      noResponseTest(
          "subscribeToPersistentSubnets",
          channel -> channel.subscribeToPersistentSubnets(emptySet()),
          MetricRecordingValidatorApiChannel.PERSISTENT_SUBSCRIPTION_COUNTER_NAME),
      noResponseTest(
          "sendSignedAttestation",
          channel -> channel.sendSignedAttestation(dataStructureUtil.randomAttestation()),
          MetricRecordingValidatorApiChannel.PUBLISHED_ATTESTATION_COUNTER_NAME),
      noResponseTest(
          "sendAggregateAndProof",
          channel ->
              channel.sendAggregateAndProof(dataStructureUtil.randomSignedAggregateAndProof()),
          MetricRecordingValidatorApiChannel.PUBLISHED_AGGREGATE_COUNTER_NAME),
      noResponseTest(
          "sendSignedBlock",
          channel -> channel.sendSignedBlock(dataStructureUtil.randomSignedBeaconBlock(1)),
          MetricRecordingValidatorApiChannel.PUBLISHED_BLOCK_COUNTER_NAME));
}
 
Example #9
Source File: TomlTest.java    From incubator-tuweni with Apache License 2.0 6 votes vote down vote up
private static Stream<Arguments> arrayTableSupplier() {
  return Stream
      .of(
          Arguments.of("[[foo]]\nbar = 'baz'", new Object[] {"foo", 0, "bar"}, "baz"),
          Arguments.of("[[foo]] #foo.bar\nbar = 'baz'", new Object[] {"foo", 0, "bar"}, "baz"),
          Arguments.of("[[foo]] \n   bar = 'buz'\nbuz=1\n", new Object[] {"foo", 0, "buz"}, 1L),
          Arguments.of("[[foo]] \n   bar = 'buz'\n[[foo]]\nbar=1\n", new Object[] {"foo", 0, "bar"}, "buz"),
          Arguments.of("[[foo]] \n   bar = 'buz'\n[[foo]]\nbar=1\n", new Object[] {"foo", 1, "bar"}, 1L),
          Arguments.of("[[foo]]\nbar=1\n[[foo]]\nbar=2\n", new Object[] {"foo", 0, "bar"}, 1L),
          Arguments.of("[[foo]]\nbar=1\n[[foo]]\nbar=2\n", new Object[] {"foo", 1, "bar"}, 2L),
          Arguments.of("[[foo]]\n\n[foo.bar]\n\nbaz=2\n\n", new Object[] {"foo", 0, "bar", "baz"}, 2L),
          Arguments
              .of(
                  "[[foo]]\n[[foo.bar]]\n[[foo.baz]]\n[foo.bar.baz]\nbuz=2\n[foo.baz.buz]\nbiz=3\n",
                  new Object[] {"foo", 0, "bar", 0, "baz", "buz"},
                  2L),
          Arguments
              .of(
                  "[[foo]]\n[[foo.bar]]\n[[foo.baz]]\n[foo.bar.baz]\nbuz=2\n[foo.baz.buz]\nbiz=3\n",
                  new Object[] {"foo", 0, "baz", 0, "buz", "biz"},
                  3L));
}
 
Example #10
Source File: BaseUInt256ValueTest.java    From incubator-tuweni with Apache License 2.0 6 votes vote down vote up
private static Stream<Arguments> divideUInt256Provider() {
  return Stream
      .of(
          Arguments.of(v(0), UInt256.valueOf(2), v(0)),
          Arguments.of(v(1), UInt256.valueOf(2), v(0)),
          Arguments.of(v(2), UInt256.valueOf(2), v(1)),
          Arguments.of(v(3), UInt256.valueOf(2), v(1)),
          Arguments.of(v(4), UInt256.valueOf(2), v(2)),
          Arguments.of(biv("13492324908428420834234908341"), UInt256.valueOf(2), biv("6746162454214210417117454170")),
          Arguments.of(biv("13492324908428420834234908342"), UInt256.valueOf(2), biv("6746162454214210417117454171")),
          Arguments.of(biv("13492324908428420834234908343"), UInt256.valueOf(2), biv("6746162454214210417117454171")),
          Arguments.of(v(2), UInt256.valueOf(8), v(0)),
          Arguments.of(v(7), UInt256.valueOf(8), v(0)),
          Arguments.of(v(8), UInt256.valueOf(8), v(1)),
          Arguments.of(v(9), UInt256.valueOf(8), v(1)),
          Arguments.of(v(17), UInt256.valueOf(8), v(2)),
          Arguments.of(v(1024), UInt256.valueOf(8), v(128)),
          Arguments.of(v(1026), UInt256.valueOf(8), v(128)),
          Arguments.of(biv("13492324908428420834234908342"), UInt256.valueOf(8), biv("1686540613553552604279363542")),
          Arguments.of(biv("13492324908428420834234908342"), UInt256.valueOf(2048), biv("6588049271693564860466263")),
          Arguments
              .of(biv("13492324908428420834234908342"), UInt256.valueOf(131072), biv("102938269870211950944785")));
}
 
Example #11
Source File: BaseUInt64ValueTest.java    From incubator-tuweni with Apache License 2.0 6 votes vote down vote up
private static Stream<Arguments> multiplyLongProvider() {
  return Stream
      .of(
          Arguments.of(v(0), 2L, v(0)),
          Arguments.of(v(1), 2L, v(2)),
          Arguments.of(v(2), 2L, v(4)),
          Arguments.of(v(3), 2L, v(6)),
          Arguments.of(v(4), 2L, v(8)),
          Arguments.of(v(10), 18L, v(180)),
          Arguments.of(v(2), 8L, v(16)),
          Arguments.of(v(7), 8L, v(56)),
          Arguments.of(v(8), 8L, v(64)),
          Arguments.of(v(17), 8L, v(136)),
          Arguments.of(v(22), 0L, v(0)),
          Arguments.of(hv("0xFFFFFFFFFFFFFFFF"), 2L, hv("0xFFFFFFFFFFFFFFFE")),
          Arguments.of(hv("0xFFFFFFFFFFFFFFFF"), 2L, hv("0xFFFFFFFFFFFFFFFE")));
}
 
Example #12
Source File: UInt384Test.java    From incubator-tuweni with Apache License 2.0 6 votes vote down vote up
private static Stream<Arguments> divideLongProvider() {
  return Stream
      .of(
          Arguments.of(v(0), 2L, v(0)),
          Arguments.of(v(1), 2L, v(0)),
          Arguments.of(v(2), 2L, v(1)),
          Arguments.of(v(3), 2L, v(1)),
          Arguments.of(v(4), 2L, v(2)),
          Arguments.of(biv("13492324908428420834234908341"), 2L, biv("6746162454214210417117454170")),
          Arguments.of(biv("13492324908428420834234908342"), 2L, biv("6746162454214210417117454171")),
          Arguments.of(biv("13492324908428420834234908343"), 2L, biv("6746162454214210417117454171")),
          Arguments.of(v(2), 8L, v(0)),
          Arguments.of(v(7), 8L, v(0)),
          Arguments.of(v(8), 8L, v(1)),
          Arguments.of(v(9), 8L, v(1)),
          Arguments.of(v(17), 8L, v(2)),
          Arguments.of(v(1024), 8L, v(128)),
          Arguments.of(v(1026), 8L, v(128)),
          Arguments.of(biv("13492324908428420834234908342"), 8L, biv("1686540613553552604279363542")),
          Arguments.of(biv("13492324908428420834234908342"), 2048L, biv("6588049271693564860466263")),
          Arguments.of(biv("13492324908428420834234908342"), 131072L, biv("102938269870211950944785")));
}
 
Example #13
Source File: BooleanTypeConverterTest.java    From yare with MIT License 5 votes vote down vote up
private static Stream<Arguments> conversionParameters() {
    return Stream.of(
            Arguments.of("true", true),
            Arguments.of("false", false),
            Arguments.of("@null", null)
    );
}
 
Example #14
Source File: UInt256Test.java    From cava with Apache License 2.0 5 votes vote down vote up
private static Stream<Arguments> compareToProvider() {
  return Stream.of(
      Arguments.of(v(5), v(5), 0),
      Arguments.of(v(5), v(3), 1),
      Arguments.of(v(5), v(6), -1),
      Arguments.of(
          hv("0x0000000000000000000000000000000000000000000000000000000000000000"),
          hv("0x0000000000000000000000000000000000000000000000000000000000000000"),
          0),
      Arguments.of(
          hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          0),
      Arguments.of(
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          0),
      Arguments.of(
          hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          hv("0x0000000000000000000000000000000000000000000000000000000000000000"),
          1),
      Arguments.of(
          hv("0x0000000000000000000000000000000000000000000000000000000000000000"),
          hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          -1),
      Arguments.of(
          hv("0x000000000000000000000000000001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          1),
      Arguments.of(
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE"),
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          -1));
}
 
Example #15
Source File: hashToCurveTest.java    From teku with Apache License 2.0 5 votes vote down vote up
public static Stream<Arguments> getIndices() {
  ArrayList<Arguments> args = new ArrayList<>();
  for (int i = 0; i < nTest; i++) {
    args.add(Arguments.of(i));
  }
  return args.stream();
}
 
Example #16
Source File: SFTPEnvironmentSetterTest.java    From sftp-fs with Apache License 2.0 5 votes vote down vote up
static Stream<Arguments> testSetter() {
    Arguments[] arguments = {
            arguments("withUsername", "username", UUID.randomUUID().toString()),
            arguments("withConnectTimeout", "connectTimeout", 1000),
            arguments("withProxy", "proxy", new ProxyHTTP("localhost")),
            arguments("withUserInfo", "userInfo", new SimpleUserInfo(UUID.randomUUID().toString().toCharArray())),
            arguments("withPassword", "password", UUID.randomUUID().toString().toCharArray()),
            arguments("withConfig", "config", System.getProperties()),
            arguments("withSocketFactory", "socketFactory", new TestSocketFactory()),
            arguments("withTimeout", "timeOut", 1000),
            arguments("withClientVersion", "clientVersion", "SSH-2"),
            arguments("withHostKeyAlias", "hostKeyAlias", "alias"),
            arguments("withServerAliveInterval", "serverAliveInterval", 500),
            arguments("withServerAliveCountMax", "serverAliveCountMax", 5),
            arguments("withIdentityRepository", "identityRepository", new TestIdentityRepository()),
            arguments("withIdentities", "identities", Collections.singletonList(IdentityTest.fromFiles())),
            arguments("withHostKeyRepository", "hostKeyRepository", new TestHostKeyRepository()),
            arguments("withKnownHosts", "knownHosts", new File("known_hosts")),
            arguments("withAgentForwarding", "agentForwarding", false),
            arguments("withFilenameEncoding", "filenameEncoding", "UTF-8"),
            arguments("withDefaultDirectory", "defaultDir", "/"),
            arguments("withClientConnectionCount", "clientConnectionCount", 5),
            arguments("withClientConnectionWaitTimeout", "clientConnectionWaitTimeout", 1000L),
            arguments("withFileSystemExceptionFactory", "fileSystemExceptionFactory", DefaultFileSystemExceptionFactory.INSTANCE),
            arguments("withActualTotalSpaceCalculation", "calculateActualTotalSpace", false),
    };
    return Arrays.stream(arguments);
}
 
Example #17
Source File: VariableArgumentsProvider.java    From tutorials with MIT License 5 votes vote down vote up
@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
    return context.getTestClass()
            .map(this::getField)
            .map(this::getValue)
            .orElseThrow(() -> new IllegalArgumentException("Failed to load test arguments"));
}
 
Example #18
Source File: UInt32Test.java    From incubator-tuweni with Apache License 2.0 5 votes vote down vote up
private static Stream<Arguments> addExactLongProvider() {
  return Stream
      .of(
          Arguments.of(UInt32.MAX_VALUE, 3),
          Arguments.of(UInt32.MAX_VALUE, Integer.MAX_VALUE),
          Arguments.of(v(0), -1));
}
 
Example #19
Source File: Cql2PgUtilTest.java    From raml-module-builder with Apache License 2.0 5 votes vote down vote up
static Stream<Arguments> quoted() {
  return Stream.of(
      Arguments.of(""           , "''"),
      Arguments.of("'"          , "''''"),
      Arguments.of("''"         , "''''''"),
      Arguments.of("a"          , "'a'"),
      Arguments.of("'a'"        , "'''a'''"),
      Arguments.of("It's cool"  , "'It''s cool'"),
      Arguments.of("Rock'n'roll", "'Rock''n''roll'")
      );
}
 
Example #20
Source File: UInt256Test.java    From incubator-tuweni with Apache License 2.0 5 votes vote down vote up
private static Stream<Arguments> multiplyModLongLongProvider() {
  return Stream
      .of(
          Arguments.of(v(0), 5L, 2L, v(0)),
          Arguments.of(v(2), 3L, 7L, v(6)),
          Arguments.of(v(2), 3L, 6L, v(0)),
          Arguments.of(v(2), 0L, 6L, v(0)),
          Arguments
              .of(
                  hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE"),
                  2L,
                  Long.MAX_VALUE,
                  hv("0x000000000000000000000000000000000000000000000000000000000000001C")));
}
 
Example #21
Source File: IdleUriParametersParserTest.java    From multiapps-controller with Apache License 2.0 5 votes vote down vote up
public static Stream<Arguments> testParseIdleHostsDomainsWithoutRoutes() {
    // @formatter:off
    return Stream.of(
        Arguments.of(Arrays.asList("test-host-1", "test-host-2"), Arrays.asList("test-domain.com"),  Arrays.asList("idle-host"), Arrays.asList("idle-domain.com"), 
                     new Expectation(Arrays.asList("idle-host.idle-domain.com").toString())),
        Arguments.of(Arrays.asList("test-host-1"), Arrays.asList("test-domain.com"), Arrays.asList("idle-host", "idle-host-2"), Arrays.asList("idle-domain.com", "idle-domain.net"),
                     new Expectation(Arrays.asList("idle-host.idle-domain.com", "idle-host-2.idle-domain.com", "idle-host.idle-domain.net", "idle-host-2.idle-domain.net").toString()))
    // @formatter:on
    );
}
 
Example #22
Source File: MethodDelegateTest.java    From riptide with MIT License 5 votes vote down vote up
static List<Arguments> data() {
    return Arrays.asList(
            Arguments.of(GET, new NoParam(Http::get)),
            Arguments.of(HEAD, new NoParam(Http::head)),
            Arguments.of(POST, new NoParam(Http::post)),
            Arguments.of(PUT, new NoParam(Http::put)),
            Arguments.of(PATCH, new NoParam(Http::patch)),
            Arguments.of(DELETE, new NoParam(Http::delete)),
            Arguments.of(OPTIONS, new NoParam(Http::options)),
            Arguments.of(TRACE, new NoParam(Http::trace)),
            Arguments.of(GET, new UriParam(Http::get, URI.create("https://example.com"))),
            Arguments.of(HEAD, new UriParam(Http::head, URI.create("https://example.com"))),
            Arguments.of(POST, new UriParam(Http::post, URI.create("https://example.com"))),
            Arguments.of(PUT, new UriParam(Http::put, URI.create("https://example.com"))),
            Arguments.of(PATCH, new UriParam(Http::patch, URI.create("https://example.com"))),
            Arguments.of(DELETE, new UriParam(Http::delete, URI.create("https://example.com"))),
            Arguments.of(OPTIONS, new UriParam(Http::options, URI.create("https://example.com"))),
            Arguments.of(TRACE, new UriParam(Http::trace, URI.create("https://example.com"))),
            Arguments.of(GET, new UriTemplateParam(Http::get, "https://example.com")),
            Arguments.of(HEAD, new UriTemplateParam(Http::head, "https://example.com")),
            Arguments.of(POST, new UriTemplateParam(Http::post, "https://example.com")),
            Arguments.of(PUT, new UriTemplateParam(Http::put, "https://example.com")),
            Arguments.of(PATCH, new UriTemplateParam(Http::patch, "https://example.com")),
            Arguments.of(DELETE, new UriTemplateParam(Http::delete, "https://example.com")),
            Arguments.of(OPTIONS, new UriTemplateParam(Http::options, "https://example.com")),
            Arguments.of(TRACE, new UriTemplateParam(Http::trace, "https://example.com"))
    );
}
 
Example #23
Source File: ComparisonRuleTests.java    From vividus with Apache License 2.0 5 votes vote down vote up
static Stream<Arguments> getVariableMatcher()
{
    // @formatter:off
    return Stream.of(
        Arguments.of(ComparisonRule.LESS_THAN, lessThan(VARIABLE)),
        Arguments.of(ComparisonRule.LESS_THAN_OR_EQUAL_TO, lessThanOrEqualTo(VARIABLE)),
        Arguments.of(ComparisonRule.GREATER_THAN, greaterThan(VARIABLE)),
        Arguments.of(ComparisonRule.GREATER_THAN_OR_EQUAL_TO, greaterThanOrEqualTo(VARIABLE)),
        Arguments.of(ComparisonRule.EQUAL_TO, comparesEqualTo(VARIABLE)),
        Arguments.of(ComparisonRule.NOT_EQUAL_TO, not(comparesEqualTo(VARIABLE)))
    );
    // @formatter:on
}
 
Example #24
Source File: ImapCommandTest.java    From james-project with Apache License 2.0 5 votes vote down vote up
static Stream<Arguments> validForStateShouldReturnFalse() {
    return Stream.of(
        Arguments.arguments(ImapCommand.anyStateCommand("command"), ImapSessionState.LOGOUT),
        Arguments.arguments(ImapCommand.selectedStateCommand("command"), ImapSessionState.LOGOUT),
        Arguments.arguments(ImapCommand.authenticatedStateCommand("command"), ImapSessionState.LOGOUT),
        Arguments.arguments(ImapCommand.nonAuthenticatedStateCommand("command"), ImapSessionState.LOGOUT),
        Arguments.arguments(ImapCommand.selectedStateCommand("command"), ImapSessionState.NON_AUTHENTICATED),
        Arguments.arguments(ImapCommand.selectedStateCommand("command"), ImapSessionState.AUTHENTICATED),
        Arguments.arguments(ImapCommand.authenticatedStateCommand("command"), ImapSessionState.NON_AUTHENTICATED),
        Arguments.arguments(ImapCommand.nonAuthenticatedStateCommand("command"), ImapSessionState.AUTHENTICATED),
        Arguments.arguments(ImapCommand.nonAuthenticatedStateCommand("command"), ImapSessionState.SELECTED));
}
 
Example #25
Source File: BooleanTypeConverterTest.java    From yare with MIT License 5 votes vote down vote up
private static Stream<Arguments> applicableParameters() {
    return Stream.of(
            Arguments.of(boolean.class, true),
            Arguments.of(Boolean.class, true),
            Arguments.of(Integer.class, false),
            Arguments.of(null, false)
    );
}
 
Example #26
Source File: BaseUInt384ValueTest.java    From cava with Apache License 2.0 5 votes vote down vote up
private static Stream<Arguments> compareToProvider() {
  return Stream.of(
      Arguments.of(v(5), v(5), 0),
      Arguments.of(v(5), v(3), 1),
      Arguments.of(v(5), v(6), -1),
      Arguments.of(
          hv("0x0000000000000000000000000000000000000000000000000000000000000000"),
          hv("0x0000000000000000000000000000000000000000000000000000000000000000"),
          0),
      Arguments.of(
          hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          0),
      Arguments.of(
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          0),
      Arguments.of(
          hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          hv("0x0000000000000000000000000000000000000000000000000000000000000000"),
          1),
      Arguments.of(
          hv("0x0000000000000000000000000000000000000000000000000000000000000000"),
          hv("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          -1),
      Arguments.of(
          hv("0x000000000000000000000000000001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          1),
      Arguments.of(
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE"),
          hv("0x000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
          -1));
}
 
Example #27
Source File: UInt64Test.java    From cava with Apache License 2.0 5 votes vote down vote up
private static Stream<Arguments> subtractLongProvider() {
  return Stream.of(
      Arguments.of(v(1), 0L, v(1)),
      Arguments.of(v(5), 0L, v(5)),
      Arguments.of(v(2), 1L, v(1)),
      Arguments.of(v(100), 100L, v(0)),
      Arguments.of(v(0), 1L, UInt64.MAX_VALUE),
      Arguments.of(v(1), 2L, UInt64.MAX_VALUE),
      Arguments.of(UInt64.MAX_VALUE, 1L, hv("0xFFFFFFFFFFFFFFFE")),
      Arguments.of(v(0), -1L, v(1)),
      Arguments.of(v(0), -100L, v(100)),
      Arguments.of(v(2), -2L, v(4)));
}
 
Example #28
Source File: TestStringPrimitiveColumn.java    From multiple-dimension-spread with Apache License 2.0 5 votes vote down vote up
public static Stream<Arguments> data1() throws IOException{
  return Stream.of(
    arguments( "jp.co.yahoo.dataplatform.mds.binary.maker.OptimizeStringColumnBinaryMaker" ),
    arguments( "jp.co.yahoo.dataplatform.mds.binary.maker.OptimizeDumpStringColumnBinaryMaker" ),
    arguments( "jp.co.yahoo.dataplatform.mds.binary.maker.UnsafeOptimizeStringColumnBinaryMaker" )
  );
}
 
Example #29
Source File: TestRankIterator.java    From RoaringBitmap with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static Stream<Arguments> parameters() throws CloneNotSupportedException {
  FastRankRoaringBitmap fast = getBitmap();
  FastRankRoaringBitmap withFull = new FastRankRoaringBitmap(fast.highLowContainer.clone());
  withFull.add(0L, 262144L);

  assertTrue(fast.isCacheDismissed());
  return Lists.cartesianProduct(Arrays.asList(fast, withFull), computeAdvances())
          .stream().map(list -> Arguments.of(list.get(0), list.get(1)));
}
 
Example #30
Source File: UInt32Test.java    From incubator-tuweni with Apache License 2.0 5 votes vote down vote up
private static Stream<Arguments> addModLongUInt32Provider() {
  return Stream
      .of(
          Arguments.of(v(0), 1, UInt32.valueOf(2), v(1)),
          Arguments.of(v(1), 1, UInt32.valueOf(2), v(0)),
          Arguments.of(UInt32.MAX_VALUE.subtract(2), 1, UInt32.MAX_VALUE, UInt32.MAX_VALUE.subtract(1)),
          Arguments.of(UInt32.MAX_VALUE.subtract(1), 1, UInt32.MAX_VALUE, v(0)),
          Arguments.of(v(2), 1, UInt32.valueOf(2), v(1)),
          Arguments.of(v(2), -1, UInt32.valueOf(2), v(1)),
          Arguments.of(v(1), -7, UInt32.valueOf(5), v(4)));
}