public class TestConfigFcns extends Object
| Constructor and Description |
|---|
TestConfigFcns() |
| Modifier and Type | Method and Description |
|---|---|
static String |
duplicate(String val,
int n)
Duplicates a value n times and returns it as a list.
|
static String |
duplicate(String val,
int n,
boolean useComma)
Same as {@link #duplicate(String,int) but comma-separates the values if
asked.
|
static String |
duplicateEnforced(String val,
String enforced,
int n)
Duplicates a value n times and returns it as a list, complaining if it
is not the enforced value.
|
static String |
duplicateString(String val,
int n,
boolean useComma)
Same as
duplicate(String,int,boolean) but puts each value in a
quoted string. |
static String |
generateDoubleSuffixedFixedNames(String prefix,
int n,
int m)
Generates a list of strings with the specified prefix and suffixed x_y,
where x is fixed and y varies 1,...,m.
|
static String |
generateDoubleSuffixedFixedNames(String prefix,
int n,
int m,
boolean useComma)
Same as
generateDoubleSuffixedNames(String,int,int,boolean)
but comma-separates the names if asked. |
static String |
generateDoubleSuffixedNames(String prefix,
int n,
int m,
boolean varyFirst)
Generates a list of strings with the specified prefix and suffixed x_y,
where x varies 1,...,n and y varies 1,...,m, and x varies first if
varyFirst is true, else y.
|
static String |
generateDoubleSuffixedNames(String prefix,
int n,
int m,
boolean varyFirst,
boolean useComma)
Same as
generateDoubleSuffixedNames(String,int,int,boolean)
but comma-separates the names if asked. |
static String |
generateDoubleSuffixedRunsOfNames(String prefix,
int n,
int m,
boolean varyFirst)
Same as
generateDoubleSuffixedNames(String,int,int,boolean)
but comma-separates each run of names. |
static String |
generateNameListsRepeatedlyShift(String prefix,
int n,
int m)
Generates comma-separated lists of strings where each list occurs m times
and the i'th unique list contains n-1 entries formed by suffixing the
specified prefix from i+1 to i-1.
|
static String |
generateNames(String prefix,
int n)
Generates a list of strings with the specified prefix and suffixed 1,...,n.
|
static String |
generateNames(String prefix,
int n,
boolean useComma)
Same as
generateNames(String,int) but comma-separates the names
if asked. |
static String |
generateNames(String prefix,
int n,
int m)
Generates a list of strings with the specified prefix and suffixed
m,...,m+n-1.
|
static String |
generateNames(String prefix,
int n,
int m,
boolean useComma)
Same as
generateNames(String,int,int) but comma-separates the
names if asked. |
static String |
generateNames(String prefix,
String n,
boolean useComma)
Generates a list of strings with the specified prefix and suffixed 1,...,n.
|
static String |
generateNamesRepeatedly(String prefix,
int n,
int m,
boolean varyFirst)
Generates a list of strings with the specified prefix and suffixed 1,...,n
with each suffix occurring m times.
|
static String |
generateNamesRepeatedlyShift(String prefix,
int n,
int m,
boolean varyFirst,
boolean useComma)
Generates a list of strings with the specified prefix and suffixed
2,...,n, 1, with each suffix occurring m times.
|
static String |
generateNamesString(String prefix,
int n,
boolean useComma)
Same as
generateNames(String,int,boolean) but puts each value in a
quoted string. |
static String |
oneof(String arg0,
String arg1)
Returns a random choice from the supplied arguments.
|
static String |
oneof(String arg0,
String arg1,
String arg2)
Returns a random choice from the supplied arguments.
|
static String |
pool(String list,
int n)
Duplicates a list until n values are created, and returns it as a list.
|
static String |
poolList(String listOfLists,
int n)
Duplicates a list of lists until n values are created from each list, and
returns it as a list.
|
static String |
poolList(String listOfLists,
int n,
int m)
Duplicates a list of lists until n values are created from each list,
for a total of m pools, and returns it as a list.
|
static String |
poolListOfLists(String listOfLists,
int n)
Duplicates a list of lists until n lists are created, and returns it as a
list of lists.
|
public static String generateNames(String prefix, int n)
public static String generateNames(String prefix, String n, boolean useComma)
public static String generateNames(String prefix, int n, boolean useComma)
generateNames(String,int) but comma-separates the names
if asked.public static String generateNamesString(String prefix, int n, boolean useComma)
generateNames(String,int,boolean) but puts each value in a
quoted string.public static String generateNames(String prefix, int n, int m)
public static String generateNames(String prefix, int n, int m, boolean useComma)
generateNames(String,int,int) but comma-separates the
names if asked.public static String generateNamesRepeatedly(String prefix, int n, int m, boolean varyFirst)
generateNamesRepeatedly("frip", 3, 2, true) yields: frip1 frip2 frip3 frip1 frip2 frip3.
generateNamesRepeatedly("frip", 3, 2, false) yields: frip1 frip1 frip2 frip2 frip3 frip3.
public static String generateNamesRepeatedlyShift(String prefix, int n, int m, boolean varyFirst, boolean useComma)
generateNamesRepeatedlyShift("frip", 3, 2, true, false) yields: frip2 frip3 frip1 frip2 frip3 frip1.
generateNamesRepeatedlyShift("frip", 3, 2, false, true) yields: frip2, frip2, frip3, frip3, frip1, frip1.
public static String generateNameListsRepeatedlyShift(String prefix, int n, int m)
generateNameListsRepeatedlyShift("frip", 3, 2) yields: frip2 frip3, frip2 frip3, frip3 frip1, frip3 frip1, frip1 frip2, frip1 frip2
public static String generateDoubleSuffixedNames(String prefix, int n, int m, boolean varyFirst)
generateDoubleSuffixedNames("frip", 3, 2, true) yields: frip_1_1 frip_2_1 frip_3_1 frip_1_2 frip_2_2 frip_3_2.
generateDoubleSuffixedNames("frip", 3, 2, false) yields: frip_1_1 frip_1_2 frip_2_1 frip_2_2 frip_3_1 frip_3_2.
public static String generateDoubleSuffixedNames(String prefix, int n, int m, boolean varyFirst, boolean useComma)
generateDoubleSuffixedNames(String,int,int,boolean)
but comma-separates the names if asked.public static String generateDoubleSuffixedRunsOfNames(String prefix, int n, int m, boolean varyFirst)
generateDoubleSuffixedNames(String,int,int,boolean)
but comma-separates each run of names.public static String generateDoubleSuffixedFixedNames(String prefix, int n, int m)
generateDoubleSuffixedNames("frip", 3, 2, true) yields: frip_3_1, frip_3_2.
generateDoubleSuffixedNames("frip", 3, 2, false) yields: frip_3_1 frip_3_2.
public static String generateDoubleSuffixedFixedNames(String prefix, int n, int m, boolean useComma)
generateDoubleSuffixedNames(String,int,int,boolean)
but comma-separates the names if asked.public static String duplicate(String val, int n)
public static String duplicateEnforced(String val, String enforced, int n)
public static String duplicate(String val, int n, boolean useComma)
public static String duplicateString(String val, int n, boolean useComma)
duplicate(String,int,boolean) but puts each value in a
quoted string.public static String pool(String list, int n)
Example: pool("a b c", 5) = "a b c a b"
Example: pool("a b c", 2) = "a b"
public static String poolList(String listOfLists, int n)
Example: poolList("a b, c", 5) = "a b a b a c c c c c"
Example: poolList("a b, c", 2) = "a b c c"
public static String poolList(String listOfLists, int n, int m)
Example: poolList("a b, c", 3, 3) = "a b a c c c a b a"
Example: poolList("a b, c", 2, 5) = "a b c c a b c c a b"
public static String poolListOfLists(String listOfLists, int n)
public static String oneof(String arg0, String arg1)
public static String oneof(String arg0, String arg1, String arg2)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.