Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use try with resources in integration test #58

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/it/MRESOURCES-99/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import java.util.List;
import java.util.Collections;
import java.util.Arrays;

import org.codehaus.plexus.util.*;

boolean result = true;

File target = new File( basedir, "target" );
Expand All @@ -43,23 +41,14 @@ if ( !someResource.exists() || someResource.isDirectory() )

Properties props = new Properties();

FileInputStream fis = null;
try
{
fis = new FileInputStream( someResource );
try (FileInputStream fis = new FileInputStream( someResource )) {
props.load( fis );
fis.close();
fis = null;
}
catch ( IOException ex )
{
System.err.println( "Failure during reading the properties " + someResource.getAbsolutePath() );
return false;
}
finally
{
IOUtil.close( fis );
}

def keysWhichHaveToExist = [
"timestamp",
Expand Down