diff --git a/.gitbugtraq b/.gitbugtraq
new file mode 100644
index 0000000000..bacffb702d
--- /dev/null
+++ b/.gitbugtraq
@@ -0,0 +1,4 @@
+# For SmartGit
+[bugtraq "jira"]
+ url = https://issues.alfresco.com/jira/browse/%BUGID%
+ logRegex = ([A-Z]+-\\d+)
diff --git a/l10n.properties b/l10n.properties
new file mode 100644
index 0000000000..22141e822e
--- /dev/null
+++ b/l10n.properties
@@ -0,0 +1,7 @@
+# Branch specific configuration file for localisation scripts
+
+MESSAGE_SEARCH_PATH="src/main/resources/alfresco/messages/action-config*.properties src/main/resources/alfresco/messages/action-service*.properties src/main/resources/alfresco/messages/activiti-engine-messages*.properties src/main/resources/alfresco/messages/activities-service*.properties src/main/resources/alfresco/messages/activity-list*.properties src/main/resources/alfresco/messages/application-model*.properties src/main/resources/alfresco/messages/authentication*.properties src/main/resources/alfresco/messages/bootstrap-content-template-examples*.properties src/main/resources/alfresco/messages/bootstrap-example-javascripts*.properties src/main/resources/alfresco/messages/bootstrap-example-smartfoldertemplates*.properties src/main/resources/alfresco/messages/bootstrap-imapScripts*.properties src/main/resources/alfresco/messages/bootstrap-javascripts*.properties src/main/resources/alfresco/messages/bootstrap-messages*.properties src/main/resources/alfresco/messages/bootstrap-readme-template*.properties src/main/resources/alfresco/messages/bootstrap-spaces*.properties src/main/resources/alfresco/messages/bootstrap-templates*.properties src/main/resources/alfresco/messages/bootstrap-tutorial*.properties src/main/resources/alfresco/messages/bootstrap-webScripts*.properties src/main/resources/alfresco/messages/bootstrap-webScriptsExtensions*.properties src/main/resources/alfresco/messages/bpm-messages*.properties src/main/resources/alfresco/messages/categories*.properties src/main/resources/alfresco/messages/coci-service*.properties src/main/resources/alfresco/messages/content-filter-languages*.properties src/main/resources/alfresco/messages/content-model*.properties src/main/resources/alfresco/messages/copy-service*.properties src/main/resources/alfresco/messages/custommodel-service*.properties src/main/resources/alfresco/messages/discussion-messages*.properties src/main/resources/alfresco/messages/distributionpolicies-model*.properties src/main/resources/alfresco/messages/doclink-service*.properties src/main/resources/alfresco/messages/download-model*.properties src/main/resources/alfresco/messages/email-server-model*.properties src/main/resources/alfresco/messages/email-service*.properties src/main/resources/alfresco/messages/file-folder-service*.properties src/main/resources/alfresco/messages/form-service*.properties src/main/resources/alfresco/messages/forum-model*.properties src/main/resources/alfresco/messages/imap-service*.properties src/main/resources/alfresco/messages/initiate-inplace*.properties src/main/resources/alfresco/messages/invitation-service*.properties src/main/resources/alfresco/messages/lock-service*.properties src/main/resources/alfresco/messages/notification-service*.properties src/main/resources/alfresco/messages/period-provider*.properties src/main/resources/alfresco/messages/permissions-service*.properties src/main/resources/alfresco/messages/publishing-model*.properties src/main/resources/alfresco/messages/publishing-service*.properties src/main/resources/alfresco/messages/quickshare-service*.properties src/main/resources/alfresco/messages/rendition-config*.properties src/main/resources/alfresco/messages/replication*.properties src/main/resources/alfresco/messages/repoadmin-service*.properties src/main/resources/alfresco/messages/reset-password-messages*.properties src/main/resources/alfresco/messages/rule-config*.properties src/main/resources/alfresco/messages/site-model*.properties src/main/resources/alfresco/messages/site-service*.properties src/main/resources/alfresco/messages/slingshot*.properties src/main/resources/alfresco/messages/smartfolder-model*.properties src/main/resources/alfresco/messages/subscription-service*.properties src/main/resources/alfresco/messages/system-messages*.properties src/main/resources/alfresco/messages/system-model*.properties src/main/resources/alfresco/messages/template-service*.properties src/main/resources/alfresco/messages/templates-messages*.properties src/main/resources/alfresco/messages/transfer-model*.properties src/main/resources/alfresco/messages/transfer-service*.properties src/main/resources/alfresco/messages/ui-inplace*.properties src/main/resources/alfresco/messages/webdav-messages*.properties src/main/resources/alfresco/messages/workflow-package-messages*.properties src/main/resources/alfresco/workflow/invitation-moderated-workflow-messages*.properties src/main/resources/alfresco/workflow/invitation-nominated-workflow-messages*.properties src/main/resources/alfresco/workflow/workflow-messages*.properties"
+
+
+EXCLUDED_FILES="src/main/resources/alfresco/messages/content-service.properties src/main/resources/alfresco/messages/module-messages.properties src/main/resources/alfresco/messages/patch-service.properties src/main/resources/alfresco/messages/repoadmin-interpreter-help.properties src/main/resources/alfresco/messages/schema-update.properties src/main/resources/alfresco/messages/tenant-interpreter-help.properties src/main/resources/alfresco/messages/version-service.properties src/main/resources/alfresco/messages/workflow-interpreter-help.properties src/main/resources/alfresco/alfresco-shared.properties src/main/resources/alfresco/caches.properties src/main/resources/alfresco/repository.properties src/main/resources/alfresco/client/config/repo-clients-apps.properties src/main/resources/alfresco/domain/cache-strategies.properties src/main/resources/alfresco/domain/hibernate-cfg.properties src/main/resources/alfresco/domain/quartz.properties src/main/resources/alfresco/domain/transaction.properties src/main/resources/alfresco/keystore/keystore-passwords.properties src/main/resources/alfresco/keystore/ssl-keystore-passwords.properties src/main/resources/alfresco/keystore/ssl-truststore-passwords.properties src/main/resources/alfresco/metadata/DWGMetadataExtracter.properties src/main/resources/alfresco/metadata/HtmlMetadataExtracter.properties src/main/resources/alfresco/metadata/MailMetadataExtracter.properties src/main/resources/alfresco/metadata/MP3MetadataExtracter.properties src/main/resources/alfresco/metadata/OfficeMetadataExtracter.properties src/main/resources/alfresco/metadata/OpenDocumentMetadataExtracter.properties src/main/resources/alfresco/metadata/OpenOfficeMetadataExtracter.properties src/main/resources/alfresco/metadata/PdfBoxMetadataExtracter.properties src/main/resources/alfresco/metadata/PoiMetadataExtracter.properties src/main/resources/alfresco/metadata/RFC822MetadataExtracter.properties src/main/resources/alfresco/metadata/TikaAudioMetadataExtracter.properties src/main/resources/alfresco/metadata/TikaAutoMetadataExtracter.properties src/main/resources/alfresco/metadata/TikaSpringConfiguredMetadataExtracter.properties src/main/resources/alfresco/subsystems/ActivitiesFeed/default/activities-jobs.properties src/main/resources/alfresco/subsystems/Authentication/alfrescoNtlm/alfresco-authentication.properties src/main/resources/alfresco/subsystems/Authentication/external/external-authentication.properties src/main/resources/alfresco/subsystems/Authentication/kerberos/kerberos-authentication.properties src/main/resources/alfresco/subsystems/Authentication/ldap/ldap-authentication.properties src/main/resources/alfresco/subsystems/Authentication/ldap-ad/ldap-ad-authentication.properties src/main/resources/alfresco/subsystems/Authentication/passthru/passthru-authentication-context.properties src/main/resources/alfresco/subsystems/email/InboundSMTP/inboundSMTP.properties src/main/resources/alfresco/subsystems/email/OutboundSMTP/outboundSMTP.properties src/main/resources/alfresco/subsystems/fileServers/default/file-servers.properties src/main/resources/alfresco/subsystems/imap/default/imap-server.properties src/main/resources/alfresco/subsystems/OOoDirect/default/openoffice-transform.properties src/main/resources/alfresco/subsystems/Replication/default/replication.properties src/main/resources/alfresco/subsystems/Search/buildonly/common-search.properties src/main/resources/alfresco/subsystems/Search/buildonly/index-recovery.properties src/main/resources/alfresco/subsystems/Search/buildonly/lucene-search.properties src/main/resources/alfresco/subsystems/Search/buildonly/scheduled-jobs.properties src/main/resources/alfresco/subsystems/Search/noindex/common-search.properties src/main/resources/alfresco/subsystems/Search/noindex/noindex-search.properties src/main/resources/alfresco/subsystems/Search/solr/common-search.properties src/main/resources/alfresco/subsystems/Search/solr/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr/solr-search.properties src/main/resources/alfresco/subsystems/Search/solr/facet/solr-facets-config.properties src/main/resources/alfresco/subsystems/Search/solr4/common-search.properties src/main/resources/alfresco/subsystems/Search/solr4/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr4/solr-search.properties src/main/resources/alfresco/subsystems/Search/solr6/common-search.properties src/main/resources/alfresco/subsystems/Search/solr6/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr6/solr-search.properties src/main/resources/alfresco/subsystems/Subscriptions/default/subscription-service.properties src/main/resources/alfresco/subsystems/Synchronization/default/default-synchronization.properties src/main/resources/alfresco/subsystems/sysAdmin/default/sysadmin-parameter.properties src/main/resources/alfresco/subsystems/thirdparty/default/alfresco-pdf-renderer-transform.properties src/main/resources/alfresco/subsystems/thirdparty/default/imagemagick-transform.properties src/main/resources/alfresco/subsystems/Transformers/default/transformers.properties src/main/resources/org/alfresco/encryption/keystore-parameters.properties src/main/resources/org/alfresco/repo/i18n/testMessages.properties src/main/resources/org/alfresco/repo/module/tool/default-file-mapping.properties src/main/resources/org/alfresco/repo/publishing/facebook/facebook-publishing.properties src/main/resources/org/alfresco/repo/publishing/flickr/flickr-publishing.properties src/main/resources/org/alfresco/repo/publishing/linkedin/linkedin-publishing.properties src/main/resources/org/alfresco/repo/publishing/slideshare/slideshare-publishing.properties src/main/resources/org/alfresco/repo/publishing/twitter/twitter-publishing.properties src/main/resources/org/alfresco/repo/publishing/youtube/youtube-publishing.properties"
+
diff --git a/pom.xml b/pom.xml
index b4fc47cfe4..7441a10a14 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
4.0.0
alfresco-repository
Alfresco Repository
- 6.7-SNAPSHOT
+ 6.8-SNAPSHOT
jar
@@ -38,9 +38,9 @@
6.2
6.0
- 6.13
+ 6.14
6.0
- 6.18
+ 6.21
6.3
1.0
1.0.1
@@ -56,6 +56,8 @@
5.22.0
5.22.0
9.4.1212
+ 5.1.40
+ 2.0.1
3.5.2
@@ -778,6 +780,11 @@
tests
test
+
+ org.alfresco
+ alfresco-data-model
+ ${dependency.alfresco-data-model.version}
+
org.alfresco
alfresco-legacy-lucene
@@ -797,6 +804,12 @@
${dependency.mysql.version}
test
+
+ org.mariadb.jdbc
+ mariadb-java-client
+ ${dependency.mariadb.version}
+ test
+
com.h2database
h2
diff --git a/src/main/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java b/src/main/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
index 0e01b2d199..6da2629133 100644
--- a/src/main/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
+++ b/src/main/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java
@@ -1283,11 +1283,6 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
throw new CmisConstraintException("This document type does requires content!");
}
- if (docType.isVersionable() && (versioningState == VersioningState.NONE))
- {
- throw new CmisConstraintException("This document type is versionable!");
- }
-
if (!docType.isVersionable() && (versioningState != VersioningState.NONE))
{
throw new CmisConstraintException("This document type is not versionable!");
diff --git a/src/main/java/org/alfresco/opencmis/CMISConnector.java b/src/main/java/org/alfresco/opencmis/CMISConnector.java
index 18773e976c..695188c4e9 100644
--- a/src/main/java/org/alfresco/opencmis/CMISConnector.java
+++ b/src/main/java/org/alfresco/opencmis/CMISConnector.java
@@ -1,28 +1,28 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco.opencmis;
import java.io.BufferedOutputStream;
@@ -50,17 +50,17 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeSet;
-
+
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
-
+
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.events.types.ContentEvent;
import org.alfresco.events.types.ContentEventImpl;
import org.alfresco.events.types.ContentReadRangeEvent;
import org.alfresco.events.types.Event;
import org.alfresco.model.ContentModel;
-import org.alfresco.service.cmr.activities.ActivityInfo;
+import org.alfresco.service.cmr.activities.ActivityInfo;
import org.alfresco.opencmis.dictionary.CMISActionEvaluator;
import org.alfresco.opencmis.dictionary.CMISAllowedActionEnum;
import org.alfresco.opencmis.dictionary.CMISDictionaryService;
@@ -81,8 +81,8 @@ import org.alfresco.opencmis.search.CMISResultSetRow;
import org.alfresco.repo.Client;
import org.alfresco.repo.Client.ClientType;
import org.alfresco.repo.action.executer.ContentMetadataExtracter;
-import org.alfresco.repo.cache.SimpleCache;
-import org.alfresco.repo.coci.CheckOutCheckInServiceImpl;
+import org.alfresco.repo.cache.SimpleCache;
+import org.alfresco.repo.coci.CheckOutCheckInServiceImpl;
import org.alfresco.repo.events.EventPreparator;
import org.alfresco.repo.events.EventPublisher;
import org.alfresco.repo.model.filefolder.GetChildrenCannedQuery;
@@ -238,12 +238,14 @@ import org.springframework.context.event.ApplicationContextEvent;
import org.springframework.extensions.surf.util.AbstractLifecycleBean;
import org.springframework.util.StringUtils;
+import static java.util.Collections.singletonList;
+
/**
* Bridge connecting Alfresco and OpenCMIS.
*
* This class provides many of the typical services that the {@link CmisService} implementation
* will need to use Alfresco.
- *
+ *
* @author florian.mueller
* @author Derek Hulley
* @author steveglover
@@ -254,7 +256,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
// mappings from cmis property names to their Alfresco property name counterparts (used by getChildren)
private static Map SORT_PROPERTY_MAPPINGS = new HashMap();
-
+
static
{
SORT_PROPERTY_MAPPINGS.put(PropertyIds.LAST_MODIFICATION_DATE, ContentModel.PROP_MODIFIED);
@@ -338,13 +340,13 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
private StoreRef storeRef;
private String rootPath;
private Map> kindToRenditionNames;
-
+
// note: cache is tenant-aware (if using TransctionalCache impl)
-
+
private SimpleCache singletonCache; // eg. for cmisRootNodeRef, cmisRenditionMapping
private final String KEY_CMIS_ROOT_NODEREF = "key.cmisRoot.noderef";
private final String KEY_CMIS_RENDITION_MAPPING_NODEREF = "key.cmisRenditionMapping.noderef";
-
+
private String proxyUser;
private boolean openHttpSession = false;
@@ -360,11 +362,11 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
private ObjectFilter objectFilter;
- // Bulk update properties
+ // Bulk update properties
private int bulkMaxItems = 1000;
private int bulkBatchSize = 20;
private int bulkWorkerThreads = 2;
-
+
// --------------------------------------------------------------
// Configuration
// --------------------------------------------------------------
@@ -376,7 +378,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
/**
* Sets the root store.
- *
+ *
* @param store
* store_type://store_id
*/
@@ -394,7 +396,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
this.activityPoster = activityPoster;
}
-
+
public CmisActivityPoster getActivityPoster()
{
return activityPoster;
@@ -413,7 +415,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
/**
* Sets the root path.
- *
+ *
* @param path
* path within default store
*/
@@ -462,22 +464,22 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
this.objectsDefaultDepth = objectsDefaultDepth;
}
- /**
- * Set the default number of content changes to return if nothing is specified
- */
- public void setContentChangesDefaultMaxItems(int contentChangesDefaultMaxItems)
- {
- if (contentChangesDefaultMaxItems < 1)
- {
- throw new IllegalArgumentException("The default maximum number of content changes to retrieve must be greater than zero.");
- }
- else if (contentChangesDefaultMaxItems == Integer.MAX_VALUE)
- {
- throw new IllegalArgumentException("The server cannot return " + Integer.MAX_VALUE + " content changes in a request!");
- }
- this.contentChangesDefaultMaxItems = contentChangesDefaultMaxItems;
- }
-
+ /**
+ * Set the default number of content changes to return if nothing is specified
+ */
+ public void setContentChangesDefaultMaxItems(int contentChangesDefaultMaxItems)
+ {
+ if (contentChangesDefaultMaxItems < 1)
+ {
+ throw new IllegalArgumentException("The default maximum number of content changes to retrieve must be greater than zero.");
+ }
+ else if (contentChangesDefaultMaxItems == Integer.MAX_VALUE)
+ {
+ throw new IllegalArgumentException("The server cannot return " + Integer.MAX_VALUE + " content changes in a request!");
+ }
+ this.contentChangesDefaultMaxItems = contentChangesDefaultMaxItems;
+ }
+
/**
* Set rendition kind mapping.
*/
@@ -500,18 +502,18 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
this.thumbnailService = thumbnailService;
}
-
+
public void setServiceRegistry(ServiceRegistry serviceRegistry)
{
this.serviceRegistry = serviceRegistry;
- }
-
- /**
- * Return the service registry
- */
- public final ServiceRegistry getServiceRegistry()
- {
- return this.serviceRegistry;
+ }
+
+ /**
+ * Return the service registry
+ */
+ public final ServiceRegistry getServiceRegistry()
+ {
+ return this.serviceRegistry;
}
/**
@@ -601,7 +603,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
return contentService;
}
-
+
/**
* Sets the event publisher
*/
@@ -609,7 +611,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
this.eventPublisher = eventPublisher;
}
-
+
/**
* Sets the rendition service.
*/
@@ -638,12 +640,12 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
this.tenantAdminService = tenantAdminService;
}
-
+
public void setSingletonCache(SimpleCache singletonCache)
{
this.singletonCache = singletonCache;
}
-
+
/**
* Sets the transaction service.
*/
@@ -721,7 +723,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
this.cmisQueryService11 = cmisQueryService;
}
-
+
public CMISQueryService getOpenCMISQueryService()
{
CmisVersion cmisVersion = getRequestCmisVersion();
@@ -809,38 +811,38 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
bulkMaxItems = size;
}
-
+
public int getBulkMaxItems()
{
return bulkMaxItems;
}
-
+
public void setBulkBatchSize(int size)
{
bulkBatchSize = size;
}
-
+
public int getBulkBatchSize()
{
return bulkBatchSize;
}
-
+
public void setBulkWorkerThreads(int threads)
{
bulkWorkerThreads = threads;
}
-
+
public int getBulkWorkerThreads()
{
return bulkWorkerThreads;
}
-
+
// --------------------------------------------------------------
// Lifecycle methods
// --------------------------------------------------------------
private File tmp;
-
+
public void setup()
{
File tempDir = TempFileProvider.getTempDir();
@@ -850,7 +852,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
throw new AlfrescoRuntimeException("Failed to create CMIS temporary directory");
}
}
-
+
public void init()
{
// register as tenant deployer
@@ -916,12 +918,12 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
/*
* For the given cmis property name get the corresponding Alfresco property name.
- *
+ *
* Certain CMIS properties (e.g. cmis:creationDate and cmis:lastModifiedBy) don't
* have direct mappings to Alfresco properties through the CMIS dictionary, because
* these mappings should not be exposed outside the repository through CMIS. For these,
* however, this method provides the mapping so that the sort works.
- *
+ *
*/
public Pair getSortProperty(String cmisPropertyName, String direction)
{
@@ -966,7 +968,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
/**
* Asynchronously generates thumbnails for the given node.
- *
+ *
* @param nodeRef NodeRef
*/
public void createThumbnails(NodeRef nodeRef, Set thumbnailNames)
@@ -997,7 +999,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
ThumbnailDefinition details = registry.getThumbnailDefinition(thumbnailName);
if(details == null)
{
- // Throw exception
+ // Throw exception
logger.warn("The thumbnail name '" + thumbnailName + "' is not registered");
continue;
}
@@ -1006,7 +1008,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
if(registry.isThumbnailDefinitionAvailable(contentData.getContentUrl(), mimeType, size, nodeRef, details))
{
org.alfresco.service.cmr.action.Action action = ThumbnailHelper.createCreateThumbnailAction(details, serviceRegistry);
-
+
// Queue async creation of thumbnail
actionService.executeAction(action, nodeRef, true, true);
}
@@ -1021,7 +1023,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
/**
* Extracts metadata for the node.
- *
+ *
* @param nodeRef NodeRef
*/
public void extractMetadata(NodeRef nodeRef)
@@ -1034,7 +1036,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
return siteService.getSite(nodeRef);
}
-
+
/**
* Should the node be filtered?
*/
@@ -1052,7 +1054,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
}
return wasEnabled;
}
-
+
public boolean enableBehaviour(QName className)
{
boolean isEnabled = behaviourFilter.isEnabled(className);
@@ -1063,7 +1065,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
return isEnabled;
}
-
+
public boolean disableBehaviour(QName className, NodeRef nodeRef)
{
boolean wasEnabled = behaviourFilter.isEnabled(nodeRef, className);
@@ -1073,7 +1075,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
}
return wasEnabled;
}
-
+
public boolean enableBehaviour(QName className, NodeRef nodeRef)
{
boolean isEnabled = behaviourFilter.isEnabled(nodeRef, className);
@@ -1235,7 +1237,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
return id;
}
}
-
+
/*
* Construct an object id based on the incoming assocRef and versionLabel. The object id will always
* be the assocRef guid.
@@ -1244,7 +1246,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
return constructObjectId(assocRef, versionLabel, isPublicApi());
}
-
+
public String constructObjectId(AssociationRef assocRef, String versionLabel, boolean dropStoreRef)
{
StringBuilder sb = new StringBuilder(CMISConnector.ASSOC_ID_PREFIX);
@@ -1265,7 +1267,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
}
return sb.toString();
}
-
+
/*
* Construct an object id based on the incoming incomingObjectId. The object id will always
* be the node guid.
@@ -1283,7 +1285,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
return constructObjectId(incomingNodeId, versionLabel, isPublicApi());
}
-
+
public String constructObjectId(String incomingNodeId, String versionLabel, boolean dropStoreRef)
{
StringBuilder sb = new StringBuilder();
@@ -1348,7 +1350,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
return constructObjectId(incomingNodeRef, versionLabel, isPublicApi());
}
-
+
public String constructObjectId(NodeRef incomingNodeRef, String versionLabel, boolean dropStoreRef)
{
StringBuilder sb = new StringBuilder();
@@ -1368,22 +1370,22 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
return createObjectId(nodeRef, isPublicApi());
}
-
+
public String createObjectId(NodeRef nodeRef, boolean dropStoreRef)
{
QName typeQName = nodeService.getType(nodeRef);
TypeDefinitionWrapper type = getOpenCMISDictionaryService().findNodeType(typeQName);
-
+
if(type instanceof ItemTypeDefinitionWrapper)
{
return constructObjectId(nodeRef, null);
}
-
+
if(type instanceof FolderTypeDefintionWrapper)
{
return constructObjectId(nodeRef, null, dropStoreRef);
}
-
+
Serializable versionLabel = getNodeService()
.getProperty(nodeRef, ContentModel.PROP_VERSION_LABEL);
if (versionLabel == null)
@@ -1393,7 +1395,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
return constructObjectId(nodeRef, (String)versionLabel, dropStoreRef);
}
-
+
private boolean isFolder(NodeRef nodeRef)
{
return getType(nodeRef) instanceof FolderTypeDefintionWrapper;
@@ -1455,7 +1457,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
case CMIS_POLICY:
throw new CmisConstraintException("Type is not a policy type!");
case CMIS_ITEM:
- throw new CmisConstraintException("Type is not an item type!");
+ throw new CmisConstraintException("Type is not an item type!");
}
}
@@ -1517,7 +1519,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
return;
}
-
+
if (!childTypes.contains(childType))
{
throw new CmisConstraintException("Objects of type '" + childType + "' cannot be added to this folder!");
@@ -1728,7 +1730,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
result.setMimeType(contentReader.getMimetype());
long contentSize = contentReader.getSize();
-
+
if ((offset == null) && (length == null))
{
result.setStream(contentReader.getContentInputStream());
@@ -1774,7 +1776,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
/**
* Notifies listeners that a read has taken place.
- *
+ *
* @param nodeRef NodeRef
* @param name String
* @param mimeType String
@@ -1785,7 +1787,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
protected void publishReadEvent(final NodeRef nodeRef, final String name, final String mimeType, final long contentSize, final String encoding, final String range)
{
final QName nodeType = nodeRef==null?null:nodeService.getType(nodeRef);
-
+
eventPublisher.publishEvent(new EventPreparator(){
@Override
public Event prepareEvent(String user, String networkId, String transactionId)
@@ -1793,16 +1795,16 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
if (StringUtils.hasText(range))
{
return new ContentReadRangeEvent(user, networkId, transactionId,
- nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding, range);
- }
- else
+ nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding, range);
+ }
+ else
{
return new ContentEventImpl(ContentEvent.DOWNLOAD, user, networkId, transactionId,
- nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding);
+ nodeRef.getId(), null, nodeType.toString(), Client.asType(ClientType.cmis), name, mimeType, contentSize, encoding);
}
}
});
-
+
}
@@ -1811,7 +1813,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
NodeRef nodeRef = nodeInfo.getNodeRef();
this.disableBehaviour(ContentModel.ASPECT_VERSIONABLE, nodeRef);
-
+
if(!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_CMIS_UPDATE_CONTEXT))
{
Map props = new HashMap();
@@ -1825,7 +1827,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
OutputStream out = new BufferedOutputStream(writer.getContentOutputStream());
-
+
InputStream in = null;
if(existingContentInput != null)
{
@@ -1856,9 +1858,9 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
}
if(out != null)
{
- out.close();
+ out.close();
}
-
+
this.enableBehaviour(ContentModel.ASPECT_VERSIONABLE, nodeRef);
}
}
@@ -2071,7 +2073,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
attributes.put("localName", propertyDefinition.getLocalName());
}
-
+
List propertyValues = new ArrayList();
if (value != null)
@@ -2127,7 +2129,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
// MNT-12496 MNT-15044
// Filter for AtomPub and Web services bindings only. Browser/json binding already encodes.
- if (AlfrescoCmisServiceCall.get() != null &&
+ if (AlfrescoCmisServiceCall.get() != null &&
(CallContext.BINDING_ATOMPUB.equals(AlfrescoCmisServiceCall.get().getBinding()) ||
CallContext.BINDING_WEBSERVICES.equals(AlfrescoCmisServiceCall.get().getBinding())))
{
@@ -2233,7 +2235,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
// MNT-12496 MNT-15044
// Filter for AtomPub and Web services bindings only. Browser/json binding already encodes.
- if (AlfrescoCmisServiceCall.get() != null &&
+ if (AlfrescoCmisServiceCall.get() != null &&
(CallContext.BINDING_ATOMPUB.equals(AlfrescoCmisServiceCall.get().getBinding()) ||
CallContext.BINDING_WEBSERVICES.equals(AlfrescoCmisServiceCall.get().getBinding())))
{
@@ -2270,7 +2272,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
return result;
}
-
+
private String filterXmlRestrictedCharacters(String origValue)
{
if (origValue == null)
@@ -2285,7 +2287,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
boolean restricted = (ch < '\u0020') && !(ch == '\t' || ch == '\n' || ch == '\r');
sb.append(restricted ? REPLACEMENT_CHAR : ch);
}
-
+
return sb.toString();
}
@@ -2767,7 +2769,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
/**
* Converts Acl to map and ignore the indirect ACEs
- *
+ *
* @param acl Acl
* @return Map
*/
@@ -2814,7 +2816,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
/**
* Filter acl to ignore inherited ACEs
- *
+ *
* @param nodeRef NodeRef
* @param acl Acl
* @return Acl
@@ -2989,18 +2991,18 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
for (CMISResultSetRow row : rs)
{
NodeRef nodeRef = row.getNodeRef();
-
+
if(!nodeService.exists(nodeRef) || filter(nodeRef))
{
continue;
}
-
+
TypeDefinitionWrapper type = getType(nodeRef);
if (type == null)
{
continue;
}
-
+
ObjectDataImpl hit = new ObjectDataImpl();
PropertiesImpl properties = new PropertiesImpl();
hit.setProperties(properties);
@@ -3076,7 +3078,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{
return;
}
-
+
Map> incomingPropsMap = properties.getProperties();
if (incomingPropsMap == null)
{
@@ -3098,12 +3100,13 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
}
}
+ Boolean isOnWorkingCopy = checkOutCheckInService.isWorkingCopy(nodeRef);
Updatability updatability = propDef.getPropertyDefinition().getUpdatability();
- if ((updatability == Updatability.READONLY)
- || (updatability == Updatability.WHENCHECKEDOUT && !checkOutCheckInService.isWorkingCopy(nodeRef)))
+ if (!isUpdatable(updatability, isOnWorkingCopy))
{
- throw new CmisInvalidArgumentException("Property " + property.getId() + " is read-only!");
+ throw new CmisInvalidArgumentException("Property " + propertyId + " is read-only!");
}
+
TypeDefinitionWrapper propType = propDef.getOwningType();
Serializable value = getValue(property, propDef.getPropertyDefinition().getCardinality() == Cardinality.MULTI);
Pair pair = new Pair(propType, value);
@@ -3129,7 +3132,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
for (String propertyId : propsMap.keySet())
{
- if(propertyId.equals(PropertyIds.SECONDARY_OBJECT_TYPE_IDS))
+ if (propertyId.equals(PropertyIds.SECONDARY_OBJECT_TYPE_IDS))
{
// already handled above
continue;
@@ -3170,7 +3173,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
for(Object o : secondaryTypes)
{
String secondaryType = (String)o;
-
+
TypeDefinitionWrapper wrapper = getOpenCMISDictionaryService().findType(secondaryType);
if(wrapper != null)
{
@@ -3183,28 +3186,34 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
}
}
- Set ignore = new HashSet();
- ignore.add(ContentModel.ASPECT_REFERENCEABLE);
- ignore.add(ContentModel.ASPECT_LOCALIZED);
- ignore.add(ContentModel.ASPECT_WORKING_COPY);
+ Set aspectsToIgnore = new HashSet<>();
+ aspectsToIgnore.add(ContentModel.ASPECT_REFERENCEABLE);
+ aspectsToIgnore.add(ContentModel.ASPECT_LOCALIZED);
+ aspectsToIgnore.add(ContentModel.ASPECT_WORKING_COPY);
+
+ Set namespacesToIgnore = new HashSet<>(singletonList(NamespaceService.SYSTEM_MODEL_1_0_URI));
// aspects to add == the list of secondary types - existing aspects - ignored aspects
Set toAdd = new HashSet(secondaryTypeAspects);
toAdd.removeAll(existingAspects);
- toAdd.removeAll(ignore);
+ toAdd.removeAll(aspectsToIgnore);
+ toAdd.removeIf(a -> namespacesToIgnore.contains(a.getNamespaceURI()));
// aspects to remove == existing aspects - secondary types
Set aspectsToRemove = new HashSet();
aspectsToRemove.addAll(existingAspects);
- aspectsToRemove.removeAll(ignore);
+ aspectsToRemove.removeAll(aspectsToIgnore);
Iterator it = aspectsToRemove.iterator();
while(it.hasNext())
{
QName aspectQName = it.next();
TypeDefinitionWrapper w = getOpenCMISDictionaryService().findNodeType(aspectQName);
- if(w == null || secondaryTypeAspects.contains(aspectQName))
+ if(w == null || secondaryTypeAspects.contains(aspectQName) || namespacesToIgnore.contains(aspectQName.getNamespaceURI()))
{
- // the type is not exposed or is in the secondary types to set, so remove it from the to remove set
+ // the type is not exposed,
+ // or is in the secondary types to set,
+ // or is in the set of namespaces to ignore,
+ // so remove it from the "to remove" set
it.remove();
}
}
@@ -3213,39 +3222,12 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
for(QName aspectQName : aspectsToRemove)
{
nodeService.removeAspect(nodeRef, aspectQName);
- // aspect is being removed so remove all of its properties from the propsToAdd map
- TypeDefinitionWrapper w = getOpenCMISDictionaryService().findNodeType(aspectQName);
- for(PropertyDefinitionWrapper wr : w.getProperties())
- {
- String propertyId = wr.getPropertyId();
- propsToAdd.remove(propertyId);
- }
}
// add aspects and properties
for(QName aspectQName : toAdd)
{
nodeService.addAspect(nodeRef, aspectQName, null);
-
- // get aspect properties
- AspectDefinition aspectDef = dictionaryService.getAspect(aspectQName);
- Map aspectPropDefs = aspectDef.getProperties();
- TypeDefinitionWrapper w = getOpenCMISDictionaryService().findNodeType(aspectQName);
- // for each aspect property...
- for(QName propQName : aspectPropDefs.keySet())
- {
- // find CMIS property id
- PropertyDefinitionWrapper property = w.getPropertyByQName(propQName);
- String propertyId = property.getPropertyId();
- if(!propsToAdd.containsKey(propertyId))
- {
- TypeDefinitionWrapper propType = property.getOwningType();
- // CMIS 1.1 secondary types specification requires that all secondary type properties are set
- // property not included in propsToAdd, add it with null value
- Pair pair = new Pair(propType, null);
- propsToAdd.put(propertyId, pair);
- }
- }
}
}
@@ -3580,9 +3562,9 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
throw new CmisInvalidArgumentException("Property " + propertyId + " is unknown!");
}
+ Boolean isOnWorkingCopy = checkOutCheckInService.isWorkingCopy(nodeRef);
Updatability updatability = propDef.getPropertyDefinition().getUpdatability();
- if ((updatability == Updatability.READONLY)
- || (updatability == Updatability.WHENCHECKEDOUT && !checkOutCheckInService.isWorkingCopy(nodeRef)))
+ if (!isUpdatable(updatability, isOnWorkingCopy))
{
throw new CmisInvalidArgumentException("Property " + propertyId + " is read-only!");
}
@@ -3607,21 +3589,21 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
}
try
- {
- String newName = value.toString();
- // If the node is checked out and the name property is set on the working copy, make sure the new name has the working copy format
- if (checkOutCheckInService.isWorkingCopy(nodeRef))
- {
- String wcLabel = (String)this.nodeService.getProperty(nodeRef, ContentModel.PROP_WORKING_COPY_LABEL);
- if (wcLabel == null)
- {
- wcLabel = CheckOutCheckInServiceImpl.getWorkingCopyLabel();
- }
- if (!newName.contains(wcLabel))
- {
- newName = CheckOutCheckInServiceImpl.createWorkingCopyName(newName, wcLabel);
- }
- }
+ {
+ String newName = value.toString();
+ // If the node is checked out and the name property is set on the working copy, make sure the new name has the working copy format
+ if (isOnWorkingCopy)
+ {
+ String wcLabel = (String)this.nodeService.getProperty(nodeRef, ContentModel.PROP_WORKING_COPY_LABEL);
+ if (wcLabel == null)
+ {
+ wcLabel = CheckOutCheckInServiceImpl.getWorkingCopyLabel();
+ }
+ if (!newName.contains(wcLabel))
+ {
+ newName = CheckOutCheckInServiceImpl.createWorkingCopyName(newName, wcLabel);
+ }
+ }
fileFolderService.rename(nodeRef, newName);
}
@@ -3709,30 +3691,30 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
params.setApplicationName(CMIS_CHANGELOG_AUDIT_APPLICATION);
params.setForward(true);
params.setFromId(from);
-
- // So we have a BigInteger. We need to ensure that we cut it down to an integer smaller than Integer.MAX_VALUE
+
+ // So we have a BigInteger. We need to ensure that we cut it down to an integer smaller than Integer.MAX_VALUE
- int maxResults = (maxItems == null ? contentChangesDefaultMaxItems : maxItems.intValue());
- maxResults = maxResults < 1 ? contentChangesDefaultMaxItems : maxResults; // Just a double check of the unbundled contents
- maxResults = maxResults > contentChangesDefaultMaxItems ? contentChangesDefaultMaxItems : maxResults; // cut it down
+ int maxResults = (maxItems == null ? contentChangesDefaultMaxItems : maxItems.intValue());
+ maxResults = maxResults < 1 ? contentChangesDefaultMaxItems : maxResults; // Just a double check of the unbundled contents
+ maxResults = maxResults > contentChangesDefaultMaxItems ? contentChangesDefaultMaxItems : maxResults; // cut it down
int queryFor = maxResults + 1; // Query for 1 more so that we know if there are more results
auditService.auditQuery(changeLogCollectingCallback, params, queryFor);
- String newChangeLogToken = null;
+ String newChangeLogToken = null;
// Check if we got more than the client requested
if (result.getObjects().size() >= maxResults)
{
// Build the change log token from the last item
StringBuilder clt = new StringBuilder();
- newChangeLogToken = (from == null ? clt.append(maxItems.intValue() + 1).toString() : clt.append(from.longValue() + maxItems.intValue()).toString()); // TODO: Make this readable
+ newChangeLogToken = (from == null ? clt.append(maxItems.intValue() + 1).toString() : clt.append(from.longValue() + maxItems.intValue()).toString()); // TODO: Make this readable
// Remove extra item that was not actually requested
- result.getObjects().remove(result.getObjects().size() - 1).getId();
+ result.getObjects().remove(result.getObjects().size() - 1).getId();
// Note to client that there are more items
result.setHasMoreItems(true);
}
else
- {
+ {
// We got the same or fewer than the number requested, so there are no more items
result.setHasMoreItems(false);
}
@@ -4110,4 +4092,23 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
}
return renditionMapping;
}
+
+ /**
+ * Verify if a property is updatable.
+ * @param updatability
+ * @param isOnWorkingCopy
+ * @return
+ */
+ private boolean isUpdatable(Updatability updatability, Boolean isOnWorkingCopy)
+ {
+ if ((updatability == Updatability.READONLY)
+ || (updatability == Updatability.WHENCHECKEDOUT && !isOnWorkingCopy))
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
}
diff --git a/src/main/java/org/alfresco/repo/action/executer/MailActionExecuter.java b/src/main/java/org/alfresco/repo/action/executer/MailActionExecuter.java
index 07d46f2751..1cfff8df39 100644
--- a/src/main/java/org/alfresco/repo/action/executer/MailActionExecuter.java
+++ b/src/main/java/org/alfresco/repo/action/executer/MailActionExecuter.java
@@ -614,11 +614,13 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
}
// set recipient
- String to = (String)ruleAction.getParameterValue(PARAM_TO);
+ String to = (String)ruleAction.getParameterValue(PARAM_TO);
+ String toRecipients = null;
if (to != null && to.length() != 0)
{
messageRef[0].setTo(to);
-
+ toRecipients = to;
+
// Note: there is no validation on the username to check that it actually is an email address.
// TODO Fix this.
@@ -777,7 +779,8 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
if(recipients.size() > 0)
{
- messageRef[0].setTo(recipients.toArray(new String[recipients.size()]));
+ messageRef[0].setTo(recipients.toArray(new String[recipients.size()]));
+ toRecipients = String.join(",", recipients);
}
else
{
@@ -925,7 +928,7 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
}
// build the email template model
- Map model = createEmailTemplateModel(actionedUponNodeRef, suppliedModel, fromPerson);
+ Map model = createEmailTemplateModel(actionedUponNodeRef, suppliedModel, fromPerson, toRecipients);
// Determine the locale to use to send the email.
Locale locale = recipient.getSecond();
@@ -1044,8 +1047,8 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
{
// Send the message unless we are in "testMode"
if (!testMode)
- {
- mailService.send(preparedMessage.getMimeMessage());
+ {
+ mailService.send(preparedMessage.getMimeMessage());
onSend();
}
else
@@ -1054,7 +1057,7 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
testSentCount++;
}
}
- catch (MailException e)
+ catch (NullPointerException | MailException e)
{
onFail();
String to = (String)ruleAction.getParameterValue(PARAM_TO);
@@ -1500,15 +1503,20 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
*
* @return Model map for email templates
*/
- private Map createEmailTemplateModel(NodeRef ref, Map suppliedModel, NodeRef fromPerson)
+ private Map createEmailTemplateModel(NodeRef ref, Map suppliedModel, NodeRef fromPerson, String toRecipents)
{
Map model = new HashMap(8, 1.0f);
if (fromPerson != null)
{
model.put("person", new TemplateNode(fromPerson, serviceRegistry, null));
- }
-
+ }
+
+ if (toRecipents != null)
+ {
+ model.put("to", toRecipents);
+ }
+
if (ref != null)
{
model.put("document", new TemplateNode(ref, serviceRegistry, null));
diff --git a/src/main/java/org/alfresco/repo/bulkimport/metadataloaders/AbstractMapBasedMetadataLoader.java b/src/main/java/org/alfresco/repo/bulkimport/metadataloaders/AbstractMapBasedMetadataLoader.java
index b29dd439d7..a6f5c94688 100644
--- a/src/main/java/org/alfresco/repo/bulkimport/metadataloaders/AbstractMapBasedMetadataLoader.java
+++ b/src/main/java/org/alfresco/repo/bulkimport/metadataloaders/AbstractMapBasedMetadataLoader.java
@@ -101,67 +101,88 @@ abstract class AbstractMapBasedMetadataLoader implements MetadataLoader
*/
abstract protected Map loadMetadataFromFile(final Path metadataFile);
-
@Override
public final void loadMetadata(final ContentAndMetadata contentAndMetadata, Metadata metadata)
{
if (contentAndMetadata.metadataFileExists())
{
final Path metadataFile = contentAndMetadata.getMetadataFile();
-
- if (Files.isReadable(metadataFile))
+ String metadataFilePath = FileUtils.getFileName(metadataFile);
+ try
{
- Map metadataProperties = loadMetadataFromFile(metadataFile);
-
- for (String key : metadataProperties.keySet())
+ loadMetadataInternal(metadata, metadataFile);
+ }
+ catch (Exception e)
+ {
+ log.error("Error encountered when reading metadata file '" + metadataFilePath + "'.");
+ throw new RuntimeException("Exception from reading file: '" + metadataFilePath + "'.", e);
+ }
+ }
+ }
+
+ private void loadMetadataInternal(Metadata metadata, final Path metadataFile)
+ {
+ final String metadataFilePath = FileUtils.getFileName(metadataFile);
+ if (Files.isReadable(metadataFile))
+ {
+ Map metadataProperties = loadMetadataFromFile(metadataFile);
+
+ for (String key : metadataProperties.keySet())
+ {
+ if (PROPERTY_NAME_TYPE.equals(key))
{
- if (PROPERTY_NAME_TYPE.equals(key))
+ String typeName = (String) metadataProperties.get(key);
+ QName type = QName.createQName(typeName, namespaceService);
+
+ metadata.setType(type);
+ }
+ else if (PROPERTY_NAME_ASPECTS.equals(key))
+ {
+ String[] aspectNames = ((String) metadataProperties.get(key)).split(",");
+
+ for (final String aspectName : aspectNames)
{
- String typeName = (String)metadataProperties.get(key);
- QName type = QName.createQName(typeName, namespaceService);
-
- metadata.setType(type);
+ QName aspect = QName.createQName(aspectName.trim(), namespaceService);
+ metadata.addAspect(aspect);
}
- else if (PROPERTY_NAME_ASPECTS.equals(key))
+ }
+ else // Any other key => property
+ {
+ // ####TODO: figure out how to handle properties of type cm:content - they need to be streamed in via a Writer
+ QName name = QName.createQName(key, namespaceService);
+ PropertyDefinition propertyDefinition = dictionaryService.getProperty(name);// TODO: measure performance impact of this API call!!
+
+ if (propertyDefinition != null)
{
- String[] aspectNames = ((String)metadataProperties.get(key)).split(",");
-
- for (final String aspectName : aspectNames)
+ if (propertyDefinition.isMultiValued())
{
- QName aspect = QName.createQName(aspectName.trim(), namespaceService);
- metadata.addAspect(aspect);
+ // Multi-valued property
+ ArrayList values = new ArrayList(
+ Arrays.asList(((String) metadataProperties.get(key)).split(multiValuedSeparator)));
+ metadata.addProperty(name, values);
+ }
+ else
+ {
+ // Single value property
+ metadata.addProperty(name, metadataProperties.get(key));
}
}
- else // Any other key => property
+ else
{
- //####TODO: figure out how to handle properties of type cm:content - they need to be streamed in via a Writer
- QName name = QName.createQName(key, namespaceService);
- PropertyDefinition propertyDefinition = dictionaryService.getProperty(name); // TODO: measure performance impact of this API call!!
-
- if (propertyDefinition != null)
- {
- if (propertyDefinition.isMultiValued())
- {
- // Multi-valued property
- ArrayList values = new ArrayList(Arrays.asList(((String)metadataProperties.get(key)).split(multiValuedSeparator)));
- metadata.addProperty(name, values);
- }
- else
- {
- // Single value property
- metadata.addProperty(name, metadataProperties.get(key));
- }
- }
- else
- {
- if (log.isWarnEnabled()) log.warn("Property " + String.valueOf(name) + " doesn't exist in the Data Dictionary. Ignoring it.");
- }
+ if (log.isWarnEnabled())
+ {
+ log.warn("Property " + String.valueOf(name) + " from '" + metadataFilePath
+ + "' doesn't exist in the Data Dictionary. Ignoring it.");
+ }
}
}
}
- else
+ }
+ else
+ {
+ if (log.isWarnEnabled())
{
- if (log.isWarnEnabled()) log.warn("Metadata file '" + FileUtils.getFileName(metadataFile) + "' is not readable.");
+ log.warn("Metadata file '" + metadataFilePath + "' is not readable.");
}
}
}
diff --git a/src/main/java/org/alfresco/repo/bulkimport/metadataloaders/XmlPropertiesFileMetadataLoader.java b/src/main/java/org/alfresco/repo/bulkimport/metadataloaders/XmlPropertiesFileMetadataLoader.java
index 5028d9adf0..571a455d24 100644
--- a/src/main/java/org/alfresco/repo/bulkimport/metadataloaders/XmlPropertiesFileMetadataLoader.java
+++ b/src/main/java/org/alfresco/repo/bulkimport/metadataloaders/XmlPropertiesFileMetadataLoader.java
@@ -1,20 +1,20 @@
/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
@@ -33,8 +33,11 @@ import java.io.Serializable;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import org.alfresco.repo.bulkimport.MetadataLoader;
import org.alfresco.repo.bulkimport.impl.FileUtils;
@@ -97,6 +100,15 @@ public final class XmlPropertiesFileMetadataLoader extends AbstractMapBasedMetad
{
private final static Log log = LogFactory.getLog(XmlPropertiesFileMetadataLoader.class);
private final static String METADATA_FILE_EXTENSION = "properties.xml";
+ // MNT-18001
+ // list of properties to be ignored from the metadata files
+ private final Set protectedProperties = new HashSet<>();
+
+ public void setProtectedProperties(List protectedProperties)
+ {
+ this.protectedProperties.clear();
+ this.protectedProperties.addAll(protectedProperties);
+ }
public XmlPropertiesFileMetadataLoader(final ServiceRegistry serviceRegistry)
{
@@ -121,6 +133,9 @@ public final class XmlPropertiesFileMetadataLoader extends AbstractMapBasedMetad
Properties props = new Properties();
props.loadFromXML(new BufferedInputStream(Files.newInputStream(metadataFile)));
result = new HashMap((Map)props);
+
+ // MNT-18001
+ removeProtectedProperties(result);
}
catch (final IOException ioe)
{
@@ -130,4 +145,13 @@ public final class XmlPropertiesFileMetadataLoader extends AbstractMapBasedMetad
return(result);
}
+ /**
+ * Removes protected properties from the map supplied
+ *
+ * @param props Map with the properties from metadata file
+ */
+ private void removeProtectedProperties(Map props)
+ {
+ props.keySet().removeAll(protectedProperties);
+ }
}
diff --git a/src/main/java/org/alfresco/repo/node/UndeletableAspect.java b/src/main/java/org/alfresco/repo/node/UndeletableAspect.java
index 1396c38f9b..c2ce8dabfa 100644
--- a/src/main/java/org/alfresco/repo/node/UndeletableAspect.java
+++ b/src/main/java/org/alfresco/repo/node/UndeletableAspect.java
@@ -1,32 +1,36 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco.repo.node;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
+import org.alfresco.repo.copy.CopyBehaviourCallback;
+import org.alfresco.repo.copy.CopyDetails;
+import org.alfresco.repo.copy.CopyServicePolicies;
+import org.alfresco.repo.copy.DoNothingCopyBehaviourCallback;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy;
import org.alfresco.repo.policy.Behaviour;
@@ -35,6 +39,7 @@ import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.site.SiteService;
+import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
/**
@@ -54,7 +59,8 @@ import org.alfresco.service.namespace.QName;
* @author Neil Mc Erlean
* @since 3.5.0
*/
-public class UndeletableAspect implements NodeServicePolicies.BeforeDeleteNodePolicy
+public class UndeletableAspect implements NodeServicePolicies.BeforeDeleteNodePolicy,
+ CopyServicePolicies.OnCopyNodePolicy
{
private PolicyComponent policyComponent;
private NodeService nodeService;
@@ -87,6 +93,11 @@ public class UndeletableAspect implements NodeServicePolicies.BeforeDeleteNodePo
this.policyComponent.bindClassBehaviour(BeforeDeleteNodePolicy.QNAME,
ContentModel.ASPECT_UNDELETABLE,
new JavaBehaviour(this, "beforeDeleteNode", Behaviour.NotificationFrequency.EVERY_EVENT));
+
+ policyComponent.bindClassBehaviour(
+ QName.createQName(NamespaceService.ALFRESCO_URI, "getCopyCallback"),
+ ContentModel.ASPECT_UNDELETABLE,
+ new JavaBehaviour(this, "getCopyCallback"));
}
/**
@@ -98,4 +109,10 @@ public class UndeletableAspect implements NodeServicePolicies.BeforeDeleteNodePo
QName nodeType = nodeService.getType(nodeRef);
throw new AlfrescoRuntimeException(nodeType.toPrefixString() + " deletion is not allowed. Attempted to delete " + nodeRef);
}
+
+ @Override
+ public CopyBehaviourCallback getCopyCallback(QName classRef, CopyDetails copyDetails)
+ {
+ return DoNothingCopyBehaviourCallback.getInstance();
+ }
}
diff --git a/src/main/java/org/alfresco/repo/security/authentication/AuthenticationServiceImpl.java b/src/main/java/org/alfresco/repo/security/authentication/AuthenticationServiceImpl.java
index 1d5f307d2c..d3e162593c 100644
--- a/src/main/java/org/alfresco/repo/security/authentication/AuthenticationServiceImpl.java
+++ b/src/main/java/org/alfresco/repo/security/authentication/AuthenticationServiceImpl.java
@@ -33,6 +33,7 @@ import org.alfresco.repo.management.subsystems.ActivateableBean;
import org.alfresco.repo.security.authentication.AuthenticationComponent.UserNameValidationMode;
import org.alfresco.repo.tenant.TenantContextHolder;
import org.alfresco.service.cmr.security.PersonService;
+import org.alfresco.util.GUID;
import org.alfresco.util.Pair;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -42,7 +43,10 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
private Log logger = LogFactory.getLog(AuthenticationServiceImpl.class);
AuthenticationComponent authenticationComponent;
TicketComponent ticketComponent;
-
+
+ /** a serviceInstanceId identifying this unique instance */
+ private String serviceInstanceId;
+
private String domain;
private boolean allowsUserCreation = true;
private boolean allowsUserDeletion = true;
@@ -85,6 +89,8 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
public AuthenticationServiceImpl()
{
super();
+
+ this.serviceInstanceId = GUID.generate();
}
public void setTicketComponent(TicketComponent ticketComponent)
@@ -124,9 +130,10 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
TenantContextHolder.setTenantDomain(tenant);
if (protectionEnabled)
{
- if (protectedUsersCache.get(userName) != null)
+ final String protectedUserKey = getProtectedUserKey(userName);
+ if (protectedUsersCache.get(protectedUserKey) != null)
{
- protectedUsersCache.remove(userName);
+ protectedUsersCache.remove(protectedUserKey);
}
}
}
@@ -148,7 +155,8 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
boolean isProtected = false;
if (protectionEnabled)
{
- ProtectedUser protectedUser = protectedUsersCache.get(userName);
+ final String protectedUserKey = getProtectedUserKey(userName);
+ ProtectedUser protectedUser = protectedUsersCache.get(protectedUserKey);
if (protectedUser != null)
{
long currentTimeStamp = System.currentTimeMillis();
@@ -168,7 +176,8 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
{
if (protectionEnabled)
{
- ProtectedUser protectedUser = protectedUsersCache.get(userName);
+ final String protectedUserKey = getProtectedUserKey(userName);
+ ProtectedUser protectedUser = protectedUsersCache.get(protectedUserKey);
if (protectedUser == null)
{
protectedUser = new ProtectedUser(userName);
@@ -186,10 +195,18 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
}
}
}
- protectedUsersCache.put(userName, protectedUser);
+ protectedUsersCache.put(protectedUserKey, protectedUser);
}
}
+ /**
+ * Creates a key by combining the service instance ID with the username. This are the type of keys maintained by protectedUsersCache map.
+ */
+ public String getProtectedUserKey(String userName)
+ {
+ return serviceInstanceId + "@@" + userName;
+ }
+
public String getCurrentUserName() throws AuthenticationException
{
return authenticationComponent.getCurrentUserName();
diff --git a/src/main/java/org/alfresco/repo/site/SitesPermissionCleaner.java b/src/main/java/org/alfresco/repo/site/SitesPermissionCleaner.java
index 76d37475d3..9c655b43a7 100644
--- a/src/main/java/org/alfresco/repo/site/SitesPermissionCleaner.java
+++ b/src/main/java/org/alfresco/repo/site/SitesPermissionCleaner.java
@@ -1,28 +1,28 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco.repo.site;
import java.util.List;
@@ -31,6 +31,7 @@ import org.alfresco.repo.domain.node.NodeDAO;
import org.alfresco.repo.domain.node.NodeIdAndAclId;
import org.alfresco.repo.domain.permissions.Acl;
import org.alfresco.repo.domain.permissions.AclDAO;
+import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.permissions.ACLType;
import org.alfresco.repo.security.permissions.AccessControlEntry;
import org.alfresco.repo.security.permissions.AccessControlList;
@@ -99,62 +100,70 @@ public class SitesPermissionCleaner
public void cleanSitePermissions(final NodeRef targetNode, SiteInfo containingSite)
{
- if (nodeDAO.exists(targetNode))
+ if (!nodeDAO.exists(targetNode))
{
- // We can calculate the containing site at the start of a recursive call & then reuse it on subsequent calls.
- if (containingSite == null)
- {
- containingSite = siteServiceImpl.getSite(targetNode);
- }
+ return;
+ }
+ // We can calculate the containing site at the start of a recursive call & then reuse it on subsequent calls.
+ if (containingSite == null)
+ {
+ containingSite = siteServiceImpl.getSite(targetNode);
+ }
- // Short-circuit at this point if the node is not in a Site.
- if (containingSite != null)
+ // Short-circuit at this point if the node is not in a Site.
+ if (containingSite == null)
+ {
+ return;
+ }
+ // For performance reasons we navigate down the containment hierarchy using the DAOs
+ // rather than the NodeService. Note: direct use of NodeDAO requires tenantService (ALF-12732).
+ final Long targetNodeID = nodeDAO.getNodePair(tenantService.getName(targetNode)).getFirst();
+ final Long targetNodeAclID = nodeDAO.getNodeAclId(targetNodeID);
+ Acl targetNodeAcl = aclDAO.getAcl(targetNodeAclID);
+
+ // Nodes that don't have defining ACLs do not need to be considered.
+ if (targetNodeAcl.getAclType() == ACLType.DEFINING)
+ {
+ AccessControlList targetNodeAccessControlList = aclDAO.getAccessControlList(targetNodeAclID);
+ List targetNodeAclEntries = targetNodeAccessControlList.getEntries();
+ for (AccessControlEntry entry : targetNodeAclEntries)
{
- // For performance reasons we navigate down the containment hierarchy using the DAOs
- // rather than the NodeService. Note: direct use of NodeDAO requires tenantService (ALF-12732).
- final Long targetNodeID = nodeDAO.getNodePair(tenantService.getName(targetNode)).getFirst();
- final Long targetNodeAclID = nodeDAO.getNodeAclId(targetNodeID);
- Acl targetNodeAcl = aclDAO.getAcl(targetNodeAclID);
-
- // Nodes that don't have defining ACLs do not need to be considered.
- if (targetNodeAcl.getAclType() == ACLType.DEFINING)
+ String authority = entry.getAuthority();
+
+ String thisSiteGroupPrefix = siteServiceImpl.getSiteGroup(containingSite.getShortName(), true);
+
+ // If it's a group site permission for a site other than the current site
+ if (authority.startsWith(PermissionService.GROUP_PREFIX) &&
+ // And it's not GROUP_EVERYONE
+ !authority.startsWith(PermissionService.ALL_AUTHORITIES) && !authority.startsWith(thisSiteGroupPrefix) &&
+ // And if the current user has permissions to do it
+ publicServiceAccessService.hasAccess("PermissionService", "clearPermission", targetNode, authority) == AccessStatus.ALLOWED)
{
- AccessControlList targetNodeAccessControlList = aclDAO.getAccessControlList(targetNodeAclID);
- List targetNodeAclEntries = targetNodeAccessControlList.getEntries();
- for (AccessControlEntry entry : targetNodeAclEntries)
- {
- String authority = entry.getAuthority();
-
- String thisSiteGroupPrefix = siteServiceImpl.getSiteGroup(containingSite.getShortName(), true);
-
- // If it's a group site permission for a site other than the current site
- if (authority.startsWith(PermissionService.GROUP_PREFIX) &&
- !authority.startsWith(PermissionService.ALL_AUTHORITIES) && // And it's not GROUP_EVERYONE
- !authority.startsWith(thisSiteGroupPrefix))
- {
- // And if the current user has permissions to do it
- if (publicServiceAccessService.hasAccess("PermissionService", "clearPermission", targetNode, authority) == AccessStatus.ALLOWED)
- {
- // Then remove it.
- permissionService.clearPermission(targetNode, authority);
- }
- if (publicServiceAccessService.hasAccess("PermissionService", "setInheritParentPermissions", targetNode, true) == AccessStatus.ALLOWED)
- {
- // And reenable permission inheritance.
- permissionService.setInheritParentPermissions(targetNode, true);
- }
- }
-
- }
+ // Then remove it.
+ permissionService.clearPermission(targetNode, authority);
}
-
- // Recurse
- List childNodeIds = nodeDAO.getPrimaryChildrenAcls(targetNodeID);
- for (NodeIdAndAclId nextChild : childNodeIds)
+
+ if (!permissionService.getInheritParentPermissions(targetNode))
{
- cleanSitePermissions(nodeDAO.getNodePair(nextChild.getId()).getSecond(), containingSite);
+ // The site manager from the new site, where this node was moved to, has to have permission to this node
+ String siteManagerAuthority = thisSiteGroupPrefix + "_" + SiteModel.SITE_MANAGER;
+ AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork()
+ {
+ public Void doWork() throws Exception
+ {
+ permissionService.setPermission(targetNode, siteManagerAuthority, SiteModel.SITE_MANAGER, true);
+ return null;
+ }
+ }, AuthenticationUtil.getSystemUserName());
}
}
}
+
+ // Recurse
+ List childNodeIds = nodeDAO.getPrimaryChildrenAcls(targetNodeID);
+ for (NodeIdAndAclId nextChild : childNodeIds)
+ {
+ cleanSitePermissions(nodeDAO.getNodePair(nextChild.getId()).getSecond(), containingSite);
+ }
}
}
diff --git a/src/main/resources/alfresco/bulk-import-context.xml b/src/main/resources/alfresco/bulk-import-context.xml
index aeb4d9a376..2bfad037d5 100644
--- a/src/main/resources/alfresco/bulk-import-context.xml
+++ b/src/main/resources/alfresco/bulk-import-context.xml
@@ -28,6 +28,11 @@
class="org.alfresco.repo.bulkimport.metadataloaders.XmlPropertiesFileMetadataLoader"
lazy-init="true">
+
+
+ cm:versionLabel
+
+
diff --git a/src/main/resources/alfresco/caches.properties b/src/main/resources/alfresco/caches.properties
index c629c244b0..876a8640d6 100644
--- a/src/main/resources/alfresco/caches.properties
+++ b/src/main/resources/alfresco/caches.properties
@@ -729,7 +729,7 @@ cache.authorizationCache.readBackupData=false
cache.protectedUsersCache.maxItems=1000
cache.protectedUsersCache.timeToLiveSeconds=0
cache.protectedUsersCache.maxIdleSeconds=0
-cache.protectedUsersCache.cluster.type=fully-distributed
+cache.protectedUsersCache.cluster.type=local
cache.protectedUsersCache.backup-count=1
cache.protectedUsersCache.eviction-policy=LRU
cache.protectedUsersCache.eviction-percentage=25
diff --git a/src/test/java/org/alfresco/AllDBTestsTestSuite.java b/src/test/java/org/alfresco/AllDBTestsTestSuite.java
new file mode 100644
index 0000000000..693982cb52
--- /dev/null
+++ b/src/test/java/org/alfresco/AllDBTestsTestSuite.java
@@ -0,0 +1,83 @@
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2017 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
+package org.alfresco;
+
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Repository project database tests.
+ */
+@RunWith(Categories.class)
+@Categories.IncludeCategory(DBTests.class)
+@Categories.ExcludeCategory(NonBuildTests.class)
+@Suite.SuiteClasses({
+
+ // From AllUnitTestsSuite
+ org.alfresco.repo.dictionary.RepoDictionaryDAOTest.class,
+
+ // From AppContext03TestSuite
+ org.alfresco.repo.lock.JobLockServiceTest.class,
+ org.alfresco.repo.node.db.DbNodeServiceImplTest.class,
+ org.alfresco.repo.node.db.DbNodeServiceImplPropagationTest.class,
+
+// // From AppContext04TestSuite
+ org.alfresco.util.schemacomp.DbToXMLTest.class,
+ org.alfresco.util.schemacomp.ExportDbTest.class,
+ org.alfresco.util.schemacomp.SchemaReferenceFileTest.class,
+
+ // From AppContext05TestSuite
+ org.alfresco.repo.domain.node.NodeDAOTest.class,
+ org.alfresco.repo.security.permissions.impl.AclDaoComponentTest.class,
+ org.alfresco.repo.domain.contentdata.ContentDataDAOTest.class,
+ org.alfresco.repo.domain.encoding.EncodingDAOTest.class,
+ org.alfresco.repo.domain.locks.LockDAOTest.class,
+ org.alfresco.repo.domain.mimetype.MimetypeDAOTest.class,
+ org.alfresco.repo.domain.locale.LocaleDAOTest.class,
+ org.alfresco.repo.domain.qname.QNameDAOTest.class,
+ org.alfresco.repo.domain.propval.PropertyValueDAOTest.class,
+ org.alfresco.repo.domain.patch.AppliedPatchDAOTest.class,
+ org.alfresco.repo.domain.permissions.AclCrudDAOTest.class,
+ org.alfresco.repo.domain.usage.UsageDAOTest.class,
+ org.alfresco.repo.domain.solr.SOLRDAOTest.class,
+ org.alfresco.repo.domain.tenant.TenantAdminDAOTest.class,
+
+ // REPO-1012 : run AuditDAOTest and PropertyValueCleanupTest near the end
+ // because their failure can cause other tests to fail on MS SQL
+ // AuditDAOTest fails if it runs after CannedQueryDAOTest.
+ // CannedQueryDAOTest will fail on MS SQL if either AuditDAOTest or PropertyValueCleanupTest fail
+ org.alfresco.repo.domain.propval.PropertyValueCleanupTest.class,
+ org.alfresco.repo.domain.audit.AuditDAOTest.class,
+
+ // From MiscContextTestSuite
+ org.alfresco.repo.domain.query.CannedQueryDAOTest.class,
+})
+public class AllDBTestsTestSuite
+{
+}
diff --git a/src/test/java/org/alfresco/AllRepositoryTestsCatalogue.java b/src/test/java/org/alfresco/AllRepositoryTestsCatalogue.java
deleted file mode 100644
index fbf8ea4c49..0000000000
--- a/src/test/java/org/alfresco/AllRepositoryTestsCatalogue.java
+++ /dev/null
@@ -1,726 +0,0 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2017 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
-package org.alfresco;
-
-import org.alfresco.heartbeat.*;
-import org.alfresco.repo.action.ActionConditionDefinitionImplTest;
-import org.alfresco.repo.action.ActionConditionImplTest;
-import org.alfresco.repo.action.ActionDefinitionImplTest;
-import org.alfresco.repo.action.ActionImplTest;
-import org.alfresco.repo.action.ActionServiceImpl2Test;
-import org.alfresco.repo.action.ActionServiceImplTest;
-import org.alfresco.repo.action.ActionTrackingServiceImplTest;
-import org.alfresco.repo.action.CompositeActionConditionImplTest;
-import org.alfresco.repo.action.CompositeActionImplTest;
-import org.alfresco.repo.action.ParameterDefinitionImplTest;
-import org.alfresco.repo.action.evaluator.CompareMimeTypeEvaluatorTest;
-import org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluatorTest;
-import org.alfresco.repo.action.evaluator.HasAspectEvaluatorTest;
-import org.alfresco.repo.action.evaluator.IsSubTypeEvaluatorTest;
-import org.alfresco.repo.action.executer.AddFeaturesActionExecuterTest;
-import org.alfresco.repo.action.executer.ContentMetadataEmbedderTest;
-import org.alfresco.repo.action.executer.ContentMetadataExtracterTagMappingTest;
-import org.alfresco.repo.action.executer.ContentMetadataExtracterTest;
-import org.alfresco.repo.action.executer.ImporterActionExecuterTest;
-import org.alfresco.repo.action.executer.MailActionExecuterTest;
-import org.alfresco.repo.action.executer.RemoveFeaturesActionExecuterTest;
-import org.alfresco.repo.action.executer.SetPropertyValueActionExecuterTest;
-import org.alfresco.repo.action.executer.SpecialiseTypeActionExecuterTest;
-import org.alfresco.repo.audit.AuditBootstrapTest;
-import org.alfresco.repo.audit.AuditComponentTest;
-import org.alfresco.repo.audit.AuditMethodInterceptorTest;
-import org.alfresco.repo.audit.AuditableAnnotationTest;
-import org.alfresco.repo.audit.AuditableAspectTest;
-import org.alfresco.repo.audit.PropertyAuditFilterTest;
-import org.alfresco.repo.audit.UserAuditFilterTest;
-import org.alfresco.repo.audit.access.AccessAuditorTest;
-import org.alfresco.repo.content.ContentDataTest;
-import org.alfresco.repo.content.GuessMimetypeTest;
-import org.alfresco.repo.content.RoutingContentServiceTest;
-import org.alfresco.repo.content.RoutingContentStoreTest;
-import org.alfresco.repo.content.caching.CachingContentStoreTest;
-import org.alfresco.repo.content.caching.ContentCacheImplTest;
-import org.alfresco.repo.content.caching.FullTest;
-import org.alfresco.repo.content.caching.cleanup.CachedContentCleanupJobTest;
-import org.alfresco.repo.content.caching.quota.StandardQuotaStrategyMockTest;
-import org.alfresco.repo.content.caching.quota.StandardQuotaStrategyTest;
-import org.alfresco.repo.content.caching.quota.UnlimitedQuotaStrategyTest;
-import org.alfresco.repo.content.caching.test.ConcurrentCachingStoreTest;
-import org.alfresco.repo.content.caching.test.SlowContentStoreTest;
-import org.alfresco.repo.content.cleanup.ContentStoreCleanerTest;
-import org.alfresco.repo.content.filestore.FileContentStoreTest;
-import org.alfresco.repo.content.filestore.NoRandomAccessFileContentStoreTest;
-import org.alfresco.repo.content.filestore.ReadOnlyFileContentStoreTest;
-import org.alfresco.repo.content.filestore.SpoofedTextContentReaderTest;
-import org.alfresco.repo.content.metadata.MetadataExtracterLimitsTest;
-import org.alfresco.repo.content.transform.TransformerConfigTestSuite;
-import org.alfresco.repo.domain.audit.AuditDAOTest;
-import org.alfresco.repo.domain.contentdata.ContentDataDAOTest;
-import org.alfresco.repo.domain.encoding.EncodingDAOTest;
-import org.alfresco.repo.domain.locale.LocaleDAOTest;
-import org.alfresco.repo.domain.locks.LockDAOTest;
-import org.alfresco.repo.domain.mimetype.MimetypeDAOTest;
-import org.alfresco.repo.domain.node.NodeDAOTest;
-import org.alfresco.repo.domain.patch.AppliedPatchDAOTest;
-import org.alfresco.repo.domain.permissions.AclCrudDAOTest;
-import org.alfresco.repo.domain.permissions.FixedAclUpdaterTest;
-import org.alfresco.repo.domain.propval.PropertyTypeConverterTest;
-import org.alfresco.repo.domain.propval.PropertyValueCleanupTest;
-import org.alfresco.repo.domain.propval.PropertyValueDAOTest;
-import org.alfresco.repo.domain.qname.QNameDAOTest;
-import org.alfresco.repo.domain.query.CannedQueryDAOTest;
-import org.alfresco.repo.domain.solr.SOLRDAOTest;
-import org.alfresco.repo.domain.tenant.TenantAdminDAOTest;
-import org.alfresco.repo.domain.usage.UsageDAOTest;
-import org.alfresco.repo.ownable.impl.OwnableServiceTest;
-import org.alfresco.repo.publishing.ChannelServiceImplIntegratedTest;
-import org.alfresco.repo.publishing.ChannelServiceImplTest;
-import org.alfresco.repo.publishing.PublishingEventHelperTest;
-import org.alfresco.repo.publishing.PublishingIntegratedTest;
-import org.alfresco.repo.publishing.PublishingPackageSerializerTest;
-import org.alfresco.repo.publishing.PublishingQueueImplTest;
-import org.alfresco.repo.publishing.PublishingRootObjectTest;
-import org.alfresco.repo.search.DocumentNavigatorTest;
-import org.alfresco.repo.search.MLAnaysisModeExpansionTest;
-import org.alfresco.repo.search.QueryRegisterComponentTest;
-import org.alfresco.repo.search.SearchServiceTest;
-import org.alfresco.repo.search.SearcherComponentTest;
-import org.alfresco.repo.search.impl.lucene.ADMLuceneCategoryTest;
-import org.alfresco.repo.search.impl.lucene.ADMLuceneTest;
-import org.alfresco.repo.search.impl.lucene.ALF947Test;
-import org.alfresco.repo.search.impl.lucene.LuceneIndexBackupComponentTest;
-import org.alfresco.repo.search.impl.lucene.MultiReaderTest;
-import org.alfresco.repo.search.impl.lucene.index.IndexInfoTest;
-import org.alfresco.repo.search.impl.parsers.CMIS_FTSTest;
-import org.alfresco.repo.search.impl.parsers.FTSTest;
-import org.alfresco.repo.security.authentication.AlfrescoSSLSocketFactoryTest;
-import org.alfresco.repo.security.authentication.AuthenticationBootstrapTest;
-import org.alfresco.repo.security.authentication.AuthenticationTest;
-import org.alfresco.repo.security.authentication.AuthorizationTest;
-import org.alfresco.repo.security.authentication.ChainingAuthenticationServiceTest;
-import org.alfresco.repo.security.authentication.NameBasedUserNameGeneratorTest;
-import org.alfresco.repo.security.authentication.ResetPasswordServiceImplTest;
-import org.alfresco.repo.security.authentication.UpgradePasswordHashTest;
-import org.alfresco.repo.security.authentication.external.DefaultRemoteUserMapperTest;
-import org.alfresco.repo.security.authentication.external.LocalAuthenticationServiceTest;
-import org.alfresco.repo.security.authentication.subsystems.SubsystemChainingFtpAuthenticatorTest;
-import org.alfresco.repo.security.authority.AuthorityBridgeTableAsynchronouslyRefreshedCacheTest;
-import org.alfresco.repo.security.authority.AuthorityServiceTest;
-import org.alfresco.repo.security.authority.DuplicateAuthorityTest;
-import org.alfresco.repo.security.authority.ExtendedPermissionServiceTest;
-import org.alfresco.repo.security.permissions.dynamic.LockOwnerDynamicAuthorityTest;
-import org.alfresco.repo.security.permissions.impl.AclDaoComponentTest;
-import org.alfresco.repo.security.permissions.impl.PermissionServiceTest;
-import org.alfresco.repo.security.permissions.impl.ReadPermissionTest;
-import org.alfresco.repo.security.permissions.impl.acegi.ACLEntryAfterInvocationTest;
-import org.alfresco.repo.security.permissions.impl.acegi.ACLEntryVoterTest;
-import org.alfresco.repo.security.permissions.impl.acegi.FilteringResultSetTest;
-import org.alfresco.repo.security.permissions.impl.model.PermissionModelTest;
-import org.alfresco.repo.security.person.HomeFolderProviderSynchronizerTest;
-import org.alfresco.repo.security.person.PersonTest;
-import org.alfresco.repo.version.ContentServiceImplTest;
-import org.alfresco.repo.version.NodeServiceImplTest;
-import org.alfresco.repo.version.VersionServiceImplTest;
-import org.alfresco.repo.version.common.VersionHistoryImplTest;
-import org.alfresco.repo.version.common.VersionImplTest;
-import org.alfresco.repo.version.common.versionlabel.SerialVersionLabelPolicyTest;
-import org.alfresco.repo.workflow.StartWorkflowActionExecuterTest;
-import org.alfresco.repo.workflow.WorkflowSuiteContextShutdownTest;
-import org.alfresco.repo.workflow.activiti.ActivitiMultitenantWorkflowTest;
-import org.alfresco.repo.workflow.activiti.ActivitiSpringTransactionTest;
-import org.alfresco.repo.workflow.activiti.ActivitiTimerExecutionTest;
-import org.alfresco.repo.workflow.activiti.ActivitiWorkflowServiceIntegrationTest;
-import org.alfresco.repo.workflow.activiti.WorklfowObjectFactoryTest;
-import org.alfresco.service.cmr.repository.TemporalSourceOptionsTest;
-import org.alfresco.service.cmr.repository.TransformationOptionLimitsTest;
-import org.alfresco.service.cmr.repository.TransformationOptionPairTest;
-import org.alfresco.util.NumericEncodingTest;
-
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.TestSuite;
-
-public class AllRepositoryTestsCatalogue
-{
- // [classpath:alfresco/application-context.xml] - part 1
- static void applicationContext_01(TestSuite suite)
- {
- suite.addTestSuite(IsSubTypeEvaluatorTest.class);
- suite.addTestSuite(ComparePropertyValueEvaluatorTest.class);
- suite.addTestSuite(CompareMimeTypeEvaluatorTest.class);
- suite.addTestSuite(HasAspectEvaluatorTest.class);
- suite.addTestSuite(SetPropertyValueActionExecuterTest.class);
- suite.addTestSuite(AddFeaturesActionExecuterTest.class);
- suite.addTestSuite(ContentMetadataExtracterTest.class);
- suite.addTestSuite(ContentMetadataExtracterTagMappingTest.class);
- suite.addTestSuite(ContentMetadataEmbedderTest.class);
- suite.addTestSuite(org.alfresco.repo.rule.RuleLinkTest.class);
- suite.addTestSuite(org.alfresco.repo.rule.RuleServiceCoverageTest.class);
- suite.addTestSuite(org.alfresco.repo.rule.RuleServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.rule.RuleTypeImplTest.class);
- suite.addTestSuite(org.alfresco.repo.rule.ruletrigger.RuleTriggerTest.class);
- suite.addTestSuite(AuthenticationTest.class);
- suite.addTestSuite(SpecialiseTypeActionExecuterTest.class);
- suite.addTestSuite(RemoveFeaturesActionExecuterTest.class);
- suite.addTestSuite(ActionTrackingServiceImplTest.class);
- suite.addTestSuite(org.alfresco.email.server.EmailServiceImplTest.class);
- suite.addTestSuite(org.alfresco.email.server.EmailServerTest.class);
- // FTPServerTest fails when run from Eclipse
- suite.addTestSuite(org.alfresco.filesys.FTPServerTest.class);
- suite.addTestSuite(org.alfresco.filesys.repo.CifsIntegrationTest.class);
- suite.addTestSuite(org.alfresco.filesys.repo.ContentDiskDriverTest.class);
- suite.addTestSuite(org.alfresco.filesys.repo.LockKeeperImplTest.class);
- suite.addTestSuite(org.alfresco.repo.activities.ActivityServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.admin.registry.RegistryServiceImplTest.class);
- }
-
- // [classpath:alfresco/application-context.xml] - part 2
- static void applicationContext_02(TestSuite suite)
- {
- // there is a test that runs for 184s and another one that runs for 40s
- suite.addTestSuite(org.alfresco.repo.attributes.AttributeServiceTest.class);
-
- suite.addTestSuite(AuditableAspectTest.class);
- suite.addTestSuite(AuditBootstrapTest.class);
- suite.addTestSuite(AuditComponentTest.class);
- suite.addTestSuite(UserAuditFilterTest.class);
- suite.addTestSuite(AuditMethodInterceptorTest.class);
- suite.addTest(new JUnit4TestAdapter(AccessAuditorTest.class));
- // the following test will lock up the DB if run in the applicationContext_01 test suite
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.activities.feed.FeedNotifierTest.class));
-
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.activities.feed.FeedNotifierJobTest.class));
- suite.addTestSuite(org.alfresco.repo.admin.RepoAdminServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.admin.patch.PatchTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.bulkimport.impl.StripingFilesystemTrackerTest.class));
- suite.addTestSuite(org.alfresco.repo.coci.CheckOutCheckInServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.configuration.ConfigurableServiceImplTest.class);
- suite.addTestSuite(GuessMimetypeTest.class);
- suite.addTest(new JUnit4TestAdapter(FileContentStoreTest.class));
- suite.addTest(new JUnit4TestAdapter(NoRandomAccessFileContentStoreTest.class));
- suite.addTest(new JUnit4TestAdapter(ReadOnlyFileContentStoreTest.class));
- suite.addTest(new JUnit4TestAdapter(RoutingContentStoreTest.class));
- try
- {
- // REPO-2791
- @SuppressWarnings("rawtypes")
- Class clazz = Class.forName("org.alfresco.repo.content.routing.StoreSelectorAspectContentStoreTest");
- suite.addTestSuite(clazz);
- }
- catch (Throwable ignore)
- {
- // Ignore
- }
- }
-
- // [classpath:alfresco/application-context.xml] - part 3
- static void applicationContext_03(TestSuite suite)
- {
- // needs a clean DB to run
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.calendar.CalendarServiceImplTest.class));
-
- suite.addTest(new JUnit4TestAdapter(RepositoryStartupTest.class));
- suite.addTestSuite(ContentStoreCleanerTest.class);
- suite.addTestSuite(RoutingContentServiceTest.class);
- suite.addTestSuite(org.alfresco.repo.exporter.ExporterComponentTest.class);
-
- // the following two tests fail on windows
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rendition.MultiUserRenditionTest.class));
- suite.addTestSuite(org.alfresco.repo.rendition.RenditionServiceIntegrationTest.class);
-
- suite.addTest(new JUnit4TestAdapter(PublishingQueueImplTest.class));
- suite.addTest(new JUnit4TestAdapter(PublishingIntegratedTest.class));
- suite.addTestSuite(org.alfresco.repo.lock.LockBehaviourImplTest.class);
- suite.addTestSuite(org.alfresco.repo.node.archive.LargeArchiveAndRestoreTest.class);
- suite.addTestSuite(org.alfresco.repo.copy.CopyServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.descriptor.DescriptorServiceTest.class);
- suite.addTestSuite(org.alfresco.repo.dictionary.DictionaryModelTypeTest.class);
- suite.addTestSuite(org.alfresco.repo.dictionary.DictionaryRepositoryBootstrapTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.dictionary.ModelValidatorTest.class));
- suite.addTestSuite(org.alfresco.repo.dictionary.types.period.PeriodTest.class);
- suite.addTestSuite(org.alfresco.repo.exporter.RepositoryExporterComponentTest.class);
- suite.addTestSuite(org.alfresco.repo.i18n.MessageServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.importer.FileImporterTest.class);
- suite.addTestSuite(org.alfresco.repo.importer.ImporterComponentTest.class);
- suite.addTestSuite(org.alfresco.repo.jscript.PeopleTest.class);
- suite.addTestSuite(org.alfresco.repo.jscript.RhinoScriptTest.class);
- // needs a clean DB to run
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.links.LinksServiceImplTest.class));
- suite.addTestSuite(org.alfresco.repo.lock.JobLockServiceTest.class);
- suite.addTestSuite(org.alfresco.repo.lock.LockServiceImplTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.lock.mem.LockStoreImplTxTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.lock.mem.LockableAspectInterceptorTest.class));
- suite.addTestSuite(org.alfresco.repo.management.JmxDumpUtilTest.class);
- suite.addTestSuite(org.alfresco.repo.node.ConcurrentNodeServiceSearchTest.class);
- suite.addTestSuite(org.alfresco.repo.node.ConcurrentNodeServiceTest.class);
- suite.addTestSuite(org.alfresco.repo.node.FullNodeServiceTest.class);
- suite.addTestSuite(org.alfresco.repo.node.NodeRefPropertyMethodInterceptorTest.class);
- suite.addTestSuite(org.alfresco.repo.node.PerformanceNodeServiceTest.class);
- suite.addTestSuite(org.alfresco.repo.node.archive.ArchiveAndRestoreTest.class);
- suite.addTest(new JUnit4TestAdapter(ChannelServiceImplIntegratedTest.class));
- suite.addTest(new JUnit4TestAdapter(PublishingPackageSerializerTest.class));
- suite.addTest(new JUnit4TestAdapter(PublishingRootObjectTest.class));
- suite.addTestSuite(org.alfresco.repo.node.db.DbNodeServiceImplTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.node.cleanup.TransactionCleanupTest.class));
- suite.addTestSuite(org.alfresco.repo.node.db.DbNodeServiceImplPropagationTest.class);
- }
-
- // [classpath:alfresco/application-context.xml] - part 4
- static void applicationContext_04(TestSuite suite)
- {
- suite.addTest(org.alfresco.repo.usage.UsageTestSuite.suite());
- suite.addTestSuite(VersionServiceImplTest.class);
- suite.addTestSuite(NodeServiceImplTest.class);
- suite.addTestSuite(ContentServiceImplTest.class);
- suite.addTestSuite(StartWorkflowActionExecuterTest.class);
- suite.addTestSuite(ActivitiWorkflowServiceIntegrationTest.class);
- suite.addTestSuite(ActivitiSpringTransactionTest.class);
- suite.addTestSuite(ActivitiTimerExecutionTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.invitation.ActivitiInvitationServiceImplTests.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.SolrFacetConfigTest.class));
- suite.addTestSuite(org.alfresco.repo.doclink.DocumentLinkServiceImplTest.class);
- // This test opens, closes and again opens the alfresco application context.
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.dictionary.CustomModelRepoRestartTest.class));
-
- suite.addTestSuite(org.alfresco.repo.rendition.StandardRenditionLocationResolverTest.class);
- suite.addTestSuite(org.alfresco.repo.rendition.executer.HTMLRenderingEngineTest.class);
- suite.addTestSuite(org.alfresco.repo.rendition.executer.XSLTFunctionsTest.class);
- suite.addTestSuite(org.alfresco.repo.rendition.executer.XSLTRenderingEngineTest.class);
- suite.addTestSuite(org.alfresco.repo.replication.ReplicationServiceIntegrationTest.class);
- suite.addTestSuite(org.alfresco.repo.template.XSLTProcessorTest.class);
- suite.addTestSuite(QueryRegisterComponentTest.class);
- suite.addTestSuite(SearchServiceTest.class);
- suite.addTestSuite(ALF947Test.class);
- suite.addTestSuite(LuceneIndexBackupComponentTest.class);
- suite.addTestSuite(org.alfresco.repo.tagging.UpdateTagScopesActionExecuterTest.class);
- suite.addTestSuite(org.alfresco.repo.thumbnail.conditions.NodeEligibleForRethumbnailingEvaluatorTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.transaction.ConnectionPoolOverloadTest.class));
- suite.addTestSuite(org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinitionTest.class);
- suite.addTestSuite(org.alfresco.repo.node.index.MissingContentReindexComponentTest.class);
- suite.addTestSuite(org.alfresco.repo.node.integrity.IncompleteNodeTaggerTest.class);
- suite.addTestSuite(org.alfresco.repo.node.integrity.IntegrityTest.class);
- suite.addTestSuite(org.alfresco.repo.policy.PolicyComponentTransactionTest.class);
- suite.addTestSuite(org.alfresco.repo.forms.FormServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.imap.ImapMessageTest.class);
- suite.addTestSuite(org.alfresco.repo.imap.ImapServiceImplCacheTest.class);
- suite.addTestSuite(org.alfresco.repo.imap.ImapServiceImplTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.bulkimport.impl.BulkImportTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.discussion.DiscussionServiceImplTest.class));
- suite.addTestSuite(org.alfresco.repo.transfer.NodeCrawlerTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.TransferServiceCallbackTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.TransferServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.TransferServiceToBeRefactoredTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.TransferVersionCheckerImplTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.manifest.ManifestIntegrationTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.script.ScriptTransferServiceTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.DbToXMLTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.ExportDbTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.SchemaReferenceFileTest.class));
- suite.addTestSuite(org.alfresco.repo.module.ModuleComponentHelperTest.class);
- suite.addTestSuite(org.alfresco.repo.node.getchildren.GetChildrenCannedQueryTest.class);
- suite.addTestSuite(org.alfresco.repo.node.index.FullIndexRecoveryComponentTest.class);
- suite.addTestSuite(org.alfresco.repo.node.index.IndexTransactionTrackerTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.CronTriggerBeanSystemTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.filesys.auth.cifs.CifsAuthenticatorPassthruTest.class));
- // the following test fails locally - on windows
- suite.addTestSuite(org.alfresco.repo.content.transform.DifferrentMimeTypeTest.class);
-
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.attributes.PropTablesCleanupJobIntegrationTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.service.ServiceRegistryTest.class));
- // does not want to work in the same test suite as org.alfresco.repo.rule.* tests
- suite.addTestSuite(org.alfresco.opencmis.search.OpenCmisQueryTest.class);
-
- }
-
- // [classpath:alfresco/application-context.xml] - part 5
- static void applicationContext_05(TestSuite suite)
- {
- suite.addTest(new JUnit4TestAdapter(NodeDAOTest.class));
- suite.addTestSuite(AuthenticationBootstrapTest.class);
- suite.addTestSuite(AuthorityServiceTest.class);
- suite.addTestSuite(DuplicateAuthorityTest.class);
- suite.addTestSuite(ExtendedPermissionServiceTest.class);
- suite.addTestSuite(LockOwnerDynamicAuthorityTest.class);
- suite.addTestSuite(AclDaoComponentTest.class);
- suite.addTestSuite(PermissionServiceTest.class);
- suite.addTestSuite(ACLEntryAfterInvocationTest.class);
- suite.addTestSuite(ACLEntryVoterTest.class);
- suite.addTestSuite(PermissionModelTest.class);
- suite.addTestSuite(PersonTest.class);
- suite.addTestSuite(OwnableServiceTest.class);
- suite.addTestSuite(ReadPermissionTest.class);
- suite.addTestSuite(UpgradePasswordHashTest.class);
- suite.addTestSuite(AuthorityBridgeTableAsynchronouslyRefreshedCacheTest.class);
- suite.addTest(new JUnit4TestAdapter(HomeFolderProviderSynchronizerTest.class));
- suite.addTestSuite(FixedAclUpdaterTest.class);
- suite.addTestSuite(DefaultRemoteUserMapperTest.class);
- suite.addTestSuite(SubsystemChainingFtpAuthenticatorTest.class);
- suite.addTest(new JUnit4TestAdapter(LocalAuthenticationServiceTest.class));
- suite.addTest(new JUnit4TestAdapter(ContentDataDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(EncodingDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(LockDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(MimetypeDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(LocaleDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(QNameDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(PropertyValueDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(AppliedPatchDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(AclCrudDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(UsageDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(SOLRDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(TenantAdminDAOTest.class));
- // REOPO-1012 : run AuditDAOTest and PropertyValueCleanupTest near the end
- // because their failure can cause other tests to fail on MS SQL
- // AuditDAOTest fails if it runs after CannedQueryDAOTest so this order is a compromise
- // CannedQueryDAOTest will fail on MS SQL if either AuditDAOTest or PropertyValueCleanupTest fail
- suite.addTest(new JUnit4TestAdapter(PropertyValueCleanupTest.class));
- suite.addTest(new JUnit4TestAdapter(AuditDAOTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.model.ModelTestSuite.class));
- suite.addTestSuite(org.alfresco.repo.tenant.MultiTNodeServiceInterceptorTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.RepoTransferReceiverImplTest.class);
- }
-
- // [classpath:alfresco/application-context.xml] - part 6
- static void applicationContext_06(TestSuite suite)
- {
- suite.addTestSuite(org.alfresco.repo.solr.SOLRTrackingComponentTest.class);
- suite.addTestSuite(org.alfresco.repo.tagging.TaggingServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.transaction.AlfrescoTransactionSupportTest.class);
- suite.addTestSuite(org.alfresco.repo.transaction.RetryingTransactionHelperTest.class);
- suite.addTestSuite(org.alfresco.repo.transaction.TransactionAwareSingletonTest.class);
- suite.addTestSuite(org.alfresco.repo.transaction.TransactionServiceImplTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.oauth1.OAuth1CredentialsStoreServiceTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.oauth2.OAuth2CredentialsStoreServiceTest.class));
- suite.addTestSuite(org.alfresco.repo.template.TemplateServiceImplTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.tenant.MultiTServiceImplTest.class));
- suite.addTestSuite(SearcherComponentTest.class);
- suite.addTestSuite(ADMLuceneCategoryTest.class);
- suite.addTestSuite(ADMLuceneTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.blog.BlogServiceImplTest.class));
- suite.addTest(new JUnit4TestAdapter(RepositoryDataCollectorTest.class));
- }
-
- // [classpath:alfresco/application-context.xml, classpath:cache-test/cache-test-context.xml]
- static void applicationContext_cacheTestContext(TestSuite suite)
- {
- suite.addTestSuite(org.alfresco.repo.cache.CacheTest.class);
- }
-
- static void applicationContext_extra(TestSuite suite)
- {
- // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/site/site-custom-context.xml]
- suite.addTestSuite(org.alfresco.repo.site.SiteServiceImplTest.class);
-
- // [classpath:alfresco/application-context.xml, classpath:scriptexec/script-exec-test.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.domain.schema.script.ScriptExecutorImplIntegrationTest.class));
- suite.addTest(
- new JUnit4TestAdapter(org.alfresco.repo.domain.schema.script.ScriptBundleExecutorImplIntegrationTest.class));
-
- // [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml,
- // classpath:org/alfresco/util/test/junitrules/dummy1-context.xml,
- // classpath:org/alfresco/util/test/junitrules/dummy2-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.ApplicationContextInitTest.class));
-
- // [classpath:alfresco/application-context.xml,
- // classpath:org/alfresco/repo/client/config/test-repo-clients-apps-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.client.config.ClientAppConfigTest.class));
-
- // [classpath:alfresco/application-context.xml,
- // classpath:org/alfresco/repo/policy/annotation/test-qname-type-editor-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.policy.annotation.QNameTypeEditorTest.class));
-
- // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/forms/MNT-7383-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.forms.processor.action.ActionFormProcessorTest.class));
-
- // [classpath:alfresco/application-context.xml, classpath:alfresco/filesys/auth/cifs/test-kerberos-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.filesys.auth.cifs.CifsAuthenticatorKerberosTest.class));
-
- // [classpath:alfresco/application-context.xml, classpath:test-cmisinteger_modell-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.opencmis.CMISTest.class));
-
- // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/action/test-action-services-context.xml]
- suite.addTestSuite(ActionServiceImplTest.class);
-
- // [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml,
- // classpath:ratings/test-RatingServiceIntegrationTest-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rating.RatingServiceIntegrationTest.class));
-
- // [classpath:alfresco/application-context.xml, classpath:sync-test-context.xml]
- suite.addTestSuite(org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizerTest.class);
-
- // [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml,
- // classpath:sites/test-TemporarySitesTest-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.site.SiteServiceImplMoreTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporarySitesTest.class));
- }
-
- // [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml]
- static void applicationContext_globalIntegrationTestContext(TestSuite suite)
- {
- suite.addTest(new JUnit4TestAdapter(MailActionExecuterTest.class));
- suite.addTest(new JUnit4TestAdapter(ActionServiceImpl2Test.class));
- suite.addTest(new JUnit4TestAdapter(ImporterActionExecuterTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.dictionary.CustomModelServiceImplTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.dictionary.ValueDataTypeValidatorImplTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.download.DownloadServiceIntegrationTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.forum.CommentsTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.jscript.ScriptNodeTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.preference.PreferenceServiceImplTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rule.MiscellaneousRulesTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rule.RuleServiceIntegrationTest.class));
- suite.addTest(new JUnit4TestAdapter(ResetPasswordServiceImplTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.subscriptions.SubscriptionServiceActivitiesTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.AlfrescoPersonTest.class));
- // the following test only passes on a clean DB
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporaryNodesTest.class));
-
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.SolrFacetQueriesDisplayHandlersTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.SolrFacetServiceImplTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.invitation.InvitationCleanupTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.quickshare.QuickShareServiceIntegrationTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.remotecredentials.RemoteCredentialsServicesTest.class));
- }
-
- // [classpath:alfresco/application-context.xml, classpath:tenant/mt-*context.xml]
- static void applicationContext_mtAllContext(TestSuite suite)
- {
- suite.addTestSuite(org.alfresco.repo.tenant.MultiTDemoTest.class);
- suite.addTestSuite(ActivitiMultitenantWorkflowTest.class);
- }
-
- // [classpath:alfresco/application-context.xml, classpath:opencmis/opencmistest-context.xml]
- static void applicationContext_openCmisContext(TestSuite suite)
- {
- suite.addTestSuite(org.alfresco.opencmis.OpenCmisLocalTest.class);
- }
-
- // TODO can we remove this? Was it EOLed?
- // [classpath:alfresco/application-context.xml, classpath:test/alfresco/test-subscriptions-context.xml]
- static void applicationContext_testSubscriptionsContext(TestSuite suite)
- {
- suite.addTestSuite(org.alfresco.repo.subscriptions.SubscriptionServiceImplTest.class);
- }
-
- // These tests can be extracted in a separate test suite
- // if/when we decide to move the transformations in a separate component
- static void applicationContext_testThumnailContext(TestSuite suite)
- {
- // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/thumbnail/test-thumbnail-context.xml]
- // some tests fail locally - on windows
- suite.addTestSuite(org.alfresco.repo.thumbnail.ThumbnailServiceImplTest.class);
-
- // [classpath:/test/alfresco/test-renditions-context.xml, classpath:alfresco/application-context.xml,
- // classpath:alfresco/test/global-integration-test-context.xml]
- // this does NOT passes locally
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.rendition.RenditionServicePermissionsTest.class));
- }
-
- // [classpath:**/virtualization-test-context.xml, classpath:alfresco/application-context.xml]
- static void applicationContext_virtualizationTestContext(TestSuite suite)
- {
- suite.addTest(org.alfresco.repo.virtual.VirtualizationIntegrationTestSuite.suite());
- }
-
- // [classpath:alfresco/minimal-context.xml]
- static void minimalContext(TestSuite suite)
- {
- suite.addTest(org.alfresco.repo.content.ContentMinimalContextTestSuite.suite());
- suite.addTestSuite(org.alfresco.repo.content.metadata.MappingMetadataExtracterTest.class);
- }
-
- static void miscContext(TestSuite suite)
- {
- // [classpath:alfresco/node-locator-context.xml, classpath:test-nodeLocatorServiceImpl-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.nodelocator.NodeLocatorServiceImplTest.class));
-
- // [classpath*:alfresco/ibatis/ibatis-test-context.xml, classpath:alfresco/application-context.xml,
- // classpath:alfresco/test/global-integration-test-context.xml]
- suite.addTest(new JUnit4TestAdapter(CannedQueryDAOTest.class));
- // REPO-2783 only passes on a dirty DB. fails to pass on a clean DB - testConcurrentArchive
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.node.NodeServiceTest.class));
-
- // [classpath:alfresco/application-context.xml, classpath:alfresco/minimal-context.xml]
- suite.addTestSuite(org.alfresco.RepositoryStartStopTest.class);
-
- // [classpath:cachingstore/test-context.xml]
- suite.addTest(new JUnit4TestAdapter(FullTest.class));
-
- // [classpath:cachingstore/test-cleaner-context.xml]
- suite.addTest(new JUnit4TestAdapter(CachedContentCleanupJobTest.class));
-
- // [classpath:cachingstore/test-std-quota-context.xml]
- suite.addTest(new JUnit4TestAdapter(StandardQuotaStrategyTest.class));
-
- // [classpath:cachingstore/test-slow-context.xml]
- suite.addTest(new JUnit4TestAdapter(SlowContentStoreTest.class));
- suite.addTest(new JUnit4TestAdapter(ConcurrentCachingStoreTest.class));
-
- // [classpath:org/alfresco/repo/jscript/test-context.xml]
- suite.addTestSuite(org.alfresco.repo.jscript.ScriptBehaviourTest.class);
-
- // [module/module-component-test-beans.xml]
- suite.addTestSuite(org.alfresco.repo.module.ComponentsTest.class);
-
- // TODO can we remove this? Was it EOLed?
- // [classpath:test/alfresco/test-web-publishing-context.xml]
- suite.addTest(new JUnit4TestAdapter(ChannelServiceImplTest.class));
- suite.addTest(new JUnit4TestAdapter(PublishingEventHelperTest.class));
-
- // [alfresco/scheduler-core-context.xml, org/alfresco/util/test-scheduled-jobs-context.xml]
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.CronTriggerBeanTest.class));
-
- // [alfresco/scheduler-core-context.xml, org/alfresco/heartbeat/test-heartbeat-context.xml]
- suite.addTest(new JUnit4TestAdapter(HeartBeatTest.class));
- }
-
- // no context - true JUNIT tests
- static void unitTestsNoContext(TestSuite suite)
- {
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.site.SiteMembershipTest.class));
- suite.addTestSuite(org.alfresco.encryption.EncryptorTest.class);
- suite.addTestSuite(org.alfresco.encryption.KeyStoreKeyProviderTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.filesys.config.ServerConfigurationBeanTest.class));
- suite.addTestSuite(org.alfresco.filesys.repo.CIFSContentComparatorTest.class);
- suite.addTestSuite(org.alfresco.filesys.repo.rules.ShuffleTest.class);
- suite.addTestSuite(org.alfresco.repo.admin.Log4JHierarchyInitTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.attributes.PropTablesCleanupJobTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.cache.DefaultCacheFactoryTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.cache.DefaultSimpleCacheTest.class));
- suite.addTestSuite(org.alfresco.repo.cache.lookup.EntityLookupCacheTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.calendar.CalendarHelpersTest.class));
- suite.addTestSuite(org.alfresco.repo.dictionary.RepoDictionaryDAOTest.class);
- suite.addTestSuite(org.alfresco.repo.forms.processor.node.FieldProcessorTest.class);
- suite.addTestSuite(org.alfresco.repo.forms.processor.workflow.TaskFormProcessorTest.class);
- suite.addTestSuite(org.alfresco.repo.forms.processor.workflow.WorkflowFormProcessorTest.class);
- suite.addTestSuite(org.alfresco.repo.invitation.site.InviteSenderTest.class);
- suite.addTestSuite(org.alfresco.repo.invitation.site.InviteModeratedSenderTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.lock.LockUtilsTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.lock.mem.LockStoreImplTest.class));
- suite.addTestSuite(org.alfresco.repo.module.ModuleDetailsImplTest.class);
- suite.addTestSuite(org.alfresco.repo.module.ModuleVersionNumberTest.class);
- suite.addTestSuite(org.alfresco.repo.module.tool.ModuleManagementToolTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.module.tool.WarHelperImplTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.module.tool.ModuleServiceImplTest.class));
- suite.addTestSuite(org.alfresco.repo.policy.MTPolicyComponentTest.class);
- suite.addTestSuite(org.alfresco.repo.policy.PolicyComponentTest.class);
- suite.addTestSuite(org.alfresco.repo.rendition.RenditionNodeManagerTest.class);
- suite.addTestSuite(org.alfresco.repo.rendition.RenditionServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.replication.ReplicationServiceImplTest.class);
- suite.addTestSuite(org.alfresco.repo.service.StoreRedirectorProxyFactoryTest.class);
- suite.addTestSuite(org.alfresco.repo.site.RoleComparatorImplTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.thumbnail.ThumbnailServiceImplParameterTest.class));
- suite.addTestSuite(org.alfresco.repo.transfer.ContentChunkerImplTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.HttpClientTransmitterImplTest.class);
- suite.addTestSuite(org.alfresco.repo.transfer.manifest.TransferManifestTest.class);
- suite.addTestSuite(org.alfresco.repo.urlshortening.BitlyUrlShortenerTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.service.cmr.calendar.CalendarRecurrenceHelperTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.service.cmr.calendar.CalendarTimezoneHelperTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.tools.RenameUserTest.class));
- suite.addTestSuite(org.alfresco.util.FileNameValidatorTest.class);
- suite.addTestSuite(org.alfresco.util.HttpClientHelperTest.class);
- suite.addTestSuite(org.alfresco.util.JSONtoFmModelTest.class);
- suite.addTestSuite(org.alfresco.util.ModelUtilTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.PropertyMapTest.class));
- suite.addTestSuite(org.alfresco.util.ValueProtectingMapTest.class);
- suite.addTestSuite(org.alfresco.util.json.ExceptionJsonSerializerTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.collections.CollectionUtilsTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.DbObjectXMLTransformerTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.DbPropertyTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.DefaultComparisonUtilsTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.DifferenceTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.MultiFileDumperTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.RedundantDbObjectTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.SchemaComparatorTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.SchemaToXMLTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.ValidatingVisitorTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.ValidationResultTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.XMLToSchemaTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.model.ColumnTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.model.ForeignKeyTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.model.IndexTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.model.PrimaryKeyTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.model.SchemaTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.model.SequenceTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.model.TableTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.validator.IndexColumnsValidatorTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.validator.NameValidatorTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.validator.SchemaVersionValidatorTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.schemacomp.validator.TypeNameOnlyValidatorTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.test.junitrules.TemporaryMockOverrideTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.SolrQueryHTTPClientTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.SolrStatsResultTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.SolrFacetComparatorTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.facet.FacetQNameUtilsTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.BeanExtenderUnitTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.SpellCheckDecisionManagerTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.solr.SolrStoreMappingWrapperTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.security.authentication.CompositePasswordEncoderTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.security.authentication.PasswordHashingTest.class));
- suite.addTest(org.alfresco.traitextender.TraitExtenderUnitTestSuite.suite());
- suite.addTest(org.alfresco.repo.virtual.VirtualizationUnitTestSuite.suite());
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.security.authentication.AuthenticationServiceImplTest.class));
- suite.addTest(new JUnit4TestAdapter(org.alfresco.util.EmailHelperTest.class));
- suite.addTest(new JUnit4TestAdapter(ParameterDefinitionImplTest.class));
- suite.addTest(new JUnit4TestAdapter(ActionDefinitionImplTest.class));
- suite.addTest(new JUnit4TestAdapter(ActionConditionDefinitionImplTest.class));
- suite.addTest(new JUnit4TestAdapter(ActionImplTest.class));
- suite.addTest(new JUnit4TestAdapter(ActionConditionImplTest.class));
- suite.addTest(new JUnit4TestAdapter(CompositeActionImplTest.class));
- suite.addTest(new JUnit4TestAdapter(CompositeActionConditionImplTest.class));
- suite.addTestSuite(AuditableAnnotationTest.class);
- suite.addTest(new JUnit4TestAdapter(PropertyAuditFilterTest.class));
- suite.addTest(new JUnit4TestAdapter(SpoofedTextContentReaderTest.class));
- suite.addTestSuite(ContentDataTest.class);
- suite.addTest(new JUnit4TestAdapter(TransformationOptionLimitsTest.class));
- suite.addTest(new JUnit4TestAdapter(TransformationOptionPairTest.class));
- suite.addTest(new JUnit4TestAdapter(TransformerConfigTestSuite.class));
- suite.addTest(new JUnit4TestAdapter(TemporalSourceOptionsTest.class));
- suite.addTest(new JUnit4TestAdapter(MetadataExtracterLimitsTest.class));
- suite.addTest(new JUnit4TestAdapter(StandardQuotaStrategyMockTest.class));
- suite.addTest(new JUnit4TestAdapter(UnlimitedQuotaStrategyTest.class));
- suite.addTest(new JUnit4TestAdapter(CachingContentStoreTest.class));
- suite.addTest(new JUnit4TestAdapter(ContentCacheImplTest.class));
- suite.addTest(new JUnit4TestAdapter(PropertyTypeConverterTest.class));
- suite.addTestSuite(MLAnaysisModeExpansionTest.class);
- suite.addTestSuite(DocumentNavigatorTest.class);
- suite.addTestSuite(MultiReaderTest.class);
- suite.addTestSuite(IndexInfoTest.class);
- suite.addTestSuite(NumericEncodingTest.class);
- suite.addTestSuite(CMIS_FTSTest.class);
- suite.addTestSuite(org.alfresco.repo.search.impl.parsers.CMISTest.class);
- suite.addTestSuite(FTSTest.class);
- suite.addTest(new JUnit4TestAdapter(AlfrescoSSLSocketFactoryTest.class));
- suite.addTestSuite(AuthorizationTest.class);
- suite.addTestSuite(FilteringResultSetTest.class);
- suite.addTestSuite(ChainingAuthenticationServiceTest.class);
- suite.addTestSuite(NameBasedUserNameGeneratorTest.class);
- suite.addTestSuite(VersionImplTest.class);
- suite.addTestSuite(VersionHistoryImplTest.class);
- suite.addTestSuite(SerialVersionLabelPolicyTest.class);
- suite.addTestSuite(WorklfowObjectFactoryTest.class);
- suite.addTestSuite(WorkflowSuiteContextShutdownTest.class);
- suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.search.impl.lucene.analysis.PathTokenFilterTest.class));
- suite.addTest(new JUnit4TestAdapter(HBDataCollectorServiceImplTest.class));
- }
-}
diff --git a/src/test/java/org/alfresco/AllUnitTestsSuite.java b/src/test/java/org/alfresco/AllUnitTestsSuite.java
index d05d311518..4c414c3649 100644
--- a/src/test/java/org/alfresco/AllUnitTestsSuite.java
+++ b/src/test/java/org/alfresco/AllUnitTestsSuite.java
@@ -25,19 +25,171 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
/**
- * All Repository project UNIT test classes should be added to this test suite.
+ * All Repository project UNIT test classes (no application context) should be added to this test suite.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
*/
-public class AllUnitTestsSuite extends TestSuite
-{
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+ org.alfresco.repo.site.SiteMembershipTest.class,
+ org.alfresco.encryption.EncryptorTest.class,
+ org.alfresco.encryption.KeyStoreKeyProviderTest.class,
+ org.alfresco.filesys.config.ServerConfigurationBeanTest.class,
+ org.alfresco.filesys.repo.CIFSContentComparatorTest.class,
+ org.alfresco.filesys.repo.rules.ShuffleTest.class,
+ org.alfresco.repo.admin.Log4JHierarchyInitTest.class,
+ org.alfresco.repo.attributes.PropTablesCleanupJobTest.class,
+ org.alfresco.repo.cache.DefaultCacheFactoryTest.class,
+ org.alfresco.repo.cache.DefaultSimpleCacheTest.class,
+ org.alfresco.repo.cache.lookup.EntityLookupCacheTest.class,
+ org.alfresco.repo.calendar.CalendarHelpersTest.class,
+ org.alfresco.repo.dictionary.RepoDictionaryDAOTest.class,
+ org.alfresco.repo.forms.processor.node.FieldProcessorTest.class,
+ org.alfresco.repo.forms.processor.workflow.TaskFormProcessorTest.class,
+ org.alfresco.repo.forms.processor.workflow.WorkflowFormProcessorTest.class,
+ org.alfresco.repo.invitation.site.InviteSenderTest.class,
+ org.alfresco.repo.invitation.site.InviteModeratedSenderTest.class,
+ org.alfresco.repo.lock.LockUtilsTest.class,
+ org.alfresco.repo.lock.mem.LockStoreImplTest.class,
+ org.alfresco.repo.module.ModuleDetailsImplTest.class,
+ org.alfresco.repo.module.ModuleVersionNumberTest.class,
+ org.alfresco.repo.module.tool.ModuleManagementToolTest.class,
+ org.alfresco.repo.module.tool.WarHelperImplTest.class,
+ org.alfresco.repo.module.tool.ModuleServiceImplTest.class,
+ org.alfresco.repo.policy.MTPolicyComponentTest.class,
+ org.alfresco.repo.policy.PolicyComponentTest.class,
+ org.alfresco.repo.rendition.RenditionNodeManagerTest.class,
+ org.alfresco.repo.rendition.RenditionServiceImplTest.class,
+ org.alfresco.repo.replication.ReplicationServiceImplTest.class,
+ org.alfresco.repo.service.StoreRedirectorProxyFactoryTest.class,
+ org.alfresco.repo.site.RoleComparatorImplTest.class,
+ org.alfresco.repo.thumbnail.ThumbnailServiceImplParameterTest.class,
+ org.alfresco.repo.transfer.ContentChunkerImplTest.class,
+ org.alfresco.repo.transfer.HttpClientTransmitterImplTest.class,
+ org.alfresco.repo.transfer.manifest.TransferManifestTest.class,
+ org.alfresco.repo.urlshortening.BitlyUrlShortenerTest.class,
+ org.alfresco.service.cmr.calendar.CalendarRecurrenceHelperTest.class,
+ org.alfresco.service.cmr.calendar.CalendarTimezoneHelperTest.class,
+ org.alfresco.tools.RenameUserTest.class,
+ org.alfresco.util.FileNameValidatorTest.class,
+ org.alfresco.util.HttpClientHelperTest.class,
+ org.alfresco.util.JSONtoFmModelTest.class,
+ org.alfresco.util.ModelUtilTest.class,
+ org.alfresco.util.PropertyMapTest.class,
+ org.alfresco.util.ValueProtectingMapTest.class,
+ org.alfresco.util.json.ExceptionJsonSerializerTest.class,
+ org.alfresco.util.collections.CollectionUtilsTest.class,
+ org.alfresco.util.schemacomp.DbObjectXMLTransformerTest.class,
+ org.alfresco.util.schemacomp.DbPropertyTest.class,
+ org.alfresco.util.schemacomp.DefaultComparisonUtilsTest.class,
+ org.alfresco.util.schemacomp.DifferenceTest.class,
+ org.alfresco.util.schemacomp.MultiFileDumperTest.class,
+ org.alfresco.util.schemacomp.RedundantDbObjectTest.class,
+ org.alfresco.util.schemacomp.SchemaComparatorTest.class,
+ org.alfresco.util.schemacomp.SchemaToXMLTest.class,
+ org.alfresco.util.schemacomp.ValidatingVisitorTest.class,
+ org.alfresco.util.schemacomp.ValidationResultTest.class,
+ org.alfresco.util.schemacomp.XMLToSchemaTest.class,
+ org.alfresco.util.schemacomp.model.ColumnTest.class,
+ org.alfresco.util.schemacomp.model.ForeignKeyTest.class,
+ org.alfresco.util.schemacomp.model.IndexTest.class,
+ org.alfresco.util.schemacomp.model.PrimaryKeyTest.class,
+ org.alfresco.util.schemacomp.model.SchemaTest.class,
+ org.alfresco.util.schemacomp.model.SequenceTest.class,
+ org.alfresco.util.schemacomp.model.TableTest.class,
+ org.alfresco.util.schemacomp.validator.IndexColumnsValidatorTest.class,
+ org.alfresco.util.schemacomp.validator.NameValidatorTest.class,
+ org.alfresco.util.schemacomp.validator.SchemaVersionValidatorTest.class,
+ org.alfresco.util.schemacomp.validator.TypeNameOnlyValidatorTest.class,
+ org.alfresco.util.test.junitrules.TemporaryMockOverrideTest.class,
+ org.alfresco.repo.search.impl.solr.SolrQueryHTTPClientTest.class,
+ org.alfresco.repo.search.impl.solr.SolrStatsResultTest.class,
+ org.alfresco.repo.search.impl.solr.facet.SolrFacetComparatorTest.class,
+ org.alfresco.repo.search.impl.solr.facet.FacetQNameUtilsTest.class,
+ org.alfresco.util.BeanExtenderUnitTest.class,
+ org.alfresco.repo.search.impl.solr.SpellCheckDecisionManagerTest.class,
+ org.alfresco.repo.search.impl.solr.SolrStoreMappingWrapperTest.class,
+ org.alfresco.repo.security.authentication.CompositePasswordEncoderTest.class,
+ org.alfresco.repo.security.authentication.PasswordHashingTest.class,
+ org.alfresco.traitextender.TraitExtenderIntegrationTest.class,
+ org.alfresco.traitextender.AJExtensionsCompileTest.class,
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.unitTestsNoContext(suite);
- return suite;
- }
+ org.alfresco.repo.virtual.page.PageCollatorTest.class,
+ org.alfresco.repo.virtual.ref.GetChildByIdMethodTest.class,
+ org.alfresco.repo.virtual.ref.GetParentReferenceMethodTest.class,
+ org.alfresco.repo.virtual.ref.NewVirtualReferenceMethodTest.class,
+ org.alfresco.repo.virtual.ref.PlainReferenceParserTest.class,
+ org.alfresco.repo.virtual.ref.PlainStringifierTest.class,
+ org.alfresco.repo.virtual.ref.ProtocolTest.class,
+ org.alfresco.repo.virtual.ref.ReferenceTest.class,
+ org.alfresco.repo.virtual.ref.ResourceParameterTest.class,
+ org.alfresco.repo.virtual.ref.StringParameterTest.class,
+ org.alfresco.repo.virtual.ref.VirtualProtocolTest.class,
+ org.alfresco.repo.virtual.store.ReferenceComparatorTest.class,
+
+ org.alfresco.repo.virtual.ref.ZeroReferenceParserTest.class,
+ org.alfresco.repo.virtual.ref.ZeroStringifierTest.class,
+
+ org.alfresco.repo.virtual.ref.HashStringifierTest.class,
+ org.alfresco.repo.virtual.ref.NodeRefRadixHasherTest.class,
+ org.alfresco.repo.virtual.ref.NumericPathHasherTest.class,
+ org.alfresco.repo.virtual.ref.StoredPathHasherTest.class,
+
+ org.alfresco.repo.virtual.template.VirtualQueryImplTest.class,
+ org.alfresco.repo.virtual.store.TypeVirtualizationMethodTest.Unit.class,
+
+ org.alfresco.repo.security.authentication.AuthenticationServiceImplTest.class,
+ org.alfresco.util.EmailHelperTest.class,
+ org.alfresco.repo.action.ParameterDefinitionImplTest.class,
+ org.alfresco.repo.action.ActionDefinitionImplTest.class,
+ org.alfresco.repo.action.ActionConditionDefinitionImplTest.class,
+ org.alfresco.repo.action.ActionImplTest.class,
+ org.alfresco.repo.action.ActionConditionImplTest.class,
+ org.alfresco.repo.action.CompositeActionImplTest.class,
+ org.alfresco.repo.action.CompositeActionConditionImplTest.class,
+ org.alfresco.repo.audit.AuditableAnnotationTest.class,
+ org.alfresco.repo.audit.PropertyAuditFilterTest.class,
+ org.alfresco.repo.content.filestore.SpoofedTextContentReaderTest.class,
+ org.alfresco.repo.content.ContentDataTest.class,
+ org.alfresco.service.cmr.repository.TransformationOptionLimitsTest.class,
+ org.alfresco.service.cmr.repository.TransformationOptionPairTest.class,
+ org.alfresco.repo.content.transform.TransformerConfigTestSuite.class,
+ org.alfresco.service.cmr.repository.TemporalSourceOptionsTest.class,
+ org.alfresco.repo.content.metadata.MetadataExtracterLimitsTest.class,
+ org.alfresco.repo.content.caching.quota.StandardQuotaStrategyMockTest.class,
+ org.alfresco.repo.content.caching.quota.UnlimitedQuotaStrategyTest.class,
+ org.alfresco.repo.content.caching.CachingContentStoreTest.class,
+ org.alfresco.repo.content.caching.ContentCacheImplTest.class,
+ org.alfresco.repo.domain.propval.PropertyTypeConverterTest.class,
+ org.alfresco.repo.search.MLAnaysisModeExpansionTest.class,
+ org.alfresco.repo.search.DocumentNavigatorTest.class,
+ org.alfresco.repo.search.impl.lucene.MultiReaderTest.class,
+ org.alfresco.repo.search.impl.lucene.index.IndexInfoTest.class,
+ org.alfresco.util.NumericEncodingTest.class,
+ org.alfresco.repo.search.impl.parsers.CMIS_FTSTest.class,
+ org.alfresco.repo.search.impl.parsers.CMISTest.class,
+ org.alfresco.repo.search.impl.parsers.FTSTest.class,
+ org.alfresco.repo.security.authentication.AlfrescoSSLSocketFactoryTest.class,
+ org.alfresco.repo.security.authentication.AuthorizationTest.class,
+ org.alfresco.repo.security.permissions.impl.acegi.FilteringResultSetTest.class,
+ org.alfresco.repo.security.authentication.ChainingAuthenticationServiceTest.class,
+ org.alfresco.repo.security.authentication.NameBasedUserNameGeneratorTest.class,
+ org.alfresco.repo.version.common.VersionImplTest.class,
+ org.alfresco.repo.version.common.VersionHistoryImplTest.class,
+ org.alfresco.repo.version.common.versionlabel.SerialVersionLabelPolicyTest.class,
+ org.alfresco.repo.workflow.activiti.WorklfowObjectFactoryTest.class,
+ org.alfresco.repo.workflow.WorkflowSuiteContextShutdownTest.class,
+ org.alfresco.repo.search.impl.lucene.analysis.PathTokenFilterTest.class,
+ org.alfresco.heartbeat.HBDataCollectorServiceImplTest.class,
+ org.alfresco.heartbeat.HBDataCollectorServiceImplTest.class
+})
+public class AllUnitTestsSuite
+{
}
diff --git a/src/test/java/org/alfresco/AppContext01TestSuite.java b/src/test/java/org/alfresco/AppContext01TestSuite.java
index 2a1ff09ae3..b2a3fe960b 100644
--- a/src/test/java/org/alfresco/AppContext01TestSuite.java
+++ b/src/test/java/org/alfresco/AppContext01TestSuite.java
@@ -25,15 +25,49 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-public class AppContext01TestSuite extends TestSuite
+/**
+ * Repository project tests using the main context alfresco/application-context.xml.
+ * To balance test jobs tests using this context have been split into multiple test suites.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
+ */
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+ org.alfresco.repo.action.evaluator.IsSubTypeEvaluatorTest.class,
+ org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluatorTest.class,
+ org.alfresco.repo.action.evaluator.CompareMimeTypeEvaluatorTest.class,
+ org.alfresco.repo.action.evaluator.HasAspectEvaluatorTest.class,
+ org.alfresco.repo.action.executer.SetPropertyValueActionExecuterTest.class,
+ org.alfresco.repo.action.executer.AddFeaturesActionExecuterTest.class,
+ org.alfresco.repo.action.executer.ContentMetadataExtracterTest.class,
+ org.alfresco.repo.action.executer.ContentMetadataExtracterTagMappingTest.class,
+ org.alfresco.repo.action.executer.ContentMetadataEmbedderTest.class,
+ org.alfresco.repo.rule.RuleLinkTest.class,
+ org.alfresco.repo.rule.RuleServiceCoverageTest.class,
+ org.alfresco.repo.rule.RuleServiceImplTest.class,
+ org.alfresco.repo.rule.RuleTypeImplTest.class,
+ org.alfresco.repo.rule.ruletrigger.RuleTriggerTest.class,
+ org.alfresco.repo.security.authentication.AuthenticationTest.class,
+ org.alfresco.repo.action.executer.SpecialiseTypeActionExecuterTest.class,
+ org.alfresco.repo.action.executer.RemoveFeaturesActionExecuterTest.class,
+ org.alfresco.repo.action.ActionTrackingServiceImplTest.class,
+ org.alfresco.email.server.EmailServiceImplTest.class,
+ org.alfresco.email.server.EmailServerTest.class,
+
+ // FTPServerTest fails when run from Eclipse
+ org.alfresco.filesys.FTPServerTest.class,
+ org.alfresco.filesys.repo.CifsIntegrationTest.class,
+ org.alfresco.filesys.repo.ContentDiskDriverTest.class,
+ org.alfresco.filesys.repo.LockKeeperImplTest.class,
+ org.alfresco.repo.activities.ActivityServiceImplTest.class,
+ org.alfresco.repo.admin.registry.RegistryServiceImplTest.class,
+})
+public class AppContext01TestSuite
{
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.applicationContext_01(suite);
- return suite;
- }
}
diff --git a/src/test/java/org/alfresco/AppContext02TestSuite.java b/src/test/java/org/alfresco/AppContext02TestSuite.java
index 250aaa8a40..dc4c52511e 100644
--- a/src/test/java/org/alfresco/AppContext02TestSuite.java
+++ b/src/test/java/org/alfresco/AppContext02TestSuite.java
@@ -25,15 +25,48 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-public class AppContext02TestSuite extends TestSuite
+/**
+ * Repository project tests using the main context alfresco/application-context.xml.
+ * To balance test jobs tests using this context have been split into multiple test suites.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
+ */
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+
+ // there is a test that runs for 184s and another one that runs for 40s
+ org.alfresco.repo.attributes.AttributeServiceTest.class,
+
+ org.alfresco.repo.audit.AuditableAspectTest.class,
+ org.alfresco.repo.audit.AuditBootstrapTest.class,
+ org.alfresco.repo.audit.AuditComponentTest.class,
+ org.alfresco.repo.audit.UserAuditFilterTest.class,
+ org.alfresco.repo.audit.AuditMethodInterceptorTest.class,
+ org.alfresco.repo.audit.access.AccessAuditorTest.class,
+
+ // the following test will lock up the DB if run in the applicationContext_01 test suite
+ org.alfresco.repo.activities.feed.FeedNotifierTest.class,
+
+ org.alfresco.repo.activities.feed.FeedNotifierJobTest.class,
+ org.alfresco.repo.admin.RepoAdminServiceImplTest.class,
+ org.alfresco.repo.admin.patch.PatchTest.class,
+ org.alfresco.repo.bulkimport.impl.StripingFilesystemTrackerTest.class,
+ org.alfresco.repo.coci.CheckOutCheckInServiceImplTest.class,
+ org.alfresco.repo.configuration.ConfigurableServiceImplTest.class,
+ org.alfresco.repo.content.GuessMimetypeTest.class,
+ org.alfresco.repo.content.filestore.FileContentStoreTest.class,
+ org.alfresco.repo.content.filestore.NoRandomAccessFileContentStoreTest.class,
+ org.alfresco.repo.content.filestore.ReadOnlyFileContentStoreTest.class,
+ org.alfresco.repo.content.RoutingContentStoreTest.class,
+
+ // TODO REPO-2791 org.alfresco.repo.content.routing.StoreSelectorAspectContentStoreTest.class,
+})
+public class AppContext02TestSuite
{
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.applicationContext_02(suite);
- return suite;
- }
}
diff --git a/src/test/java/org/alfresco/AppContext03TestSuite.java b/src/test/java/org/alfresco/AppContext03TestSuite.java
index 3a1e2b72de..336a7f3adb 100644
--- a/src/test/java/org/alfresco/AppContext03TestSuite.java
+++ b/src/test/java/org/alfresco/AppContext03TestSuite.java
@@ -25,15 +25,70 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-public class AppContext03TestSuite extends TestSuite
+/**
+ * Repository project tests using the main context alfresco/application-context.xml.
+ * To balance test jobs tests using this context have been split into multiple test suites.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
+ */
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+
+ // needs a clean DB to run
+ org.alfresco.repo.calendar.CalendarServiceImplTest.class,
+
+ org.alfresco.RepositoryStartupTest.class,
+ org.alfresco.repo.content.cleanup.ContentStoreCleanerTest.class,
+ org.alfresco.repo.content.RoutingContentServiceTest.class,
+ org.alfresco.repo.exporter.ExporterComponentTest.class,
+
+ // the following two tests fail on windows
+ org.alfresco.repo.rendition.MultiUserRenditionTest.class,
+ org.alfresco.repo.rendition.RenditionServiceIntegrationTest.class,
+
+ org.alfresco.repo.publishing.PublishingQueueImplTest.class,
+ org.alfresco.repo.publishing.PublishingIntegratedTest.class,
+ org.alfresco.repo.lock.LockBehaviourImplTest.class,
+ org.alfresco.repo.node.archive.LargeArchiveAndRestoreTest.class,
+ org.alfresco.repo.copy.CopyServiceImplTest.class,
+ org.alfresco.repo.descriptor.DescriptorServiceTest.class,
+ org.alfresco.repo.dictionary.DictionaryModelTypeTest.class,
+ org.alfresco.repo.dictionary.DictionaryRepositoryBootstrapTest.class,
+ org.alfresco.repo.dictionary.ModelValidatorTest.class,
+ org.alfresco.repo.dictionary.types.period.PeriodTest.class,
+ org.alfresco.repo.exporter.RepositoryExporterComponentTest.class,
+ org.alfresco.repo.i18n.MessageServiceImplTest.class,
+ org.alfresco.repo.importer.FileImporterTest.class,
+ org.alfresco.repo.importer.ImporterComponentTest.class,
+ org.alfresco.repo.jscript.PeopleTest.class,
+ org.alfresco.repo.jscript.RhinoScriptTest.class,
+
+ // needs a clean DB to run
+ org.alfresco.repo.links.LinksServiceImplTest.class,
+ org.alfresco.repo.lock.JobLockServiceTest.class,
+ org.alfresco.repo.lock.LockServiceImplTest.class,
+ org.alfresco.repo.lock.mem.LockStoreImplTxTest.class,
+ org.alfresco.repo.lock.mem.LockableAspectInterceptorTest.class,
+ org.alfresco.repo.management.JmxDumpUtilTest.class,
+ org.alfresco.repo.node.ConcurrentNodeServiceSearchTest.class,
+ org.alfresco.repo.node.ConcurrentNodeServiceTest.class,
+ org.alfresco.repo.node.FullNodeServiceTest.class,
+ org.alfresco.repo.node.NodeRefPropertyMethodInterceptorTest.class,
+ org.alfresco.repo.node.PerformanceNodeServiceTest.class,
+ org.alfresco.repo.node.archive.ArchiveAndRestoreTest.class,
+ org.alfresco.repo.publishing.ChannelServiceImplIntegratedTest.class,
+ org.alfresco.repo.publishing.PublishingPackageSerializerTest.class,
+ org.alfresco.repo.publishing.PublishingRootObjectTest.class,
+ org.alfresco.repo.node.db.DbNodeServiceImplTest.class,
+ org.alfresco.repo.node.cleanup.TransactionCleanupTest.class,
+ org.alfresco.repo.node.db.DbNodeServiceImplPropagationTest.class,
+})
+public class AppContext03TestSuite
{
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.applicationContext_03(suite);
- return suite;
- }
}
diff --git a/src/test/java/org/alfresco/AppContext04TestSuite.java b/src/test/java/org/alfresco/AppContext04TestSuite.java
index 66fb1e7ece..84518b08db 100644
--- a/src/test/java/org/alfresco/AppContext04TestSuite.java
+++ b/src/test/java/org/alfresco/AppContext04TestSuite.java
@@ -25,15 +25,87 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-public class AppContext04TestSuite extends TestSuite
+/**
+ * Repository project tests using the main context alfresco/application-context.xml.
+ * To balance test jobs tests using this context have been split into multiple test suites.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
+ */
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+ org.alfresco.repo.usage.RepoUsageComponentTest.class,
+ org.alfresco.repo.usage.UserUsageTest.class,
+ org.alfresco.repo.usage.UserUsageTrackingComponentTest.class,
+ org.alfresco.repo.version.VersionServiceImplTest.class,
+ org.alfresco.repo.version.NodeServiceImplTest.class,
+ org.alfresco.repo.version.ContentServiceImplTest.class,
+ org.alfresco.repo.workflow.StartWorkflowActionExecuterTest.class,
+ org.alfresco.repo.workflow.activiti.ActivitiWorkflowServiceIntegrationTest.class,
+ org.alfresco.repo.workflow.activiti.ActivitiSpringTransactionTest.class,
+ org.alfresco.repo.workflow.activiti.ActivitiTimerExecutionTest.class,
+ org.alfresco.repo.invitation.ActivitiInvitationServiceImplTests.class,
+ org.alfresco.repo.search.impl.solr.facet.SolrFacetConfigTest.class,
+ org.alfresco.repo.doclink.DocumentLinkServiceImplTest.class,
+
+ // This test opens, closes and again opens the alfresco application context.
+ org.alfresco.repo.dictionary.CustomModelRepoRestartTest.class,
+
+ org.alfresco.repo.rendition.StandardRenditionLocationResolverTest.class,
+ org.alfresco.repo.rendition.executer.HTMLRenderingEngineTest.class,
+ org.alfresco.repo.rendition.executer.XSLTFunctionsTest.class,
+ org.alfresco.repo.rendition.executer.XSLTRenderingEngineTest.class,
+ org.alfresco.repo.replication.ReplicationServiceIntegrationTest.class,
+ org.alfresco.repo.template.XSLTProcessorTest.class,
+ org.alfresco.repo.search.QueryRegisterComponentTest.class,
+ org.alfresco.repo.search.SearchServiceTest.class,
+ org.alfresco.repo.search.impl.lucene.ALF947Test.class,
+ org.alfresco.repo.search.impl.lucene.LuceneIndexBackupComponentTest.class,
+ org.alfresco.repo.tagging.UpdateTagScopesActionExecuterTest.class,
+ org.alfresco.repo.thumbnail.conditions.NodeEligibleForRethumbnailingEvaluatorTest.class,
+ org.alfresco.repo.transaction.ConnectionPoolOverloadTest.class,
+ org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinitionTest.class,
+ org.alfresco.repo.node.index.MissingContentReindexComponentTest.class,
+ org.alfresco.repo.node.integrity.IncompleteNodeTaggerTest.class,
+ org.alfresco.repo.node.integrity.IntegrityTest.class,
+ org.alfresco.repo.policy.PolicyComponentTransactionTest.class,
+ org.alfresco.repo.forms.FormServiceImplTest.class,
+ org.alfresco.repo.imap.ImapMessageTest.class,
+ org.alfresco.repo.imap.ImapServiceImplCacheTest.class,
+ org.alfresco.repo.imap.ImapServiceImplTest.class,
+ org.alfresco.repo.bulkimport.impl.BulkImportTest.class,
+ org.alfresco.repo.discussion.DiscussionServiceImplTest.class,
+ org.alfresco.repo.transfer.NodeCrawlerTest.class,
+ org.alfresco.repo.transfer.TransferServiceCallbackTest.class,
+ org.alfresco.repo.transfer.TransferServiceImplTest.class,
+ org.alfresco.repo.transfer.TransferServiceToBeRefactoredTest.class,
+ org.alfresco.repo.transfer.TransferVersionCheckerImplTest.class,
+ org.alfresco.repo.transfer.manifest.ManifestIntegrationTest.class,
+ org.alfresco.repo.transfer.script.ScriptTransferServiceTest.class,
+ org.alfresco.util.schemacomp.DbToXMLTest.class,
+ org.alfresco.util.schemacomp.ExportDbTest.class,
+ org.alfresco.util.schemacomp.SchemaReferenceFileTest.class,
+ org.alfresco.repo.module.ModuleComponentHelperTest.class,
+ org.alfresco.repo.node.getchildren.GetChildrenCannedQueryTest.class,
+ org.alfresco.repo.node.index.FullIndexRecoveryComponentTest.class,
+ org.alfresco.repo.node.index.IndexTransactionTrackerTest.class,
+ org.alfresco.util.CronTriggerBeanSystemTest.class,
+ org.alfresco.filesys.auth.cifs.CifsAuthenticatorPassthruTest.class,
+
+ // the following test fails locally - on windows
+ org.alfresco.repo.content.transform.DifferrentMimeTypeTest.class,
+
+ org.alfresco.repo.attributes.PropTablesCleanupJobIntegrationTest.class,
+ org.alfresco.service.ServiceRegistryTest.class,
+
+ // does not want to work in the same test suite as org.alfresco.repo.rule.* tests
+ org.alfresco.opencmis.search.OpenCmisQueryTest.class
+ })
+public class AppContext04TestSuite
{
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.applicationContext_04(suite);
- return suite;
- }
}
diff --git a/src/test/java/org/alfresco/AppContext05TestSuite.java b/src/test/java/org/alfresco/AppContext05TestSuite.java
index 87297f6657..2b7f84f9ef 100644
--- a/src/test/java/org/alfresco/AppContext05TestSuite.java
+++ b/src/test/java/org/alfresco/AppContext05TestSuite.java
@@ -25,15 +25,64 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-public class AppContext05TestSuite extends TestSuite
+/**
+ * Repository project tests using the main context alfresco/application-context.xml.
+ * To balance test jobs tests using this context have been split into multiple test suites.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
+ */
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+ org.alfresco.repo.domain.node.NodeDAOTest.class,
+ org.alfresco.repo.security.authentication.AuthenticationBootstrapTest.class,
+ org.alfresco.repo.security.authority.AuthorityServiceTest.class,
+ org.alfresco.repo.security.authority.DuplicateAuthorityTest.class,
+ org.alfresco.repo.security.authority.ExtendedPermissionServiceTest.class,
+ org.alfresco.repo.security.permissions.dynamic.LockOwnerDynamicAuthorityTest.class,
+ org.alfresco.repo.security.permissions.impl.AclDaoComponentTest.class,
+ org.alfresco.repo.security.permissions.impl.PermissionServiceTest.class,
+ org.alfresco.repo.security.permissions.impl.acegi.ACLEntryAfterInvocationTest.class,
+ org.alfresco.repo.security.permissions.impl.acegi.ACLEntryVoterTest.class,
+ org.alfresco.repo.security.permissions.impl.model.PermissionModelTest.class,
+ org.alfresco.repo.security.person.PersonTest.class,
+ org.alfresco.repo.ownable.impl.OwnableServiceTest.class,
+ org.alfresco.repo.security.permissions.impl.ReadPermissionTest.class,
+ org.alfresco.repo.security.authentication.UpgradePasswordHashTest.class,
+ org.alfresco.repo.security.authority.AuthorityBridgeTableAsynchronouslyRefreshedCacheTest.class,
+ org.alfresco.repo.security.person.HomeFolderProviderSynchronizerTest.class,
+ org.alfresco.repo.domain.permissions.FixedAclUpdaterTest.class,
+ org.alfresco.repo.security.authentication.external.DefaultRemoteUserMapperTest.class,
+ org.alfresco.repo.security.authentication.subsystems.SubsystemChainingFtpAuthenticatorTest.class,
+ org.alfresco.repo.security.authentication.external.LocalAuthenticationServiceTest.class,
+ org.alfresco.repo.domain.contentdata.ContentDataDAOTest.class,
+ org.alfresco.repo.domain.encoding.EncodingDAOTest.class,
+ org.alfresco.repo.domain.locks.LockDAOTest.class,
+ org.alfresco.repo.domain.mimetype.MimetypeDAOTest.class,
+ org.alfresco.repo.domain.locale.LocaleDAOTest.class,
+ org.alfresco.repo.domain.qname.QNameDAOTest.class,
+ org.alfresco.repo.domain.propval.PropertyValueDAOTest.class,
+ org.alfresco.repo.domain.patch.AppliedPatchDAOTest.class,
+ org.alfresco.repo.domain.permissions.AclCrudDAOTest.class,
+ org.alfresco.repo.domain.usage.UsageDAOTest.class,
+ org.alfresco.repo.domain.solr.SOLRDAOTest.class,
+ org.alfresco.repo.domain.tenant.TenantAdminDAOTest.class,
+
+ // REPO-1012 : run AuditDAOTest and PropertyValueCleanupTest near the end
+ // because their failure can cause other tests to fail on MS SQL
+ // AuditDAOTest fails if it runs after CannedQueryDAOTest so this order is a compromise
+ // CannedQueryDAOTest will fail on MS SQL if either AuditDAOTest or PropertyValueCleanupTest fail
+ org.alfresco.repo.domain.propval.PropertyValueCleanupTest.class,
+ org.alfresco.repo.domain.audit.AuditDAOTest.class,
+ org.alfresco.repo.model.ModelTestSuite.class,
+ org.alfresco.repo.tenant.MultiTNodeServiceInterceptorTest.class,
+ org.alfresco.repo.transfer.RepoTransferReceiverImplTest.class,
+})
+public class AppContext05TestSuite
{
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.applicationContext_05(suite);
- return suite;
- }
}
diff --git a/src/test/java/org/alfresco/AppContext06TestSuite.java b/src/test/java/org/alfresco/AppContext06TestSuite.java
index afd3ac81ab..fea83e4498 100644
--- a/src/test/java/org/alfresco/AppContext06TestSuite.java
+++ b/src/test/java/org/alfresco/AppContext06TestSuite.java
@@ -25,15 +25,36 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-public class AppContext06TestSuite extends TestSuite
+/**
+ * Repository project tests using the main context alfresco/application-context.xml.
+ * To balance test jobs tests using this context have been split into multiple test suites.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
+ */
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+ org.alfresco.repo.solr.SOLRTrackingComponentTest.class,
+ org.alfresco.repo.tagging.TaggingServiceImplTest.class,
+ org.alfresco.repo.transaction.AlfrescoTransactionSupportTest.class,
+ org.alfresco.repo.transaction.RetryingTransactionHelperTest.class,
+ org.alfresco.repo.transaction.TransactionAwareSingletonTest.class,
+ org.alfresco.repo.transaction.TransactionServiceImplTest.class,
+ org.alfresco.repo.oauth1.OAuth1CredentialsStoreServiceTest.class,
+ org.alfresco.repo.oauth2.OAuth2CredentialsStoreServiceTest.class,
+ org.alfresco.repo.template.TemplateServiceImplTest.class,
+ org.alfresco.repo.tenant.MultiTServiceImplTest.class,
+ org.alfresco.repo.search.SearcherComponentTest.class,
+ org.alfresco.repo.search.impl.lucene.ADMLuceneCategoryTest.class,
+ org.alfresco.repo.search.impl.lucene.ADMLuceneTest.class,
+ org.alfresco.repo.blog.BlogServiceImplTest.class,
+ org.alfresco.heartbeat.RepositoryDataCollectorTest.class,
+})
+public class AppContext06TestSuite
{
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.applicationContext_06(suite);
- return suite;
- }
}
diff --git a/src/test/java/org/alfresco/AppContextExtraTestSuite.java b/src/test/java/org/alfresco/AppContextExtraTestSuite.java
index 0cd7197e38..17145435df 100644
--- a/src/test/java/org/alfresco/AppContextExtraTestSuite.java
+++ b/src/test/java/org/alfresco/AppContextExtraTestSuite.java
@@ -25,23 +25,142 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-public class AppContextExtraTestSuite extends TestSuite
+/**
+ * Repository project tests using the main context alfresco/application-context.xml PLUS some additional context.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
+ */
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+ // ----------------------------------------------------------------------
+ // globalIntegrationTestContext [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml]
+ // ----------------------------------------------------------------------
+
+ org.alfresco.repo.action.executer.MailActionExecuterTest.class,
+ org.alfresco.repo.action.ActionServiceImpl2Test.class,
+ org.alfresco.repo.action.executer.ImporterActionExecuterTest.class,
+ org.alfresco.repo.dictionary.CustomModelServiceImplTest.class,
+ org.alfresco.repo.dictionary.ValueDataTypeValidatorImplTest.class,
+ org.alfresco.repo.download.DownloadServiceIntegrationTest.class,
+ org.alfresco.repo.forum.CommentsTest.class,
+ org.alfresco.repo.jscript.ScriptNodeTest.class,
+ org.alfresco.repo.preference.PreferenceServiceImplTest.class,
+ org.alfresco.repo.rule.MiscellaneousRulesTest.class,
+ org.alfresco.repo.rule.RuleServiceIntegrationTest.class,
+ org.alfresco.repo.security.authentication.ResetPasswordServiceImplTest.class,
+ org.alfresco.repo.subscriptions.SubscriptionServiceActivitiesTest.class,
+ org.alfresco.util.test.junitrules.AlfrescoPersonTest.class,
+
+ // the following test only passes on a clean DB
+ org.alfresco.util.test.junitrules.TemporaryNodesTest.class,
+
+ org.alfresco.repo.search.impl.solr.facet.SolrFacetQueriesDisplayHandlersTest.class,
+ org.alfresco.repo.search.impl.solr.facet.SolrFacetServiceImplTest.class,
+ org.alfresco.repo.invitation.InvitationCleanupTest.class,
+ org.alfresco.repo.quickshare.QuickShareServiceIntegrationTest.class,
+ org.alfresco.repo.remotecredentials.RemoteCredentialsServicesTest.class,
+
+ // ----------------------------------------------------------------------
+ // Context_extra
+ // ----------------------------------------------------------------------
+
+ // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/site/site-custom-context.xml]
+ org.alfresco.repo.site.SiteServiceImplTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:scriptexec/script-exec-test.xml]
+ org.alfresco.repo.domain.schema.script.ScriptExecutorImplIntegrationTest.class,
+ org.alfresco.repo.domain.schema.script.ScriptBundleExecutorImplIntegrationTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml,
+ // classpath:org/alfresco/util/test/junitrules/dummy1-context.xml,
+ // classpath:org/alfresco/util/test/junitrules/dummy2-context.xml]
+ org.alfresco.util.test.junitrules.ApplicationContextInitTest.class,
+
+ // [classpath:alfresco/application-context.xml,
+ // classpath:org/alfresco/repo/client/config/test-repo-clients-apps-context.xml]
+ org.alfresco.repo.client.config.ClientAppConfigTest.class,
+
+ // [classpath:alfresco/application-context.xml,
+ // classpath:org/alfresco/repo/policy/annotation/test-qname-type-editor-context.xml]
+ org.alfresco.repo.policy.annotation.QNameTypeEditorTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/forms/MNT-7383-context.xml]
+ org.alfresco.repo.forms.processor.action.ActionFormProcessorTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:alfresco/filesys/auth/cifs/test-kerberos-context.xml]
+ org.alfresco.filesys.auth.cifs.CifsAuthenticatorKerberosTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:test-cmisinteger_modell-context.xml]
+ org.alfresco.opencmis.CMISTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/action/test-action-services-context.xml]
+ org.alfresco.repo.action.ActionServiceImplTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml,
+ // classpath:ratings/test-RatingServiceIntegrationTest-context.xml]
+ org.alfresco.repo.rating.RatingServiceIntegrationTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:sync-test-context.xml]
+ org.alfresco.repo.security.sync.ChainingUserRegistrySynchronizerTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:alfresco/test/global-integration-test-context.xml,
+ // classpath:sites/test-TemporarySitesTest-context.xml]
+ org.alfresco.repo.site.SiteServiceImplMoreTest.class,
+ org.alfresco.util.test.junitrules.TemporarySitesTest.class,
+
+ // ======================================================================
+ // any other order may lead to failing tests
+ // ======================================================================
+
+ // ----------------------------------------------------------------------
+ // virtualizationTestContext [classpath:**/virtualization-test-context.xml, classpath:alfresco/application-context.xml]
+ // ----------------------------------------------------------------------
+ org.alfresco.repo.virtual.bundle.VirtualPreferenceServiceExtensionTest.class,
+ org.alfresco.repo.virtual.bundle.VirtualLockableAspectInterceptorExtensionTest.class,
+ org.alfresco.repo.virtual.bundle.VirtualVersionServiceExtensionTest.class,
+ org.alfresco.repo.virtual.bundle.VirtualRatingServiceExtensionTest.class,
+ org.alfresco.repo.virtual.bundle.VirtualCheckOutCheckInServiceExtensionTest.class,
+ org.alfresco.repo.virtual.bundle.VirtualPermissionServiceExtensionTest.class,
+ org.alfresco.repo.virtual.bundle.VirtualNodeServiceExtensionTest.class,
+ org.alfresco.repo.virtual.bundle.VirtualFileFolderServiceExtensionTest.class,
+ org.alfresco.repo.virtual.template.ApplyTemplateMethodTest.class,
+ org.alfresco.repo.virtual.model.SystemTemplateLocationsConstraintTest.class,
+ org.alfresco.repo.virtual.store.SystemVirtualizationMethodTest.class,
+ org.alfresco.repo.virtual.store.TypeVirtualizationMethodTest.Integration.class,
+ org.alfresco.repo.virtual.template.TemplateResourceProcessorTest.class,
+ org.alfresco.repo.virtual.store.VirtualStoreImplTest.class,
+ org.alfresco.repo.virtual.config.NodeRefPathExpressionTest.class,
+ org.alfresco.repo.virtual.template.TemplateFilingRuleTest.class,
+ org.alfresco.repo.virtual.bundle.FileInfoPropsComparatorTest.class,
+
+ // ----------------------------------------------------------------------
+ // testSubscriptionsContext [classpath:alfresco/application-context.xml, classpath:test/alfresco/test-subscriptions-context.xml]
+ // TODO can we remove this? Was it EOLed?
+ // ----------------------------------------------------------------------
+ org.alfresco.repo.subscriptions.SubscriptionServiceImplTest.class,
+
+ // ----------------------------------------------------------------------
+ // openCmisContext [classpath:alfresco/application-context.xml, classpath:opencmis/opencmistest-context.xml]
+ // ----------------------------------------------------------------------
+ org.alfresco.opencmis.OpenCmisLocalTest.class,
+
+ // ----------------------------------------------------------------------
+ // cacheTestContext [classpath:alfresco/application-context.xml, classpath:cache-test/cache-test-context.xml]
+ // ----------------------------------------------------------------------
+ org.alfresco.repo.cache.CacheTest.class,
+
+ // ----------------------------------------------------------------------
+ // mtAllContext [classpath:alfresco/application-context.xml, classpath:tenant/mt-*context.xml]
+ // ----------------------------------------------------------------------
+ org.alfresco.repo.tenant.MultiTDemoTest.class,
+ org.alfresco.repo.workflow.activiti.ActivitiMultitenantWorkflowTest.class
+})
+public class AppContextExtraTestSuite
{
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.applicationContext_globalIntegrationTestContext(suite);
- AllRepositoryTestsCatalogue.applicationContext_extra(suite);
- // any other order may lead to failing tests
- AllRepositoryTestsCatalogue.applicationContext_virtualizationTestContext(suite);
- AllRepositoryTestsCatalogue.applicationContext_testSubscriptionsContext(suite);
- AllRepositoryTestsCatalogue.applicationContext_openCmisContext(suite);
- AllRepositoryTestsCatalogue.applicationContext_cacheTestContext(suite);
- AllRepositoryTestsCatalogue.applicationContext_mtAllContext(suite);
-
- return suite;
- }
}
diff --git a/src/test/java/org/alfresco/MiscContextTestSuite.java b/src/test/java/org/alfresco/MiscContextTestSuite.java
index 229c987489..8461a5410a 100644
--- a/src/test/java/org/alfresco/MiscContextTestSuite.java
+++ b/src/test/java/org/alfresco/MiscContextTestSuite.java
@@ -25,19 +25,149 @@
*/
package org.alfresco;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.alfresco.util.ApplicationContextHelper;
+import org.alfresco.util.testing.category.DBTests;
+import org.alfresco.util.testing.category.NonBuildTests;
+import org.junit.experimental.categories.Categories;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.springframework.context.ApplicationContext;
+/**
+ * Repository project tests using the various application contexts including the minimal context
+ * alfresco/minimal-context.xml but not the main one alfresco/application-context.xml.
+ * Tests marked as DBTests are automatically excluded and are run as part of {@link AllDBTestsTestSuite}.
+ */
+@RunWith(Categories.class)
+@Categories.ExcludeCategory({DBTests.class, NonBuildTests.class})
+@Suite.SuiteClasses({
+
+ // ----------------------------------------------------------------------
+ // Minimum context [classpath:alfresco/minimal-context.xml]
+ // ----------------------------------------------------------------------
+
+ // Limits
+ org.alfresco.repo.content.transform.AbstractContentTransformerLimitsTest.class,
+
+ // Transform tests
+ org.alfresco.repo.content.transform.BinaryPassThroughContentTransformerTest.class,
+ org.alfresco.repo.content.transform.ComplexContentTransformerTest.class,
+ org.alfresco.repo.content.transform.ContentTransformerRegistryTest.class,
+ org.alfresco.repo.content.transform.HtmlParserContentTransformerTest.class,
+ org.alfresco.repo.content.transform.MailContentTransformerTest.class,
+ org.alfresco.repo.content.transform.EMLTransformerTest.class,
+ org.alfresco.repo.content.transform.MediaWikiContentTransformerTest.class,
+ org.alfresco.repo.content.transform.OpenOfficeContentTransformerTest.class,
+ org.alfresco.repo.content.transform.PdfBoxContentTransformerTest.class,
+ org.alfresco.repo.content.transform.PoiContentTransformerTest.class,
+ org.alfresco.repo.content.transform.PoiHssfContentTransformerTest.class,
+ org.alfresco.repo.content.transform.PoiOOXMLContentTransformerTest.class,
+ org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerTest.class,
+ org.alfresco.repo.content.transform.StringExtractingContentTransformerTest.class,
+ org.alfresco.repo.content.transform.TextMiningContentTransformerTest.class,
+ org.alfresco.repo.content.transform.TextToPdfContentTransformerTest.class,
+ org.alfresco.repo.content.transform.TikaAutoContentTransformerTest.class,
+ org.alfresco.repo.content.transform.magick.ImageMagickContentTransformerTest.class,
+ org.alfresco.repo.content.transform.AppleIWorksContentTransformerTest.class,
+ org.alfresco.repo.content.transform.ArchiveContentTransformerTest.class,
+
+ // Metadata tests
+ org.alfresco.repo.content.metadata.DWGMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.HtmlMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.MailMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.MP3MetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.OfficeMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.OpenDocumentMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.OpenOfficeMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.PdfBoxMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.ConcurrencyPdfBoxMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.PoiMetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.RFC822MetadataExtracterTest.class,
+ org.alfresco.repo.content.metadata.TikaAutoMetadataExtracterTest.class,
+
+ org.alfresco.repo.content.metadata.MappingMetadataExtracterTest.class,
+
+ // ----------------------------------------------------------------------
+ // Misc contexts
+ // ----------------------------------------------------------------------
+
+ // [classpath:alfresco/node-locator-context.xml, classpath:test-nodeLocatorServiceImpl-context.xml]
+ org.alfresco.repo.nodelocator.NodeLocatorServiceImplTest.class,
+
+ // [classpath*:alfresco/ibatis/ibatis-test-context.xml, classpath:alfresco/application-context.xml,
+ // classpath:alfresco/test/global-integration-test-context.xml]
+ org.alfresco.repo.domain.query.CannedQueryDAOTest.class,
+ // REPO-2783 only passes on a dirty DB. fails to pass on a clean DB - testConcurrentArchive
+ org.alfresco.repo.node.NodeServiceTest.class,
+
+ // [classpath:alfresco/application-context.xml, classpath:alfresco/minimal-context.xml]
+ org.alfresco.RepositoryStartStopTest.class,
+
+ // [classpath:cachingstore/test-context.xml]
+ org.alfresco.repo.content.caching.FullTest.class,
+
+ // [classpath:cachingstore/test-cleaner-context.xml]
+ org.alfresco.repo.content.caching.cleanup.CachedContentCleanupJobTest.class,
+
+ // [classpath:cachingstore/test-std-quota-context.xml]
+ org.alfresco.repo.content.caching.quota.StandardQuotaStrategyTest.class,
+
+ // [classpath:cachingstore/test-slow-context.xml]
+ org.alfresco.repo.content.caching.test.SlowContentStoreTest.class,
+ org.alfresco.repo.content.caching.test.ConcurrentCachingStoreTest.class,
+
+ // [classpath:org/alfresco/repo/jscript/test-context.xml]
+ org.alfresco.repo.jscript.ScriptBehaviourTest.class,
+
+ // [module/module-component-test-beans.xml]
+ org.alfresco.repo.module.ComponentsTest.class,
+
+ // TODO can we remove this? Was it EOLed?
+ // [classpath:test/alfresco/test-web-publishing-context.xml]
+ org.alfresco.repo.publishing.ChannelServiceImplTest.class,
+ org.alfresco.repo.publishing.PublishingEventHelperTest.class,
+
+ // [alfresco/scheduler-core-context.xml, org/alfresco/util/test-scheduled-jobs-context.xml]
+ org.alfresco.util.CronTriggerBeanTest.class,
+
+ // [alfresco/scheduler-core-context.xml, org/alfresco/heartbeat/test-heartbeat-context.xml]
+ org.alfresco.heartbeat.HeartBeatTest.class,
+
+ // ----------------------------------------------------------------------
+ // Transformer/Rendition contexts
+ //
+ // The following tests can be extracted in a separate test suite
+ // if/when we decide to move the transformations in a separate component
+ // ----------------------------------------------------------------------
+
+ // [classpath:alfresco/application-context.xml, classpath:org/alfresco/repo/thumbnail/test-thumbnail-context.xml]
+ // some tests fail locally - on windows
+ org.alfresco.repo.thumbnail.ThumbnailServiceImplTest.class,
+
+ // [classpath:/test/alfresco/test-renditions-context.xml, classpath:alfresco/application-context.xml,
+ // classpath:alfresco/test/global-integration-test-context.xml]
+ // this does NOT passes locally
+ org.alfresco.repo.rendition.RenditionServicePermissionsTest.class,
+
+ // [alfresco/scheduler-core-context.xml, org/alfresco/heartbeat/test-heartbeat-context.xml]
+ org.alfresco.heartbeat.HeartBeatTest.class,
+})
public class MiscContextTestSuite
{
- public static Test suite()
- {
- TestSuite suite = new TestSuite();
- AllRepositoryTestsCatalogue.minimalContext(suite);
- AllRepositoryTestsCatalogue.miscContext(suite);
- // the following tests can be extracted in a separate test suite
- // if/when we decide to move the transformations in a separate component
- AllRepositoryTestsCatalogue.applicationContext_testThumnailContext(suite);
- return suite;
- }
+ /**
+ * Asks {@link ApplicationContextHelper} to give us a
+ * suitable, perhaps cached context for use in our tests
+ */
+ public static ApplicationContext getMinimalContext() {
+ ApplicationContextHelper.setUseLazyLoading(false);
+ ApplicationContextHelper.setNoAutoStart(true);
+ return ApplicationContextHelper.getApplicationContext(
+ new String[] { "classpath:alfresco/minimal-context.xml" }
+ );
+ }
+
+ static
+ {
+ getMinimalContext();
+ }
}
diff --git a/src/test/java/org/alfresco/RepositoryStartStopTest.java b/src/test/java/org/alfresco/RepositoryStartStopTest.java
index ed8a91293a..7c908b3eed 100644
--- a/src/test/java/org/alfresco/RepositoryStartStopTest.java
+++ b/src/test/java/org/alfresco/RepositoryStartStopTest.java
@@ -1,28 +1,28 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco;
import java.lang.reflect.Field;
@@ -38,6 +38,8 @@ import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.BaseApplicationContextHelper;
+import org.alfresco.util.testing.category.LuceneTests;
+import org.junit.experimental.categories.Category;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
@@ -58,6 +60,7 @@ import junit.framework.TestCase;
*
* @author Nick Burch
*/
+@Category(LuceneTests.class)
public class RepositoryStartStopTest extends TestCase
{
private ServiceRegistry serviceRegistry;
diff --git a/src/test/java/org/alfresco/email/server/EmailServiceImplTest.java b/src/test/java/org/alfresco/email/server/EmailServiceImplTest.java
index 393715f6e4..038430aa63 100644
--- a/src/test/java/org/alfresco/email/server/EmailServiceImplTest.java
+++ b/src/test/java/org/alfresco/email/server/EmailServiceImplTest.java
@@ -1,28 +1,28 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco.email.server;
import java.io.ByteArrayOutputStream;
@@ -65,6 +65,7 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.test_category.OwnJVMTestsCategory;
import org.alfresco.util.ApplicationContextHelper;
+import org.alfresco.util.testing.category.LuceneTests;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -78,7 +79,7 @@ import com.sun.mail.smtp.SMTPMessage;
* @author mrogers
*
*/
-@Category(OwnJVMTestsCategory.class)
+@Category({OwnJVMTestsCategory.class, LuceneTests.class})
public class EmailServiceImplTest extends TestCase
{
/**
diff --git a/src/test/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorKerberosTest.java b/src/test/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorKerberosTest.java
index 31f96f7ee1..34ea9821ba 100644
--- a/src/test/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorKerberosTest.java
+++ b/src/test/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorKerberosTest.java
@@ -1,28 +1,28 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco.filesys.auth.cifs;
import static org.junit.Assert.assertEquals;
@@ -44,13 +44,16 @@ import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.GUID;
import org.alfresco.util.PropertyMap;
+import org.alfresco.util.testing.category.LuceneTests;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.junit.experimental.categories.Category;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.context.ApplicationContext;
+@Category(LuceneTests.class)
public class CifsAuthenticatorKerberosTest
{
public static final String[] CONFIG_LOCATIONS = new String[] { "classpath:alfresco/application-context.xml",
diff --git a/src/test/java/org/alfresco/opencmis/BaseCMISTest.java b/src/test/java/org/alfresco/opencmis/BaseCMISTest.java
index 8b7cd5867e..75c57f573f 100644
--- a/src/test/java/org/alfresco/opencmis/BaseCMISTest.java
+++ b/src/test/java/org/alfresco/opencmis/BaseCMISTest.java
@@ -1,28 +1,28 @@
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco.opencmis;
import java.util.Date;
@@ -57,6 +57,8 @@ import org.alfresco.service.cmr.version.VersionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
+import org.alfresco.util.testing.category.LuceneTests;
+import org.junit.experimental.categories.Category;
import org.springframework.context.ApplicationContext;
/**
@@ -66,6 +68,7 @@ import org.springframework.context.ApplicationContext;
* @author andyh
*
*/
+@Category(LuceneTests.class)
public abstract class BaseCMISTest extends TestCase
{
protected ApplicationContext ctx;
@@ -121,7 +124,7 @@ public abstract class BaseCMISTest extends TestCase
protected StoreRef storeRef;
public void setUp() throws Exception
- {
+ {
ctx = ApplicationContextHelper.getApplicationContext();
serviceRegistry = (ServiceRegistry) ctx.getBean("ServiceRegistry");
diff --git a/src/test/java/org/alfresco/opencmis/CMISTest.java b/src/test/java/org/alfresco/opencmis/CMISTest.java
index dc1043a8a6..f9a8893a8c 100644
--- a/src/test/java/org/alfresco/opencmis/CMISTest.java
+++ b/src/test/java/org/alfresco/opencmis/CMISTest.java
@@ -1,172 +1,175 @@
-
-/*
- * #%L
- * Alfresco Repository
- * %%
- * Copyright (C) 2005 - 2016 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
- * provided under the following open source license terms:
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- * #L%
- */
+
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2016 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
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
package org.alfresco.opencmis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.alfresco.model.ContentModel;
-import org.alfresco.opencmis.dictionary.CMISDictionaryService;
-import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper;
-import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
-import org.alfresco.opencmis.search.CMISQueryOptions;
-import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode;
-import org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator;
-import org.alfresco.repo.action.executer.AddFeaturesActionExecuter;
-import org.alfresco.repo.audit.AuditComponent;
-import org.alfresco.repo.audit.AuditComponentImpl;
-import org.alfresco.repo.audit.AuditServiceImpl;
-import org.alfresco.repo.audit.UserAuditFilter;
-import org.alfresco.repo.audit.model.AuditModelRegistryImpl;
-import org.alfresco.repo.content.MimetypeMap;
-import org.alfresco.repo.dictionary.DictionaryDAO;
-import org.alfresco.repo.dictionary.M2Model;
-import org.alfresco.repo.domain.audit.AuditDAO;
-import org.alfresco.repo.domain.node.ContentDataWithId;
-import org.alfresco.repo.domain.node.NodeDAO;
-import org.alfresco.repo.model.Repository;
-import org.alfresco.repo.node.archive.NodeArchiveService;
-import org.alfresco.repo.security.authentication.AuthenticationComponent;
-import org.alfresco.repo.security.authentication.AuthenticationContext;
-import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
-import org.alfresco.repo.tenant.TenantAdminService;
-import org.alfresco.repo.tenant.TenantService;
-import org.alfresco.repo.tenant.TenantUtil;
-import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
-import org.alfresco.repo.transaction.RetryingTransactionHelper;
-import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
-import org.alfresco.repo.version.VersionableAspectTest;
-import org.alfresco.repo.workflow.WorkflowDeployer;
-import org.alfresco.service.ServiceRegistry;
-import org.alfresco.service.cmr.action.ActionCondition;
-import org.alfresco.service.cmr.action.ActionService;
-import org.alfresco.service.cmr.dictionary.AspectDefinition;
-import org.alfresco.service.cmr.dictionary.DictionaryService;
-import org.alfresco.service.cmr.lock.LockService;
-import org.alfresco.service.cmr.lock.LockType;
-import org.alfresco.service.cmr.model.FileFolderService;
-import org.alfresco.service.cmr.model.FileInfo;
-import org.alfresco.service.cmr.repository.ChildAssociationRef;
-import org.alfresco.service.cmr.repository.ContentService;
-import org.alfresco.service.cmr.repository.ContentWriter;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.repository.StoreRef;
-import org.alfresco.service.cmr.rule.Rule;
-import org.alfresco.service.cmr.rule.RuleService;
-import org.alfresco.service.cmr.rule.RuleType;
-import org.alfresco.service.cmr.search.SearchService;
-import org.alfresco.service.cmr.security.AccessPermission;
-import org.alfresco.service.cmr.security.AuthorityService;
-import org.alfresco.service.cmr.security.AuthorityType;
-import org.alfresco.service.cmr.security.PermissionService;
-import org.alfresco.service.cmr.tagging.TaggingService;
-import org.alfresco.service.cmr.version.Version;
-import org.alfresco.service.cmr.version.VersionService;
-import org.alfresco.service.cmr.version.VersionType;
-import org.alfresco.service.cmr.workflow.WorkflowAdminService;
-import org.alfresco.service.cmr.workflow.WorkflowService;
-import org.alfresco.service.namespace.NamespaceService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.service.transaction.TransactionService;
-import org.alfresco.util.ApplicationContextHelper;
-import org.alfresco.util.Pair;
-import org.apache.chemistry.opencmis.commons.PropertyIds;
-import org.apache.chemistry.opencmis.commons.data.Ace;
-import org.apache.chemistry.opencmis.commons.data.AllowableActions;
-import org.apache.chemistry.opencmis.commons.data.CmisExtensionElement;
-import org.apache.chemistry.opencmis.commons.data.ContentStream;
-import org.apache.chemistry.opencmis.commons.data.FailedToDeleteData;
-import org.apache.chemistry.opencmis.commons.data.ObjectData;
-import org.apache.chemistry.opencmis.commons.data.ObjectInFolderData;
-import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList;
-import org.apache.chemistry.opencmis.commons.data.ObjectList;
-import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
-import org.apache.chemistry.opencmis.commons.data.Properties;
-import org.apache.chemistry.opencmis.commons.data.PropertyData;
-import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
-import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
-import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
-import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
-import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
-import org.apache.chemistry.opencmis.commons.enums.Action;
-import org.apache.chemistry.opencmis.commons.enums.ChangeType;
-import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
-import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
-import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
-import org.apache.chemistry.opencmis.commons.enums.VersioningState;
-import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
-import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
-import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
-import org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.CmisExtensionElementImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.ExtensionDataImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyDecimalDefinitionImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIntegerDefinitionImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIntegerImpl;
-import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl;
-import org.apache.chemistry.opencmis.commons.impl.server.AbstractServiceFactory;
-import org.apache.chemistry.opencmis.commons.server.CallContext;
-import org.apache.chemistry.opencmis.commons.server.CmisService;
-import org.apache.chemistry.opencmis.commons.spi.Holder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.context.ApplicationContext;
-import org.springframework.extensions.webscripts.GUID;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.alfresco.model.ContentModel;
+import org.alfresco.opencmis.dictionary.CMISDictionaryService;
+import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper;
+import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
+import org.alfresco.opencmis.search.CMISQueryOptions;
+import org.alfresco.opencmis.search.CMISQueryOptions.CMISQueryMode;
+import org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator;
+import org.alfresco.repo.action.executer.AddFeaturesActionExecuter;
+import org.alfresco.repo.audit.AuditComponent;
+import org.alfresco.repo.audit.AuditComponentImpl;
+import org.alfresco.repo.audit.AuditServiceImpl;
+import org.alfresco.repo.audit.UserAuditFilter;
+import org.alfresco.repo.audit.model.AuditModelRegistryImpl;
+import org.alfresco.repo.content.MimetypeMap;
+import org.alfresco.repo.dictionary.DictionaryDAO;
+import org.alfresco.repo.dictionary.M2Model;
+import org.alfresco.repo.domain.audit.AuditDAO;
+import org.alfresco.repo.domain.node.ContentDataWithId;
+import org.alfresco.repo.domain.node.NodeDAO;
+import org.alfresco.repo.model.Repository;
+import org.alfresco.repo.node.archive.NodeArchiveService;
+import org.alfresco.repo.security.authentication.AuthenticationComponent;
+import org.alfresco.repo.security.authentication.AuthenticationContext;
+import org.alfresco.repo.security.authentication.AuthenticationUtil;
+import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
+import org.alfresco.repo.tenant.TenantAdminService;
+import org.alfresco.repo.tenant.TenantService;
+import org.alfresco.repo.tenant.TenantUtil;
+import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
+import org.alfresco.repo.transaction.RetryingTransactionHelper;
+import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
+import org.alfresco.repo.version.VersionableAspectTest;
+import org.alfresco.repo.workflow.WorkflowDeployer;
+import org.alfresco.service.ServiceRegistry;
+import org.alfresco.service.cmr.action.ActionCondition;
+import org.alfresco.service.cmr.action.ActionService;
+import org.alfresco.service.cmr.dictionary.AspectDefinition;
+import org.alfresco.service.cmr.dictionary.DictionaryService;
+import org.alfresco.service.cmr.lock.LockService;
+import org.alfresco.service.cmr.lock.LockType;
+import org.alfresco.service.cmr.model.FileFolderService;
+import org.alfresco.service.cmr.model.FileInfo;
+import org.alfresco.service.cmr.repository.ChildAssociationRef;
+import org.alfresco.service.cmr.repository.ContentService;
+import org.alfresco.service.cmr.repository.ContentWriter;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.repository.NodeService;
+import org.alfresco.service.cmr.repository.StoreRef;
+import org.alfresco.service.cmr.rule.Rule;
+import org.alfresco.service.cmr.rule.RuleService;
+import org.alfresco.service.cmr.rule.RuleType;
+import org.alfresco.service.cmr.search.SearchService;
+import org.alfresco.service.cmr.security.AccessPermission;
+import org.alfresco.service.cmr.security.AuthorityService;
+import org.alfresco.service.cmr.security.AuthorityType;
+import org.alfresco.service.cmr.security.PermissionService;
+import org.alfresco.service.cmr.tagging.TaggingService;
+import org.alfresco.service.cmr.version.Version;
+import org.alfresco.service.cmr.version.VersionService;
+import org.alfresco.service.cmr.version.VersionType;
+import org.alfresco.service.cmr.workflow.WorkflowAdminService;
+import org.alfresco.service.cmr.workflow.WorkflowService;
+import org.alfresco.service.namespace.NamespaceService;
+import org.alfresco.service.namespace.QName;
+import org.alfresco.service.transaction.TransactionService;
+import org.alfresco.util.ApplicationContextHelper;
+import org.alfresco.util.Pair;
+import org.alfresco.util.testing.category.LuceneTests;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.Ace;
+import org.apache.chemistry.opencmis.commons.data.AllowableActions;
+import org.apache.chemistry.opencmis.commons.data.CmisExtensionElement;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.data.FailedToDeleteData;
+import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.commons.data.ObjectInFolderData;
+import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList;
+import org.apache.chemistry.opencmis.commons.data.ObjectList;
+import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
+import org.apache.chemistry.opencmis.commons.data.Properties;
+import org.apache.chemistry.opencmis.commons.data.PropertyData;
+import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
+import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+import org.apache.chemistry.opencmis.commons.enums.Action;
+import org.apache.chemistry.opencmis.commons.enums.ChangeType;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.AccessControlListImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.CmisExtensionElementImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.ExtensionDataImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyDecimalDefinitionImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIntegerDefinitionImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIntegerImpl;
+import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl;
+import org.apache.chemistry.opencmis.commons.impl.server.AbstractServiceFactory;
+import org.apache.chemistry.opencmis.commons.server.CallContext;
+import org.apache.chemistry.opencmis.commons.server.CmisService;
+import org.apache.chemistry.opencmis.commons.spi.Holder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.springframework.context.ApplicationContext;
+import org.springframework.extensions.webscripts.GUID;
/**
* OpenCMIS tests.
@@ -174,12 +177,13 @@ import org.springframework.extensions.webscripts.GUID;
* @author steveglover
*
*/
+@Category(LuceneTests.class)
public class CMISTest
-{
- private static Log logger = LogFactory.getLog(CMISTest.class);
+{
+ private static Log logger = LogFactory.getLog(CMISTest.class);
- private static final QName TEST_START_TASK = QName.createQName("http://www.alfresco.org/model/workflow/test/1.0", "startTaskVarScriptAssign");
- private static final QName TEST_WORKFLOW_TASK = QName.createQName("http://www.alfresco.org/model/workflow/test/1.0", "assignVarTask");
+ private static final QName TEST_START_TASK = QName.createQName("http://www.alfresco.org/model/workflow/test/1.0", "startTaskVarScriptAssign");
+ private static final QName TEST_WORKFLOW_TASK = QName.createQName("http://www.alfresco.org/model/workflow/test/1.0", "assignVarTask");
private static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext(new String[]{ApplicationContextHelper.CONFIG_LOCATIONS[0],"classpath:test-cmisinteger_modell-context.xml"});
@@ -209,7 +213,7 @@ public class CMISTest
private TenantService tenantService;
private SearchService searchService;
private java.util.Properties globalProperties;
- private AuditComponentImpl auditComponent;
+ private AuditComponentImpl auditComponent;
private AlfrescoCmisServiceFactory factory;
@@ -388,7 +392,7 @@ public class CMISTest
this.tenantAdminService = (TenantAdminService) ctx.getBean("tenantAdminService");
this.tenantService = (TenantService) ctx.getBean("tenantService");
this.searchService = (SearchService) ctx.getBean("SearchService");
- this.auditComponent = (AuditComponentImpl) ctx.getBean("auditComponent");
+ this.auditComponent = (AuditComponentImpl) ctx.getBean("auditComponent");
this.globalProperties = (java.util.Properties) ctx.getBean("global-properties");
this.globalProperties.setProperty(VersionableAspectTest.AUTO_VERSION_PROPS_KEY, "true");
@@ -658,9 +662,9 @@ public class CMISTest
assertNotNull(startTaskTypeDefinition);
assertNotNull(workflowTaskTypeDefinition);
- // caches are refreshed asynchronously
- Thread.sleep(5000);
-
+ // caches are refreshed asynchronously
+ Thread.sleep(5000);
+
// check that loaded model is available via CMIS API
CallContext context = new SimpleCallContext("admin", "admin", CmisVersion.CMIS_1_1);
CmisService service = factory.getService(context);
@@ -799,12 +803,12 @@ public class CMISTest
*/
@Test
public void testContentMimeTypeDetection()
- {
- ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
- FileFolderService ffs = serviceRegistry.getFileFolderService();
- AuthenticationComponent authenticationComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
- final String isoEncoding = "ISO-8859-1";
- final String utfEncoding = "UTF-8";
+ {
+ ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
+ FileFolderService ffs = serviceRegistry.getFileFolderService();
+ AuthenticationComponent authenticationComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
+ final String isoEncoding = "ISO-8859-1";
+ final String utfEncoding = "UTF-8";
// get repository id
List repositories = withCmisService(new CmisServiceCallback>()
@@ -875,16 +879,16 @@ public class CMISTest
return contentType;
}
});
- assertEquals("Mimetype is not defined correctly.", MimetypeMap.MIMETYPE_HTML, contentType);
-
- // check that the encoding is detected correctly
+ assertEquals("Mimetype is not defined correctly.", MimetypeMap.MIMETYPE_HTML, contentType);
+
+ // check that the encoding is detected correctly
checkEncoding(ffs, authenticationComponent, objectData, utfEncoding);
}
// create content stream with mimetype and encoding as UTF-8
{
- String mimeType = MimetypeMap.MIMETYPE_TEXT_PLAIN + "; charset="+isoEncoding;
- // NOTE that we intentionally specify the wrong charset here.
+ String mimeType = MimetypeMap.MIMETYPE_TEXT_PLAIN + "; charset="+isoEncoding;
+ // NOTE that we intentionally specify the wrong charset here.
// Alfresco will detect the encoding (as UTF-8 - given by the ContentStreamImpl constructor)
final ContentStreamImpl contentStreamHTML = new ContentStreamImpl(null, mimeType, " Hello Test html