@DataPoints public static String[] testPaths() { return new String[] { "FileA", "FileB", "DirC", "DirE", "DirC/FileD", "UndefF", "DirC/UndefF", "DirE/UndefF" }; }
private void addMultiPointMethods(ParameterSignature sig, List<PotentialAssignment> list) throws Throwable { for (FrameworkMethod dataPointsMethod : getDataPointsMethods(sig)) { Class<?> returnType = dataPointsMethod.getReturnType(); if ((returnType.isArray() && sig.canPotentiallyAcceptType(returnType.getComponentType())) || Iterable.class.isAssignableFrom(returnType)) { try { addDataPointsValues(returnType, sig, dataPointsMethod.getName(), list, dataPointsMethod.invokeExplosively(null)); } catch (Throwable throwable) { DataPoints annotation = dataPointsMethod.getAnnotation(DataPoints.class); if (annotation != null && isAssignableToAnyOf(annotation.ignoredExceptions(), throwable)) { return; } else { throw throwable; } } } } }
@Override protected Collection<Field> getDataPointsFields(ParameterSignature sig) { Collection<Field> fields = super.getDataPointsFields(sig); String requestedName = sig.getAnnotation(FromDataPoints.class).value(); List<Field> fieldsWithMatchingNames = new ArrayList<Field>(); for (Field field : fields) { String[] fieldNames = field.getAnnotation(DataPoints.class).value(); if (Arrays.asList(fieldNames).contains(requestedName)) { fieldsWithMatchingNames.add(field); } } return fieldsWithMatchingNames; }
@DataPoints public static CharSequence[] dataPoints() { CharSequence[] charSequences = new CharSequence[PRINTABLE_CHAR_COUNT]; int i = 0; for (char c = MINIMUM_PRINTABLE_CHAR; c <= MAXIMUM_PRINTABLE_CHAR; c++) { if (c != 'x' && c != 'u') { charSequences[i++] = "\\" + c; } } return charSequences; }
@Override protected Collection<FrameworkMethod> getDataPointsMethods(ParameterSignature sig) { Collection<FrameworkMethod> methods = super.getDataPointsMethods(sig); String requestedName = sig.getAnnotation(FromDataPoints.class).value(); List<FrameworkMethod> methodsWithMatchingNames = new ArrayList<FrameworkMethod>(); for (FrameworkMethod method : methods) { String[] methodNames = method.getAnnotation(DataPoints.class).value(); if (Arrays.asList(methodNames).contains(requestedName)) { methodsWithMatchingNames.add(method); } } return methodsWithMatchingNames; }
private void addMultiPointMethods(ParameterSignature sig, List<PotentialAssignment> list) throws Throwable { for (FrameworkMethod dataPointsMethod : getDataPointsMethods(sig)) { Class<?> returnType = dataPointsMethod.getReturnType(); if ((returnType.isArray() && sig.canPotentiallyAcceptType(returnType.getComponentType())) || Iterable.class.isAssignableFrom(returnType)) { try { addDataPointsValues(returnType, sig, dataPointsMethod.getName(), list, dataPointsMethod.invokeExplosively(null)); } catch (Throwable throwable) { DataPoints annotation = dataPointsMethod.getAnnotation(DataPoints.class); if (annotation != null && isAssignableToAnyOf(annotation.ignoredExceptions(), throwable)) { return; } else { throw throwable; } } } } }
@DataPoints public static String[] testPaths() { return new String[] { "FileA", "FileB", "DirC", "DirC/FileD", "DirE", "UndefF", "DirC/UndefF", "DirE/UndefF", "DirE/UndefG/UndefH/UndefI" }; }
@Override protected Collection<Field> getDataPointsFields(ParameterSignature sig) { Collection<Field> fields = super.getDataPointsFields(sig); String requestedName = sig.getAnnotation(FromDataPoints.class).value(); List<Field> fieldsWithMatchingNames = new ArrayList<Field>(); for (Field field : fields) { String[] fieldNames = field.getAnnotation(DataPoints.class).value(); if (Arrays.asList(fieldNames).contains(requestedName)) { fieldsWithMatchingNames.add(field); } } return fieldsWithMatchingNames; }
private void addMultiPointMethods(ParameterSignature sig, List<PotentialAssignment> list) throws Throwable { for (FrameworkMethod dataPointsMethod : getDataPointsMethods(sig)) { Class<?> returnType = dataPointsMethod.getReturnType(); if ((returnType.isArray() && sig.canPotentiallyAcceptType(returnType.getComponentType())) || Iterable.class.isAssignableFrom(returnType)) { try { addDataPointsValues(returnType, sig, dataPointsMethod.getName(), list, dataPointsMethod.invokeExplosively(null)); } catch (Throwable throwable) { DataPoints annotation = dataPointsMethod.getAnnotation(DataPoints.class); if (annotation != null && isAssignableToAnyOf(annotation.ignoredExceptions(), throwable)) { return; } else { throw throwable; } } } } }
@DataPoints public static int[][] valuesAndLengths() { return new int[][] { {1, 1}, {10, 2}, {100, 3}, {1000, 4}, {12, 2}, {123, 3}, {2345, 4}, {9, 1}, {99, 2}, {999, 3}, {9999, 4}, }; }
@Override protected Collection<Field> getDataPointsFields(ParameterSignature sig) { Collection<Field> fields = super.getDataPointsFields(sig); String requestedName = sig.getAnnotation(FromDataPoints.class).value(); List<Field> fieldsWithMatchingNames = new ArrayList<Field>(); for (Field field : fields) { String[] fieldNames = field.getAnnotation(DataPoints.class).value(); if (Arrays.asList(fieldNames).contains(requestedName)) { fieldsWithMatchingNames.add(field); } } return fieldsWithMatchingNames; }
@DataPoints public static int[][] valuesAndLengths() { return new int[][] { {1, 1}, {10, 2}, {100, 3}, {1000, 4}, {12, 2}, {123, 3}, {2345, 4}, {9, 1}, {99, 2}, {999, 3}, {9999, 4}, }; }
@Override protected Collection<FrameworkMethod> getDataPointsMethods(ParameterSignature sig) { Collection<FrameworkMethod> methods = super.getDataPointsMethods(sig); String requestedName = sig.getAnnotation(FromDataPoints.class).value(); List<FrameworkMethod> methodsWithMatchingNames = new ArrayList<FrameworkMethod>(); for (FrameworkMethod method : methods) { String[] methodNames = method.getAnnotation(DataPoints.class).value(); if (Arrays.asList(methodNames).contains(requestedName)) { methodsWithMatchingNames.add(method); } } return methodsWithMatchingNames; }
@DataPoints public static String[][] input() { return new String[][]{ {"xunitdata/failed-test.xml", "failed-test.xml", String.format("%s%n", "Assert.True() Failure\\r\\nExpected: True\\r\\nActual: False") + "test output\\n", "FAILED-TRACE"}, {"xunitdata/passed-test.xml", "passed-test.xml", "test output\\n", null} }; }
@Override protected Collection<FrameworkMethod> getDataPointsMethods(ParameterSignature sig) { Collection<FrameworkMethod> methods = super.getDataPointsMethods(sig); String requestedName = sig.getAnnotation(FromDataPoints.class).value(); List<FrameworkMethod> methodsWithMatchingNames = new ArrayList<FrameworkMethod>(); for (FrameworkMethod method : methods) { String[] methodNames = method.getAnnotation(DataPoints.class).value(); if (Arrays.asList(methodNames).contains(requestedName)) { methodsWithMatchingNames.add(method); } } return methodsWithMatchingNames; }
@DataPoints public static CharSequence[] dataPoints() { return new CharSequence[] {
@DataPoints public static CharSequence[] dataPoints() { List<Character> localDigits = digits(); final int size = localDigits.size(); List<CharSequence> charSequences = new ArrayList<CharSequence>((int) Math.pow(size, 2) + size); for (char highDigit : localDigits) { for (char lowDigit : localDigits) { charSequences.add("\\x" + highDigit + lowDigit); } } for (char digit : localDigits) { charSequences.add("\\x" + digit); } return charSequences.toArray(new CharSequence[charSequences.size()]); }
@DataPoints @SuppressWarnings( "unused" ) // accessed by reflection public static String[] candidates = {"", "get_or_create", "create_or_fail"};
@DataPoints("database") public static final DatabaseAndResult[] DATABASES = { new DatabaseAndResult(new H2(), "ALTER TABLE ${table_name} ALTER COLUMN ${old_column_name} RENAME TO ${new_column_name}"), }; @DataPoints("columnDef") public static final ColumnDef[] COLUMN_DEFS = { BigIntegerColumnDef.newBigIntegerColumnDefBuilder().setColumnName(NEW_COLUMN_NAME).setIsNullable(false).build(), }; @DataPoints("illegalColumnName") public static final String[] ILLEGAL_COLUMN_NAME = { "",
public class TextBodyBuilderTest { @DataPoints public static boolean[] BOOLEANS = { true, false }; @DataPoints public static QuoteStyle[] QUOTESTYLES = { QuoteStyle.PREFIX, QuoteStyle.HEADER };