HXENG-64 refactor ATS

* Pick refactored t-core 3.0.0 and t-service 2.0.0.
* Use new package names from t-model
* Fix up a few test failures due to incomplete t-config which is now checked.
This commit is contained in:
Alan Davis
2022-09-14 22:07:07 +01:00
committed by GitHub
parent bec0ac0236
commit 64955658fc
30 changed files with 126 additions and 108 deletions

View File

@@ -51,8 +51,8 @@
<dependency.alfresco-log-sanitizer.version>0.2</dependency.alfresco-log-sanitizer.version>
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
<dependency.activiti.version>5.23.0</dependency.activiti.version>
<dependency.alfresco-transform-service.version>1.5.4-A3</dependency.alfresco-transform-service.version>
<dependency.alfresco-transform-core.version>2.7.0-A1</dependency.alfresco-transform-core.version>
<dependency.alfresco-transform-service.version>2.0.0-A1</dependency.alfresco-transform-service.version>
<dependency.alfresco-transform-core.version>3.0.0-A1</dependency.alfresco-transform-core.version>
<dependency.alfresco-greenmail.version>6.4</dependency.alfresco-greenmail.version>
<dependency.acs-event-model.version>0.0.16</dependency.acs-event-model.version>

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -36,7 +36,7 @@ import org.alfresco.repo.content.metadata.MetadataExtracter;
import org.alfresco.repo.content.metadata.MetadataExtracterRegistry;
import org.alfresco.repo.content.transform.LocalTransformServiceRegistry;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.DeclarativeWebScript;
import org.springframework.extensions.webscripts.Status;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2021 Alfresco Software Limited
* Copyright (C) 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -50,7 +50,7 @@ import org.alfresco.service.namespace.NamespaceException;
import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;

View File

@@ -31,9 +31,9 @@ import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.transform.client.model.config.TransformOption;
import org.alfresco.transform.client.model.config.TransformOptionGroup;
import org.alfresco.transform.client.model.config.TransformOptionValue;
import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.config.TransformOptionGroup;
import org.alfresco.transform.config.TransformOptionValue;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -37,8 +37,8 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.transform.client.registry.SupportedTransform;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.registry.SupportedTransform;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.alfresco.util.PropertyCheck;
import org.alfresco.util.TempFileProvider;
import org.springframework.beans.BeansException;

View File

@@ -25,8 +25,8 @@
*/
package org.alfresco.repo.content.transform;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.config.CoreFunction;
import org.alfresco.transform.registry.TransformServiceRegistry;
import java.util.Map;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2019 Alfresco Software Limited
* Copyright (C) 2019-2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -31,7 +31,7 @@ import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.transform.client.model.config.TransformOption;
import org.alfresco.transform.config.TransformOption;
import org.alfresco.util.TempFileProvider;
import java.io.File;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -31,11 +31,11 @@ import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.transform.client.model.config.SupportedSourceAndTarget;
import org.alfresco.transform.client.model.config.TransformOption;
import org.alfresco.transform.client.model.config.Transformer;
import org.alfresco.transform.client.registry.AbstractTransformRegistry;
import org.alfresco.transform.client.registry.CombinedConfig;
import org.alfresco.transform.config.SupportedSourceAndTarget;
import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.config.Transformer;
import org.alfresco.transform.registry.AbstractTransformRegistry;
import org.alfresco.transform.registry.CombinedConfig;
import java.io.IOException;
import java.io.InputStreamReader;

View File

