use of org.alfresco.service.cmr.repository.TransformationOptionLimits in project alfresco-repository by Alfresco.
the class TransformerConfigLimitsTest method transformerDefaultsUsedInMimetypesTest.
// ---------------------------------------
@Test
public // Checks that transformer defaults are combined to construct mimetype specific values
void transformerDefaultsUsedInMimetypesTest() {
mockProperties(transformerProperties, "content.transformer.transformer1.extensions.pdf.png.maxSourceSizeKBytes", "10", "content.transformer.transformer1.timeoutMs", "10000");
extractor = new TransformerConfigLimits(transformerProperties, mimetypeService);
TransformationOptionLimits limits = extractor.getLimits(transformer1, "application/pdf", "image/png", null);
assertEquals(10, limits.getMaxSourceSizeKBytes());
assertEquals(10000L, limits.getTimeoutMs());
}
use of org.alfresco.service.cmr.repository.TransformationOptionLimits in project alfresco-repository by Alfresco.
the class TransformerConfigLimitsTest method useSetTest.
@Test
public // Checks limit does not change if use param is specified but not specifically set
void useSetTest() {
mockProperties(transformerProperties, "content.transformer.transformer1.pageLimit.use.doclib", "22", "content.transformer.transformer1.pageLimit", "76");
extractor = new TransformerConfigLimits(transformerProperties, mimetypeService);
TransformationOptionLimits transformerDefaultLimits = extractor.getLimits(transformer1, null, null, null);
TransformationOptionLimits transformerDoclibLimits = extractor.getLimits(transformer1, null, null, "doclib");
assertEquals(76, transformerDefaultLimits.getPageLimit());
assertEquals(22, transformerDoclibLimits.getPageLimit());
}
use of org.alfresco.service.cmr.repository.TransformationOptionLimits in project alfresco-repository by Alfresco.
the class TransformerConfigLimitsTest method defaultUseTest2.
@Test
public // A value is specified as a transformer default without mimetypes but with a use
void defaultUseTest2() {
mockProperties(transformerProperties, "content.transformer.default.maxSourceSizeKBytes", "10", "content.transformer.default.maxSourceSizeKBytes.use.index", "20", // The following is ignored when "index" is specified, as the 'use' property is system wide.
"content.transformer.transformer2.maxSourceSizeKBytes", "30");
extractor = new TransformerConfigLimits(transformerProperties, mimetypeService);
TransformationOptionLimits limits = extractor.getLimits(transformer1, "application/pdf", "image/png", null);
assertEquals(10, limits.getMaxSourceSizeKBytes());
limits = extractor.getLimits(transformer2, "application/pdf", "image/png", null);
assertEquals(30, limits.getMaxSourceSizeKBytes());
limits = extractor.getLimits(transformer1, "application/pdf", "image/png", "index");
assertEquals(20, limits.getMaxSourceSizeKBytes());
limits = extractor.getLimits(transformer2, "application/pdf", "image/png", "index");
assertEquals(20, limits.getMaxSourceSizeKBytes());
}
use of org.alfresco.service.cmr.repository.TransformationOptionLimits in project alfresco-repository by Alfresco.
the class TransformerConfigLimitsTest method transformerMimetypesTest.
@Test
public // A value is specified for a transformer and mimetypes
void transformerMimetypesTest() {
mockProperties(transformerProperties, "content.transformer.transformer1.extensions.pdf.png.maxSourceSizeKBytes", "10");
extractor = new TransformerConfigLimits(transformerProperties, mimetypeService);
TransformationOptionLimits limits = extractor.getLimits(transformer1, "application/pdf", "image/png", null);
assertEquals(10, limits.getMaxSourceSizeKBytes());
}
use of org.alfresco.service.cmr.repository.TransformationOptionLimits in project alfresco-repository by Alfresco.
the class TransformerConfigLimitsTest method defaultMimetypesTest.
@Test
public // A value is specified as a transformer default with mimetypes
void defaultMimetypesTest() {
mockProperties(transformerProperties, "content.transformer.default.extensions.pdf.png.maxSourceSizeKBytes", "10");
extractor = new TransformerConfigLimits(transformerProperties, mimetypeService);
TransformationOptionLimits limits = extractor.getLimits(transformer1, "application/pdf", "image/png", null);
assertEquals(10, limits.getMaxSourceSizeKBytes());
}
Aggregations