File tree Expand file tree Collapse file tree
modules/dcache/src/test/java/org/dcache/pool/json Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,16 +13,18 @@ public void shouldPrintHotfileReplicationStatus() {
1313 details .setHotFileReplicationEnabled (true );
1414
1515 StringWriter sw = new StringWriter ();
16- PrintWriter pw = new PrintWriter (sw );
17- details .print (pw );
16+ try (PrintWriter pw = new PrintWriter (sw )) {
17+ details .print (pw );
18+ }
1819
1920 String output = sw .toString ();
2021 assertTrue ("Output should contain Hot File Replication status" , output .contains ("Hot File Replication : ON" ));
2122
2223 details .setHotFileReplicationEnabled (false );
2324 sw = new StringWriter ();
24- pw = new PrintWriter (sw );
25- details .print (pw );
25+ try (PrintWriter pw = new PrintWriter (sw )) {
26+ details .print (pw );
27+ }
2628 output = sw .toString ();
2729 assertTrue ("Output should contain HotFile Replication status" , output .contains ("Hot File Replication : OFF" ));
2830 }
You can’t perform that action at this time.
0 commit comments