Java Code Examples for org.junit.experimental.theories.ParameterSignature#getAnnotation()
The following examples show how to use
org.junit.experimental.theories.ParameterSignature#getAnnotation() .
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: DoubleSupplier.java From latexdraw with GNU General Public License v3.0 | 6 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final DoubleData doubledata = sig.getAnnotation(DoubleData.class); DoubleStream stream = Arrays.stream(doubledata.vals()); if(doubledata.angle()) { stream = DoubleStream.of(0d, Math.PI / 2d, Math.PI, 3d * Math.PI / 2d, 2d * Math.PI, -Math.PI / 2d, -Math.PI, -3d * Math.PI / 2d, -2d * Math.PI, 1.234, -1.234, 3d * Math.PI, -3d * Math.PI); } if(doubledata.bads()) { stream = DoubleStream.concat(stream, DoubleStream.of(Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)); } return stream.mapToObj(i -> PotentialAssignment.forValue("", i)).collect(Collectors.toList()); }
Example 2
Source File: FooOrEmptyOrNullStringSupplier.java From galimatias with MIT License | 5 votes |
@Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) { FooOrEmptyOrNullString annotation = sig.getAnnotation(FooOrEmptyOrNullString.class); String foo = annotation.foo(); List<PotentialAssignment> res = new ArrayList<PotentialAssignment>(); for (final String value : new String[]{ foo, "", null }) { res.add(PotentialAssignment.forValue(value, value)); } return res; }
Example 3
Source File: FooOrNullStringSupplier.java From galimatias with MIT License | 5 votes |
@Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) { FooOrNullString annotation = sig.getAnnotation(FooOrNullString.class); String foo = annotation.foo(); List<PotentialAssignment> res = new ArrayList<PotentialAssignment>(); for (final String value : new String[]{ foo, null }) { res.add(PotentialAssignment.forValue(value, value)); } return res; }
Example 4
Source File: AnyUrlyStringSupplier.java From galimatias with MIT License | 5 votes |
@Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) { AnyUrlyString annotation = sig.getAnnotation(AnyUrlyString.class); List<PotentialAssignment> res = new ArrayList<PotentialAssignment>(); for (final String value : values) { res.add(PotentialAssignment.forValue(value, value)); } return res; }
Example 5
Source File: TestURL.java From galimatias with MIT License | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final TestURLs ref = sig.getAnnotation(TestURLs.class); final String dataset = ref.dataset(); if (!datasetMap.containsKey(dataset)) { datasetMap.put(dataset, TestURLLoader.loadTestURLs(dataset)); } final List<PotentialAssignment> values = new ArrayList<PotentialAssignment>(); for (final TestURL testURL : datasetMap.get(dataset)) { values.add(PotentialAssignment.forValue(testURL.toString(), testURL)); } return values; }
Example 6
Source File: ShapeSupplier.java From latexdraw with GNU General Public License v3.0 | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) throws IOException { final ShapeData shapeData = sig.getAnnotation(ShapeData.class); final Stream<Shape> instances; if(shapeData.withParamVariants()) { instances = getDiversifiedShapes(); }else { instances = getStdShapesStream(); } return instances.map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList()); }
Example 7
Source File: LineArcSupplier.java From latexdraw with GNU General Public License v3.0 | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final LineArcData shapeData = sig.getAnnotation(LineArcData.class); final Stream<LineArcProp> instances; if(shapeData.withParamVariants()) { instances = lineArcDiversified(); }else { instances = Stream.of(ShapeSupplier.createRectangle(), ShapeSupplier.createSquare()); } return instances.map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList()); }
Example 8
Source File: ArcSupplier.java From latexdraw with GNU General Public License v3.0 | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final ArcData shapeData = sig.getAnnotation(ArcData.class); final Stream<Arc> instances; if(shapeData.withParamVariants()) { instances = createDiversifiedArc(); }else { instances = Stream.of(createArc()); } return instances.map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList()); }
Example 9
Source File: StdGridSupplier.java From latexdraw with GNU General Public License v3.0 | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final StdGridData shapeData = sig.getAnnotation(StdGridData.class); final Stream<StandardGrid> instances; if(shapeData.withParamVariants()) { instances = createDiversifiedStdGrids(); }else { instances = createStdGrids(); } return instances.map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList()); }
Example 10
Source File: ArrowableSupplier.java From latexdraw with GNU General Public License v3.0 | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final ArrowableData shapeData = sig.getAnnotation(ArrowableData.class); final Stream<ArrowableSingleShape> instances; if(shapeData.withParamVariants()) { instances = createDiversifiedArrowableShapes(); }else { instances = createArrowableShapes(); } return instances.map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList()); }
Example 11
Source File: StringSupplier.java From latexdraw with GNU General Public License v3.0 | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final StringData data = sig.getAnnotation(StringData.class); Stream<String> stream = Arrays.stream(data.vals()); if(data.withNull()) { stream = Stream.concat(stream, Stream.of((String) null)); } return stream.map(i -> PotentialAssignment.forValue("", i)).collect(Collectors.toList()); }
Example 12
Source File: TestModifiablePointsShapeBase.java From latexdraw with GNU General Public License v3.0 | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final ModifPtShapeData data = sig.getAnnotation(ModifPtShapeData.class); final List<Point> pts = Arrays.stream(data.x()).mapToObj(x -> ShapeFactory.INST.createPoint(x, 0d)).collect(Collectors.toList()); for(int i = 0, size = pts.size(); i < size; i++) { pts.get(i).setY(data.y()[i]); } return Stream.of(ShapeFactory.INST.createBezierCurve(pts), ShapeFactory.INST.createPolyline(pts), ShapeFactory.INST.createPolygon(pts)). map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList()); }
Example 13
Source File: FooOrEmptyOrNullStringSupplier.java From galimatias with MIT License | 5 votes |
@Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) { FooOrEmptyOrNullString annotation = sig.getAnnotation(FooOrEmptyOrNullString.class); String foo = annotation.foo(); List<PotentialAssignment> res = new ArrayList<PotentialAssignment>(); for (final String value : new String[]{ foo, "", null }) { res.add(PotentialAssignment.forValue(value, value)); } return res; }
Example 14
Source File: FooOrNullStringSupplier.java From galimatias with MIT License | 5 votes |
@Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) { FooOrNullString annotation = sig.getAnnotation(FooOrNullString.class); String foo = annotation.foo(); List<PotentialAssignment> res = new ArrayList<PotentialAssignment>(); for (final String value : new String[]{ foo, null }) { res.add(PotentialAssignment.forValue(value, value)); } return res; }
Example 15
Source File: AnyUrlyStringSupplier.java From galimatias with MIT License | 5 votes |
@Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) { AnyUrlyString annotation = sig.getAnnotation(AnyUrlyString.class); List<PotentialAssignment> res = new ArrayList<PotentialAssignment>(); for (final String value : values) { res.add(PotentialAssignment.forValue(value, value)); } return res; }
Example 16
Source File: TestURL.java From galimatias with MIT License | 5 votes |
@Override public List<PotentialAssignment> getValueSources(final ParameterSignature sig) { final TestURLs ref = sig.getAnnotation(TestURLs.class); final String dataset = ref.dataset(); if (!datasetMap.containsKey(dataset)) { datasetMap.put(dataset, TestURLLoader.loadTestURLs(dataset)); } final List<PotentialAssignment> values = new ArrayList<PotentialAssignment>(); for (final TestURL testURL : datasetMap.get(dataset)) { values.add(PotentialAssignment.forValue(testURL.toString(), testURL)); } return values; }