use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class Test_TestBox method testDbNameEmpty.
@Test(expected = NullOrEmptyConfigurationPropertyException.class)
public void testDbNameEmpty() throws NullOrEmptyConfigurationPropertyException {
TestBox testBox = new TestBox();
testBox.setDbName(ONLY_SPACE_STR);
}
use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class DatabaseBackupRestoreTests method init.
@BeforeMethod
public void init() {
serverBox = new TestBox();
serverBox.setHost(configuration.getDatabaseHost());
serverBox.setDbType(configuration.getDatabaseType());
serverBox.setDbName(configuration.getBackupDatabaseName());
serverBox.setDbUser(configuration.getDatabaseUser());
serverBox.setDbPass(configuration.getDatabasePassword());
serverBox.setDbPort(String.valueOf(configuration.getDbPort()));
// establish DB connection
dbOperations = new DatabaseOperations(serverBox);
dbConn = new DbConnPostgreSQL(configuration.getDatabaseHost(), port, configuration.getBackupDatabaseName(), configuration.getDatabaseUser(), configuration.getDatabasePassword(), null);
// establish tables which to be inspected
dbTables = new ArrayList<>();
dbTables.add(new DbTable(TABLE));
}
use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class DatabaseVerificationTests method beforeMethod.
/**
* Prior to each test we make sure we have the table we worked with
* is in same state
*/
@BeforeMethod
public void beforeMethod() {
// initialize all connection parameters
dbServerBox = new TestBox();
dbServerBox.setHost(configuration.getDatabaseHost());
dbServerBox.setDbType(configuration.getDatabaseType());
dbServerBox.setDbName(configuration.getDatabaseName());
dbServerBox.setDbUser(configuration.getDatabaseUser());
dbServerBox.setDbPass(configuration.getDatabasePassword());
dbServerBox.setDbPort(String.valueOf(configuration.getDbPort()));
// initialize this helper class
dbOperations = new DatabaseOperations(dbServerBox);
// cleanup the table we use and fill it with the needed data
dbOperations.delete(TABLE, "1=1");
dbOperations.insertValues(TABLE, new String[] { "id", "firstName", "lastName", "age" }, new String[] { "1", "Chuck", "Norris", "70" });
dbOperations.insertValues(TABLE, new String[] { "id", "firstName", "lastName", "age" }, new String[] { "2", "Jackie", "Chan", "64" });
// Initialize the class we will use in our tests
dbVerification = new DbVerification(dbServerBox, TABLE);
}
use of com.axway.ats.harness.config.TestBox in project ats-framework by Axway.
the class DatabaseOperationTests method beforeMethod.
/**
* Prior to each test we make sure we have the table we worked with
* is in same state
*/
@BeforeMethod
public void beforeMethod() {
// Here we define all connection parameters
TestBox serverBox = new TestBox();
serverBox.setHost(configuration.getDatabaseHost());
serverBox.setDbType(configuration.getDatabaseType());
serverBox.setDbName(configuration.getDatabaseName());
serverBox.setDbUser(configuration.getDatabaseUser());
serverBox.setDbPass(configuration.getDatabasePassword());
serverBox.setDbPort(String.valueOf(configuration.getDbPort()));
// establish DB connection
dbOperations = new DatabaseOperations(serverBox);
// cleanup the table we use and fill it with the needed data
dbOperations.delete(TABLE, "1=1");
dbOperations.insertValues(TABLE, new String[] { "id", "firstName", "lastName", "age" }, new String[] { "1", "Chuck", "Norris", "70" });
dbOperations.insertValues(TABLE, new String[] { "id", "firstName", "lastName", "age" }, new String[] { "2", "Jackie", "Chan", "64" });
}
Aggregations