Class TestBox

    • 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
    • Constructor Detail

      • TestBox

        public TestBox()
    • 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 from DbConnection 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 property
        value - value of the property
      • verifyNotNullNorEmptyParameter

        protected void verifyNotNullNorEmptyParameter​(String key,
                                                      String value)
      • getNewProperties

        protected Properties getNewProperties()