HADOOP-15444 ITestS3GuardToolDynamo should only run with -Ddynamo (Aaron Fabbri)

This commit is contained in:
Aaron Fabbri 2018-05-04 11:34:37 -07:00
parent 8cdb032aff
commit 96c843f64b
No known key found for this signature in database
GPG Key ID: B2EEFA9E78118A29

View File

@ -28,6 +28,7 @@
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
import com.amazonaws.services.dynamodbv2.document.Table;
import com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException;
import org.junit.Assume;
import org.junit.Test;
import org.apache.hadoop.conf.Configuration;
@ -51,6 +52,14 @@ protected MetadataStore newMetadataStore() {
return new DynamoDBMetadataStore();
}
@Override
public void setup() throws Exception {
super.setup();
Assume.assumeTrue("Test only applies when DynamoDB is used for S3Guard",
getConfiguration().get(Constants.S3_METADATA_STORE_IMPL).equals(
Constants.S3GUARD_METASTORE_DYNAMO));
}
// Check the existence of a given DynamoDB table.
private static boolean exist(DynamoDB dynamoDB, String tableName) {
assertNotNull(dynamoDB);