@DataProvider public static Object[][] emptyAfterTrim() { return new Object[][] { {""}, {" "}, {" "} }; }
@DataProvider public static Object[][] datasetIdSupportedLengths() { return new Object[][] { {ServerId.NOT_UUID_DATASET_ID_LENGTH}, {UUID_DATASET_ID_LENGTH}, }; } }
@DataProvider public static Object[][] allRenamingCases() { return new Object[][] { {"repo1", "rule1", "repo1", "rule2"}, {"repo1", "rule1", "repo2", "rule1"}, {"repo1", "rule1", "repo2", "rule2"}, }; }
@DataProvider public static Object[][] organizationEnabledFlags() { return new Object[][] { {true}, {false} }; }
@DataProvider public static Object[][] branchBranchTypes() { return new Object[][] { {BranchType.SHORT}, {BranchType.LONG} }; }
@DataProvider public static Object[][] allValuesForSelect() { return new Object[][] { {null, ""}, {"", ""}, {"some value", "some value"}, {VALUE_SIZE_4000, VALUE_SIZE_4000}, {VALUE_SIZE_4001, VALUE_SIZE_4001} }; }
@DataProvider public static Object[][] nullOrEmpty() { return new Object[][] { {null}, {""} }; }
@DataProvider public static Object[][] valid_values() { return new Object[][] { {INT, "10"}, {MILLISEC, "1000"}, {WORK_DUR, "1000"}, {FLOAT, "5.12"}, {PERCENT, "10.30"}, }; }
@DataProvider public static Object[][] OneOrMoreIterations() { return new Object[][] { {1}, {1 + new Random().nextInt(10)}, }; }
@DataProvider public static Object[][] allResolutionsBeforeClosing() { return Arrays.stream(ALL_RESOLUTIONS_BEFORE_CLOSING) .map(t -> new Object[] {t}) .toArray(Object[][]::new); }
@DataProvider public static Object[][] nullOrNotNullString() { return new Object[][] { {null}, {randomAlphabetic(12)} }; }
@DataProvider public static Object[][] anyTypeButFile() { return Arrays.stream(Component.Type.values()) .filter(t -> t != Component.Type.FILE) .map(t -> new Object[] {t}) .toArray(Object[][]::new); }
@DataProvider public static Object[][] nonRootProjectComponentTypes() { return dataproviderFromComponentTypeValues(new Predicate<Component.Type>() { @Override public boolean apply(Component.Type input) { return input.isReportType() && input != Component.Type.PROJECT; } }); }
@DataProvider public static Object[][] nonRootViewsComponentTypes() { return dataproviderFromComponentTypeValues(new Predicate<Component.Type>() { @Override public boolean apply(Component.Type input) { return input.isViewsType() && input != Component.Type.VIEW; } }); }
@DataProvider public static Object[][] reportTypes() { return from(REPORT_TYPES).transform(new Function<Type, Object[]>() { @Nullable @Override public Object[] apply(Type input) { return new Object[] {input}; } }).toArray(Object[].class); } }
@DataProvider public static Object[][] nonProjectComponentFactory() { return new Object[][] { {(Function<ComponentDto, ComponentDto>) ComponentTesting::newModuleDto}, {(Function<ComponentDto, ComponentDto>) p -> ComponentTesting.newDirectory(p, "foo")}, {(Function<ComponentDto, ComponentDto>) ComponentTesting::newFileDto} }; }
@DataProvider public static Object[][] coreExtensionsSets() { return new Object[][] { {emptySet()}, {singleton(newCoreExtension())}, {ImmutableSet.of(newCoreExtension(), newCoreExtension())}, }; }
@DataProvider public static Object[][] date_times() { return new Object[][] { {"2014-05-27", parseDate("2014-05-27")}, {"2014-05-27T15:50:45+0100", parseDateTime("2014-05-27T15:50:45+0100")}, {null, null} }; }
@DataProvider public static Object[][] characteriticsOfMainBranchesAndPr() { return new Object[][] { {NO_CHARACTERISTICS}, {branchCharacteristics("LONG", randomAlphabetic(15))}, {branchCharacteristics("SHORT", randomAlphabetic(16))}, {branchCharacteristics(randomAlphabetic(17), randomAlphabetic(18))}, {prCharacteristics(randomAlphabetic(19))}, }; }
@DataProvider public static Object[][] all_types_batch_measure_builders() { return new Object[][] { {ScannerReport.Measure.newBuilder().setBooleanValue(BoolValue.newBuilder().setValue(true)), SOME_BOOLEAN_METRIC}, {ScannerReport.Measure.newBuilder().setIntValue(IntValue.newBuilder().setValue(1)), SOME_INT_METRIC}, {ScannerReport.Measure.newBuilder().setLongValue(LongValue.newBuilder().setValue(1)), SOME_LONG_METRIC}, {ScannerReport.Measure.newBuilder().setDoubleValue(DoubleValue.newBuilder().setValue(1)), SOME_DOUBLE_METRIC}, {ScannerReport.Measure.newBuilder().setStringValue(StringValue.newBuilder().setValue("1")), SOME_STRING_METRIC}, {ScannerReport.Measure.newBuilder().setStringValue(StringValue.newBuilder().setValue(Measure.Level.OK.name())), SOME_LEVEL_METRIC} }; } }