Package jsonvalues.gen
Class TestProperty
- java.lang.Object
-
- jsonvalues.gen.TestProperty
-
public class TestProperty extends java.lang.Object
provides different methods to test properties described as predicates. By default, if not specified the times parameter, every property is tested against 1000 generated values. The seed of the generation is generated if not provided. I recommend you generate the seed before the test and printing it out in case of failure.
-
-
Constructor Summary
Constructors Constructor Description TestProperty()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <O extends JsValue>
voidtest(JsGen<O> gen, java.util.function.Predicate<O> condition, int times, java.util.function.Consumer<O> errorConsumer)
static <O extends JsValue>
voidtest(JsGen<O> gen, java.util.function.Predicate<O> condition, int times, java.util.function.Consumer<O> errorConsumer, java.util.Random random)
static <O extends JsValue>
voidtest(JsGen<O> gen, java.util.function.Predicate<O> condition, java.util.function.Consumer<O> errorConsumer)
static <O extends JsValue>
voidtest(JsGen<O> gen, java.util.function.Predicate<O> condition, java.util.function.Consumer<O> errorConsumer, java.util.Random random)
-
-
-
Method Detail
-
test
public static <O extends JsValue> void test(JsGen<O> gen, java.util.function.Predicate<O> condition, java.util.function.Consumer<O> errorConsumer)
- Type Parameters:
O
- the type of the generated and tested value- Parameters:
gen
- generator to produce randomized input datacondition
- the property to be testederrorConsumer
- consumer that takes the value that made the test fail
-
test
public static <O extends JsValue> void test(JsGen<O> gen, java.util.function.Predicate<O> condition, int times, java.util.function.Consumer<O> errorConsumer)
- Type Parameters:
O
- the type of the generated and tested value- Parameters:
gen
- generator to produce randomized input datacondition
- the property to be testedtimes
- number of times an input is produced and tested on the propertyerrorConsumer
- consumer that takes the value that made the test fail
-
test
public static <O extends JsValue> void test(JsGen<O> gen, java.util.function.Predicate<O> condition, int times, java.util.function.Consumer<O> errorConsumer, java.util.Random random)
- Type Parameters:
O
- the type of the generated and tested value- Parameters:
gen
- generator to produce randomized input datacondition
- the property to be testedtimes
- number of times an input is produced and tested on the propertyerrorConsumer
- consumer that takes the value that made the test failrandom
- the initial seed
-
test
public static <O extends JsValue> void test(JsGen<O> gen, java.util.function.Predicate<O> condition, java.util.function.Consumer<O> errorConsumer, java.util.Random random)
- Type Parameters:
O
- the type of the generated and tested value- Parameters:
gen
- generator to produce randomized input datacondition
- the property to be testederrorConsumer
- consumer that takes the value that made the test failrandom
- the initial seed
-
-