ATS-702 Add AIO tests from Misc Transformers (#234)

This commit is contained in:
David Edwards
2020-04-23 12:35:27 +01:00
committed by GitHub
parent bcb6626965
commit 0eda874c82
11 changed files with 224 additions and 16 deletions

View File

@@ -86,6 +86,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@@ -44,9 +44,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.nio.file.Files;
import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transformer.transformers.SelectingTransformer;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.junit.Before;
@@ -54,7 +54,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MvcResult;
@@ -65,13 +64,13 @@ import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilde
public class MiscControllerTest extends AbstractTransformerControllerTest
{
@Autowired
private MiscController controller;
protected AbstractTransformerController controller;
private final String sourceEncoding = "UTF-8";
private final String targetEncoding = "UTF-8";
private final String targetMimetype = MIMETYPE_TEXT_PLAIN;
protected final String sourceEncoding = "UTF-8";
protected final String targetEncoding = "UTF-8";
protected final String targetMimetype = MIMETYPE_TEXT_PLAIN;
private static final String ENGINE_CONFIG_NAME = "misc_engine_config.json";
protected static final String ENGINE_CONFIG_NAME = "misc_engine_config.json";
@Before
public void before() throws Exception
@@ -82,7 +81,7 @@ public class MiscControllerTest extends AbstractTransformerControllerTest
expectedOptions = null;
expectedSourceSuffix = null;
expectedSourceFileBytes = readTestFile(sourceExtension);
expectedTargetFileBytes = readTestFile(targetExtension);
expectedTargetFileBytes = Files.readAllBytes(getTestFile("quick2." + targetExtension, true).toPath());
//expectedTargetFileBytes = null;
sourceFile = new MockMultipartFile("file", "quick." + sourceExtension, sourceMimetype,
expectedSourceFileBytes);

View File

@@ -95,7 +95,7 @@ public class MiscTransformsIT
testFile(MIMETYPE_OPENXML_PRESENTATION, "pptx", "quick.pptx"),
testFile(MIMETYPE_OUTLOOK_MSG, "msg", "quick.msg"),
testFile(MIMETYPE_PDF, "pdf", "quick.pdf"),
testFile(MIMETYPE_TEXT_PLAIN, "txt", "quick.txt"),
testFile(MIMETYPE_TEXT_PLAIN, "txt", "quick2.txt"),
testFile("text/richtext", "rtf", "sample.rtf"),
testFile("text/sgml", "sgml", "sample.sgml"),