public class SdkAsserts
extends java.lang.Object
Constructor and Description |
---|
SdkAsserts() |
Modifier and Type | Method and Description |
---|---|
static void |
assertFileEqualsFile(java.io.File expected,
java.io.File actual)
Asserts that the contents of the two files are same.
|
static void |
assertFileEqualsStream(java.io.File expected,
java.io.InputStream actual)
Asserts that the contents in the specified file are exactly equal to the contents read from
the specified input stream.
|
static void |
assertFileEqualsStream(java.lang.String errmsg,
java.io.File expected,
java.io.InputStream actual)
Asserts that the contents in the specified file are exactly equal to the contents read from
the specified input stream.
|
static void |
assertNotEmpty(java.lang.String str)
Deprecated.
Use Hamcrest Matchers instead
|
static void |
assertStreamEqualsStream(java.io.InputStream expected,
java.io.InputStream actual)
Asserts that the contents in the specified input streams are same.
|
static void |
assertStreamEqualsStream(java.lang.String errmsg,
java.io.InputStream expectedInputStream,
java.io.InputStream inputStream)
Asserts that the contents in the specified input streams are same.
|
static void |
assertStringEqualsStream(java.lang.String expected,
java.io.InputStream actual)
Asserts that the contents in the specified string are exactly equal to the contents read from
the specified input stream.
|
static void |
assertValidException(AmazonServiceException e)
Asserts that the specified AmazonServiceException is valid, meaning it has a non-empty,
non-null value for its message, requestId, etc.
|
static boolean |
doesFileEqualStream(java.io.File expectedFile,
java.io.InputStream inputStream)
Returns true if, and only if, the contents in the specified file are exactly equal to the
contents read from the specified input stream.
|
static boolean |
doesStreamEqualStream(java.io.InputStream expected,
java.io.InputStream actual)
Returns true if, and only if, the contents read from the specified input streams are exactly
equal.
|
@Deprecated public static void assertNotEmpty(java.lang.String str)
str
- The String to test.public static void assertFileEqualsStream(java.io.File expected, java.io.InputStream actual)
expected
- The file containing the expected contents.actual
- The stream that will be read, compared to the expected file contents, and finally
closed.public static void assertFileEqualsStream(java.lang.String errmsg, java.io.File expected, java.io.InputStream actual)
errmsg
- error message to be thrown when the assertion fails.expected
- The file containing the expected contents.actual
- The stream that will be read, compared to the expected file contents, and finally
closed.public static void assertStreamEqualsStream(java.io.InputStream expected, java.io.InputStream actual)
expected
- expected input stream. The stream will be closed at the end.actual
- The stream that will be read, compared to the expected file contents, and finally
closed.public static void assertStreamEqualsStream(java.lang.String errmsg, java.io.InputStream expectedInputStream, java.io.InputStream inputStream)
errmsg
- error message to be thrown when the assertion fails.expected
- expected input stream. The stream will be closed at the end.actual
- The stream that will be read, compared to the expected file contents, and finally
closed.public static void assertFileEqualsFile(java.io.File expected, java.io.File actual)
expected
- expected file.actual
- actual file.public static void assertStringEqualsStream(java.lang.String expected, java.io.InputStream actual)
expected
- The string containing the expected data.actual
- The stream that will be read, compared to the expected string data, and finally
closed.public static boolean doesStreamEqualStream(java.io.InputStream expected, java.io.InputStream actual) throws java.io.IOException
expected
- The input stream containing the expected contents.inputStream
- The stream that will be read, compared to the expected file contents, and finally
closed.java.io.IOException
- If any problems are encountered comparing the file and stream.public static boolean doesFileEqualStream(java.io.File expectedFile, java.io.InputStream inputStream) throws java.io.IOException
expectedFile
- The file containing the expected contents.inputStream
- The stream that will be read, compared to the expected file contents, and finally
closed.java.io.IOException
- If any problems are encountered comparing the file and stream.public static void assertValidException(AmazonServiceException e)
e
- The exception to validate.