org.junit.experimental.theories.PotentialAssignment源码实例Demo

类org.junit.experimental.theories.PotentialAssignment源码实例Demo

下面列出了org.junit.experimental.theories.PotentialAssignment 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: latexdraw   文件: DoubleSupplier.java
@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());
}
 
源代码2 项目: latexdraw   文件: TestPositionShapeBase.java
@Override
public List<PotentialAssignment> getValueSources(final ParameterSignature sig) {
	return Stream.of(ShapeFactory.INST.createEllipse(),
		ShapeFactory.INST.createCircleArc(),
		ShapeFactory.INST.createGrid(ShapeFactory.INST.createPoint()),
		ShapeFactory.INST.createCircle(),
		ShapeFactory.INST.createRectangle(),
		ShapeFactory.INST.createText(),
		ShapeFactory.INST.createDot(ShapeFactory.INST.createPoint()),
		ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint()),
		ShapeFactory.INST.createSquare(),
		ShapeFactory.INST.createPlot(ShapeFactory.INST.createPoint(), 0d, 10d, "x", false),
		ShapeFactory.INST.createRhombus(),
		ShapeFactory.INST.createTriangle(),
		ShapeFactory.INST.createPicture(ShapeFactory.INST.createPoint())).
		map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList());
}
 
源代码3 项目: spliceengine   文件: ParallelTheoryRunner.java
@Override
protected void runWithIncompleteAssignment(Assignments incomplete) throws Throwable{
    for(PotentialAssignment source:incomplete.potentialsForNextUnassigned()){
        final Assignments nextAssignment = incomplete.assignNext(source);
        ForkJoinTask<?> run = new RecursiveAction(){
            @Override
            protected void compute(){
                try{
                    ParallelTheoryAnchor.this.runWithAssignment(nextAssignment);
                }catch(Throwable t){
                    throw new RuntimeException(t);
                }
            }
        };
        runs.addFirst(run.fork());
    }
}
 
源代码4 项目: bowman   文件: RestOperationsFactoryTest.java
@Override
public List<PotentialAssignment> getValueSources(ParameterSignature sig) {
	return asList(
		PotentialAssignment.forValue(
			"deserializerInstance",
			new HandlerInstantiatorTestParams(DummyJsonDeserializer.class,
				(instantiator, clazz) -> instantiator.deserializerInstance(null, null, clazz))
		),
		
		PotentialAssignment.forValue(
			"keyDeserializerInstance",
			new HandlerInstantiatorTestParams(DummyKeyDeserializer.class,
				(instantiator, clazz) -> instantiator.keyDeserializerInstance(null, null, clazz))
		),
		
		PotentialAssignment.forValue(
			"serializerInstance",
			new HandlerInstantiatorTestParams(DummySerializer.class,
				(instantiator, clazz) -> instantiator.serializerInstance(null, null, clazz))
		),
		
		PotentialAssignment.forValue(
			"typeResolverBuilderInstance",
			new HandlerInstantiatorTestParams(DummyTypeResolverBuilder.class,
				(instantiator, clazz) -> instantiator.typeResolverBuilderInstance(null, null, clazz))
		),
		
		PotentialAssignment.forValue(
			"typeIdResolverInstance",
			new HandlerInstantiatorTestParams(DummyTypeIdResolver.class,
				(instantiator, clazz) -> instantiator.typeIdResolverInstance(null, null, clazz))
		)
	);
}
 
@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;
}
 
源代码6 项目: galimatias   文件: FooOrNullStringSupplier.java
@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;
}
 
源代码7 项目: galimatias   文件: AnyUrlyStringSupplier.java
@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;
}
 
源代码8 项目: galimatias   文件: AnyNameValueSupplier.java
@Override
public List<PotentialAssignment> getValueSources(ParameterSignature sig) {
    List<PotentialAssignment> res = new ArrayList<PotentialAssignment>();
    for (final String name : values) {
        for (final String value : values) {
            final NameValue nameValue = new NameValue(name, value);
            res.add(PotentialAssignment.forValue(nameValue.toString(), nameValue));
        }
    }
    return res;
}
 
源代码9 项目: galimatias   文件: TestURL.java
@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;
}
 
源代码10 项目: latexdraw   文件: ShapeSupplier.java
@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());
}
 
源代码11 项目: latexdraw   文件: LineArcSupplier.java
@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());
}
 
