Skip to content

Commit c31067c

Browse files
save log files to debug problem in system test
1 parent df00212 commit c31067c

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

system-test/src/test/java/oracle/weblogic/deploy/integration/BaseTest.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
3+
4+
5+
6+
17
// Copyright 2019, Oracle Corporation and/or its affiliates. All rights reserved.
28
// Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
39

@@ -79,7 +85,8 @@ protected static void cleanup() throws Exception {
7985
logger.info("cleaning up the test environment ...");
8086

8187
// remove WDT script home directory
82-
String cmd = "rm -rf " + getTargetDir() + FS + WDT_HOME_DIR;
88+
String cmd = "tar -cvf" + getTargetDir() +FS
89+
8390
executeNoVerify(cmd);
8491

8592
// delete the domain directory created by the tests
@@ -89,7 +96,13 @@ protected static void cleanup() throws Exception {
8996
FileUtils.deleteDirectory(domainParentDir);
9097
}
9198
}
99+
protected static void saveLogFiles(testMethodName) throws Exception {
100+
logger.info("saving log files ...");
92101

102+
// remove WDT script home directory
103+
String cmd = "tar -cvf" + getTargetDir() +FS + "testMethodName.tar " + getTargetDir() + FS + WDT_HOME_DIR;
104+
executeNoVerify(cmd);
105+
}
93106
protected static String getProjectRoot() {
94107
return projectRoot;
95108
}

system-test/src/test/java/oracle/weblogic/deploy/integration/ITWdt.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ public void testFDiscoverDomainWithRequiredArgument() throws Exception {
362362

363363
logger.info("executing command: " + cmd);
364364
ExecResult result = ExecCommand.exec(cmd);
365+
saveLogFiles(testMethodName);
365366
verifyResult(result, "discoverDomain.sh completed successfully");
366367

367368
// unzip discoveredArchive.zip
@@ -393,6 +394,7 @@ public void testGDiscoverDomainWithModelFile() throws Exception {
393394

394395
logger.info("executing command: " + cmd);
395396
ExecResult result = ExecCommand.exec(cmd);
397+
saveLogFiles(testMethodName);
396398
verifyResult(result, "discoverDomain.sh completed successfully");
397399

398400
// verify model file
@@ -418,6 +420,7 @@ public void testHDiscoverDomainJRFDomainType() throws Exception {
418420

419421
logger.info("executing command: " + cmd);
420422
ExecResult result = ExecCommand.exec(cmd);
423+
saveLogFiles(testMethodName);
421424
verifyResult(result, "discoverDomain.sh completed successfully");
422425

423426
// verify model file

0 commit comments

Comments
 (0)