Skip to content

Commit

Permalink
Move log files + cleanup (#88)
Browse files Browse the repository at this point in the history
Move log files in RunTck + cleanup
  • Loading branch information
tzaeschke committed Nov 26, 2023
1 parent 4a03d88 commit f241fb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 11 additions & 12 deletions exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public void execute() throws MojoExecutionException {
if (resultValue != 0) {
failureCount++;
}
copyLogFiles(logFilePrefix);
moveLogFiles(logFilePrefix);

if (runOnce) {
alreadyRan = true;
Expand Down Expand Up @@ -533,6 +533,7 @@ private int executeTestClass(
command.add(debugDirectives);
}
command.add(testRunnerClass);
command.add("execute");
command.add("--disable-banner");
command.add("--disable-ansi-colors");
command.add("--details=" + testRunnerDetails);
Expand Down Expand Up @@ -583,34 +584,32 @@ private int executeTestClass(
}

/**
* Copies the implementation log file and TCK log file to the current log directory
* Moves the implementation log file and TCK log file to the current log directory
*
* @param logFilePrefix the prefix of the log file consisting of idtype and conf
*/
private void copyLogFiles(String logFilePrefix) {
private void moveLogFiles(String logFilePrefix) {
// Move log to per-test location
String testLogFilename = logFilePrefix + impl + ".txt";
try {
File logFile = new File(implLogFile);
FileUtils.copyFile(logFile, new File(testLogFilename));
resetFileContent(implLogFile);
FileUtils.moveFile(logFile, new File(testLogFilename));
} catch (Exception e) {
System.out.println(">> Error copying implementation log file: " + e.getMessage());
System.out.println(">> Error moving implementation log file: " + e.getMessage());
}
String tckLogFilename = logFilePrefix + TCK_LOG_FILE;
try {
File logFile = new File(tckLogFile);
FileUtils.copyFile(logFile, new File(tckLogFilename));
resetFileContent(tckLogFile);
FileUtils.moveFile(logFile, new File(tckLogFilename));
} catch (Exception e) {
System.out.println(">> Error copying tck log file: " + e.getMessage());
System.out.println(">> Error moving tck log file: " + e.getMessage());
}
}

/**
* Finalizes the TCK run: delete log files create the result summray file TCK-results.txt create
* system configuration description file Copy metadata from enhanced to configuration logs
* directory This method is called once per TCK run.
* Finalizes the TCK run: delete log files, create the result summary file TCK-results.txt, create
* system configuration description file, copy metadata from enhanced to configuration logs
* directory. This method is called once per TCK run.
*
* @param logDir the path of the log directory
* @param cpString classpath
Expand Down
2 changes: 0 additions & 2 deletions tck/src/main/java/org/apache/jdo/tck/pc/mylib/Point.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ public String toString() {
}

public int getX() {
System.out.println("Hello from Point.getX");
return x;
}

public Integer getY() {
System.out.println("Hello from Point.getY");
return y;
}

Expand Down

0 comments on commit f241fb9

Please sign in to comment.