assert readFile(oneFile).startsWith(onePropValue);
assert readFile(twoFile).startsWith("@@two.prop@@");
assert readFile(threeFile).startsWith(threePropValue);
DeploymentsMetadata metadata = new DeploymentsMetadata(this.destDir);
DeploymentProperties deploymentProps = metadata.getDeploymentProperties(deployment.getId());
assert deploymentProps.getDeploymentId() == deployment.getId();
assert deploymentProps.getBundleName().equals(bundle.getName());
assert deploymentProps.getBundleVersion().equals(bundleVersion.getVersion());
assert deploymentProps.getManageRootDir() == true;
DeploymentProperties currentProps = metadata.getCurrentDeploymentProperties();
assert deploymentProps.equals(currentProps);
// check the backup directory - note, clean flag is irrelevent when determining what should be backed up
File backupDir = metadata.getDeploymentBackupDirectory(deployment.getId());
File extraBackupFile = new File(backupDir, extraDir.getName() + File.separatorChar + extraFile.getName());
File ignoredBackupFile = new File(backupDir, ignoreDir.getName() + File.separatorChar + ignoredFile.getName());
assert !ignoredBackupFile.exists() : "ignored file was backed up but it should not have been";
assert extraBackupFile.exists() : "extra file was not backed up";
assert "extra".equals(new String(StreamUtil.slurp(new FileInputStream(extraBackupFile)))) : "bad backup of extra";
DeploymentProperties previousProps = metadata.getPreviousDeploymentProperties(456);
assert previousProps != null : "There should be previous deployment metadata";
assert previousProps.getDeploymentId() == 123 : "bad previous deployment metadata"; // testAntBundleInitialInstall used 123
assert previousProps.getBundleName().equals(deploymentProps.getBundleName());
assert previousProps.getBundleVersion().equals("2.5"); // testAntBundleInitialInstall deployed version 2.5
assert previousProps.getManageRootDir() == true;
}