Skip to content

Commit

Permalink
adding in TestingResourcesTest
Browse files Browse the repository at this point in the history
  • Loading branch information
sambish5 committed May 20, 2024
1 parent da7d8b5 commit dc62465
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/java/emissary/test/core/junit5/TestingResourcesTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package emissary.test.core.junit5;

import emissary.place.IServiceProviderPlace;
import emissary.transform.HtmlEscapePlace;
import emissary.transform.HtmlEscapePlaceTest;

import org.junit.jupiter.params.provider.Arguments;

import java.io.IOException;
import java.util.stream.Stream;

/**
* Explicitly meant to test data and answer files from different directories. This test uses {@link HtmlEscapePlaceTest}
* sample.dat with the sample.xml in {@link TestingResourcesTest} directory.
*/
public class TestingResourcesTest extends ExtractionTest {

public static Stream<? extends Arguments> data() {
return getMyTestParameterFiles(HtmlEscapePlaceTest.class, TestingResourcesTest.class);
}

@Override
public IServiceProviderPlace createPlace() throws IOException {
return new HtmlEscapePlace();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<root>
<setup>
<initialForm>HTML</initialForm>
<fontEncoding>UTF8</fontEncoding>
</setup>

<answers>
<numAttachments>0</numAttachments>
<currentForm>HTML</currentForm>
<fileType>HTML</fileType>
<currentFormSize>1</currentFormSize>
<fontEncoding>UTF8</fontEncoding>

<meta>
<name>CHARACTER_DIGIT_HTML_ESCAPE</name>
<value>7</value>
</meta>

<meta>
<name>CHARACTER_PUNCTUATION_HTML_ESCAPE</name>
<value>4</value>
</meta>

<meta>
<name>CHARACTER_BLANK_SPACE_HTML_ESCAPE</name>
<value>3</value>
</meta>

<data matchMode="index">
<value>٠١٢٣٤٥</value>
</data>

<data matchMode="index">
<value>This Is A Test</value>
</data>

<data matchMode="contains">
<value>This Is A Test</value>
</data>

<data matchMode="index">
<value>You can have it one way &amp;&amp; Not the other way, || both ways</value>
</data>

</answers>
</root>

0 comments on commit dc62465

Please sign in to comment.