Java Code Examples for org.junit.jupiter.params.provider.Arguments#of()

The following examples show how to use org.junit.jupiter.params.provider.Arguments#of() . 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: TestTypeNodeViewer.java    From JetUML with GNU General Public License v3.0 5 votes vote down vote up
private static Arguments createClassNode3()
{
	ClassNode node = new ClassNode();
	node.setName(node.getName() + "NAME");
	return Arguments.of(node, 
			new Rectangle(0, 0, 100, 60)); // Default width and height
}
 
Example 2
Source File: RealDataBenchmarkSanityTest.java    From RoaringBitmap with Apache License 2.0 5 votes vote down vote up
public static Stream<Arguments> params() {
  Arguments[] product = new Arguments[REAL_DATA_SETS.length * BITMAP_TYPES.length * BITMAP_IMMUTABILITY.length];
  int i = 0;
  for (String ds : REAL_DATA_SETS) {
    for (String type : BITMAP_TYPES) {
      for (boolean mutability : BITMAP_IMMUTABILITY) {
        product[i++] = Arguments.of(ds, type, mutability);
      }
    }
  }
  return Arrays.stream(product);
}
 
Example 3
Source File: SearchAPIIT.java    From molgenis with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static Arguments getTestCaseArguments(Map testcase, String idAttributeName) {
  List<Map<String, Object>> expected = (List<Map<String, Object>>) testcase.get("contains");
  return Arguments.of(
      testcase.get("id"),
      testcase.get("attribute"),
      getRsqlOperator((String) testcase.get("operator")),
      testcase.get("value"),
      testcase.get("count"),
      expected.stream().map(it -> it.get(idAttributeName)).collect(toList()),
      testcase.get("comment"));
}
 
Example 4
Source File: JMAPFilteringTest.java    From james-project with Apache License 2.0 5 votes vote down vote up
public Arguments build() {
    Preconditions.checkState(description.isPresent());
    Preconditions.checkState(field.isPresent());
    Preconditions.checkState(valueToMatch.isPresent());
    
    return Arguments.of(description.get(), field.get(), mimeMessageBuilder, valueToMatch.get());
}
 
Example 5
Source File: Java9RequestContextAwareFutureTest.java    From armeria with Apache License 2.0 5 votes vote down vote up
@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext context) throws Exception {
    final Arguments completeAsync = Arguments.of(
            (BiConsumer<CompletableFuture<?>, AtomicBoolean>) (future, called) -> {
                future.completeAsync(() -> {
                    called.set(true);
                    return null;
                }, MoreExecutors.directExecutor()).exceptionally(cause -> {
                    called.set(true);
                    return null;
                });
            });

    return Stream.concat(super.provideArguments(context), Stream.of(completeAsync));
}
 
Example 6
Source File: TestTypeNodeViewer.java    From JetUML with GNU General Public License v3.0 5 votes vote down vote up
private static Arguments createClassNode6()
{
	ClassNode node = new ClassNode();
	node.setMethods("METHODS");
	return Arguments.of(node, 
			new Rectangle(0, 0, 100, 60)); // Default width and height
}
 
Example 7
Source File: TestTypeNodeViewer.java    From JetUML with GNU General Public License v3.0 5 votes vote down vote up
private static Arguments createClassNode5()
{
	ClassNode node = new ClassNode();
	node.setName("NAME1\nNAME2\nNAME3\nNAME4");
	return Arguments.of(node, 
			new Rectangle(0, 0, 100, osDependent(70, 65, 65))); // Default width and additional height
}
 
Example 8
Source File: TestTypeNodeViewer.java    From JetUML with GNU General Public License v3.0 5 votes vote down vote up
private static Arguments createClassNode4()
{
	ClassNode node = new ClassNode();
	node.setName(node.getName() + "NAME");
	return Arguments.of(node, 
			new Rectangle(0, 0, 100, 60)); // Default width and height
}
 
Example 9
Source File: TestTypeNodeViewer.java    From JetUML with GNU General Public License v3.0 5 votes vote down vote up
private static Arguments createClassNode2()
{
	ClassNode node = new ClassNode();
	node.moveTo(new Point(10,20));
	return Arguments.of(node, 
			new Rectangle(10, 20, 100, 60)); // Default width and height, translated
}
 
Example 10
Source File: MosaicVectorTester.java    From symbol-sdk-java with Apache License 2.0 5 votes vote down vote up
private static Arguments extractArguments(
    Map<String, String> entry, NetworkType networkType,
    String addressField, String mosaicField) {
    String address = entry.get(addressField);
    String mosaicId = entry.get(mosaicField);
    return Arguments.of(networkType, entry.get("mosaicNonce"), address, mosaicId);
}
 
Example 11
Source File: AddressVectorTester.java    From symbol-sdk-java with Apache License 2.0 5 votes vote down vote up
private static Arguments extractArguments(
    Map<String, String> entry, NetworkType networkType, String addressField) {
    String address = entry.get(addressField);
    if (address == null) {
        return null;
    }
    return Arguments.of(networkType, entry.get("publicKey"), address);
}
 
Example 12
Source File: MetricRecordingValidatorApiChannelTest.java    From teku with Apache License 2.0 5 votes vote down vote up
private static <T> Arguments requestDataTest(
    final String name,
    final Function<ValidatorApiChannel, SafeFuture<Optional<T>>> method,
    final String counterName,
    final T presentValue) {
  return Arguments.of(name, method, counterName, presentValue);
}
 
Example 13
Source File: HealthSeriesBuilderTest.java    From warnings-ng-plugin with MIT License 5 votes vote down vote up
/**
 * Build the tests argument.
 *
 * @return test arg
 */
Object build() {
    return Arguments.of(
            name,
            descriptor,
            run,
            series
    );
}
 
Example 14
Source File: ContractFunctionSelectorTest.java    From hedera-sdk-java with Apache License 2.0 4 votes vote down vote up
private static Arguments funcSelectorArgs(String hash, String funcName, String... paramTypes) {
    return Arguments.of(hash, funcName, paramTypes);
}
 
Example 15
Source File: TestTypeNodeViewer.java    From JetUML with GNU General Public License v3.0 4 votes vote down vote up
private static Arguments createClassNode1()
{
	return Arguments.of(new ClassNode(), 
			new Rectangle(0,0, 100, 60)); // Default width and height
}
 
Example 16
Source File: MonetaryAmountDeserializerTest.java    From jackson-datatype-money with MIT License 4 votes vote down vote up
private static <M extends MonetaryAmount> Arguments of(final Class<M> type, final Configurer configurer) {
    return Arguments.of(type, configurer);
}
 
Example 17
Source File: MetricRecordingValidatorApiChannelTest.java    From teku with Apache License 2.0 4 votes vote down vote up
private static Arguments noResponseTest(
    final String name, final Consumer<ValidatorApiChannel> method, final String counterName) {
  return Arguments.of(name, method, counterName);
}
 
Example 18
Source File: AnalysisHistoryTest.java    From warnings-ng-plugin with MIT License 2 votes vote down vote up
/**
 * Build the tests argument.
 *
 * @return test arg
 */
Object build() {
    return Arguments.of(testName, expectedResult, qualityGateStatus, jobResult);
}