|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig
public final class LocalDatastoreServiceTestConfig
Config for accessing the local datastore service in tests.
Default behavior is to configure the local datastore to only store data
in-memory, to not write anything to disk, and for all jobs to apply on the
first attempt (master/slave consistency model). tearDown()
wipes
out all in-memory state so that the datastore is empty at the end of every
test.
Constructor Summary | |
---|---|
LocalDatastoreServiceTestConfig()
|
Method Summary | |
---|---|
java.lang.Class<? extends HighRepJobPolicy> |
getAlternateHighRepJobPolicyClass()
|
java.lang.String |
getBackingStoreLocation()
|
java.lang.Long |
getDefaultHighRepJobPolicyRandomSeed()
|
java.lang.Float |
getDefaultHighRepJobPolicyUnappliedJobPercentage()
|
static LocalDatastoreService |
getLocalDatastoreService()
|
java.lang.Integer |
getMaxQueryLifetimeMs()
|
java.lang.Integer |
getMaxTxnLifetimeMs()
|
java.lang.Integer |
getStoreDelayMs()
|
boolean |
isNoIndexAutoGen()
|
boolean |
isNoStorage()
|
LocalDatastoreServiceTestConfig |
setAlternateHighRepJobPolicyClass(java.lang.Class<? extends HighRepJobPolicy> alternateHighRepJobPolicyClass)
An alternate HighRepJobPolicy implementation. |
LocalDatastoreServiceTestConfig |
setBackingStoreLocation(java.lang.String backingStoreLocation)
Where to read/store the datastore from/to. |
LocalDatastoreServiceTestConfig |
setDefaultHighRepJobPolicyRandomSeed(long defaultHighRepJobPolicyRandomSeed)
A seed for a Random used by
DefaultHighRepJobPolicy to determine whether or not a job
application attempt fails. |
LocalDatastoreServiceTestConfig |
setDefaultHighRepJobPolicyUnappliedJobPercentage(float defaultHighRepJobPolicyUnappliedJobPercentage)
The percentage of job application attempts that will fail. |
LocalDatastoreServiceTestConfig |
setMaxQueryLifetimeMs(int maxQueryLifetimeMs)
Sets how long a query can stay "live" before we expire it. |
LocalDatastoreServiceTestConfig |
setMaxTxnLifetimeMs(int maxTxnLifetimeMs)
Sets how long a txn can stay "live" before we expire it. |
LocalDatastoreServiceTestConfig |
setNoIndexAutoGen(boolean noIndexAutoGen)
True to prevent the datastore from writing the auto-generated index file. |
LocalDatastoreServiceTestConfig |
setNoStorage(boolean noStorage)
True to put the datastore into "memory-only" mode. |
LocalDatastoreServiceTestConfig |
setStoreDelayMs(int storeDelayMs)
Sets how long to wait before updating the persistent store. |
void |
setUp()
Set up the local service. |
void |
tearDown()
Tear down the local service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalDatastoreServiceTestConfig()
Method Detail |
---|
public boolean isNoStorage()
public LocalDatastoreServiceTestConfig setNoStorage(boolean noStorage)
noStorage
-
this
(for chaining)public java.lang.Integer getMaxQueryLifetimeMs()
public LocalDatastoreServiceTestConfig setMaxQueryLifetimeMs(int maxQueryLifetimeMs)
maxQueryLifetimeMs
-
this
(for chaining)public java.lang.Integer getMaxTxnLifetimeMs()
public LocalDatastoreServiceTestConfig setMaxTxnLifetimeMs(int maxTxnLifetimeMs)
maxTxnLifetimeMs
-
this
(for chaining)public java.lang.Integer getStoreDelayMs()
public LocalDatastoreServiceTestConfig setStoreDelayMs(int storeDelayMs)
isNoStorage()
returns false
.
storeDelayMs
-
this
(for chaining)public java.lang.String getBackingStoreLocation()
public LocalDatastoreServiceTestConfig setBackingStoreLocation(java.lang.String backingStoreLocation)
backingStoreLocation
-
this
(for chaining)public boolean isNoIndexAutoGen()
public LocalDatastoreServiceTestConfig setNoIndexAutoGen(boolean noIndexAutoGen)
noIndexAutoGen
-
this
(for chaining)public java.lang.Long getDefaultHighRepJobPolicyRandomSeed()
public LocalDatastoreServiceTestConfig setDefaultHighRepJobPolicyRandomSeed(long defaultHighRepJobPolicyRandomSeed)
Random
used by
DefaultHighRepJobPolicy
to determine whether or not a job
application attempt fails. This method cannot be used in combination with
setAlternateHighRepJobPolicyClass(Class)
.
defaultHighRepJobPolicyRandomSeed
- The random seed.
this
(for chaining)
java.lang.IllegalArgumentException
- If
setAlternateHighRepJobPolicyClass(Class)
has been called.public java.lang.Float getDefaultHighRepJobPolicyUnappliedJobPercentage()
public LocalDatastoreServiceTestConfig setDefaultHighRepJobPolicyUnappliedJobPercentage(float defaultHighRepJobPolicyUnappliedJobPercentage)
LocalDatastoreService
, not in the setter, so it will not fail
fast. In addition, any portion of the value beyond two decimal places
will be truncated. This method cannot be used in combination with
setAlternateHighRepJobPolicyClass(Class)
.
defaultHighRepJobPolicyUnappliedJobPercentage
- The percentage of job
application attempts that should fail.
this
(for chaining)
java.lang.IllegalArgumentException
- If
setAlternateHighRepJobPolicyClass(Class)
has been called.public java.lang.Class<? extends HighRepJobPolicy> getAlternateHighRepJobPolicyClass()
public LocalDatastoreServiceTestConfig setAlternateHighRepJobPolicyClass(java.lang.Class<? extends HighRepJobPolicy> alternateHighRepJobPolicyClass)
HighRepJobPolicy
implementation. The class must have
a no-arg constructor, but this validation is performed during the
iniitialization of LocalDatastoreService
, not in the setter, so it
will not fail fast. This method cannot be used in combination with
setDefaultHighRepJobPolicyRandomSeed(long)
or
setDefaultHighRepJobPolicyUnappliedJobPercentage(float)
.
alternateHighRepJobPolicyClass
- The HighRepJobPolicy
implementation.
this
(for chaining)
java.lang.IllegalArgumentException
- If
setDefaultHighRepJobPolicyRandomSeed(long)
or
setDefaultHighRepJobPolicyUnappliedJobPercentage(float)
has been
called.public void setUp()
LocalServiceTestConfig
setUp
in interface LocalServiceTestConfig
public void tearDown()
LocalServiceTestConfig
tearDown
in interface LocalServiceTestConfig
public static LocalDatastoreService getLocalDatastoreService()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |