mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ACS-2322 Don't compare audit properties for CMIS TCK RootFolderTest (#1159)
* ACS-2322 Check the passthrough implementation Skip properties which might be modified asynchronously Update copyright headers Slight refactoring and using Mockito.spy instead of proxy
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -35,7 +35,6 @@ import org.alfresco.util.testing.category.LuceneTests;
|
||||
import org.alfresco.util.testing.category.RedundantTests;
|
||||
import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.impl.JUnitHelper;
|
||||
import org.apache.chemistry.opencmis.tck.tests.basics.BasicsTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.control.ControlTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.crud.BulkUpdatePropertiesTest;
|
||||
import org.apache.chemistry.opencmis.tck.tests.crud.CRUDTestGroup;
|
||||
@@ -69,7 +68,7 @@ public abstract class AbstractEnterpriseOpenCMIS11TCKTest extends AbstractEnterp
|
||||
@Test
|
||||
public void testCMISTCKBasics() throws Exception
|
||||
{
|
||||
BasicsTestGroup basicsTestGroup = new BasicsTestGroup();
|
||||
AlfrescoCMISBasicsTestGroup basicsTestGroup = new AlfrescoCMISBasicsTestGroup();
|
||||
JUnitHelper.run(basicsTestGroup);
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.rest.api.tests;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.chemistry.opencmis.client.api.CmisObject;
|
||||
import org.apache.chemistry.opencmis.client.api.Property;
|
||||
import org.apache.chemistry.opencmis.tck.CmisTestResult;
|
||||
import org.apache.chemistry.opencmis.tck.tests.basics.BasicsTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.basics.RootFolderTest;
|
||||
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
class AlfrescoCMISBasicsTestGroup extends BasicsTestGroup
|
||||
{
|
||||
@Override
|
||||
public void init(Map<String, String> parameters) throws Exception
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
replaceRootFolderTest();
|
||||
}
|
||||
|
||||
private void replaceRootFolderTest() throws Exception {
|
||||
getTests().removeIf(t -> t instanceof RootFolderTest);
|
||||
addTest(new RootFolderTest()
|
||||
{
|
||||
@Override
|
||||
protected CmisTestResult assertEquals(CmisObject expected, CmisObject actual, CmisTestResult success, CmisTestResult failure, boolean checkAcls, boolean checkPolicies)
|
||||
{
|
||||
return super.assertEquals(hideAsynchronouslyChangedProperties(expected), hideAsynchronouslyChangedProperties(actual), success, failure, checkAcls, checkPolicies);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private CmisObject hideAsynchronouslyChangedProperties(final CmisObject target)
|
||||
{
|
||||
CmisObject spiedObject = spy(target);
|
||||
when(spiedObject.getProperties()).then(a -> {
|
||||
List<Property<?>> properties = (List<Property<?>>) a.callRealMethod();
|
||||
return properties.stream()
|
||||
.filter(p -> !p.getId().startsWith("cmis:lastMod"))
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
});
|
||||
|
||||
return spiedObject;
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -27,19 +27,13 @@ package org.alfresco.rest.api.tests;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.opencmis.OpenCMISClientContext;
|
||||
import org.alfresco.opencmis.tck.tests.query.QueryForObjectCustom;
|
||||
import org.alfresco.opencmis.tck.tests.query.QueryInFolderTestCustom;
|
||||
import org.alfresco.opencmis.tck.tests.query.QueryLikeTestCustom;
|
||||
import org.alfresco.repo.dictionary.DictionaryDAO;
|
||||
import org.alfresco.repo.dictionary.M2Aspect;
|
||||
import org.alfresco.repo.dictionary.M2Model;
|
||||
import org.alfresco.repo.dictionary.M2Property;
|
||||
import org.alfresco.repo.model.Repository;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
@@ -47,10 +41,8 @@ import org.alfresco.repo.web.util.JettyComponent;
|
||||
import org.alfresco.service.cmr.model.FileFolderService;
|
||||
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.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.testing.category.LuceneTests;
|
||||
import org.alfresco.util.testing.category.RedundantTests;
|
||||
@@ -58,13 +50,11 @@ import org.apache.chemistry.opencmis.commons.enums.BindingType;
|
||||
import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.impl.JUnitHelper;
|
||||
import org.apache.chemistry.opencmis.tck.impl.TestParameters;
|
||||
import org.apache.chemistry.opencmis.tck.tests.basics.BasicsTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.control.ControlTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.crud.CRUDTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.filing.FilingTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.query.ContentChangesSmokeTest;
|
||||
import org.apache.chemistry.opencmis.tck.tests.query.QuerySmokeTest;
|
||||
import org.apache.chemistry.opencmis.tck.tests.types.TypesTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.versioning.CheckedOutTest;
|
||||
import org.apache.chemistry.opencmis.tck.tests.versioning.VersionDeleteTest;
|
||||
import org.apache.chemistry.opencmis.tck.tests.versioning.VersioningSmokeTest;
|
||||
@@ -123,13 +113,12 @@ public class TestEnterpriseAtomPubTCK extends AbstractEnterpriseOpenCMIS10TCKTes
|
||||
overrideVersionableAspectProperties(jetty.getApplicationContext());
|
||||
}
|
||||
|
||||
// Commented out: See https://issues.alfresco.com/jira/browse/MNT-11123?focusedCommentId=339130&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-339130
|
||||
// @Test
|
||||
// public void testCMISTCKBasics() throws Exception
|
||||
// {
|
||||
// BasicsTestGroup basicsTestGroup = new BasicsTestGroup();
|
||||
// JUnitHelper.run(basicsTestGroup);
|
||||
// }
|
||||
@Test
|
||||
public void testCMISTCKBasics() throws Exception
|
||||
{
|
||||
AlfrescoCMISBasicsTestGroup basicsTestGroup = new AlfrescoCMISBasicsTestGroup();
|
||||
JUnitHelper.run(basicsTestGroup);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCMISTCKCRUD() throws Exception
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Remote API
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -25,8 +25,6 @@
|
||||
*/
|
||||
package org.alfresco.rest.api.tests;
|
||||
|
||||
import static org.junit.Assume.assumeFalse;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -42,7 +40,6 @@ import org.apache.chemistry.opencmis.commons.enums.BindingType;
|
||||
import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.impl.JUnitHelper;
|
||||
import org.apache.chemistry.opencmis.tck.impl.TestParameters;
|
||||
import org.apache.chemistry.opencmis.tck.tests.basics.BasicsTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.control.ControlTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.crud.CRUDTestGroup;
|
||||
import org.apache.chemistry.opencmis.tck.tests.filing.FilingTestGroup;
|
||||
@@ -93,7 +90,7 @@ public class TestPublicApiAtomPub10TCK extends AbstractEnterpriseOpenCMIS10TCKTe
|
||||
@Test
|
||||
public void testCMISTCKBasics() throws Exception
|
||||
{
|
||||
BasicsTestGroup basicsTestGroup = new BasicsTestGroup();
|
||||
AlfrescoCMISBasicsTestGroup basicsTestGroup = new AlfrescoCMISBasicsTestGroup();
|
||||
JUnitHelper.run(basicsTestGroup);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user