|
Copyright 2008 - 2010 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<java.math.BigDecimal> |
shrinkBigDecimal
A shrink strategy for big decimals. |
static Shrink<java.math.BigInteger> |
shrinkBigInteger
A shrink strategy for big integers. |
static Shrink<java.util.BitSet> |
shrinkBitSet
A shrink strategy for bit sets. |
static Shrink<java.lang.Boolean> |
shrinkBoolean
A shrink strategy for booleans using false as the bottom of the shrink. |
static Shrink<java.lang.Byte> |
shrinkByte
A shrink strategy for bytes using 0 as the bottom of the shrink. |
static Shrink<java.util.Calendar> |
shrinkCalendar
A shrink strategy for calendars. |
static Shrink<java.lang.Character> |
shrinkCharacter
A shrink strategy for characters using 0 as the bottom of the shrink. |
static Shrink<java.util.Date> |
shrinkDate
A shrink strategy for dates. |
static Shrink<java.lang.Double> |
shrinkDouble
A shrink strategy for doubles using 0 as the bottom of the shrink. |
static Shrink<java.lang.Float> |
shrinkFloat
A shrink strategy for floats using 0 as the bottom of the shrink. |
static Shrink<java.util.GregorianCalendar> |
shrinkGregorianCalendar
A shrink strategy for gregorian calendars. |
static Shrink<java.lang.Integer> |
shrinkInteger
A shrink strategy for integers using 0 as the bottom of the shrink. |
static Shrink<java.lang.Long> |
shrinkLong
A shrink strategy for longs using 0 as the bottom of the shrink. |
static Shrink<java.util.Properties> |
shrinkProperties
A shrink strategy for properties. |
static Shrink<java.lang.Short> |
shrinkShort
A shrink strategy for shorts using 0 as the bottom of the shrink. |
static Shrink<java.sql.Date> |
shrinkSQLDate
A shrink strategy for SQL dates. |
static Shrink<java.lang.String> |
shrinkString
A shrink strategy for strings using the empty string as the bottom of the shrink. |
static Shrink<java.lang.StringBuffer> |
shrinkStringBuffer
A shrink strategy for string buffers using the empty string as the bottom of the shrink. |
static Shrink<java.lang.StringBuilder> |
shrinkStringBuilder
A shrink strategy for string builders using the empty string as the bottom of the shrink. |
static Shrink<java.lang.Throwable> |
shrinkThrowable
A shrink strategy for throwables. |
static Shrink<java.sql.Time> |
shrinkTime
A shrink strategy for SQL times. |
static Shrink<java.sql.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<java.lang.Throwable> |
shrinkThrowable(Shrink<java.lang.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<java.lang.Long> shrinkLong
public static final Shrink<java.lang.Boolean> shrinkBoolean
public static final Shrink<java.lang.Integer> shrinkInteger
public static final Shrink<java.lang.Byte> shrinkByte
public static final Shrink<java.lang.Character> shrinkCharacter
public static final Shrink<java.lang.Short> shrinkShort
public static final Shrink<java.lang.Float> shrinkFloat
public static final Shrink<java.lang.Double> shrinkDouble
public static final Shrink<java.lang.String> shrinkString
public static final Shrink<java.lang.StringBuffer> shrinkStringBuffer
public static final Shrink<java.lang.StringBuilder> shrinkStringBuilder
public static final Shrink<java.lang.Throwable> shrinkThrowable
public static final Shrink<java.util.BitSet> shrinkBitSet
public static final Shrink<java.util.Calendar> shrinkCalendar
public static final Shrink<java.util.Date> shrinkDate
public static final Shrink<java.util.GregorianCalendar> shrinkGregorianCalendar
public static final Shrink<java.util.Properties> shrinkProperties
public static final Shrink<java.sql.Date> shrinkSQLDate
public static final Shrink<java.sql.Time> shrinkTime
public static final Shrink<java.sql.Timestamp> shrinkTimestamp
public static final Shrink<java.math.BigInteger> shrinkBigInteger
public static final Shrink<java.math.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<java.lang.Throwable> shrinkThrowable(Shrink<java.lang.String> ss)
ss - A shrink strategy for throwable messages.
public static <A> Shrink<java.util.ArrayList<A>> shrinkArrayList(Shrink<A> sa)
sa - The shrink strategy for the elements of the array list.
public static <K extends java.lang.Enum<K>,V> Shrink<java.util.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 java.lang.Enum<A>> Shrink<java.util.EnumSet<A>> shrinkEnumSet(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <K,V> Shrink<java.util.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<java.util.HashSet<A>> shrinkHashSet(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <K,V> Shrink<java.util.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<java.util.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<java.util.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<java.util.LinkedHashSet<A>> shrinkLinkedHashSet(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.LinkedList<A>> shrinkLinkedList(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.PriorityQueue<A>> shrinkPriorityQueue(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.Stack<A>> shrinkStack(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <K,V> Shrink<java.util.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<java.util.TreeSet<A>> shrinkTreeSet(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.Vector<A>> shrinkVector(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <K,V> Shrink<java.util.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<java.util.concurrent.ArrayBlockingQueue<A>> shrinkArrayBlockingQueue(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <K,V> Shrink<java.util.concurrent.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<java.util.concurrent.ConcurrentLinkedQueue<A>> shrinkConcurrentLinkedQueue(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.concurrent.CopyOnWriteArrayList<A>> shrinkCopyOnWriteArrayList(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.concurrent.CopyOnWriteArraySet<A>> shrinkCopyOnWriteArraySet(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A extends java.util.concurrent.Delayed> Shrink<java.util.concurrent.DelayQueue<A>> shrinkDelayQueue(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.concurrent.LinkedBlockingQueue<A>> shrinkLinkedBlockingQueue(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.concurrent.PriorityBlockingQueue<A>> shrinkPriorityBlockingQueue(Shrink<A> sa)
sa - The shrink strategy for the elements.
public static <A> Shrink<java.util.concurrent.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 - 2010 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 | ||||||||