diff --git a/.gitattributes b/.gitattributes index d1d0795b..ad16cf07 100644 --- a/.gitattributes +++ b/.gitattributes @@ -182,8 +182,10 @@ Dotify/test/org/daisy/dotify/impl/input/text/resource-files/normalize.xsl -text Dotify/test/org/daisy/dotify/impl/input/xml/XMLInputManagerFactoryTest.java -text Dotify/test/org/daisy/dotify/input/InputManagerFactoryMakerTest.java -text Dotify/test/org/daisy/dotify/obfl/impl/ExpressionTest.java -text svneol=unset#text/plain +Dotify/test/org/daisy/dotify/resource-files/obfl-border-expected.pef -text Dotify/test/org/daisy/dotify/resource-files/obfl-dls-expected.pef -text Dotify/test/org/daisy/dotify/resource-files/obfl-expected.txt -text +Dotify/test/org/daisy/dotify/resource-files/obfl-input-border.obfl -text Dotify/test/org/daisy/dotify/resource-files/obfl-input-dls.obfl -text Dotify/test/org/daisy/dotify/resource-files/obfl-input.obfl -text DotifyDevtools/.classpath -text diff --git a/Dotify/test/org/daisy/dotify/LayoutEngineTest.java b/Dotify/test/org/daisy/dotify/LayoutEngineTest.java index 2f3b51a4..ac597809 100644 --- a/Dotify/test/org/daisy/dotify/LayoutEngineTest.java +++ b/Dotify/test/org/daisy/dotify/LayoutEngineTest.java @@ -52,6 +52,15 @@ public void testLayoutEnginge() throws LayoutEngineException, IOException { @Test public void testLayoutEngingeDLS() throws LayoutEngineException, IOException, PagedMediaWriterConfigurationException { + testPEF("resource-files/obfl-input-dls.obfl", "resource-files/obfl-dls-expected.pef"); + } + + @Test + public void testLayoutEngingeBorder() throws LayoutEngineException, IOException, PagedMediaWriterConfigurationException { + testPEF("resource-files/obfl-input-border.obfl", "resource-files/obfl-border-expected.pef"); + } + + private void testPEF(String input, String expected) throws LayoutEngineException, IOException, PagedMediaWriterConfigurationException { FormatterEngine engine = FormatterEngineMaker.newInstance().newFormatterEngine("sv-SE", BrailleTranslatorFactory.MODE_UNCONTRACTED, PagedMediaWriterFactoryMaker.newInstance().newPagedMediaWriter(MediaTypes.PEF_MEDIA_TYPE)); @@ -59,11 +68,11 @@ public void testLayoutEngingeDLS() throws LayoutEngineException, IOException, Pa File res = File.createTempFile("TestResult", ".tmp"); res.deleteOnExit(); - engine.convert(this.getClass().getResourceAsStream("resource-files/obfl-input-dls.obfl"), new FileOutputStream(res)); + engine.convert(this.getClass().getResourceAsStream(input), new FileOutputStream(res)); try { PEFFileCompare cmp = new PEFFileCompare(); - cmp.compare(new StreamSource(this.getClass().getResourceAsStream("resource-files/obfl-dls-expected.pef")), new StreamSource(new FileInputStream(res))); + cmp.compare(new StreamSource(this.getClass().getResourceAsStream(expected)), new StreamSource(new FileInputStream(res))); assertEquals("Binary compare is equal", -1, cmp.getPos()); } catch (IOException e) { e.printStackTrace(); diff --git a/Dotify/test/org/daisy/dotify/resource-files/obfl-border-expected.pef b/Dotify/test/org/daisy/dotify/resource-files/obfl-border-expected.pef new file mode 100644 index 00000000..1d5ec3fb --- /dev/null +++ b/Dotify/test/org/daisy/dotify/resource-files/obfl-border-expected.pef @@ -0,0 +1,61 @@ + + + + +application/x-pef+xml +dummy-id-ee904d6badfc2 +2014-01-13 +dummy-id-ee904d6badfc2 +1.0 +50 +2 +29 +29 +28 +N/A +Dotify +2 +yyyy-MM-dd +obfl +Mon Jan 13 14:29:43 CET 2014 +32 +0 +2014-01-13 +pef +N/A + + + + +
+ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠼⠁ +⠿⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠿ +⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠃⠕⠗⠙⠑⠗⠎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠏⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠹⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠏⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠹⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠇⠠⠞⠓⠊⠎⠀⠊⠎⠀⠁⠀⠞⠑⠎⠞⠀⠕⠋⠀⠸⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠇⠍⠥⠇⠞⠊⠏⠇⠑⠀⠃⠕⠗⠙⠑⠗⠎⠀⠀⠀⠸⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠇⠉⠕⠍⠃⠊⠝⠑⠙⠀⠺⠊⠞⠓⠀⠀⠀⠀⠀⠀⠸⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠇⠍⠁⠗⠛⠊⠝⠎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠇⠝⠑⠺⠀⠇⠊⠝⠑⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠇⠁⠝⠙⠀⠎⠕⠀⠕⠝⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠧⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠼⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠀⠧⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠼⠀⠀⠀⠀⠀⠿ +⠿⠀⠀⠠⠞⠓⠊⠎⠀⠊⠎⠀⠁⠀⠞⠑⠭⠞⠀⠁⠞⠀⠞⠓⠑⠀⠑⠝⠙⠀⠕⠋⠀⠞⠓⠑⠀⠀⠀⠿ +⠿⠀⠀⠕⠥⠞⠑⠗⠀⠃⠇⠕⠉⠅⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠿ +⠿⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠿ + +⠠⠊⠋⠀⠁⠀⠃⠇⠕⠉⠅⠀⠊⠎⠀⠑⠍⠏⠞⠽⠂⠀⠊⠞⠀⠎⠓⠕⠥⠇⠙⠀⠗⠑⠝⠙⠑⠗⠂ +⠊⠋⠀⠃⠕⠗⠙⠑⠗⠎⠀⠁⠗⠑⠀⠏⠗⠑⠎⠑⠝⠞⠄ +⠏⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠹ +⠧⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠼ + +
+
+ +
diff --git a/Dotify/test/org/daisy/dotify/resource-files/obfl-input-border.obfl b/Dotify/test/org/daisy/dotify/resource-files/obfl-input-border.obfl new file mode 100644 index 00000000..7a39612d --- /dev/null +++ b/Dotify/test/org/daisy/dotify/resource-files/obfl-input-border.obfl @@ -0,0 +1,26 @@ + + + + +
+ + + + + + +
+