-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#635 create a test to check new line encoding on .sh files
- Loading branch information
1 parent
6391858
commit 94a3f0e
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
olv-dist/src/test/java/pl/otros/logview/dist/FileNewLineEncodingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package pl.otros.logview.dist; | ||
|
||
import org.testng.annotations.Test; | ||
import org.testng.reporters.Files; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import static org.testng.AssertJUnit.assertFalse; | ||
|
||
public class FileNewLineEncodingTest { | ||
@Test | ||
public void testShellScriptUnixNewLineEncoding() throws IOException { | ||
assertFalse("The file olv.sh contains widows new line ('\\r'). Remove it or you cannot use this script with linux!", readFile("olv.sh").contains("\r")); | ||
assertFalse("The file olv-batch.sh contains widows new line ('\\r'). Remove it or you cannot use this script with linux!", readFile("olv-batch.sh").contains("\r")); | ||
} | ||
|
||
private String readFile(String file) throws IOException { | ||
return Files.readFile(new File("src/main/dist/" + file)); | ||
} | ||
} |