本文整理汇总了Java中org.junit.experimental.theories.internal.Assignments类的典型用法代码示例。如果您正苦于以下问题:Java Assignments类的具体用法?Java Assignments怎么用?Java Assignments使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Assignments类属于org.junit.experimental.theories.internal包,在下文中一共展示了Assignments类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runWithIncompleteAssignment
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
@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());
}
}
示例2: evaluate
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
@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);
}
}
示例3: runWithAssignment
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
protected void runWithAssignment(Assignments parameterAssignment)
throws Throwable {
if (!parameterAssignment.isComplete()) {
runWithIncompleteAssignment(parameterAssignment);
} else {
runWithCompleteAssignment(parameterAssignment);
}
}
示例4: runWithIncompleteAssignment
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
protected void runWithIncompleteAssignment(Assignments incomplete)
throws Throwable {
for (PotentialAssignment source : incomplete
.potentialsForNextUnassigned()) {
runWithAssignment(incomplete.assignNext(source));
}
}
示例5: methodCompletesWithParameters
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
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);
}
};
}
示例6: runWithIncompleteAssignment
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
@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);
}
示例7: createGuesserQueue
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
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());
}
示例8: evaluate
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
@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);
}
}
示例9: runWithIncompleteAssignment
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
protected void runWithIncompleteAssignment(Assignments incomplete)
throws InstantiationException, IllegalAccessException,
Throwable {
for (PotentialAssignment source : incomplete
.potentialsForNextUnassigned()) {
runWithAssignment(incomplete.assignNext(source));
}
}
示例10: methodCompletesWithParameters
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
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
}
}
};
}
示例11: runWithIncompleteAssignment
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
@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);
}
示例12: createGuesserQueue
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
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());
}
示例13: potentialAssignments
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
public static List<PotentialAssignment> potentialAssignments(Method method)
throws Throwable {
return Assignments.allUnassigned(method,
new TestClass(method.getDeclaringClass()))
.potentialsForNextUnassigned();
}
示例14: potentialValues
import org.junit.experimental.theories.internal.Assignments; //导入依赖的package包/类
private List<PotentialAssignment> potentialValues(Method method)
throws Exception {
return Assignments.allUnassigned(method,
new TestClass(HasDateMethod.class))
.potentialsForNextUnassigned();
}