源代码12 项目: latexdraw   文件: ArcSupplier.java
@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());
}
 
源代码13 项目: latexdraw   文件: StdGridSupplier.java
@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());
}
 
源代码14 项目: latexdraw   文件: ArrowableSupplier.java
@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());
}
 
源代码15 项目: latexdraw   文件: StringSupplier.java
@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());
}
 
源代码16 项目: latexdraw   文件: TestControlPointShapeBase.java
@Override
public List<PotentialAssignment> getValueSources(final ParameterSignature sig) {
	return Stream.of(ShapeFactory.INST.createBezierCurve(Arrays.asList(
		ShapeFactory.INST.createPoint(10d, 20d),
		ShapeFactory.INST.createPoint(30d, 40d)))).
		map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList());
}
 
源代码17 项目: latexdraw   文件: TestModifiablePointsShapeBase.java
@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());
}
 
源代码18 项目: usergrid   文件: InvalidIdGenerator.java
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
    final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();

    result.add( PotentialAssignment.forValue( "nullId", null ) );
    result.add( PotentialAssignment.forValue( "nullEntityId", nullEntityId() ) );
    result.add( PotentialAssignment.forValue( "nullEntityType", nullEntityType() ) );

    return result;
}
 
源代码19 项目: usergrid   文件: InvalidIdGenerator.java
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {

    final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
    result.add( PotentialAssignment.forValue( "wrongEntityTypeLength", wrongEntityTypeLength() ) );

    return result;
}
 
源代码20 项目: usergrid   文件: InvalidEntityGenerator.java
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {

    final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();

    final Entity entity = mock( Entity.class );
    when( entity.getId() ).thenReturn( null );
    when( entity.getVersion() ).thenReturn( null );

    result.add( PotentialAssignment.forValue( "nullEntity", null ) );
    result.add( PotentialAssignment.forValue( "nullIdsEntity", entity ) );

    return result;
}
 
源代码21 项目: usergrid   文件: InvalidMvccEntityGenerator.java
@Override
public List<PotentialAssignment> getValueSources( final ParameterSignature sig ) {
    final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();

    result.add( PotentialAssignment.forValue( "wrongUuidType", wrongUuidType() ) );
    result.add( PotentialAssignment.forValue( "invalidSubTypes", invalidId() ) );

    return result;
}
 
@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;
}
 
源代码23 项目: galimatias   文件: FooOrNullStringSupplier.java
@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;
}
 
源代码24 项目: galimatias   文件: AnyUrlyStringSupplier.java
@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;
}
 
源代码25 项目: galimatias   文件: AnyNameValueSupplier.java
@Override
public List<PotentialAssignment> getValueSources(ParameterSignature sig) {
    List<PotentialAssignment> res = new ArrayList<PotentialAssignment>();
    for (final String name : values) {
        for (final String value : values) {
            final NameValue nameValue = new NameValue(name, value);
            res.add(PotentialAssignment.forValue(nameValue.toString(), nameValue));
        }
    }
    return res;
}
 
源代码26 项目: galimatias   文件: TestURL.java
@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;
}
 
源代码27 项目: latexdraw   文件: RectangularSupplier.java
@Override
public List<PotentialAssignment> getValueSources(final ParameterSignature sig) {
	return Stream.of(ShapeFactory.INST.createRectangle(), ShapeFactory.INST.createEllipse(), ShapeFactory.INST.createRhombus(),
		ShapeFactory.INST.createTriangle())
		.map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList());
}
 
源代码28 项目: latexdraw   文件: CircleSupplier.java
@Override
public List<PotentialAssignment> getValueSources(final ParameterSignature sig) {
	return Stream.of(ShapeFactory.INST.createCircle()).map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList());
}
 
源代码29 项目: latexdraw   文件: EllSupplier.java
@Override
public List<PotentialAssignment> getValueSources(final ParameterSignature sig) {
	return Stream.of(ShapeFactory.INST.createEllipse()).map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList());
}
 
源代码30 项目: latexdraw   文件: TestSetShapesBase.java
@Override
public List<PotentialAssignment> getValueSources(final ParameterSignature sig) {
	return Stream.of(ShapeFactory.INST.createDrawing(),
		ShapeFactory.INST.createGroup()).map(r -> PotentialAssignment.forValue("", r)).collect(Collectors.toList());
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法