NO-JIRA improve logging for test System prop cleanup
This commit is contained in:
parent
acb8ff5a2e
commit
3e5a2f4951
|
@ -68,15 +68,25 @@ public class CleanupSystemPropertiesRule extends ExternalResource {
|
|||
|
||||
System.out.println("======================================================================================================");
|
||||
|
||||
if (!newProperties.isEmpty()) {
|
||||
System.out.println("Clearing system property...");
|
||||
|
||||
int i = 1;
|
||||
for (Object key : newProperties) {
|
||||
System.out.println("Cleaning up system property " + key);
|
||||
System.out.printf("\t%3d. %s = %s%n", i++, key, System.getProperty(key.toString()));
|
||||
System.clearProperty(key.toString());
|
||||
}
|
||||
}
|
||||
|
||||
if (!changed.isEmpty()) {
|
||||
System.out.println("Resetting system property...");
|
||||
|
||||
int i = 1;
|
||||
for (Map.Entry<Object, Object> entry : changed.entrySet()) {
|
||||
System.out.println("Setting up old system property, key=" + entry.getKey() + ", value = " + entry.getValue());
|
||||
System.out.printf("\t%3d. %s = %s (was %s)%n", i++, entry.getKey(), entry.getValue(), System.getProperty(entry.getKey().toString()));
|
||||
System.setProperty(entry.getKey().toString(), entry.getValue().toString());
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("======================================================================================================");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue