Class AbstractDynamoDbConnectJunit
- java.lang.Object
-
- net.officefloor.nosql.dynamodb.test.AbstractDynamoDbConnectJunit
-
- Direct Known Subclasses:
AbstractDynamoDbJunit
,DynamoDbConnectExtension
,DynamoDbConnectRule
public class AbstractDynamoDbConnectJunit extends java.lang.Object
Abstract JUnit DynamoDb connect functionality.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractDynamoDbConnectJunit.Configuration
Configuration of DynamoDb.
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDynamoDbConnectJunit.Configuration
configuration
static int
DEFAULT_LOCAL_DYNAMO_PORT
Default local DynamoDb port.protected AmazonDynamoDbFactory
dynamoFactory
-
Constructor Summary
Constructors Constructor Description AbstractDynamoDbConnectJunit()
Instantiate with defaultAbstractDynamoDbConnectJunit.Configuration
.AbstractDynamoDbConnectJunit(AbstractDynamoDbConnectJunit.Configuration configuration)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
extendStart()
Allows overriding to extend starting.protected void
extendStop()
Allows overriding to extend stop.com.amazonaws.services.dynamodbv2.AmazonDynamoDB
getAmazonDynamoDb()
Obtains theAmazonDynamoDB
.com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper
getDynamoDbMapper()
Obtains theDynamoDBMapper
.protected int
getDynamoDbPort()
Obtains the DynamoDb port.protected void
startAmazonDynamoDb()
Starts theAmazonDynamoDB
locally.protected void
stopAmazonDynamoDb()
StopsAmazonDynamoDB
.
-
-
-
Field Detail
-
DEFAULT_LOCAL_DYNAMO_PORT
public static final int DEFAULT_LOCAL_DYNAMO_PORT
Default local DynamoDb port.- See Also:
- Constant Field Values
-
configuration
protected final AbstractDynamoDbConnectJunit.Configuration configuration
-
dynamoFactory
protected final AmazonDynamoDbFactory dynamoFactory
-
-
Constructor Detail
-
AbstractDynamoDbConnectJunit
public AbstractDynamoDbConnectJunit()
Instantiate with defaultAbstractDynamoDbConnectJunit.Configuration
.
-
AbstractDynamoDbConnectJunit
public AbstractDynamoDbConnectJunit(AbstractDynamoDbConnectJunit.Configuration configuration)
Instantiate.- Parameters:
configuration
-AbstractDynamoDbConnectJunit.Configuration
.
-
-
Method Detail
-
getAmazonDynamoDb
public com.amazonaws.services.dynamodbv2.AmazonDynamoDB getAmazonDynamoDb()
Obtains theAmazonDynamoDB
.- Returns:
AmazonDynamoDB
.
-
getDynamoDbMapper
public com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper getDynamoDbMapper()
Obtains theDynamoDBMapper
.- Returns:
DynamoDBMapper
.
-
getDynamoDbPort
protected int getDynamoDbPort()
Obtains the DynamoDb port.- Returns:
- DynamoDb port.
-
startAmazonDynamoDb
protected void startAmazonDynamoDb() throws java.lang.Exception
Starts theAmazonDynamoDB
locally.- Throws:
java.lang.Exception
- If fails to start.
-
extendStart
protected void extendStart() throws java.lang.Exception
Allows overriding to extend starting.- Throws:
java.lang.Exception
- Possible start failure.
-
stopAmazonDynamoDb
protected void stopAmazonDynamoDb() throws java.lang.Exception
StopsAmazonDynamoDB
.- Throws:
java.lang.Exception
- If fails to stop.
-
extendStop
protected void extendStop() throws java.lang.Exception
Allows overriding to extend stop.- Throws:
java.lang.Exception
- Possible start failure.
-
-