public abstract class AWSTestBase extends Object
| Modifier and Type | Field and Description |
|---|---|
static AWSCredentials |
credentials
Shared AWS credentials, loaded from a properties file
|
| Constructor and Description |
|---|
AWSTestBase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertFileEqualsFile(File expected,
File actual)
Asserts that the contents of the two files are same.
|
protected void |
assertFileEqualsStream(File expected,
InputStream actual)
Asserts that the contents in the specified file are exactly equal to the
contents read from the specified input stream.
|
protected void |
assertFileEqualsStream(String errmsg,
File expected,
InputStream actual)
Asserts that the contents in the specified file are exactly equal to the
contents read from the specified input stream.
|
protected void |
assertNotEmpty(String str)
Asserts that the specified String is not null and not empty.
|
protected void |
assertStreamEqualsStream(InputStream expected,
InputStream actual)
Asserts that the contents in the specified input streams are same.
|
protected void |
assertStreamEqualsStream(String errmsg,
InputStream expectedInputStream,
InputStream inputStream)
Asserts that the contents in the specified input streams are same.
|
protected void |
assertStringEqualsStream(String expected,
InputStream actual)
Asserts that the contents in the specified string are exactly equal to
the contents read from the specified input stream.
|
protected 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.
|
protected boolean |
doesFileEqualStream(File expectedFile,
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.
|
protected boolean |
doesStreamEqualStream(InputStream expected,
InputStream actual)
Returns true if, and only if, the contents read from the specified input
streams are exactly equal.
|
protected byte[] |
drainInputStream(InputStream inputStream) |
static void |
setUpCredentials() |
public static AWSCredentials credentials
public static void setUpCredentials()
throws FileNotFoundException,
IOException
FileNotFoundExceptionIOExceptionprotected void assertNotEmpty(String str)
str - The String to test.protected void assertFileEqualsStream(File expected, 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.protected void assertFileEqualsStream(String errmsg, File expected, 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.protected void assertStreamEqualsStream(InputStream expected, 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.protected void assertStreamEqualsStream(String errmsg, InputStream expectedInputStream, 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.protected void assertFileEqualsFile(File expected, File actual)
expected - expected file.actual - actual file.protected void assertStringEqualsStream(String expected, 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.protected boolean doesStreamEqualStream(InputStream expected, InputStream actual) throws 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.IOException - If any problems are encountered comparing the file and
stream.protected byte[] drainInputStream(InputStream inputStream)
protected boolean doesFileEqualStream(File expectedFile, InputStream inputStream) throws IOException
expectedFile - The file containing the expected contents.inputStream - The stream that will be read, compared to the expected file
contents, and finally closed.IOException - If any problems are encountered comparing the file and
stream.protected void assertValidException(AmazonServiceException e)
e - The exception to validate.Copyright © 2015. All rights reserved.