Package de.xima.fc.testhelper
Class TestHelper
java.lang.Object
de.xima.fc.testhelper.TestHelper
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic javax.mail.internet.InternetAddress[]static voidassertBlank(String actual) static voidassertContains(Iterable<?> expected, Object actual) static voidassertContains(String expectedContent, String value) static voidassertContainsEntries(Map<Object, Object> expected, Object actual) static voidassertContainsValuesAtKeys(Set<?> expectedKeys, Set<?> expectedValues, Object actual) static voidassertEmpty(String actual) static voidassertEmpty(List<?> actual) static voidassertEndsWith(String expectedSuffix, String actual) static <T> TassertHasOneItem(Iterable<T> actual) static voidassertHasSize(int expectedSize, Collection<?> actualCollection) static voidassertInRange(com.google.common.collect.Range<Double> expected, double actual) static voidassertInRange(com.google.common.collect.Range<Float> expected, float actual) static voidassertInRange(com.google.common.collect.Range<Integer> expected, int actual) static voidassertInRange(com.google.common.collect.Range<Long> expected, long actual) static <T> Class<? extends T>assertIsAssignableFrom(Class<T> expectedType, Class<?> actualType) static <T> TassertIsInstance(Class<T> clazz, Object item) static <T extends Throwable>
TassertIsOrHasCause(Throwable actual, Class<T> expectedType) static voidassertLengthGreaterThan(int expectedMinLength, CharSequence value) static voidassertLinesEqual(String expected, String actual) static voidassertNotBlank(String actual) static voidassertSameItems(Object expected, Object actual) static voidassertSetEquals(Iterable<?> expected, Iterable<?> actual) static voidassertStartsWith(String expectedPrefix, String actual) static voidassertStreamEquals(byte[] expected, InputStream actual) static voidassertStreamEquals(InputStream expected, InputStream actual) static voidassertStreamEquals(Reader expected, Reader actual) static Filestatic FilecreateTmpFile(byte[] content, String fileName, String extension) Creates a file in the temp folder with the specified contentstatic FilecreateTmpFile(String content, String fileName, String extension) Creates a file in the temp folder with the specified contentstatic FilecreateTmpTextFile(String content) Creates a file in the temp folder with the specified contentstatic <T> List<T>list(T... items) static List<de.xima.mailserver.api.IMailMessage>mailsSorted(de.xima.mailserver.api.IMailInbox mailbox) static <K,V> Map<K, V> static IUserDeprecated.static <K,V> Map<K, V> orderedMap(Object... items) static intstatic <T> Set<T>set(T... items) static Stringstr(byte[] bytes) static <K,V> Map<K, V> static <K,V> Map<K, V>  
- 
Constructor Details
- 
TestHelper
public TestHelper() 
 - 
 - 
Method Details
- 
addr
 - 
assertBlank
 - 
assertNotBlank
 - 
assertContains
 - 
assertContains
 - 
assertLengthGreaterThan
 - 
assertContainsEntries
 - 
assertContainsValuesAtKeys
 - 
assertHasOneItem
 - 
assertSetEquals
 - 
assertEmpty
 - 
assertEmpty
 - 
assertEndsWith
 - 
assertIsInstance
 - 
assertIsAssignableFrom
 - 
assertIsOrHasCause
 - 
assertLinesEqual
 - 
assertInRange
 - 
assertInRange
 - 
assertInRange
 - 
assertInRange
 - 
assertSameItems
 - 
assertHasSize
 - 
assertStartsWith
 - 
assertStreamEquals
 - 
assertStreamEquals
 - 
assertStreamEquals
 - 
createTmpDir
- Throws:
 IOException
 - 
createTmpFile
public static File createTmpFile(byte[] content, String fileName, String extension) throws IOException Creates a file in the temp folder with the specified content- Parameters:
 content- the file contentfileName- Name of the tmp fileextension- Extension of the tmp file.- Returns:
 - the 
Fileinstance - Throws:
 IOException- When the text file could not be created.
 - 
createTmpFile
public static File createTmpFile(String content, String fileName, String extension) throws IOException Creates a file in the temp folder with the specified content- Parameters:
 content- the file contentfileName- Name of the tmp fileextension- Extension of the tmp file.- Returns:
 - the 
Fileinstance - Throws:
 IOException- When the text file could not be created.
 - 
createTmpTextFile
Creates a file in the temp folder with the specified content- Parameters:
 content- the file content- Returns:
 - the 
Fileinstance - Throws:
 IOException- When the text file could not be created.
 - 
list
 - 
mailsSorted
public static List<de.xima.mailserver.api.IMailMessage> mailsSorted(de.xima.mailserver.api.IMailInbox mailbox) throws de.xima.mailserver.api.MailServerException - Throws:
 de.xima.mailserver.api.MailServerException
 - 
map
 - 
orderedMap
 - 
mockUser
Deprecated.- Parameters:
 name- Name of the user, unused.- Returns:
 - An anonymous virtual user.
 
 - 
randomFreePort
public static int randomFreePort() - 
set
 - 
str
 - 
submap
 - 
submap
 
 - 
 
VirtualUser.builder(String)