forked from mtmse/dotify.formatter.impl
-
Notifications
You must be signed in to change notification settings - Fork 0
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
f4ae2e7
commit da3bb59
Showing
5 changed files
with
146 additions
and
3 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
integrationtest/org/daisy/dotify/formatter/test/SequenceBreakTest.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 org.daisy.dotify.formatter.test; | ||
|
||
import org.daisy.dotify.api.engine.LayoutEngineException; | ||
import org.daisy.dotify.api.writer.PagedMediaWriterConfigurationException; | ||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Unit tests for sequence breaks. | ||
* TODO: true -> false | ||
* | ||
* @author Paul Rambags | ||
*/ | ||
@SuppressWarnings("javadoc") | ||
public class SequenceBreakTest extends AbstractFormatterEngineTest { | ||
|
||
@Test | ||
public void testParsing() throws | ||
LayoutEngineException, | ||
IOException, | ||
PagedMediaWriterConfigurationException { | ||
testPEF( | ||
"resource-files/sequence-break/parsing-input.obfl", | ||
"resource-files/sequence-break/parsing-expected.pef", | ||
true | ||
); | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
...ontest/org/daisy/dotify/formatter/test/resource-files/sequence-break/parsing-expected.pef
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,53 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<pef version="2008-1" xmlns="http://www.daisy.org/ns/2008/pef"> | ||
<head> | ||
<meta xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<dc:format>application/x-pef+xml</dc:format> | ||
<dc:identifier>identifier?</dc:identifier> | ||
<dc:date>2020-08-07</dc:date> | ||
<dc:title>Parsing of sequence breaks test</dc:title> | ||
<dc:description>Tests the parsing of sequence breaks</dc:description> | ||
</meta> | ||
</head> | ||
<body> | ||
<volume cols="10" rows="6" rowgap="0" duplex="false"> | ||
<section> | ||
<page> | ||
<row>⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
<section> | ||
<page> | ||
<row>⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
<section> | ||
<page> | ||
<row>⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
<section> | ||
<page> | ||
<row>⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
<section> | ||
<page> | ||
<row>⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
</volume> | ||
<volume cols="10" rows="6" rowgap="0" duplex="false"> | ||
<section> | ||
<page> | ||
<row>⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
<section> | ||
<page> | ||
<row>⠤⠤⠤</row> | ||
</page> | ||
</section> | ||
</volume> | ||
</body> | ||
</pef> |
56 changes: 56 additions & 0 deletions
56
...tiontest/org/daisy/dotify/formatter/test/resource-files/sequence-break/parsing-input.obfl
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,56 @@ | ||
<obfl xmlns="http://www.daisy.org/ns/2011/obfl" version="2011-1" xml:lang="en"> | ||
<meta xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<dc:title>Parsing of sequence breaks test</dc:title> | ||
<dc:description>Tests the parsing of sequence breaks</dc:description> | ||
</meta> | ||
<layout-master name="main" page-width="10" page-height="6" duplex="false"> | ||
<default-template> | ||
<header/> | ||
<footer/> | ||
</default-template> | ||
</layout-master> | ||
<table-of-contents name="toc"> | ||
<toc-block/> | ||
</table-of-contents> | ||
<volume-template sheets-in-volume-max="5" use-when="(= $volume 1)"> | ||
<pre-content> | ||
<dynamic-sequence master="main" break-before="page" break-after="page"> | ||
<block>⠤⠤⠤</block> | ||
</dynamic-sequence> | ||
<sequence master="main" break-before="page" break-after="page"> | ||
<block>⠤⠤⠤</block> | ||
</sequence> | ||
</pre-content> | ||
<post-content> | ||
<toc-sequence toc="toc" range="document" master="main" break-before="page" break-after="page"/> | ||
</post-content> | ||
</volume-template> | ||
<volume-template sheets-in-volume-max="5" use-when="(> $volume 1)"> | ||
<pre-content> | ||
<dynamic-sequence master="main" break-before="sheet" break-after="sheet"> | ||
<block>⠤⠤⠤</block> | ||
</dynamic-sequence> | ||
<sequence master="main" break-before="sheet" break-after="sheet"> | ||
<block>⠤⠤⠤</block> | ||
</sequence> | ||
</pre-content> | ||
<post-content> | ||
<toc-sequence toc="toc" range="document" master="main" break-before="sheet" break-after="sheet"/> | ||
</post-content> | ||
</volume-template> | ||
<sequence master="main"> | ||
<block>⠤⠤⠤</block> | ||
</sequence> | ||
<sequence master="main" break-before="auto" break-after="page"> | ||
<block>⠤⠤⠤</block> | ||
</sequence> | ||
<sequence master="main" break-before="page" break-after="sheet"> | ||
<block>⠤⠤⠤</block> | ||
</sequence> | ||
<sequence master="main" break-before="sheet" break-after="volume"> | ||
<block>⠤⠤⠤</block> | ||
</sequence> | ||
<sequence master="main" break-before="volume" break-after="auto"> | ||
<block>⠤⠤⠤</block> | ||
</sequence> | ||
</obfl> |
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