Skip to content

Commit

Permalink
[sleepiq] Fix the failing tests on Windows (openhab#7983)
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Garnier <[email protected]>
  • Loading branch information
lolodomo authored and andrewfg committed Aug 31, 2020
1 parent 139f949 commit 37ef22e
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@
import java.util.Arrays;
import java.util.List;

public abstract class AbstractTest
{
public abstract class AbstractTest {
private static final String RESOURCES_PATH = "src/test/resources/";

protected File getTestDataFile(String name)
{
protected File getTestDataFile(String name) {
return getTestDataPath(name).toFile();
}

protected Path getTestDataPath(String name)
{
protected Path getTestDataPath(String name) {
String packageName = this.getClass().getPackage().getName();

List<String> paths = new ArrayList<>();
Expand All @@ -44,8 +41,7 @@ protected Path getTestDataPath(String name)
return Paths.get(RESOURCES_PATH, paths.toArray(new String[paths.size()]));
}

protected String readJson(String jsonFileName) throws IOException
{
return new String(Files.readAllBytes(getTestDataPath(jsonFileName)));
protected String readJson(String jsonFileName) throws IOException {
return String.join("\n", Files.readAllLines(getTestDataPath(jsonFileName)));
}
}

0 comments on commit 37ef22e

Please sign in to comment.