mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
#59 fix unparsed text uri resolving
This commit is contained in:
parent
13de7f00a4
commit
0717e22d33
10 changed files with 58 additions and 16 deletions
|
|
@ -9,11 +9,8 @@ import static org.mockito.Mockito.when;
|
|||
|
||||
import javax.xml.transform.Source;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.ContentRepository;
|
||||
|
|
@ -42,7 +39,8 @@ public class CreateReportActionTest {
|
|||
@Before
|
||||
public void setup() {
|
||||
this.repository = Simple.createContentRepository();
|
||||
this.action = new CreateReportAction(this.repository.getProcessor(), new ConversionService(), this.repository.getResolver());
|
||||
this.action = new CreateReportAction(this.repository.getProcessor(), new ConversionService(), this.repository.getResolver(),
|
||||
this.repository.getUnparsedTextURIResolver());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -72,7 +70,7 @@ public class CreateReportActionTest {
|
|||
public void testExecutionException() throws SaxonApiException {
|
||||
final Processor p = mock(Processor.class);
|
||||
final DocumentBuilder documentBuilder = mock(DocumentBuilder.class);
|
||||
this.action = new CreateReportAction(p, new ConversionService(), null);
|
||||
this.action = new CreateReportAction(p, new ConversionService(), null, null);
|
||||
|
||||
when(p.newDocumentBuilder()).thenReturn(documentBuilder);
|
||||
when(documentBuilder.build(any(Source.class))).thenThrow(new SaxonApiException("mocked"));
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@
|
|||
<result>
|
||||
<xsl:copy-of select="." />
|
||||
</result>
|
||||
<text>
|
||||
<xsl:value-of select="unparsed-text('some.txt','UTF-8')" />
|
||||
</text>
|
||||
</report>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
|||
1
src/test/resources/examples/simple/repository/some.txt
Normal file
1
src/test/resources/examples/simple/repository/some.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
This content should be transferred to the result document
|
||||
Loading…
Add table
Add a link
Reference in a new issue