Skip to content

Commit

Permalink
LPD-35725 SF
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Sep 26, 2024
1 parent ecaabaf commit f4a752e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ public void generateReport(UpgradeRecorder upgradeRecorder) {
}

_executionDate = _getExecutionDate();

_executionTime =
(DBUpgrader.getUpgradeTime() / Time.SECOND) + " seconds";

_rootDir = _getRootDir();

Map<String, Object> reportData = _getReportData(upgradeRecorder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -933,25 +933,25 @@ private void _assertLogContextDiagnostics(String key, String text) {
private void _assertRenameUpgradeReport(String reportFileName)
throws Exception {

File reportFile1 = _getReportFile(reportFileName);
File reportFile = _getReportFile(reportFileName);

Assert.assertTrue(reportFile1.exists());
Assert.assertTrue(reportFile.exists());

long reportFile1LastModified = reportFile1.lastModified();
long reportFile1LastModified = reportFile.lastModified();

_appender.start();

_appender.stop();

File reportFile2 = _getReportFile(reportFileName);
reportFile = _getReportFile(
reportFileName + "." + reportFile1LastModified);

Assert.assertTrue(
_getReportFile(
reportFileName + "." + reportFile1LastModified
).exists());
Assert.assertTrue(reportFile2.exists());
Assert.assertTrue(
reportFile2.lastModified() != reportFile1LastModified);
Assert.assertTrue(reportFile.exists());

reportFile = _getReportFile(reportFileName);

Assert.assertTrue(reportFile.exists());
Assert.assertTrue(reportFile.lastModified() != reportFile1LastModified);
}

private void _assertReport(String testString) throws Exception {
Expand Down Expand Up @@ -1003,15 +1003,13 @@ private void _assertUpgradeReportDirectory(

Assert.assertTrue(reportFile.exists());

String reportFileAbsolutePath = reportFile.getAbsolutePath();

Assert.assertTrue(reportFileAbsolutePath.contains(_upgradeReportDir));
String pathString = reportFile.getAbsolutePath();

Assert.assertTrue(pathString.contains(_upgradeReportDir));
Assert.assertTrue(
StringUtil.contains(
String.valueOf(logCapture.getLogEntries()),
"Upgrade report generated in " + reportFileAbsolutePath,
StringPool.BLANK));
"Upgrade report generated in " + pathString, StringPool.BLANK));
}

private void _assertUpgradeReportDirectoryWriteProtected(
Expand All @@ -1033,7 +1031,6 @@ private void _assertUpgradeReportDirectoryWriteProtected(
reportFile = _getReportFile(reportFileName);

Assert.assertTrue(reportFile.exists());

Assert.assertTrue(
StringUtil.contains(
String.valueOf(logCapture.getLogEntries()),
Expand Down

0 comments on commit f4a752e

Please sign in to comment.