|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfj.test.Shrink<A>
public final class Shrink<A>
Represents a shrinking strategy over the given type parameter if that type can be represented as a tree structure. This is used in falsification to produce the smallest counter-example, rather than the first counter-example.
Field Summary | |
---|---|
static Shrink<BigDecimal> |
shrinkBigDecimal
A shrink strategy for big decimals. |
static Shrink<BigInteger> |
shrinkBigInteger
A shrink strategy for big integers. |
static Shrink<BitSet> |
shrinkBitSet
A shrink strategy for bit sets. |
static Shrink<Boolean> |
shrinkBoolean
A shrink strategy for booleans using false as the bottom of the shrink. |
static Shrink<Byte> |
shrinkByte
A shrink strategy for bytes using 0 as the bottom of the shrink. |
static Shrink<Calendar> |
shrinkCalendar
A shrink strategy for calendars. |
static Shrink<Character> |
shrinkCharacter
A shrink strategy for characters using 0 as the bottom of the shrink. |
static Shrink<Date> |
shrinkDate
A shrink strategy for dates. |
static Shrink<Double> |
shrinkDouble
A shrink strategy for doubles using 0 as the bottom of the shrink. |
static Shrink<Float> |
shrinkFloat
A shrink strategy for floats using 0 as the bottom of the shrink. |
static Shrink<GregorianCalendar> |
shrinkGregorianCalendar
A shrink strategy for gregorian calendars. |
static Shrink<Integer> |
shrinkInteger
A shrink strategy for integers using 0 as the bottom of the shrink. |
static Shrink<Long> |
shrinkLong
A shrink strategy for longs using 0 as the bottom of the shrink. |
static Shrink<Properties> |
shrinkProperties
A shrink strategy for properties. |
static Shrink<Short> |
shrinkShort
A shrink strategy for shorts using 0 as the bottom of the shrink. |
static Shrink<Date> |
shrinkSQLDate
A shrink strategy for SQL dates. |
static Shrink<String> |
shrinkString
A shrink strategy for strings using the empty string as the bottom of the shrink. |
static Shrink<StringBuffer> |
shrinkStringBuffer
A shrink strategy for string buffers using the empty string as the bottom of the shrink. |
static Shrink<StringBuilder> |
shrinkStringBuilder
A shrink strategy for string builders using the empty string as the bottom of the shrink. |
static Shrink<Throwable> |
shrinkThrowable
A shrink strategy for throwables. |
static Shrink<Time> |
shrinkTime
A shrink strategy for SQL times. |
static Shrink<Timestamp> |
shrinkTimestamp
A shrink strategy for SQL timestamps. |
Method Summary | ||
---|---|---|
static
|
empty()
Returns a shrink strategy that cannot be reduced further. |
|
|
map(F<A,B> f,
F<B,A> g)
Creates a shrink from this shrink and the given symmetric transformations. |
|
Stream<A> |
shrink(A a)
Returns a shrink of the given argument. |
|
static
|
shrink(F<A,Stream<A>> f)
Constructs a shrink strategy from the given function that produces a tree of values given a value. |
|
static
|
shrinkArray(Shrink<A> sa)
Returns a shrink strategy for arrays. |
|
static
|
shrinkArrayBlockingQueue(Shrink<A> sa)
A shrink strategy for array blocking queues. |
|
static
|
shrinkArrayList(Shrink<A> sa)
Returns a shrink strategy for array lists. |
|
static
|
shrinkConcurrentHashMap(Shrink<K> sk,
Shrink<V> sv)
A shrink strategy for concurrent hash maps. |
|
static
|
shrinkConcurrentLinkedQueue(Shrink<A> sa)
A shrink strategy for concurrent linked queues. |
|
static
|
shrinkCopyOnWriteArrayList(Shrink<A> sa)
A shrink strategy for copy on write array lists. |
|
static
|
shrinkCopyOnWriteArraySet(Shrink<A> sa)
A shrink strategy for copy on write array sets. |
|
static
|
shrinkDelayQueue(Shrink<A> sa)
A shrink strategy for delay queues. |
|
static
|
shrinkEither(Shrink<A> sa,
Shrink<B> sb)
Returns a shrink strategy for either values. |
|
static
|
shrinkEnumMap(Shrink<K> sk,
Shrink<V> sv)
A shrink strategy for enum maps. |
|
static
|
shrinkEnumSet(Shrink<A> sa)
A shrink strategy for enum sets. |
|
static
|
shrinkHashMap(Shrink<K> sk,
Shrink<V> sv)
A shrink strategy for hash maps. |
|
static
|
shrinkHashSet(Shrink<A> sa)
A shrink strategy for hash sets. |
|
static
|
shrinkHashtable(Shrink<K> sk,
Shrink<V> sv)
A shrink strategy for hash tables. |
|
static
|
shrinkIdentityHashMap(Shrink<K> sk,
Shrink<V> sv)
A shrink strategy for identity hash maps. |
|
static
|
shrinkLinkedBlockingQueue(Shrink<A> sa)
A shrink strategy for linked blocking queues. |
|
static
|
shrinkLinkedHashMap(Shrink<K> sk,
Shrink<V> sv)
A shrink strategy for linked hash maps. |
|
static
|
shrinkLinkedHashSet(Shrink<A> sa)
A shrink strategy for linked hash sets. |
|
static
|
shrinkLinkedList(Shrink<A> sa)
A shrink strategy for linked lists. |
|
static
|
shrinkList(Shrink<A> sa)
Returns a shrink strategy for lists. |
|
static
|
shrinkOption(Shrink<A> sa)
Returns a shrink strategy for optional values. |
|
static
|
shrinkP1(Shrink<A> sa)
Returns a shrinking strategy for product-1 values. |
|
static
|
shrinkP2(Shrink<A> sa,
Shrink<B> sb)
Returns a shrinking strategy for product-2 values. |
|
static
|
shrinkP3(Shrink<A> sa,
Shrink<B> sb,
Shrink<C> sc)
Returns a shrinking strategy for product-3 values. |
|
static
|
shrinkP4(Shrink<A> sa,
Shrink<B> sb,
Shrink<C> sc,
Shrink<D> sd)
Returns a shrinking strategy for product-4 values. |
|
static
|
shrinkP5(Shrink<A> sa,
Shrink<B> sb,
Shrink<C> sc,
Shrink<D> sd,
Shrink<E> se)
Returns a shrinking strategy for product-5 values. |
|
static
|
shrinkP6(Shrink<A> sa,
Shrink<B> sb,
Shrink<C> sc,
Shrink<D> sd,
Shrink<E> se,
Shrink<F$> sf)
Returns a shrinking strategy for product-6 values. |
|
static
|
shrinkP7(Shrink<A> sa,
Shrink<B> sb,
Shrink<C> sc,
Shrink<D> sd,
Shrink<E> se,
Shrink<F$> sf,
Shrink<G> sg)
Returns a shrinking strategy for product-7 values. |
|
static
|
shrinkP8(Shrink<A> sa,
Shrink<B> sb,
Shrink<C> sc,
Shrink<D> sd,
Shrink<E> se,
Shrink<F$> sf,
Shrink<G> sg,
Shrink<H> sh)
Returns a shrinking strategy for product-8 values. |
|
static
|
shrinkPriorityBlockingQueue(Shrink<A> sa)
A shrink strategy for priority blocking queues. |
|
static
|
shrinkPriorityQueue(Shrink<A> sa)
A shrink strategy for priority queues. |
|
static
|
shrinkStack(Shrink<A> sa)
A shrink strategy for stacks. |
|
static
|
shrinkStream(Shrink<A> sa)
Returns a shrink strategy for streams. |
|
static
|
shrinkSynchronousQueue(Shrink<A> sa)
A shrink strategy for synchronous queues. |
|
static Shrink<Throwable> |
shrinkThrowable(Shrink<String> ss)
A shrink strategy for throwables. |
|
static
|
shrinkTreeMap(Shrink<K> sk,
Shrink<V> sv)
A shrink strategy for tree maps. |
|
static
|
shrinkTreeSet(Shrink<A> sa)
A shrink strategy for tree sets. |
|
static
|
shrinkVector(Shrink<A> sa)
A shrink strategy for vectors. |
|
static
|
shrinkWeakHashMap(Shrink<K> sk,
Shrink<V> sv)
A shrink strategy for weak hash maps. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Shrink<Long> shrinkLong
public static final Shrink<Boolean> shrinkBoolean
public static final Shrink<Integer> shrinkInteger
public static final Shrink<Byte> shrinkByte
public static final Shrink<Character> shrinkCharacter
public static final Shrink<Short> shrinkShort
public static final Shrink<Float> shrinkFloat
public static final Shrink<Double> shrinkDouble
public static final Shrink<String> shrinkString
public static final Shrink<StringBuffer> shrinkStringBuffer
public static final Shrink<StringBuilder> shrinkStringBuilder
public static final Shrink<Throwable> shrinkThrowable
public static final Shrink<BitSet> shrinkBitSet
public static final Shrink<Calendar> shrinkCalendar
public static final Shrink<Date> shrinkDate
public static final Shrink<GregorianCalendar> shrinkGregorianCalendar
public static final Shrink<Properties> shrinkProperties
public static final Shrink<Date> shrinkSQLDate
public static final Shrink<Time> shrinkTime
public static final Shrink<Timestamp> shrinkTimestamp
public static final Shrink<BigInteger> shrinkBigInteger
public static final Shrink<BigDecimal> shrinkBigDecimal
Method Detail |
---|
public Stream<A> shrink(A a)
a
- The argument to shrink.
public <B> Shrink<B> map(F<A,B> f, F<B,A> g)
f
- A transformation from this shrink type to the new shrink type.g
- A transformation from the new shrink type to this shrink type.
public static <A> Shrink<A> shrink(F<A,Stream<A>> f)
f
- A function that produces a tree of values given a value.
public static <A> Shrink<A> empty()
public static <A> Shrink<Option<A>> shrinkOption(Shrink<A> sa)
sa
- The shrink strategy for the potential value.
public static <A,B> Shrink<Either<A,B>> shrinkEither(Shrink<A> sa, Shrink<B> sb)
sa
- The shrinking strategy for left values.sb
- The shrinking strategy for right values.
public static <A> Shrink<List<A>> shrinkList(Shrink<A> sa)
sa
- The shrink strategy for the elements of the list.
public static <A> Shrink<Array<A>> shrinkArray(Shrink<A> sa)
sa
- The shrink strategy for the elements of the array.
public static <A> Shrink<Stream<A>> shrinkStream(Shrink<A> sa)
sa
- The shrink strategy for the elements of the stream.
public static Shrink<Throwable> shrinkThrowable(Shrink<String> ss)
ss
- A shrink strategy for throwable messages.
public static <A> Shrink<ArrayList<A>> shrinkArrayList(Shrink<A> sa)
sa
- The shrink strategy for the elements of the array list.
public static <K extends Enum<K>,V> Shrink<EnumMap<K,V>> shrinkEnumMap(Shrink<K> sk, Shrink<V> sv)
sk
- The shrink strategy for keys.sv
- The shrink stratgey for values.
public static <A extends Enum<A>> Shrink<EnumSet<A>> shrinkEnumSet(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <K,V> Shrink<HashMap<K,V>> shrinkHashMap(Shrink<K> sk, Shrink<V> sv)
sk
- The shrink strategy for keys.sv
- The shrink stratgey for values.
public static <A> Shrink<HashSet<A>> shrinkHashSet(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <K,V> Shrink<Hashtable<K,V>> shrinkHashtable(Shrink<K> sk, Shrink<V> sv)
sk
- The shrink strategy for keys.sv
- The shrink stratgey for values.
public static <K,V> Shrink<IdentityHashMap<K,V>> shrinkIdentityHashMap(Shrink<K> sk, Shrink<V> sv)
sk
- The shrink strategy for keys.sv
- The shrink stratgey for values.
public static <K,V> Shrink<LinkedHashMap<K,V>> shrinkLinkedHashMap(Shrink<K> sk, Shrink<V> sv)
sk
- The shrink strategy for keys.sv
- The shrink stratgey for values.
public static <A> Shrink<LinkedHashSet<A>> shrinkLinkedHashSet(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<LinkedList<A>> shrinkLinkedList(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<PriorityQueue<A>> shrinkPriorityQueue(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<Stack<A>> shrinkStack(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <K,V> Shrink<TreeMap<K,V>> shrinkTreeMap(Shrink<K> sk, Shrink<V> sv)
sk
- The shrink strategy for keys.sv
- The shrink stratgey for values.
public static <A> Shrink<TreeSet<A>> shrinkTreeSet(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<Vector<A>> shrinkVector(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <K,V> Shrink<WeakHashMap<K,V>> shrinkWeakHashMap(Shrink<K> sk, Shrink<V> sv)
sk
- The shrink strategy for keys.sv
- The shrink stratgey for values.
public static <A> Shrink<ArrayBlockingQueue<A>> shrinkArrayBlockingQueue(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <K,V> Shrink<ConcurrentHashMap<K,V>> shrinkConcurrentHashMap(Shrink<K> sk, Shrink<V> sv)
sk
- The shrink strategy for keys.sv
- The shrink stratgey for values.
public static <A> Shrink<ConcurrentLinkedQueue<A>> shrinkConcurrentLinkedQueue(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<CopyOnWriteArrayList<A>> shrinkCopyOnWriteArrayList(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<CopyOnWriteArraySet<A>> shrinkCopyOnWriteArraySet(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A extends Delayed> Shrink<DelayQueue<A>> shrinkDelayQueue(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<LinkedBlockingQueue<A>> shrinkLinkedBlockingQueue(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<PriorityBlockingQueue<A>> shrinkPriorityBlockingQueue(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<SynchronousQueue<A>> shrinkSynchronousQueue(Shrink<A> sa)
sa
- The shrink strategy for the elements.
public static <A> Shrink<P1<A>> shrinkP1(Shrink<A> sa)
sa
- The shrinking strategy for the values.
public static <A,B> Shrink<P2<A,B>> shrinkP2(Shrink<A> sa, Shrink<B> sb)
sa
- The shrinking strategy for the values.sb
- The shrinking strategy for the values.
public static <A,B,C> Shrink<P3<A,B,C>> shrinkP3(Shrink<A> sa, Shrink<B> sb, Shrink<C> sc)
sa
- The shrinking strategy for the values.sb
- The shrinking strategy for the values.sc
- The shrinking strategy for the values.
public static <A,B,C,D> Shrink<P4<A,B,C,D>> shrinkP4(Shrink<A> sa, Shrink<B> sb, Shrink<C> sc, Shrink<D> sd)
sa
- The shrinking strategy for the values.sb
- The shrinking strategy for the values.sc
- The shrinking strategy for the values.sd
- The shrinking strategy for the values.
public static <A,B,C,D,E> Shrink<P5<A,B,C,D,E>> shrinkP5(Shrink<A> sa, Shrink<B> sb, Shrink<C> sc, Shrink<D> sd, Shrink<E> se)
sa
- The shrinking strategy for the values.sb
- The shrinking strategy for the values.sc
- The shrinking strategy for the values.sd
- The shrinking strategy for the values.se
- The shrinking strategy for the values.
public static <A,B,C,D,E,F$> Shrink<P6<A,B,C,D,E,F$>> shrinkP6(Shrink<A> sa, Shrink<B> sb, Shrink<C> sc, Shrink<D> sd, Shrink<E> se, Shrink<F$> sf)
sa
- The shrinking strategy for the values.sb
- The shrinking strategy for the values.sc
- The shrinking strategy for the values.sd
- The shrinking strategy for the values.se
- The shrinking strategy for the values.sf
- The shrinking strategy for the values.
public static <A,B,C,D,E,F$,G> Shrink<P7<A,B,C,D,E,F$,G>> shrinkP7(Shrink<A> sa, Shrink<B> sb, Shrink<C> sc, Shrink<D> sd, Shrink<E> se, Shrink<F$> sf, Shrink<G> sg)
sa
- The shrinking strategy for the values.sb
- The shrinking strategy for the values.sc
- The shrinking strategy for the values.sd
- The shrinking strategy for the values.se
- The shrinking strategy for the values.sf
- The shrinking strategy for the values.sg
- The shrinking strategy for the values.
public static <A,B,C,D,E,F$,G,H> Shrink<P8<A,B,C,D,E,F$,G,H>> shrinkP8(Shrink<A> sa, Shrink<B> sb, Shrink<C> sc, Shrink<D> sd, Shrink<E> se, Shrink<F$> sf, Shrink<G> sg, Shrink<H> sh)
sa
- The shrinking strategy for the values.sb
- The shrinking strategy for the values.sc
- The shrinking strategy for the values.sd
- The shrinking strategy for the values.se
- The shrinking strategy for the values.sf
- The shrinking strategy for the values.sg
- The shrinking strategy for the values.sh
- The shrinking strategy for the values.
|
Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg This software is released under an open source BSD licence. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |