com.google.appengine.tools.development.testing
Class LocalRdbmsServiceTestConfig
- java.lang.Object
-
- com.google.appengine.tools.development.testing.LocalRdbmsServiceTestConfig
-
- All Implemented Interfaces:
- LocalServiceTestConfig
public class LocalRdbmsServiceTestConfig extends java.lang.Object implements LocalServiceTestConfig
Config for accessing the local RDBMS service in tests. Default behavior is to configure the local service to use an in-memory database.tearDown()does not wipe out data or tables.
-
-
Constructor Summary
Constructors Constructor and Description LocalRdbmsServiceTestConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetDriverClass()java.lang.StringgetJdbcConnectionStringFormat()static LocalRdbmsServicegetLocalRdbmsService()LocalRdbmsServiceTestConfigsetDatabase(java.lang.String database)Sets the database to be passed to the underlyinglocalJDBC driver.LocalRdbmsServiceTestConfigsetDriverClass(java.lang.String driverClass)Sets the class of the driver used by thecom.google.appengine.api.rdbms.dev.LocalRdbmsServiceLocalDriverand attempts to loaddriverClassin the currentClassLoader.LocalRdbmsServiceTestConfigsetExtraDriverProperties(java.util.Map<java.lang.String,java.lang.String> map)Sets Extra properties to be passed to the underlyinglocalJDBC driver.LocalRdbmsServiceTestConfigsetJdbcConnectionStringFormat(java.lang.String jdbcConnectionStringFormat)Sets the format of the connection string that the jdbc driver will use.LocalRdbmsServiceTestConfigsetPassword(java.lang.String password)Sets the password to be passed to the underlyinglocalJDBC driver.LocalRdbmsServiceTestConfigsetRemoteClientFactory(java.lang.Class<? extends SqlClientFactory> remoteClientFactory)Sets the remote client factory class.LocalRdbmsServiceTestConfigsetServerType(LocalRdbmsService.ServerType serverType)Sets the server type to eitherhostedorlocal.voidsetUp()Set up the local service.LocalRdbmsServiceTestConfigsetUser(java.lang.String user)Sets the user to be passed to the underlyinglocalJDBC driver.voidtearDown()Tear down the local service.
-
-
-
Method Detail
-
setUp
public void setUp()
Description copied from interface:LocalServiceTestConfigSet up the local service.- Specified by:
setUpin interfaceLocalServiceTestConfig
-
tearDown
public void tearDown()
Description copied from interface:LocalServiceTestConfigTear down the local service.- Specified by:
tearDownin interfaceLocalServiceTestConfig
-
getLocalRdbmsService
public static LocalRdbmsService getLocalRdbmsService()
-
getDriverClass
public java.lang.String getDriverClass()
- Returns:
- The driver class.
-
setDriverClass
public LocalRdbmsServiceTestConfig setDriverClass(java.lang.String driverClass)
Sets the class of the driver used by thecom.google.appengine.api.rdbms.dev.LocalRdbmsServiceLocalDriverand attempts to loaddriverClassin the currentClassLoader.- Parameters:
driverClass- The driver class. Must be the fully-qualified name of a class that implementsDriver.- Returns:
this(for chaining)- Throws:
java.lang.RuntimeException- wrapping any exceptions loading driverClass.
-
getJdbcConnectionStringFormat
public java.lang.String getJdbcConnectionStringFormat()
- Returns:
- The JDBC connection string format
-
setJdbcConnectionStringFormat
public LocalRdbmsServiceTestConfig setJdbcConnectionStringFormat(java.lang.String jdbcConnectionStringFormat)
Sets the format of the connection string that the jdbc driver will use.- Parameters:
jdbcConnectionStringFormat- the connection string format- Returns:
this(for chaining)
-
setServerType
public LocalRdbmsServiceTestConfig setServerType(LocalRdbmsService.ServerType serverType)
Sets the server type to eitherhostedorlocal.localconnections proxy the SQL Service wire format to a local database using JDBC.remoteconnections talk over aSpeckleRpcto a hosted development mode Speckle instance.
- Parameters:
serverType- hosted or local- Returns:
this(for chaining)- Throws:
java.lang.IllegalArgumentException- if serverType is not "hosted" or "local"
-
setExtraDriverProperties
public LocalRdbmsServiceTestConfig setExtraDriverProperties(java.util.Map<java.lang.String,java.lang.String> map)
Sets Extra properties to be passed to the underlyinglocalJDBC driver.- Parameters:
map- the extra driver properties.- Returns:
this(for chaining)
-
setDatabase
public LocalRdbmsServiceTestConfig setDatabase(java.lang.String database)
Sets the database to be passed to the underlyinglocalJDBC driver.
-
setUser
public LocalRdbmsServiceTestConfig setUser(java.lang.String user)
Sets the user to be passed to the underlyinglocalJDBC driver.
-
setPassword
public LocalRdbmsServiceTestConfig setPassword(java.lang.String password)
Sets the password to be passed to the underlyinglocalJDBC driver.
-
setRemoteClientFactory
public LocalRdbmsServiceTestConfig setRemoteClientFactory(java.lang.Class<? extends SqlClientFactory> remoteClientFactory)
Sets the remote client factory class.- Parameters:
remoteClientFactory- the SqlClientFactory implementation.- Returns:
this(for chaining)
-
-