Package com.axway.ats.harness.config
Class TestBox
- java.lang.Object
-
- com.axway.ats.harness.config.TestBox
-
- All Implemented Interfaces:
Serializable
public class TestBox extends Object
A test box- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
DB_PORT_NOT_SPECIFIED
Constant for specifying that DB port is not setprotected Properties
properties
List of generic properties
-
Constructor Summary
Constructors Constructor Description TestBox()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DbConnection
asDbConnection()
INTERNAL method.static TestBox
fromDbConnection(DbConnection dbConnection)
INTERNAL method.String
getAdminPass()
String
getAdminUser()
String
getDbName()
String
getDbPass()
int
getDbPort()
String
getDbType()
String
getDbUser()
String
getHost()
protected Properties
getNewProperties()
Map<String,Object>
getProperties()
Get all properties associated with this boxString
getProperty(String name)
Get a generic property associated with this boxTestBox
newCopy()
void
setAdminPass(String adminPass)
void
setAdminUser(String adminUser)
void
setDbName(String dbName)
void
setDbPass(String dbPass)
void
setDbPort(String dbPortStr)
Specifies DB port.void
setDbType(String dbType)
void
setDbUser(String dbUser)
void
setHost(String host)
void
setProperty(String name, String value)
Associate a property with this box (not to be exposed to clients)String
toString()
protected void
verifyNotNullNorEmptyParameter(String key, String value)
-
-
-
Field Detail
-
DB_PORT_NOT_SPECIFIED
public static final int DB_PORT_NOT_SPECIFIED
Constant for specifying that DB port is not set- See Also:
- Constant Field Values
-
properties
protected Properties properties
List of generic properties
-
-
Method Detail
-
getHost
public String getHost()
- Returns:
- the host
-
setHost
public void setHost(String host)
- Parameters:
host
- the host to set
-
getDbPort
public int getDbPort()
- Returns:
- the DB port to be used for connection
-
setDbPort
public void setDbPort(String dbPortStr)
Specifies DB port. Should be a string representing a valid integer port number.- Parameters:
dbPortStr
- the DB port number to set- Throws:
IllegalArgumentException
- if parameter could not be parsed as a valid integer port number
-
getAdminUser
public String getAdminUser()
- Returns:
- the adminUser
-
setAdminUser
public void setAdminUser(String adminUser)
- Parameters:
adminUser
- the adminUser to set
-
getAdminPass
public String getAdminPass()
- Returns:
- the adminPass
-
setAdminPass
public void setAdminPass(String adminPass)
- Parameters:
adminPass
- the adminPass to set
-
getDbType
public String getDbType()
- Returns:
-
setDbType
public void setDbType(String dbType)
- Parameters:
dbType
-
-
getDbName
public String getDbName()
- Returns:
-
setDbName
public void setDbName(String dbName)
- Parameters:
dbName
-
-
getDbUser
public String getDbUser()
- Returns:
-
setDbUser
public void setDbUser(String dbUser)
- Parameters:
dbUser
-
-
getDbPass
public String getDbPass()
- Returns:
-
setDbPass
public void setDbPass(String dbPass)
- Parameters:
dbPass
-
-
newCopy
public TestBox newCopy()
- Returns:
- a new copy of this Box
-
fromDbConnection
public static TestBox fromDbConnection(DbConnection dbConnection)
INTERNAL method. Could be changed without notice Create TestBox fromDbConnection
object
Note that any custom properties from the connection (except the port value) will not be transfered to the TestBox- Parameters:
dbConnection
- - the db connection or null if the dbConnection parameter is null
-
asDbConnection
public DbConnection asDbConnection()
INTERNAL method. Could be changed without notice
-
toString
public String toString()
-
getProperty
public String getProperty(String name)
Get a generic property associated with this box- Parameters:
name
- name of the property- Returns:
- value of the property
-
getProperties
public Map<String,Object> getProperties()
Get all properties associated with this box
-
setProperty
public void setProperty(String name, String value)
Associate a property with this box (not to be exposed to clients)- Parameters:
name
- name of the propertyvalue
- value of the property
-
verifyNotNullNorEmptyParameter
protected void verifyNotNullNorEmptyParameter(String key, String value)
-
getNewProperties
protected Properties getNewProperties()
-
-