@@ -30,7 +30,7 @@ import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.transform.client.model.config.TransformOption;
import org.alfresco.transform.config.TransformOption;
import org.alfresco.util.TempFileProvider;
import java.io.File;
@@ -39,7 +39,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.alfresco.transform.client.util.RequestParamMap.DIRECT_ACCESS_URL;
import static org.alfresco.transform.common.RequestParamMap.DIRECT_ACCESS_URL;
/**
* Transformer that passes a document through a pipeline of transformations to arrive at an target mimetype.

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -31,7 +31,7 @@ import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.transform.client.model.config.TransformOption;
import org.alfresco.transform.config.TransformOption;
import org.alfresco.util.Pair;
import java.util.HashMap;

View File

@@ -36,14 +36,14 @@ import java.util.function.Consumer;
import java.util.stream.Collectors;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.model.config.TransformOptionGroup;
import org.alfresco.transform.client.registry.CombinedConfig;
import org.alfresco.transform.client.model.config.TransformOption;
import org.alfresco.transform.client.registry.TransformServiceRegistryImpl;
import org.alfresco.transform.client.model.config.TransformStep;
import org.alfresco.transform.client.model.config.Transformer;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.config.CoreFunction;
import org.alfresco.transform.config.TransformOptionGroup;
import org.alfresco.transform.registry.CombinedConfig;
import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.registry.TransformServiceRegistryImpl;
import org.alfresco.transform.config.TransformStep;
import org.alfresco.transform.config.Transformer;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.alfresco.util.PropertyCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -33,7 +33,7 @@ import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.DirectAccessUrl;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.config.CoreFunction;
import org.alfresco.util.PropertyCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -43,7 +43,7 @@ import java.util.HashMap;
import java.util.Map;
import static org.alfresco.model.ContentModel.PROP_CONTENT;
import static org.alfresco.transform.client.util.RequestParamMap.DIRECT_ACCESS_URL;
import static org.alfresco.transform.common.RequestParamMap.DIRECT_ACCESS_URL;
/**
* Request synchronous transforms.

View File

@@ -35,7 +35,7 @@ import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.DirectAccessUrl;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.config.CoreFunction;
import org.alfresco.util.PropertyCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -48,7 +48,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static org.alfresco.model.ContentModel.PROP_CONTENT;
import static org.alfresco.transform.client.util.RequestParamMap.DIRECT_ACCESS_URL;
import static org.alfresco.transform.common.RequestParamMap.DIRECT_ACCESS_URL;
/**
* Requests rendition transforms take place using transforms available on the local machine (based on

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -27,7 +27,7 @@ package org.alfresco.repo.rendition2;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.alfresco.util.ConfigFileFinder;
import org.alfresco.util.ConfigScheduler;
import org.alfresco.util.Pair;

View File

@@ -25,8 +25,8 @@
*/
package org.alfresco.repo.rendition2;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.config.CoreFunction;
import org.alfresco.transform.registry.TransformServiceRegistry;
import java.util.Map;

View File

@@ -2,11 +2,11 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
@@ -44,7 +44,7 @@ import org.alfresco.service.cmr.thumbnail.ThumbnailException;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;

View File

