TestSupport
.@Deprecated public abstract class TestSupport extends junit.framework.TestCase
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log
Deprecated.
|
protected static String |
LS
Deprecated.
|
Constructor and Description |
---|
TestSupport()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static <T> Collection<T> |
assertCollectionSize(Collection<T> list,
int size)
Deprecated.
Asserts that a list is of the given size
|
static <T> Collection<T> |
assertCollectionSize(String message,
Collection<T> list,
int size)
Deprecated.
Asserts that a list is of the given size
|
static void |
assertDirectoryEquals(String expected,
String actual)
Deprecated.
To be used for folder/directory comparison that works across different platforms such
as Window, Mac and Linux.
|
static void |
assertDirectoryEquals(String message,
String expected,
String actual)
Deprecated.
To be used for folder/directory comparison that works across different platforms such
as Window, Mac and Linux.
|
static void |
assertEndpointUri(Endpoint endpoint,
String uri)
Deprecated.
|
static Object |
assertExpression(Expression expression,
Exchange exchange,
Object expected)
Deprecated.
Asserts that the given expression when evaluated returns the given answer
|
static void |
assertFileExists(String filename)
Deprecated.
To be used to check is a file is found in the file system
|
static void |
assertFileNotExists(String filename)
Deprecated.
To be used to check is a file is not found in the file system
|
static void |
assertInMessageBodyEquals(Exchange exchange,
Object expected)
Deprecated.
Asserts that the given exchange has an OUT message of the given body value
|
static Object |
assertInMessageHeader(Exchange exchange,
String name,
Object expected)
Deprecated.
Asserts the In message on the exchange contains the expected value
|
static <T> T |
assertIsInstanceOf(Class<T> expectedType,
Object value)
Deprecated.
|
static <T> List<T> |
assertListSize(List<T> list,
int size)
Deprecated.
Asserts that a list is of the given size
|
static <T> List<T> |
assertListSize(String message,
List<T> list,
int size)
Deprecated.
Asserts that a list is of the given size
|
static Object |
assertMessageHeader(Message message,
String name,
Object expected)
Deprecated.
|
static <T> T |
assertOneElement(List<T> list)
Deprecated.
|
static void |
assertOutMessageBodyEquals(Exchange exchange,
Object expected)
Deprecated.
Asserts that the given exchange has an OUT message of the given body value
|
static Object |
assertOutMessageHeader(Exchange exchange,
String name,
Object expected)
Deprecated.
Asserts the Out message on the exchange contains the expected value
|
static boolean |
assertPredicate(Predicate predicate,
Exchange exchange,
boolean expected)
Deprecated.
Asserts that the predicate returns the expected value on the exchange
|
static void |
assertPredicateDoesNotMatch(Predicate predicate,
Exchange exchange)
Deprecated.
Asserts that the predicate returns the expected value on the exchange
|
static void |
assertPredicateMatches(Predicate predicate,
Exchange exchange)
Deprecated.
Asserts that the predicate returns the expected value on the exchange
|
static void |
assertStringContains(String text,
String containedText)
Deprecated.
Asserts that the text contains the given string
|
static ValueBuilder |
body()
Deprecated.
Returns a predicate and value builder for the inbound body on an exchange
|
static <T> ValueBuilder |
bodyAs(Class<T> type)
Deprecated.
Returns a predicate and value builder for the inbound message body as a
specific type
|
protected boolean |
canRunOnThisPlatform()
Deprecated.
|
static void |
createDirectory(String file)
Deprecated.
create the directory
|
protected Exchange |
createExchangeWithBody(CamelContext camelContext,
Object body)
Deprecated.
Creates an exchange with the given body
|
static boolean |
deleteDirectory(File file)
Deprecated.
Recursively delete a directory, useful to zapping test data
|
static boolean |
deleteDirectory(String file)
Deprecated.
Recursively delete a directory, useful to zapping test data
|
static ValueBuilder |
faultBody()
Deprecated.
Returns a predicate and value builder for the fault body on an
exchange
|
static <T> ValueBuilder |
faultBodyAs(Class<T> type)
Deprecated.
Returns a predicate and value builder for the fault message body as a
specific type
|
static List<Route> |
getRouteList(RouteBuilder builder)
Deprecated.
A helper method to create a list of Route objects for a given route builder
|
String |
getTestMethodName()
Deprecated.
Gets the current test method name
|
static ValueBuilder |
header(String name)
Deprecated.
Returns a value builder for the given header
|
static boolean |
isJava15()
Deprecated.
Is this Java 1.5
|
static boolean |
isJavaVendor(String vendor)
Deprecated.
Is this Java by the given vendor.
|
static boolean |
isPlatform(String platform)
Deprecated.
Is this OS the given platform.
|
static ValueBuilder |
outBody()
Deprecated.
Returns a predicate and value builder for the outbound body on an
exchange
|
static <T> ValueBuilder |
outBodyAs(Class<T> type)
Deprecated.
Returns a predicate and value builder for the outbound message body as a
specific type
|
static ValueBuilder |
property(String name)
Deprecated.
Returns a value builder for the given property
|
static Endpoint |
resolveMandatoryEndpoint(CamelContext context,
String uri)
Deprecated.
Resolves an endpoint and asserts that it is found
|
static <T extends Endpoint> |
resolveMandatoryEndpoint(CamelContext context,
String uri,
Class<T> endpointType)
Deprecated.
Resolves an endpoint and asserts that it is found
|
void |
runBare()
Deprecated.
Runs the bare test sequence only if this platform is supported
|
static ValueBuilder |
systemProperty(String name)
Deprecated.
Returns a value builder for the given system property
|
static ValueBuilder |
systemProperty(String name,
String defaultValue)
Deprecated.
Returns a value builder for the given system property
|
static Processor |
unwrap(Processor processor)
Deprecated.
If a processor is wrapped with a bunch of DelegateProcessor or DelegateAsyncProcessor objects
this call will drill through them and return the wrapped Processor.
|
static Channel |
unwrapChannel(Processor processor)
Deprecated.
If a processor is wrapped with a bunch of DelegateProcessor or DelegateAsyncProcessor objects
this call will drill through them and return the Channel.
|
countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
protected static final String LS
protected transient org.slf4j.Logger log
public void runBare() throws Throwable
runBare
in class junit.framework.TestCase
Throwable
- if any exception is thrownprotected boolean canRunOnThisPlatform()
public static ValueBuilder header(String name)
public static ValueBuilder property(String name)
public static ValueBuilder body()
public static <T> ValueBuilder bodyAs(Class<T> type)
public static ValueBuilder outBody()
public static <T> ValueBuilder outBodyAs(Class<T> type)
public static ValueBuilder faultBody()
public static <T> ValueBuilder faultBodyAs(Class<T> type)
public static ValueBuilder systemProperty(String name)
public static ValueBuilder systemProperty(String name, String defaultValue)
public static <T> T assertIsInstanceOf(Class<T> expectedType, Object value)
public static Object assertInMessageHeader(Exchange exchange, String name, Object expected)
public static Object assertOutMessageHeader(Exchange exchange, String name, Object expected)
public static void assertInMessageBodyEquals(Exchange exchange, Object expected) throws InvalidPayloadException
exchange
- the exchange which should have an OUT messageexpected
- the expected value of the OUT messageInvalidPayloadException
- is thrown if the payload is not the expected class typepublic static void assertOutMessageBodyEquals(Exchange exchange, Object expected) throws InvalidPayloadException
exchange
- the exchange which should have an OUT messageexpected
- the expected value of the OUT messageInvalidPayloadException
- is thrown if the payload is not the expected class typepublic static Object assertMessageHeader(Message message, String name, Object expected)
public static Object assertExpression(Expression expression, Exchange exchange, Object expected)
public static void assertPredicateMatches(Predicate predicate, Exchange exchange)
public static void assertPredicateDoesNotMatch(Predicate predicate, Exchange exchange)
public static boolean assertPredicate(Predicate predicate, Exchange exchange, boolean expected)
public static Endpoint resolveMandatoryEndpoint(CamelContext context, String uri)
public static <T extends Endpoint> T resolveMandatoryEndpoint(CamelContext context, String uri, Class<T> endpointType)
protected Exchange createExchangeWithBody(CamelContext camelContext, Object body)
public static <T> T assertOneElement(List<T> list)
public static <T> List<T> assertListSize(List<T> list, int size)
public static <T> List<T> assertListSize(String message, List<T> list, int size)
public static <T> Collection<T> assertCollectionSize(Collection<T> list, int size)
public static <T> Collection<T> assertCollectionSize(String message, Collection<T> list, int size)
public static List<Route> getRouteList(RouteBuilder builder) throws Exception
Exception
public static void assertStringContains(String text, String containedText)
text
- the text to comparecontainedText
- the text which must be contained inside the other text parameterpublic static Processor unwrap(Processor processor)
public static Channel unwrapChannel(Processor processor)
public static boolean deleteDirectory(String file)
file
- the directory to be deletedpublic static boolean deleteDirectory(File file)
file
- the directory to be deletedpublic static void createDirectory(String file)
file
- the directory to be createdpublic static void assertDirectoryEquals(String expected, String actual)
public static void assertDirectoryEquals(String message, String expected, String actual)
public static void assertFileExists(String filename)
public static void assertFileNotExists(String filename)
public static boolean isPlatform(String platform)
platform
- such as Windowspublic static boolean isJavaVendor(String vendor)
vendor
- such as IBMpublic static boolean isJava15()
public String getTestMethodName()
Apache CAMEL