-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f19db33
commit 6aa9437
Showing
4 changed files
with
100 additions
and
12 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
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
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
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,46 @@ | ||
package io.eroshenkoam.xcresults; | ||
|
||
import io.eroshenkoam.xcresults.util.FreemarkerUtil; | ||
import org.junit.Test; | ||
|
||
import picocli.CommandLine; | ||
|
||
import java.nio.file.FileSystems; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.PathMatcher; | ||
import java.util.Map; | ||
import java.util.stream.Stream; | ||
|
||
public class SimpleTest { | ||
|
||
@Test | ||
public void testCommand() { | ||
System.setProperty("user.dir", "/Users/eroshenkoam/Downloads"); | ||
final CommandLine cmd = new CommandLine(new MainCommand()); | ||
cmd.execute( | ||
"export", | ||
"marathon-uiTests/device-files/omni/*/xcresult/*.xcresult", | ||
"-o", "/Users/eroshenkoam/Downloads/allure-results" | ||
); | ||
} | ||
|
||
@Test | ||
public void testTempplate() throws Exception { | ||
FreemarkerUtil.render(Path.of("/Users/eroshenkoam/Developer/eroshenkoam/xcresults/src/main/resources/templates/carousel.ftl"), Map.of("ca", "")); | ||
} | ||
|
||
@Test | ||
public void testGlob() throws Exception { | ||
final String dir = "/Users/eroshenkoam/Downloads"; | ||
final String input = "marathon-uiTests/device-files/omni/*/xcresult/*.xcresult"; | ||
|
||
// final String input = "glob:marathon-uiTests/allure-results/*.json"; | ||
final String pattern = String.format("glob:%s", Path.of(input).toAbsolutePath()); | ||
System.out.println(pattern); | ||
final PathMatcher pathMatcher = FileSystems.getDefault().getPathMatcher(pattern); | ||
final Stream<Path> walk = Files.walk(Path.of(dir)); | ||
walk.filter(pathMatcher::matches).forEach(System.out::println); | ||
} | ||
|
||
} |