diff options
author | pacien | 2018-01-07 23:03:21 +0100 |
---|---|---|
committer | pacien | 2018-01-07 23:20:23 +0100 |
commit | d6be0ea1898777f358a5c0d772d3eadb97d83127 (patch) | |
tree | a915af972bdd77b5ef8057c1ce86c0ec994af2b3 /src/test/java | |
download | pandoc-filter-plantuml-d6be0ea1898777f358a5c0d772d3eadb97d83127.tar.gz |
Import project
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/pacien/pandoc/filter/plantuml/FilterTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/java/org/pacien/pandoc/filter/plantuml/FilterTest.java b/src/test/java/org/pacien/pandoc/filter/plantuml/FilterTest.java new file mode 100644 index 0000000..f720b22 --- /dev/null +++ b/src/test/java/org/pacien/pandoc/filter/plantuml/FilterTest.java | |||
@@ -0,0 +1,27 @@ | |||
1 | package org.pacien.pandoc.filter.plantuml; | ||
2 | |||
3 | import org.junit.Assert; | ||
4 | import org.junit.Test; | ||
5 | |||
6 | import java.io.*; | ||
7 | import java.net.URISyntaxException; | ||
8 | import java.nio.file.Files; | ||
9 | import java.nio.file.Paths; | ||
10 | |||
11 | final public class FilterTest { | ||
12 | |||
13 | private static final String INPUT_FILE = "/input.json"; | ||
14 | private static final String EXPECTED_FILE = "/expected.json"; | ||
15 | |||
16 | @Test | ||
17 | public void filterTest() { | ||
18 | try (ByteArrayOutputStream o = new ByteArrayOutputStream()) { | ||
19 | byte[] e = Files.readAllBytes(Paths.get(getClass().getResource(EXPECTED_FILE).toURI())); | ||
20 | Filter.filter(getClass().getResourceAsStream(INPUT_FILE), o); | ||
21 | Assert.assertArrayEquals(o.toByteArray(), e); | ||
22 | } catch (IOException | URISyntaxException e) { | ||
23 | Assert.fail(); | ||
24 | } | ||
25 | } | ||
26 | |||
27 | } | ||