mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
TransformerDebugTests + Ingres prefix tests
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -53,7 +53,7 @@ management:
|
|||||||
|
|
||||||
container:
|
container:
|
||||||
name: ${HOSTNAME:t-engine}
|
name: ${HOSTNAME:t-engine}
|
||||||
behind-ingres: true
|
behind-ingres: false
|
||||||
|
|
||||||
async-task-executor:
|
async-task-executor:
|
||||||
core-pool-size: 1
|
core-pool-size: 1
|
||||||
|
@@ -57,6 +57,7 @@ import org.springframework.core.io.UrlResource;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.mock.web.MockMultipartFile;
|
import org.springframework.mock.web.MockMultipartFile;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
|
import org.springframework.test.util.ReflectionTestUtils;
|
||||||
import org.springframework.test.web.servlet.MockMvc;
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||||
|
|
||||||
@@ -177,6 +178,29 @@ public class TransformControllerTest
|
|||||||
return logMessages;
|
return logMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void testPageWithOrWithoutIngresPrefix(String url, boolean behindIngres, String... expected) throws Exception
|
||||||
|
{
|
||||||
|
boolean origBehindIngres = (boolean) ReflectionTestUtils.getField(transformController, "behindIngres");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ReflectionTestUtils.setField(transformController, "behindIngres", behindIngres);
|
||||||
|
|
||||||
|
mockMvc.perform(MockMvcRequestBuilders.get(url))
|
||||||
|
.andExpect(status().isOk())
|
||||||
|
.andExpect(content().string(containsString(expected[0])))
|
||||||
|
.andExpect(content().string(containsString(expected[1])))
|
||||||
|
.andExpect(content().string(containsString(expected[2])))
|
||||||
|
.andExpect(content().string(containsString(expected[3])))
|
||||||
|
.andExpect(content().string(containsString(expected[4])))
|
||||||
|
.andExpect(content().string(containsString(expected[5])));
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
ReflectionTestUtils.setField(transformController, "behindIngres", origBehindIngres);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionEndpointIncludesAvailable() throws Exception
|
public void testVersionEndpointIncludesAvailable() throws Exception
|
||||||
{
|
{
|
||||||
@@ -188,25 +212,72 @@ public class TransformControllerTest
|
|||||||
@Test
|
@Test
|
||||||
public void testRootEndpointReturnsTestPage() throws Exception
|
public void testRootEndpointReturnsTestPage() throws Exception
|
||||||
{
|
{
|
||||||
mockMvc.perform(MockMvcRequestBuilders.get(ENDPOINT_ROOT))
|
testPageWithOrWithoutIngresPrefix(ENDPOINT_ROOT, false,
|
||||||
.andExpect(status().isOk())
|
"TwoCustomTransformers Test Page",
|
||||||
.andExpect(content().string(containsString("TwoCustomTransformers Test Page")));
|
"action=\"/test\"",
|
||||||
|
"<a href=\"/log\">Log</a>",
|
||||||
|
"<a href=\"/ready\">Ready</a>",
|
||||||
|
"<a href=\"/live\">Live</a>",
|
||||||
|
"<a href=\"/transform/config?configVersion=9999\">Config</a>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRootEndpointReturnsTestPageWithIngres() throws Exception
|
||||||
|
{
|
||||||
|
testPageWithOrWithoutIngresPrefix(ENDPOINT_ROOT, true,
|
||||||
|
"TwoCustomTransformers Test Page",
|
||||||
|
"action=\"/twocustomtransformers/test\"",
|
||||||
|
"href=\"/twocustomtransformers/log\"",
|
||||||
|
"<a href=\"/twocustomtransformers/ready\">Ready</a>",
|
||||||
|
"<a href=\"/twocustomtransformers/live\">Live</a>",
|
||||||
|
"<a href=\"/twocustomtransformers/transform/config?configVersion=9999\">Config</a>");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testErrorEndpointReturnsErrorPage() throws Exception
|
public void testErrorEndpointReturnsErrorPage() throws Exception
|
||||||
{
|
{
|
||||||
mockMvc.perform(MockMvcRequestBuilders.get(ENDPOINT_ERROR))
|
testPageWithOrWithoutIngresPrefix(ENDPOINT_ERROR, false,
|
||||||
.andExpect(status().isOk())
|
"TwoCustomTransformers Error Page",
|
||||||
.andExpect(content().string(containsString("TwoCustomTransformers Error Page")));
|
"<a href=\"/\">Test</a>",
|
||||||
|
"<a href=\"/log\">Log</a>",
|
||||||
|
"<a href=\"/ready\">Ready</a>",
|
||||||
|
"<a href=\"/live\">Live</a>",
|
||||||
|
"<a href=\"/transform/config?configVersion=9999\">Config</a>"); }
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testErrorEndpointReturnsErrorPageWithIngres() throws Exception
|
||||||
|
{
|
||||||
|
testPageWithOrWithoutIngresPrefix(ENDPOINT_ERROR, true,
|
||||||
|
"TwoCustomTransformers Error Page",
|
||||||
|
"href=\"/twocustomtransformers/\"",
|
||||||
|
"href=\"/twocustomtransformers/log\"",
|
||||||
|
"<a href=\"/twocustomtransformers/ready\">Ready</a>",
|
||||||
|
"<a href=\"/twocustomtransformers/live\">Live</a>",
|
||||||
|
"<a href=\"/twocustomtransformers/transform/config?configVersion=9999\">Config</a>");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLogEndpointReturnsLogPage() throws Exception
|
public void testLogEndpointReturnsLogPage() throws Exception
|
||||||
{
|
{
|
||||||
mockMvc.perform(MockMvcRequestBuilders.get(ENDPOINT_LOG))
|
testPageWithOrWithoutIngresPrefix(ENDPOINT_LOG, false,
|
||||||
.andExpect(status().isOk())
|
"TwoCustomTransformers Log Entries",
|
||||||
.andExpect(content().string(containsString("TwoCustomTransformers Log Entries")));
|
"<a href=\"/\">Test</a>",
|
||||||
|
"Log",
|
||||||
|
"<a href=\"/ready\">Ready</a>",
|
||||||
|
"<a href=\"/live\">Live</a>",
|
||||||
|
"<a href=\"/transform/config?configVersion=9999\">Config</a>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testLogEndpointReturnsLogPageWithIngres() throws Exception
|
||||||
|
{
|
||||||
|
testPageWithOrWithoutIngresPrefix(ENDPOINT_LOG, true,
|
||||||
|
"TwoCustomTransformers Log Entries",
|
||||||
|
"href=\"/twocustomtransformers/\"",
|
||||||
|
"Log",
|
||||||
|
"<a href=\"/twocustomtransformers/ready\">Ready</a>",
|
||||||
|
"<a href=\"/twocustomtransformers/live\">Live</a>",
|
||||||
|
"<a href=\"/twocustomtransformers/transform/config?configVersion=9999\">Config</a>");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@@ -78,6 +78,10 @@ public class TransformerDebug
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Only called from the deprecated transformer base
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
public void pushTransform(String reference, String sourceMimetype, String targetMimetype, File sourceFile, String transformerName)
|
public void pushTransform(String reference, String sourceMimetype, String targetMimetype, File sourceFile, String transformerName)
|
||||||
{
|
{
|
||||||
final long sourceSizeInBytes = sourceFile.length();
|
final long sourceSizeInBytes = sourceFile.length();
|
||||||
|
@@ -39,6 +39,10 @@ import java.util.StringJoiner;
|
|||||||
|
|
||||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
|
import static org.alfresco.transform.common.Mimetype.MIMETYPE_TEXT_PLAIN;
|
||||||
import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORD;
|
import static org.alfresco.transform.common.Mimetype.MIMETYPE_WORD;
|
||||||
|
import static org.alfresco.transform.common.RepositoryClientData.CLIENT_DATA_SEPARATOR;
|
||||||
|
import static org.alfresco.transform.common.RepositoryClientData.DEBUG;
|
||||||
|
import static org.alfresco.transform.common.RepositoryClientData.DEBUG_SEPARATOR;
|
||||||
|
import static org.alfresco.transform.common.RepositoryClientData.REPO_ID;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,14 +63,16 @@ class TransformerDebugTest
|
|||||||
.replaceAll(" [\\d,]+ ms", " -- ms");
|
.replaceAll(" [\\d,]+ ms", " -- ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void twoStepTransform(boolean isTEngine, boolean fail, Level logLevel)
|
private void twoStepTransform(boolean isTEngine, boolean fail, Level logLevel, String renditionName,
|
||||||
|
long sourceSize)
|
||||||
{
|
{
|
||||||
transformerDebug.setIsTEngine(isTEngine);
|
transformerDebug.setIsTEngine(isTEngine);
|
||||||
monitorLogs(logLevel);
|
monitorLogs(logLevel);
|
||||||
|
|
||||||
TransformRequest request = TransformRequest.builder()
|
TransformRequest request = TransformRequest.builder()
|
||||||
.withSourceSize(1234L)
|
.withSourceSize(sourceSize)
|
||||||
.withInternalContext(InternalContext.initialise(null))
|
.withInternalContext(InternalContext.initialise(null))
|
||||||
|
.withClientData(clientDataWithDebugRequest(renditionName))
|
||||||
.build();
|
.build();
|
||||||
TransformStack.setInitialSourceReference(request.getInternalContext(), "fileRef");
|
TransformStack.setInitialSourceReference(request.getInternalContext(), "fileRef");
|
||||||
|
|
||||||
@@ -102,6 +108,22 @@ class TransformerDebugTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String clientDataWithDebugRequest(String renditionName)
|
||||||
|
{
|
||||||
|
return new StringJoiner(CLIENT_DATA_SEPARATOR)
|
||||||
|
.add(REPO_ID + "ACS1234")
|
||||||
|
.add("1")
|
||||||
|
.add(renditionName)
|
||||||
|
.add("3")
|
||||||
|
.add("4")
|
||||||
|
.add("5")
|
||||||
|
.add("54321")
|
||||||
|
.add("7")
|
||||||
|
.add("8")
|
||||||
|
.add(DEBUG)
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
|
||||||
private void monitorLogs(Level logLevel)
|
private void monitorLogs(Level logLevel)
|
||||||
{
|
{
|
||||||
Logger logger = (Logger)LoggerFactory.getLogger(TransformerDebug.class);
|
Logger logger = (Logger)LoggerFactory.getLogger(TransformerDebug.class);
|
||||||
@@ -122,7 +144,7 @@ class TransformerDebugTest
|
|||||||
@Test
|
@Test
|
||||||
void testRouterTwoStepTransform()
|
void testRouterTwoStepTransform()
|
||||||
{
|
{
|
||||||
twoStepTransform(false, false, Level.DEBUG);
|
twoStepTransform(false, false, Level.DEBUG, "", 1234L);
|
||||||
|
|
||||||
Assertions.assertEquals("" +
|
Assertions.assertEquals("" +
|
||||||
"1 txt pdf 1.2 KB wrapper\n" +
|
"1 txt pdf 1.2 KB wrapper\n" +
|
||||||
@@ -137,7 +159,7 @@ class TransformerDebugTest
|
|||||||
@Test
|
@Test
|
||||||
void testRouterTwoStepTransformWithTrace()
|
void testRouterTwoStepTransformWithTrace()
|
||||||
{
|
{
|
||||||
twoStepTransform(false, false, Level.TRACE);
|
twoStepTransform(false, false, Level.TRACE, "", 1234L);
|
||||||
|
|
||||||
// With trace there are "Finished" lines for nested transforms, like a T-Engine's debug but still without
|
// With trace there are "Finished" lines for nested transforms, like a T-Engine's debug but still without
|
||||||
// the size and rendition name
|
// the size and rendition name
|
||||||
@@ -156,7 +178,7 @@ class TransformerDebugTest
|
|||||||
@Test
|
@Test
|
||||||
void testEngineTwoStepTransform()
|
void testEngineTwoStepTransform()
|
||||||
{
|
{
|
||||||
twoStepTransform(true, false, Level.DEBUG);
|
twoStepTransform(true, false, Level.DEBUG, "", 1234L);
|
||||||
|
|
||||||
// Note the first and last lines would only ever be logged on the router, but the expected data includes
|
// Note the first and last lines would only ever be logged on the router, but the expected data includes
|
||||||
// the extra "Finished" lines, sizes and renditions (if set in client data).
|
// the extra "Finished" lines, sizes and renditions (if set in client data).
|
||||||
@@ -175,7 +197,7 @@ class TransformerDebugTest
|
|||||||
@Test
|
@Test
|
||||||
void testRouterTwoStepTransformWithFailure()
|
void testRouterTwoStepTransformWithFailure()
|
||||||
{
|
{
|
||||||
twoStepTransform(false, true, Level.DEBUG);
|
twoStepTransform(false, true, Level.DEBUG, "", 1234L);
|
||||||
|
|
||||||
Assertions.assertEquals("" +
|
Assertions.assertEquals("" +
|
||||||
"1 txt pdf 1.2 KB wrapper\n" +
|
"1 txt pdf 1.2 KB wrapper\n" +
|
||||||
@@ -187,19 +209,98 @@ class TransformerDebugTest
|
|||||||
getTransformerDebugOutput());
|
getTransformerDebugOutput());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testRenditionName()
|
||||||
|
{
|
||||||
|
twoStepTransform(false, false, Level.DEBUG, "renditionName", 1234L);
|
||||||
|
|
||||||
|
Assertions.assertEquals("" +
|
||||||
|
"1 txt pdf 1.2 KB -- renditionName -- wrapper\n" +
|
||||||
|
"1.1 txt doc transformer1\n" +
|
||||||
|
"1.2 doc pdf transformer2\n" +
|
||||||
|
"1.2 k1=\"v1\"\n" +
|
||||||
|
"1.2 k2=\"v2\"\n" +
|
||||||
|
"1 Finished in -- ms",
|
||||||
|
getTransformerDebugOutput());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testMetadataExtract()
|
||||||
|
{
|
||||||
|
twoStepTransform(false, false, Level.DEBUG, "transform:alfresco-metadata-extract", 1234L);
|
||||||
|
|
||||||
|
Assertions.assertEquals("" +
|
||||||
|
"1 txt pdf 1.2 KB -- metadataExtract -- wrapper\n" +
|
||||||
|
"1.1 txt doc transformer1\n" +
|
||||||
|
"1.2 doc pdf transformer2\n" +
|
||||||
|
"1.2 k1=\"v1\"\n" +
|
||||||
|
"1.2 k2=\"v2\"\n" +
|
||||||
|
"1 Finished in -- ms",
|
||||||
|
getTransformerDebugOutput());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testMetadataEmbed()
|
||||||
|
{
|
||||||
|
twoStepTransform(false, false, Level.DEBUG, "transform:alfresco-metadata-embed", 1234L);
|
||||||
|
|
||||||
|
Assertions.assertEquals("" +
|
||||||
|
"1 txt pdf 1.2 KB -- metadataEmbed -- wrapper\n" +
|
||||||
|
"1.1 txt doc transformer1\n" +
|
||||||
|
"1.2 doc pdf transformer2\n" +
|
||||||
|
"1.2 k1=\"v1\"\n" +
|
||||||
|
"1.2 k2=\"v2\"\n" +
|
||||||
|
"1 Finished in -- ms",
|
||||||
|
getTransformerDebugOutput());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testSourceSize1Byte()
|
||||||
|
{
|
||||||
|
twoStepTransform(false, false, Level.DEBUG, "", 1);
|
||||||
|
|
||||||
|
Assertions.assertEquals("" +
|
||||||
|
"1 txt pdf 1 byte wrapper\n" +
|
||||||
|
"1.1 txt doc transformer1\n" +
|
||||||
|
"1.2 doc pdf transformer2\n" +
|
||||||
|
"1.2 k1=\"v1\"\n" +
|
||||||
|
"1.2 k2=\"v2\"\n" +
|
||||||
|
"1 Finished in -- ms",
|
||||||
|
getTransformerDebugOutput());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testSourceSize23TB()
|
||||||
|
{
|
||||||
|
twoStepTransform(false, false, Level.DEBUG, "", 23L*1024*1024*1024*1024);
|
||||||
|
|
||||||
|
Assertions.assertEquals("" +
|
||||||
|
"1 txt pdf 23 TB wrapper\n" +
|
||||||
|
"1.1 txt doc transformer1\n" +
|
||||||
|
"1.2 doc pdf transformer2\n" +
|
||||||
|
"1.2 k1=\"v1\"\n" +
|
||||||
|
"1.2 k2=\"v2\"\n" +
|
||||||
|
"1 Finished in -- ms",
|
||||||
|
getTransformerDebugOutput());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testLogFailure()
|
void testLogFailure()
|
||||||
{
|
{
|
||||||
monitorLogs(Level.TRACE);
|
monitorLogs(Level.TRACE);
|
||||||
|
|
||||||
|
String origClientData = clientDataWithDebugRequest("");
|
||||||
TransformReply reply = TransformReply.builder()
|
TransformReply reply = TransformReply.builder()
|
||||||
.withInternalContext(InternalContext.initialise(null))
|
.withInternalContext(InternalContext.initialise(null))
|
||||||
.withErrorDetails("T-Request was null - a major error")
|
.withErrorDetails("T-Request was null - a major error")
|
||||||
|
.withClientData(origClientData)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
transformerDebug.logFailure(reply);
|
transformerDebug.logFailure(reply);
|
||||||
|
|
||||||
Assertions.assertEquals(" T-Request was null - a major error", getTransformerDebugOutput());
|
String expectedDebug = " T-Request was null - a major error";
|
||||||
|
Assertions.assertEquals(expectedDebug, getTransformerDebugOutput());
|
||||||
|
assertEquals(origClientData+DEBUG_SEPARATOR+expectedDebug, reply.getClientData());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
2
pom.xml
2
pom.xml
@@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-transform-core</artifactId>
|
<artifactId>alfresco-transform-core</artifactId>
|
||||||
<version>3.0.1-HXP-A2-SNAPSHOT</version>
|
<version>3.0.0-HXP-A3-SNAPSHOT</version>
|
||||||
<name>Alfresco Transform Core</name>
|
<name>Alfresco Transform Core</name>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user