-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- B fixed issue with opening multiple files of Linux
fixes #429
- Loading branch information
1 parent
68eb07a
commit e649445
Showing
2 changed files
with
31 additions
and
1 deletion.
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
30 changes: 30 additions & 0 deletions
30
approvaltests-util/src/test/java/com/spun/util/tests/LinuxOpenerTest.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,30 @@ | ||
package com.spun.util.tests; | ||
|
||
import com.spun.util.io.FileUtils; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.File; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class LinuxOpenerTest | ||
{ | ||
@Disabled("This test takes a lot of time to run and opens a browser window") | ||
@Test | ||
void testMultipleFilesOnLinux() throws Exception | ||
{ | ||
File tempFile = File.createTempFile("test", ".html"); | ||
FileUtils.writeFile(tempFile, "<html><body><h1>Applesauce</h1></body></html>"); | ||
int countCorrect = 0; | ||
int totalRuns = 10; | ||
for (int i = 0; i < totalRuns; i++) | ||
{ | ||
if (LinuxOpener.executeOnLinux(tempFile.getAbsolutePath(), "open")) | ||
{ | ||
countCorrect++; | ||
} | ||
} | ||
assertEquals(totalRuns, countCorrect); | ||
} | ||
} |