Skip to content

Commit

Permalink
Merge pull request #251 from simon04/patch-1
Browse files Browse the repository at this point in the history
DynamicPolicy should continue existing file
  • Loading branch information
pmwmedia committed Apr 21, 2022
2 parents ed4c06d + ebf38b0 commit 5622635
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public DynamicPolicy(final String argument) {

@Override
public boolean continueExistingFile(final String path) {
return !reset;
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public final class DynamicPolicyTest {
public final SystemStreamCollector systemStream = new SystemStreamCollector(true);

/**
* Verifies that an existing log file can be continued until triggering a manual reset.
* Verifies that an existing log file will always be continued.
*
* @throws IOException
* Failed creating temporary file
*/
@Test
public void discontinueExistingFile() throws IOException {
public void continueExistingFile() throws IOException {
String file = FileSystem.createTemporaryFile();
DynamicPolicy policy = new DynamicPolicy(null);
assertThat(policy.continueExistingFile(file)).isTrue();

DynamicPolicy.setReset();
assertThat(policy.continueExistingFile(file)).isFalse();
assertThat(policy.continueExistingFile(file)).isTrue();

policy.reset();
assertThat(policy.continueExistingFile(file)).isTrue();
Expand Down

0 comments on commit 5622635

Please sign in to comment.