Java 类org.junit.experimental.theories.internal.Assignments 实例源码

项目: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());
    }
}
项目:sosiefier    文件:Theories.java   
@Override
public void evaluate() throws Throwable {
    runWithAssignment(Assignments.allUnassigned(
            fTestMethod.getMethod(), getTestClass()));

    //if this test method is not annotated with Theory, then no successes is a valid case
    boolean hasTheoryAnnotation = fTestMethod.getAnnotation(Theory.class) != null;
    if (successes == 0 && hasTheoryAnnotation) {
        Assert
                .fail("Never found parameters that satisfied method assumptions.  Violated assumptions: "
                        + fInvalidParameters);
    }
}
项目:sosiefier    文件:Theories.java   
protected void runWithAssignment(Assignments parameterAssignment)
        throws Throwable {
    if (!parameterAssignment.isComplete()) {
        runWithIncompleteAssignment(parameterAssignment);
    } else {
        runWithCompleteAssignment(parameterAssignment);
    }
}
项目:sosiefier    文件:Theories.java   
protected void runWithIncompleteAssignment(Assignments incomplete)
        throws Throwable {
    for (PotentialAssignment source : incomplete
            .potentialsForNextUnassigned()) {
        runWithAssignment(incomplete.assignNext(source));
    }
}
项目:sosiefier    文件:Theories.java   
private Statement methodCompletesWithParameters(
        final FrameworkMethod method, final Assignments complete, final Object freshInstance) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            final Object[] values = complete.getMethodArguments();

            if (!nullsOk()) {
                Assume.assumeNotNull(values);
            }

            method.invokeExplosively(freshInstance, values);
        }
    };
}
项目:sosiefier    文件:StubbedTheories.java   
@Override
protected void runWithIncompleteAssignment(Assignments incomplete)
        throws Throwable {
    GuesserQueue guessers = createGuesserQueue(incomplete);
    queues.add(guessers);
    while (!guessers.isEmpty())
        runWithAssignment(incomplete.assignNext(guessers.remove(0)));
    queues.remove(guessers);
}
项目:sosiefier    文件:StubbedTheories.java   
private GuesserQueue createGuesserQueue(Assignments incomplete)
        throws Throwable {
    ParameterSignature nextUnassigned = incomplete.nextUnassigned();

    if (nextUnassigned.hasAnnotation(Stub.class)) {
        GuesserQueue queue = new GuesserQueue();
        queue.add(new Guesser<Object>(nextUnassigned.getType()));
        return queue;
    }

    return GuesserQueue.forSingleValues(incomplete.potentialsForNextUnassigned());
}
项目:lcm    文件:Theories.java   
@Override
public void evaluate() throws Throwable {
    runWithAssignment(Assignments.allUnassigned(
            fTestMethod.getMethod(), getTestClass()));

    if (successes == 0) {
        Assert
                .fail("Never found parameters that satisfied method assumptions.  Violated assumptions: "
                        + fInvalidParameters);
    }
}
项目:lcm    文件:Theories.java   
protected void runWithAssignment(Assignments parameterAssignment)
        throws Throwable {
    if (!parameterAssignment.isComplete()) {
        runWithIncompleteAssignment(parameterAssignment);
    } else {
        runWithCompleteAssignment(parameterAssignment);
    }
}
项目:lcm    文件:Theories.java   
protected void runWithIncompleteAssignment(Assignments incomplete)
        throws InstantiationException, IllegalAccessException,
        Throwable {
    for (PotentialAssignment source : incomplete
            .potentialsForNextUnassigned()) {
        runWithAssignment(incomplete.assignNext(source));
    }
}
项目:lcm    文件:Theories.java   
private Statement methodCompletesWithParameters(
        final FrameworkMethod method, final Assignments complete, final Object freshInstance) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            try {
                final Object[] values = complete.getMethodArguments(
                        nullsOk());
                method.invokeExplosively(freshInstance, values);
            } catch (CouldNotGenerateValueException e) {
                // ignore
            }
        }
    };
}
项目:junit    文件:Theories.java   
@Override
public void evaluate() throws Throwable {
    runWithAssignment(Assignments.allUnassigned(
            fTestMethod.getMethod(), getTestClass()));

    if (successes == 0) {
        Assert
                .fail("Never found parameters that satisfied method assumptions.  Violated assumptions: "
                        + fInvalidParameters);
    }
}
项目:junit    文件:Theories.java   
protected void runWithAssignment(Assignments parameterAssignment)
        throws Throwable {
    if (!parameterAssignment.isComplete()) {
        runWithIncompleteAssignment(parameterAssignment);
    } else {
        runWithCompleteAssignment(parameterAssignment);
    }
}
项目:junit    文件:Theories.java   
protected void runWithIncompleteAssignment(Assignments incomplete)
        throws InstantiationException, IllegalAccessException,
        Throwable {
    for (PotentialAssignment source : incomplete
            .potentialsForNextUnassigned()) {
        runWithAssignment(incomplete.assignNext(source));
    }
}
项目:junit    文件:Theories.java   
private Statement methodCompletesWithParameters(
        final FrameworkMethod method, final Assignments complete, final Object freshInstance) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            try {
                final Object[] values = complete.getMethodArguments(
                        nullsOk());
                method.invokeExplosively(freshInstance, values);
            } catch (CouldNotGenerateValueException e) {
                // ignore
            }
        }
    };
}
项目:junit    文件:StubbedTheories.java   
@Override
protected void runWithIncompleteAssignment(Assignments incomplete)
        throws InstantiationException, IllegalAccessException,
        Throwable {
    GuesserQueue guessers = createGuesserQueue(incomplete);
    queues.add(guessers);
    while (!guessers.isEmpty())
        runWithAssignment(incomplete.assignNext(guessers.remove(0)));
    queues.remove(guessers);
}
项目:junit    文件:StubbedTheories.java   
private GuesserQueue createGuesserQueue(Assignments incomplete)
        throws InstantiationException, IllegalAccessException {
    ParameterSignature nextUnassigned = incomplete.nextUnassigned();

    if (nextUnassigned.hasAnnotation(Stub.class)) {
        GuesserQueue queue = new GuesserQueue();
        queue.add(new Guesser<Object>(nextUnassigned.getType()));
        return queue;
    }

    return GuesserQueue.forSingleValues(incomplete.potentialsForNextUnassigned());
}
项目:org.openntf.domino    文件:Theories.java   
@Override
public void evaluate() throws Throwable {
    runWithAssignment(Assignments.allUnassigned(
            fTestMethod.getMethod(), getTestClass()));

    if (successes == 0) {
        Assert
                .fail("Never found parameters that satisfied method assumptions.  Violated assumptions: "
                        + fInvalidParameters);
    }
}
项目:org.openntf.domino    文件:Theories.java   
protected void runWithAssignment(Assignments parameterAssignment)
        throws Throwable {
    if (!parameterAssignment.isComplete()) {
        runWithIncompleteAssignment(parameterAssignment);
    } else {
        runWithCompleteAssignment(parameterAssignment);
    }
}
项目:org.openntf.domino    文件:Theories.java   
protected void runWithIncompleteAssignment(Assignments incomplete)
        throws InstantiationException, IllegalAccessException,
        Throwable {
    for (PotentialAssignment source : incomplete
            .potentialsForNextUnassigned()) {
        runWithAssignment(incomplete.assignNext(source));
    }
}
项目:org.openntf.domino    文件:Theories.java   
private Statement methodCompletesWithParameters(
        final FrameworkMethod method, final Assignments complete, final Object freshInstance) {
    return new Statement() {
        @Override
        public void evaluate() throws Throwable {
            try {
                final Object[] values = complete.getMethodArguments(
                        nullsOk());
                method.invokeExplosively(freshInstance, values);
            } catch (CouldNotGenerateValueException e) {
                // ignore
            }
        }
    };
}
项目:health-and-care-developer-network    文件:StubbedTheories.java   
@Override
protected void runWithIncompleteAssignment(Assignments incomplete)
        throws InstantiationException, IllegalAccessException,
        Throwable {
    GuesserQueue guessers = createGuesserQueue(incomplete);
    queues.add(guessers);
    while (!guessers.isEmpty())
        runWithAssignment(incomplete.assignNext(guessers.remove(0)));
    queues.remove(guessers);
}
项目:health-and-care-developer-network    文件:StubbedTheories.java   
private GuesserQueue createGuesserQueue(Assignments incomplete)
        throws InstantiationException, IllegalAccessException {
    ParameterSignature nextUnassigned = incomplete.nextUnassigned();

    if (nextUnassigned.hasAnnotation(Stub.class)) {
        GuesserQueue queue = new GuesserQueue();
        queue.add(new Guesser<Object>(nextUnassigned.getType()));
        return queue;
    }

    return GuesserQueue.forSingleValues(incomplete.potentialsForNextUnassigned());
}
项目:sosiefier    文件:TheoryTestUtils.java   
public static List<PotentialAssignment> potentialAssignments(Method method)
        throws Throwable {
    return Assignments.allUnassigned(method,
            new TestClass(method.getDeclaringClass()))
            .potentialsForNextUnassigned();
}
项目:junit    文件:WithDataPointMethod.java   
private List<PotentialAssignment> potentialValues(Method method)
        throws Exception {
    return Assignments.allUnassigned(method,
            new TestClass(HasDateMethod.class))
            .potentialsForNextUnassigned();
}
项目:health-and-care-developer-network    文件:WithDataPointMethod.java   
private List<PotentialAssignment> potentialValues(Method method)
        throws Exception {
    return Assignments.allUnassigned(method,
            new TestClass(HasDateMethod.class))
            .potentialsForNextUnassigned();
}