use of com.axway.ats.environment.EnvironmentUnit in project ats-framework by Axway.
the class Test_DirectoryEnvironmentUnit method restore_originalDirectoryIsFile.
@Test(expected = EnvironmentCleanupException.class)
public void restore_originalDirectoryIsFile() throws EnvironmentCleanupException, IOException {
EnvironmentUnit dirEnvUnit = new DirectoryEnvironmentUnit(restoreDirPath, backupDirPath, backupDirName);
new File(restoreDirPath).createNewFile();
dirEnvUnit.restore();
// Assert.assertTrue( dirEnvUnit.restore() );
//
// FileEnvironmentUnit fileEnvUnit = new FileEnvironmentUnit( IoUtils.getFilePath( originalFileName ),
// backupFileName );
// assertTrue( fileEnvUnit.restore() );
}
use of com.axway.ats.environment.EnvironmentUnit in project ats-framework by Axway.
the class Test_FileEnvironmentUnit method testBackupFolder_ifNotExist.
@Test
public void testBackupFolder_ifNotExist() throws EnvironmentCleanupException {
String backupFileNameInDeepDir = backupFolder + "agent_test_backup/test_folder/other_folder/backup_file.txt";
EnvironmentUnit fileEnvUnit = new FileEnvironmentUnit(originalFileName, backupFolder + "agent_test_backup/test_folder/other_folder/", "backup_file.txt");
fileEnvUnit.backup();
//verify if the backup file exists on the right place
File backupFile = new File(backupFileNameInDeepDir);
Assert.assertTrue(backupFile.exists());
}
use of com.axway.ats.environment.EnvironmentUnit in project ats-framework by Axway.
the class MockDbEnvironmentUnit method getTestComponent.
private Component getTestComponent() {
Component testComponent = new Component(COMPONENT_NAME);
Map<String, Object> customProperties = new HashMap<String, Object>();
customProperties.put(DbKeys.PORT_KEY, 3306);
List<EnvironmentUnit> environmentUnits = new ArrayList<EnvironmentUnit>();
environmentUnits.add(new MockDbEnvironmentUnit(new DbConnMySQL("host_1", "db_1", "user_1", "password_1", customProperties)));
testComponent.setEnvironments(Arrays.asList(new ComponentEnvironment(COMPONENT_NAME, null, environmentUnits, "backupFolder")));
return testComponent;
}
Aggregations