@@ -23,15 +23,15 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform.client.registry;
package org.alfresco.transform.registry;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.content.transform.LocalPassThroughTransform;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.transform.client.model.config.TransformConfig;
import org.alfresco.transform.client.model.config.Transformer;
import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.config.Transformer;
import org.alfresco.util.ConfigFileFinder;
import org.apache.commons.logging.Log;
import org.apache.http.HttpEntity;
@@ -47,7 +47,7 @@ import java.io.StringReader;
import java.util.Collections;
import java.util.List;
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM_CONFIG_LATEST;
import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM_CONFIG_LATEST;
/**
* This class reads multiple T-Engine config and local files and registers as if they were all

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,9 +23,12 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform.client.registry;
package org.alfresco.transform.registry;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.alfresco.transform.registry.AbstractTransformRegistry;
import org.alfresco.transform.registry.SupportedTransform;
import org.alfresco.transform.registry.TransformCache;
import org.alfresco.util.ConfigScheduler;
import org.alfresco.util.PropertyCheck;
import org.alfresco.util.ShutdownIndicator;
@@ -38,7 +41,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import static org.alfresco.transform.client.registry.TransformRegistryHelper.retrieveTransformListBySize;
import static org.alfresco.transform.registry.TransformRegistryHelper.retrieveTransformListBySize;
/**
* Used by clients to work out if a transformation is supported by the Transform Service.

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2017 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -50,7 +50,7 @@ import org.junit.runners.Suite;
org.alfresco.repo.event2.RepoEvent2ITSuite.class,
// Requires running transformers
org.alfresco.transform.client.registry.LocalTransformServiceRegistryConfigTest.class,
org.alfresco.transform.registry.LocalTransformServiceRegistryConfigTest.class,
org.alfresco.repo.rendition2.RenditionService2IntegrationTest.class,
org.alfresco.repo.rendition2.LocalTransformServiceRegistryIntegrationTest.class,
org.alfresco.repo.rendition2.LocalTransformClientIntegrationTest.class,

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -58,7 +58,7 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.test_category.BaseSpringTestsCategory;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.alfresco.util.BaseSpringTest;
import org.alfresco.util.GUID;
import org.junit.After;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -57,7 +57,7 @@ import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.alfresco.util.BaseSpringTest;
import org.alfresco.util.GUID;
import org.alfresco.util.PropertyMap;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2018 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -29,8 +29,8 @@ import junit.framework.AssertionFailedError;
import org.alfresco.repo.content.transform.TransformerDebug;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.thumbnail.ThumbnailDefinition;
import org.alfresco.transform.client.registry.AbstractTransformRegistry;
import org.alfresco.transform.client.registry.SupportedTransform;
import org.alfresco.transform.registry.AbstractTransformRegistry;
import org.alfresco.transform.registry.SupportedTransform;
import org.alfresco.util.testing.category.DebugTests;
import org.junit.Before;
import org.junit.Test;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2018 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -25,22 +25,15 @@
*/
package org.alfresco.repo.rendition2;
import org.alfresco.transform.client.registry.AbstractTransformRegistry;
import org.alfresco.transform.client.registry.SupportedTransform;
import org.alfresco.transform.registry.AbstractTransformRegistry;
import org.alfresco.util.testing.category.DebugTests;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import static org.alfresco.repo.content.MimetypeMap.MIMETYPE_TEXT_PLAIN;
/**
* Repeats quick file rendition tests with local transforms enabled but legacy transformers disabled.

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -26,8 +26,8 @@
package org.alfresco.repo.rendition2;
import org.alfresco.repo.content.transform.LocalTransformServiceRegistry;
import org.alfresco.transform.client.registry.SupportedTransform;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.registry.SupportedTransform;
import org.alfresco.transform.registry.TransformServiceRegistry;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
@@ -39,8 +39,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_IWORK_PAGES;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IWORK_PAGES;
/**
* Integration tests for {@link LocalTransformServiceRegistry}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -40,7 +40,7 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.rule.RuleService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.transform.client.registry.TransformServiceRegistryImpl;
import org.alfresco.transform.registry.TransformServiceRegistryImpl;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -25,8 +25,8 @@
*/
package org.alfresco.repo.rendition2;
import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import org.alfresco.transform.config.CoreFunction;
import org.alfresco.transform.registry.TransformServiceRegistry;
import java.util.Map;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,7 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform.client.registry;
package org.alfresco.transform.registry;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.alfresco.repo.content.MimetypeMap;
@@ -32,12 +32,12 @@ import org.alfresco.repo.content.transform.LocalPipelineTransform;
import org.alfresco.repo.content.transform.LocalTransformImpl;
import org.alfresco.repo.content.transform.LocalTransformServiceRegistry;
import org.alfresco.repo.content.transform.TransformerDebug;
import org.alfresco.transform.client.model.config.SupportedSourceAndTarget;
import org.alfresco.transform.client.model.config.TransformConfig;
import org.alfresco.transform.client.model.config.TransformOption;
import org.alfresco.transform.client.model.config.TransformOptionGroup;
import org.alfresco.transform.client.model.config.TransformOptionValue;
import org.alfresco.transform.client.model.config.Transformer;
import org.alfresco.transform.config.SupportedSourceAndTarget;
import org.alfresco.transform.config.TransformConfig;
import org.alfresco.transform.config.TransformOption;
import org.alfresco.transform.config.TransformOptionGroup;
import org.alfresco.transform.config.TransformOptionValue;
import org.alfresco.transform.config.Transformer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Level;
@@ -72,7 +72,7 @@ import static org.junit.Assert.fail;
/**
* Testing LocalTransformServiceRegistry.
*/
public class LocalTransformServiceRegistryConfigTest extends TransformRegistryTest
public class LocalTransformServiceRegistryConfigTest extends TransformRegistryModelTest
{
public static final String HARD_CODED_VALUE = "hard coded value";
@@ -242,19 +242,21 @@ public class LocalTransformServiceRegistryConfigTest extends TransformRegistryTe
protected int getExpectedTransformsForTestJsonPipeline()
{
// imagemagick
// {"sourceMediaType": "image/jpeg", "targetMediaType": "image/jpeg"},
// {"sourceMediaType": "image/jpeg", "targetMediaType": "image/png"},
// {"sourceMediaType": "image/jpeg", "targetMediaType": "image/bmp"}
// {"sourceMediaType": "image/png", "targetMediaType": "image/jpeg"},
// {"sourceMediaType": "image/png", "targetMediaType": "image/gif"},
// {"sourceMediaType": "image/png", "targetMediaType": "image/png"},
// {"sourceMediaType": "image/png", "targetMediaType": "image/tiff"}
// pdfrendere
// {"sourceMediaType": "application/pdf", "targetMediaType": "image/png" }
// libreoffice
// {"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "application/pdf"}
// {"sourceMediaType": "application/msword", "targetMediaType": "application/pdf" },
// officeToImageViaPdf
// {"sourceMediaType": "application/msword", "targetMediaType": "image/gif" },
// {"sourceMediaType": "application/msword", "targetMediaType": "image/jpeg"},
// {"sourceMediaType": "application/msword", "targetMediaType": "image/png" },
// {"sourceMediaType": "application/msword", "targetMediaType": "image/tiff"}
return 3 + 1 + 1 + 4; // 9
return 4 + 1 + 2 + 4; // 11
}
/**
@@ -391,6 +393,23 @@ public class LocalTransformServiceRegistryConfigTest extends TransformRegistryTe
combinedConfig.register((TransformServiceRegistryImpl)registry);
}
// The super class uses org.junit.jupiter:junit-jupiter-engine:5.8.2
// This cannot be used in the Alfresco repo as other tests in this class fail as they expect junit 4
@Override
protected void assertSupported(String sourceMimetype, long sourceSizeInBytes, String targetMimetype,
Map<String, String> actualOptions, String renditionName, String unsupportedMsg)
{
boolean supported = registry.isSupported(sourceMimetype, sourceSizeInBytes, targetMimetype, actualOptions, renditionName);
if (unsupportedMsg != null && !unsupportedMsg.isEmpty())
{
assertFalse(supported);
}
else
{
assertTrue(supported);
}
}
@Test
public void testJsonConfig() throws IOException
{
@@ -802,7 +821,7 @@ public class LocalTransformServiceRegistryConfigTest extends TransformRegistryTe
public void testPipelineAndFailover()
{
retrieveLocalTransformList("alfresco/local-transform-service-config-pipeline-and-failover-test.json");
registry.assertErrorLogged("Transformer .* cannot have pipeline and failover sections.*pipeline-and-failover.*");
registry.assertErrorLogged("Transformer .* cannot have both pipeline and failover sections.*pipeline-and-failover.*");
}
@Test

View File

@@ -34,9 +34,10 @@
{
"transformerName": "imagemagick",
"supportedSourceAndTargetList": [
{"sourceMediaType": "image/jpeg", "targetMediaType": "image/jpeg"},
{"sourceMediaType": "image/jpeg", "targetMediaType": "image/png"},
{"sourceMediaType": "image/jpeg", "targetMediaType": "image/bmp"}
{"sourceMediaType": "image/png", "targetMediaType": "image/jpeg"},
{"sourceMediaType": "image/png", "targetMediaType": "image/gif"},
{"sourceMediaType": "image/png", "targetMediaType": "image/png"},
{"sourceMediaType": "image/png", "targetMediaType": "image/tiff"}
],
"transformOptions": [
"imageMagickOptions"
@@ -54,6 +55,7 @@
{
"transformerName": "libreoffice",
"supportedSourceAndTargetList": [
{"sourceMediaType": "application/msword", "targetMediaType": "application/pdf" },
{"sourceMediaType": "application/vnd.ms-outlook", "targetMediaType": "application/pdf"}
]
},

View File

@@ -1,16 +1,17 @@
{
"transformers": [
"overrideSupported": [
{
"transformerName": "rubbish",
"transformerPipeline" : [
{"transformerName": "appleIWorks", "targetMediaType": "image/jpeg"},
{"transformerName": "imagemagick"}
],
"supportedSourceAndTargetList": [
{"sourceMediaType": "application/vnd.apple.pages", "maxSourceSizeBytes": 786432, "targetMediaType": "rubbish"}
],
"transformOptions": [
]
"transformerName": "appleIWorks",
"sourceMediaType": "application/vnd.apple.pages",
"targetMediaType": "image/jpeg",
"maxSourceSizeBytes": 786432
}
],
"addSupported": [
{
"transformerName": "imagemagick",
"sourceMediaType": "image/jpeg",
"targetMediaType": "rubbish"
}
]
}