Package org.silverpeas.core.test.util
Class RandomGenerator
- java.lang.Object
-
- org.silverpeas.core.test.util.RandomGenerator
-
public class RandomGenerator extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Calendar
getCalendarAfter(Calendar date)
static Calendar
getCalendarBefore(Calendar date)
static Calendar
getFuturCalendar()
static Calendar
getOutdatedCalendar()
static boolean
getRandomBoolean()
Generate a random boolean.static Calendar
getRandomCalendar()
static int
getRandomDay()
Generate a random int between 0 and 31.static float
getRandomFloat()
Generate a random float.static int
getRandomHour()
Generate a random int between 0 and 23.static int
getRandomInt()
Generate a random int.static int
getRandomInt(int max)
Generate a random int in the 0 inclusive max exclusive.static String
getRandomLanguage()
Generate a random languagestatic long
getRandomLong()
Generate a random long.static int
getRandomMinutes()
Generate a random int between 0 and 59.static int
getRandomMonth()
Generate a random int between 0 and 11.static String
getRandomString()
Generate a random String of size 32.static int
getRandomYear()
Generate a random int between 2019 and 2019.
-
-
-
Method Detail
-
getRandomHour
public static int getRandomHour()
Generate a random int between 0 and 23.- Returns:
- a random int between 0 and 23.
-
getRandomMinutes
public static int getRandomMinutes()
Generate a random int between 0 and 59.- Returns:
- a random int between 0 and 59.
-
getRandomMonth
public static int getRandomMonth()
Generate a random int between 0 and 11.- Returns:
- a random int between 0 and 11.
-
getRandomYear
public static int getRandomYear()
Generate a random int between 2019 and 2019.- Returns:
- a random int between 2019 and 2019.
-
getRandomDay
public static int getRandomDay()
Generate a random int between 0 and 31.- Returns:
- a random int between 0 and 31.
-
getRandomLong
public static long getRandomLong()
Generate a random long.- Returns:
- a random long.
-
getRandomFloat
public static float getRandomFloat()
Generate a random float.- Returns:
- a random float.
-
getRandomString
public static String getRandomString()
Generate a random String of size 32.- Returns:
- a random String of 32 chars.
-
getRandomLanguage
public static String getRandomLanguage()
Generate a random language- Returns:
- a random valid language.
-
getRandomBoolean
public static boolean getRandomBoolean()
Generate a random boolean.- Returns:
- a random boolean.
-
getRandomInt
public static int getRandomInt()
Generate a random int.- Returns:
- a random int.
-
getRandomInt
public static int getRandomInt(int max)
Generate a random int in the 0 inclusive max exclusive.- Parameters:
max
- the exclusive maximum of the random int.- Returns:
- a random int.
-
getOutdatedCalendar
public static Calendar getOutdatedCalendar()
-
getFuturCalendar
public static Calendar getFuturCalendar()
-
getRandomCalendar
public static Calendar getRandomCalendar()
-
-