From b2b0c9e6605a437a331a78fd942a3350e167fffb Mon Sep 17 00:00:00 2001 From: Alex Mukha Date: Sun, 4 Mar 2018 16:58:48 +0000 Subject: [PATCH] Upgrade Spring (REPO-1295), Quartz (REPO-3049) and remove Hibernate (REPO-2873) (#45) * Change context file schemas * Change quartz related usages --- pom.xml | 8 +- .../framework/core/ResourceInspectorUtil.java | 190 +++++++-------- .../webscripts/ResourceWebScriptPut.java | 4 +- .../blogs/web-scripts-blog-context.xml | 6 +- .../alfresco/public-rest-context.xml | 6 +- .../resources/alfresco/remote-api-context.xml | 7 +- .../web-scripts-application-context.xml | 9 +- .../alfresco/AppContextExtraTestSuite.java | 4 - .../subsystems/test/SubsystemsTest.java | 228 ------------------ .../test/TestPortEarlyPropertyChecker.java | 72 ------ .../web/scripts/RepositoryContainerTest.java | 66 ++--- .../alfresco/repo/webdav/PutMethodTest.java | 18 ++ .../alfresco/rest/api/tests/RepoService.java | 39 +-- .../api/tests/TestPublicApiAtomPub10TCK.java | 9 +- .../api/tests/TestPublicApiAtomPub11TCK.java | 69 +++--- .../api/tests/TestPublicApiBrowser11TCK.java | 69 +++--- .../workflow/api/impl/ProcessesImplTest.java | 15 +- ...eadsheet-webscript-application-context.xml | 6 +- .../quick-share-turned-off-test-context.xml | 7 +- src/test/resources/rest-api-test-context.xml | 12 +- src/test/resources/test-rest-context.xml | 8 +- 21 files changed, 284 insertions(+), 568 deletions(-) delete mode 100644 src/test/java/org/alfresco/repo/management/subsystems/test/SubsystemsTest.java delete mode 100644 src/test/java/org/alfresco/repo/management/subsystems/test/TestPortEarlyPropertyChecker.java diff --git a/pom.xml b/pom.xml index bbb04b2e55..47748c9b0b 100644 --- a/pom.xml +++ b/pom.xml @@ -35,16 +35,16 @@ ${project.build.directory}/alf_data convert - 6.27 - 6.18 - 7.3 + 6.28 + 7.0 + 8.0 1.1 2.8.10 6.13 1.0.0 - 3.2.17.RELEASE + 5.0.4.RELEASE 9.4.1212 5.1.40 diff --git a/src/main/java/org/alfresco/rest/framework/core/ResourceInspectorUtil.java b/src/main/java/org/alfresco/rest/framework/core/ResourceInspectorUtil.java index b9241cb9d2..064d2b7bfd 100755 --- a/src/main/java/org/alfresco/rest/framework/core/ResourceInspectorUtil.java +++ b/src/main/java/org/alfresco/rest/framework/core/ResourceInspectorUtil.java @@ -1,28 +1,28 @@ -/* - * #%L - * Alfresco Remote API - * %% - * 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 Remote API + * %% + * 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.rest.framework.core; import java.lang.annotation.Annotation; @@ -31,12 +31,12 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import org.alfresco.rest.framework.Operation; +import org.alfresco.rest.framework.Operation; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.core.BridgeMethodResolver; -import org.springframework.core.GenericCollectionTypeResolver; import org.springframework.core.GenericTypeResolver; +import org.springframework.core.ResolvableType; import org.springframework.core.annotation.AnnotationUtils; /** @@ -57,56 +57,56 @@ public class ResourceInspectorUtil protected static Class determineType(Class resource, Method method) { Method resolvedMethod = BridgeMethodResolver.findBridgedMethod(method); - - /* - * The api is consistent that the object passed in must match the object passed out - * however, operations are different, if the param is supplied it doesn't have to match - * the return type. - * So we need special logic for operations - */ - Annotation annot = AnnotationUtils.findAnnotation(resolvedMethod, Operation.class); - if (annot != null) + + /* + * The api is consistent that the object passed in must match the object passed out + * however, operations are different, if the param is supplied it doesn't have to match + * the return type. + * So we need special logic for operations + */ + Annotation annot = AnnotationUtils.findAnnotation(resolvedMethod, Operation.class); + if (annot != null) { - return determineOperationType(resource, method); + return determineOperationType(resource, method); + } + else + { + Class returnType = GenericTypeResolver.resolveReturnType(resolvedMethod, resource); + if (List.class.isAssignableFrom(returnType)) + { + return ResolvableType.forMethodReturnType(method).asCollection().getGeneric(0).resolve(); + } + return returnType; } - else - { - Class returnType = GenericTypeResolver.resolveReturnType(resolvedMethod, resource); - if (List.class.isAssignableFrom(returnType)) - { - return GenericCollectionTypeResolver.getCollectionReturnType(method); - } - return returnType; - } } - protected static Class determineOperationType(Class resource, Method method) - { - //Its an operation annotated method and its a bit special - Class[] paramTypes = method.getParameterTypes(); - if (paramTypes!= null) - { - switch (paramTypes.length) - { - case 4: - //EntityResource operation by id, same logic as RelationshipEntityResource operation by id - case 5: - int position = paramTypes.length-3; - if (Void.class.equals(paramTypes[position])) - { - return null; - } - else - { - return paramTypes[position]; - } - } - } - - throw new IllegalArgumentException("Your method signature should have 4 parameters (uniqueId, typePassedin, Parameters, WithResponse)," + - " use Void if you are not interested in the second argument. "+resource.getName()+ " "+ method.getName()); - } - + protected static Class determineOperationType(Class resource, Method method) + { + //Its an operation annotated method and its a bit special + Class[] paramTypes = method.getParameterTypes(); + if (paramTypes!= null) + { + switch (paramTypes.length) + { + case 4: + //EntityResource operation by id, same logic as RelationshipEntityResource operation by id + case 5: + int position = paramTypes.length-3; + if (Void.class.equals(paramTypes[position])) + { + return null; + } + else + { + return paramTypes[position]; + } + } + } + + throw new IllegalArgumentException("Your method signature should have 4 parameters (uniqueId, typePassedin, Parameters, WithResponse)," + + " use Void if you are not interested in the second argument. "+resource.getName()+ " "+ method.getName()); + } + /** * Finds methods for the given annotation * @@ -121,7 +121,7 @@ public class ResourceInspectorUtil * @return - the List of Method or an empty List */ @SuppressWarnings("rawtypes") - public static List findMethodsByAnnotation(Class objClass, Class annotationType) + public static List findMethodsByAnnotation(Class objClass, Class annotationType) { List annotatedMethods = new ArrayList(); @@ -139,24 +139,24 @@ public class ResourceInspectorUtil return annotatedMethods; } - /** - * Invokes a no arg method and returns the result - * @param annotatedMethod Method - * @param obj Object - * @return result of method call - */ - public static Object invokeMethod(Method annotatedMethod, Object obj) - { - try - { - return invokeMethod(annotatedMethod, obj, null); - } - catch (Throwable error) - { - logger.error("Invocation failure", error); - return null; - } - } + /** + * Invokes a no arg method and returns the result + * @param annotatedMethod Method + * @param obj Object + * @return result of method call + */ + public static Object invokeMethod(Method annotatedMethod, Object obj) + { + try + { + return invokeMethod(annotatedMethod, obj, null); + } + catch (Throwable error) + { + logger.error("Invocation failure", error); + return null; + } + } /** * Invokes a method and returns the result @@ -164,13 +164,13 @@ public class ResourceInspectorUtil * @param obj Object * @return result of method call */ - public static Object invokeMethod(Method annotatedMethod, Object obj, Object... args) throws Throwable + public static Object invokeMethod(Method annotatedMethod, Object obj, Object... args) throws Throwable { if (annotatedMethod != null) { try { - return annotatedMethod.invoke(obj, args); + return annotatedMethod.invoke(obj, args); } catch (IllegalArgumentException error) { @@ -183,7 +183,7 @@ public class ResourceInspectorUtil catch (InvocationTargetException error) { logger.warn("InvocationTargetException", error); - throw error.getCause(); + throw error.getCause(); } } return null; diff --git a/src/main/java/org/alfresco/rest/framework/webscripts/ResourceWebScriptPut.java b/src/main/java/org/alfresco/rest/framework/webscripts/ResourceWebScriptPut.java index 328239a6ea..18db1a6f3d 100644 --- a/src/main/java/org/alfresco/rest/framework/webscripts/ResourceWebScriptPut.java +++ b/src/main/java/org/alfresco/rest/framework/webscripts/ResourceWebScriptPut.java @@ -139,9 +139,9 @@ public class ResourceWebScriptPut extends AbstractResourceWebScript implements P { MediaType media = MediaType.parseMediaType(req.getContentType()); contentType = media.getType()+'/'+media.getSubtype(); - if (media.getCharSet() != null) + if (media.getCharset() != null) { - encoding = media.getCharSet().toString(); + encoding = media.getCharset().toString(); } } diff --git a/src/main/resources/alfresco/blogs/web-scripts-blog-context.xml b/src/main/resources/alfresco/blogs/web-scripts-blog-context.xml index f2e94d9388..ee43c630ce 100644 --- a/src/main/resources/alfresco/blogs/web-scripts-blog-context.xml +++ b/src/main/resources/alfresco/blogs/web-scripts-blog-context.xml @@ -1,7 +1,9 @@ - + - diff --git a/src/main/resources/alfresco/public-rest-context.xml b/src/main/resources/alfresco/public-rest-context.xml index 8936d28ecb..0d9d0f0721 100644 --- a/src/main/resources/alfresco/public-rest-context.xml +++ b/src/main/resources/alfresco/public-rest-context.xml @@ -2,8 +2,8 @@ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> true @@ -42,7 +42,7 @@ - + diff --git a/src/main/resources/alfresco/remote-api-context.xml b/src/main/resources/alfresco/remote-api-context.xml index 21f6d6b54f..c3f3816939 100644 --- a/src/main/resources/alfresco/remote-api-context.xml +++ b/src/main/resources/alfresco/remote-api-context.xml @@ -1,7 +1,8 @@ - - - + diff --git a/src/main/resources/alfresco/web-scripts-application-context.xml b/src/main/resources/alfresco/web-scripts-application-context.xml index 4bf49eeb44..abf4654c5e 100644 --- a/src/main/resources/alfresco/web-scripts-application-context.xml +++ b/src/main/resources/alfresco/web-scripts-application-context.xml @@ -1,7 +1,8 @@ - - - + @@ -185,7 +186,7 @@ - + diff --git a/src/test/java/org/alfresco/AppContextExtraTestSuite.java b/src/test/java/org/alfresco/AppContextExtraTestSuite.java index 20d7cada86..cb53cdfc22 100644 --- a/src/test/java/org/alfresco/AppContextExtraTestSuite.java +++ b/src/test/java/org/alfresco/AppContextExtraTestSuite.java @@ -68,10 +68,6 @@ import org.junit.runners.Suite; // these tests run very fast once the context is up org.alfresco.repo.remoteticket.RemoteAlfrescoTicketServiceTest.class, org.alfresco.repo.web.scripts.servlet.RemoteAuthenticatorFactoryTest.class, - - - // [classpath:alfresco/application-context.xml, classpath:subsystem-test-context.xml] - org.alfresco.repo.management.subsystems.test.SubsystemsTest.class, // [classpath:alfresco/application-context.xml] org.alfresco.repo.webdav.GetMethodRegressionTest.class, diff --git a/src/test/java/org/alfresco/repo/management/subsystems/test/SubsystemsTest.java b/src/test/java/org/alfresco/repo/management/subsystems/test/SubsystemsTest.java deleted file mode 100644 index 8eafdcbc88..0000000000 --- a/src/test/java/org/alfresco/repo/management/subsystems/test/SubsystemsTest.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * #%L - * Alfresco Remote API - * %% - * 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.management.subsystems.test; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.ServerSocket; -import java.net.SocketTimeoutException; -import java.util.HashMap; -import java.util.Map; - -import org.alfresco.repo.management.subsystems.ApplicationContextFactory; -import org.alfresco.repo.management.subsystems.ChildApplicationContextFactory; -import org.alfresco.repo.management.subsystems.InvalidPropertyValueException; -import org.alfresco.repo.management.subsystems.SubsystemEarlyPropertyChecker; -import org.alfresco.test_category.OwnJVMTestsCategory; -import org.alfresco.util.ApplicationContextHelper; -import org.alfresco.util.BaseSpringTest; -import org.apache.commons.logging.LogFactory; -import org.junit.experimental.categories.Category; -import org.springframework.context.ConfigurableApplicationContext; - -/** - * Ensures the following features of subsystems are working: - *
    - *
  • Subsystem default properties - *
  • Global property overrides (via alfresco-global.properties) - *
  • Subsystem instance specific property overrides (via extension classpath) - *
  • Subsystem instance specific Spring overrides (via extension classpath) - *
  • Composite property defaults - *
  • Composite property instance overrides - *
- * - * @see ChildApplicationContextFactory - * @author dward - */ -@Category(OwnJVMTestsCategory.class) -public class SubsystemsTest extends BaseSpringTest -{ - volatile boolean shouldBlockPort; - - /* - * (non-Javadoc) - * @see org.alfresco.util.BaseSpringTest#getConfigLocations() - */ - @Override - protected String[] getConfigLocations() - { - return new String[] - { - ApplicationContextHelper.CONFIG_LOCATIONS[0], "classpath:subsystem-test-context.xml" - }; - } - - /** - * Test subsystems. - * - * @throws Exception - * the exception - */ - public void testSubsystems() throws Exception - { - ApplicationContextFactory subsystem = (ApplicationContextFactory) getApplicationContext().getBean( - "testsubsystem"); - ConfigurableApplicationContext childContext = (ConfigurableApplicationContext) subsystem - .getApplicationContext(); - assertTrue("Subsystem not started", childContext.isActive()); - TestService testService = (TestService) childContext.getBean("testService"); - // Make sure subsystem defaults work - assertEquals("Subsystem Default1", testService.getSimpleProp1()); - // Make sure global property overrides work - assertEquals(true, testService.getSimpleProp2().booleanValue()); - // Make sure extension classpath property overrides work - assertEquals("Instance Override3", testService.getSimpleProp3()); - // Make sure extension classpath Spring overrides work - assertEquals("An extra bean I changed", childContext.getBean("anotherBean")); - // Make sure composite properties and their defaults work - TestBean[] testBeans = testService.getTestBeans(); - assertNotNull("Composite property not set", testBeans); - assertEquals(3, testBeans.length); - assertEquals("inst1", testBeans[0].getId()); - assertEquals(false, testBeans[0].isBoolProperty()); - assertEquals(123456789123456789L, testBeans[0].getLongProperty()); - assertEquals("Global Default", testBeans[0].getAnotherStringProperty()); - assertEquals("inst2", testBeans[1].getId()); - assertEquals(true, testBeans[1].isBoolProperty()); - assertEquals(123456789123456789L, testBeans[1].getLongProperty()); - assertEquals("Global Default", testBeans[1].getAnotherStringProperty()); - assertEquals("inst3", testBeans[2].getId()); - assertEquals(false, testBeans[2].isBoolProperty()); - assertEquals(123456789123456789L, testBeans[2].getLongProperty()); - assertEquals("Global Instance Default", testBeans[2].getAnotherStringProperty()); - } - - public void testAbstractPropertyBackedBean_performEarlyPropertyChecks_PortEarlyPropertyChecker() - { - int testPortNumber = (Integer) getApplicationContext().getBean("testPortNumber"); - String testHost = (String) getApplicationContext().getBean("testHost"); - - ChildApplicationContextFactory testBean = (ChildApplicationContextFactory) getApplicationContext().getBean("testsubsystem"); - - Map testProperties = new HashMap(); - - // Check for empty port value error: - testProperties.put("test1.port", ""); - - // Check for "unable to parse" error: - testProperties.put("test2.port", "123xy"); - - // Check for "out-of-bounds" (less than) error: - testProperties.put("test3.port", "0"); - - // Check for "out of bounds" (greater than) error: - testProperties.put("test4.port", "65536"); - - // Check for "port in use" error: - testProperties.put("test5.port", "" + testPortNumber); - - String errorMessage = testBean.performEarlyPropertyChecks(testProperties); - - assertTrue(errorMessage.contains("The value for TestSubsystem port property cannot be empty.")); - assertTrue(errorMessage.contains("Unable to parse value for TestSubsystem port property: 123xy.")); - assertTrue(errorMessage.contains("The port chosen for TestSubsystem is outside the required range (1, 65535): 0.")); - assertTrue(errorMessage.contains("The port chosen for TestSubsystem is outside the required range (1, 65535): 65536.")); - - assertTrue(errorMessage.contains( - "The port chosen for TestSubsystem is already in use or you don't have permission to use it: " + testPortNumber + ".")); - - testProperties.clear(); - - testProperties.put("test_with_host.port", "" + testPortNumber); - // Check for unknown host: - testProperties.put("test.subsystem.host", testHost); - - errorMessage = testBean.performEarlyPropertyChecks(testProperties); - - assertTrue(errorMessage.contains( - "The hostname chosen for TestSubsystem is unknown or misspelled: " + testProperties.get("test.subsystem.host") + ".")); - - } - - public void testAbstractPropertyBackedBean_performEarlyPropertyChecks_CustomEarlyPropertyChecker() - { - ChildApplicationContextFactory testBean = new ChildApplicationContextFactory(); - - SubsystemEarlyPropertyChecker testEarlyPropertyChecker = new SubsystemEarlyPropertyChecker() - { - @Override - public void checkPropertyValue(String propertyName, String propertyValue, String pairedPropertyValue) throws InvalidPropertyValueException - { - if (propertyValue == null || propertyValue.isEmpty()) - { - throw new InvalidPropertyValueException("Property value cannot be empty."); - } - - if (pairedPropertyValue == null) - { - if (propertyValue.equals("Bad value")) - { - throw new InvalidPropertyValueException("Property value cannot be a 'Bad value'."); - } - } - else if ((propertyValue + pairedPropertyValue).contains("bad value")) - { - throw new InvalidPropertyValueException("No 'bad value's allowed!"); - } - } - - @Override - public String getPairedPropertyName() - { - return "testPairedPropertyName"; - } - }; - - Map earlyPropertyCheckersMap = new HashMap(); - earlyPropertyCheckersMap.put("test1.property", testEarlyPropertyChecker); - earlyPropertyCheckersMap.put("test2.property", testEarlyPropertyChecker); - - testBean.setEarlyPropertyCheckers(earlyPropertyCheckersMap); - - Map testProperties = new HashMap(); - - // Test empty value error: - testProperties.put("test1.property", ""); - - // Test "Bad value" error: - testProperties.put("test2.property", "Bad value"); - - String errorMessage = testBean.performEarlyPropertyChecks(testProperties); - - assertTrue(errorMessage.contains("Property value cannot be empty.")); - assertTrue(errorMessage.contains("Property value cannot be a 'Bad value'.")); - - earlyPropertyCheckersMap.clear(); - earlyPropertyCheckersMap.put("test3.property", testEarlyPropertyChecker); - - testProperties.clear(); - testProperties.put("testPairedPropertyName", "Test paired property bad value"); - testProperties.put("test3.property", "Test property value"); - - errorMessage = testBean.performEarlyPropertyChecks(testProperties); - assertTrue(errorMessage.contains("No 'bad value's allowed!")); - } -} diff --git a/src/test/java/org/alfresco/repo/management/subsystems/test/TestPortEarlyPropertyChecker.java b/src/test/java/org/alfresco/repo/management/subsystems/test/TestPortEarlyPropertyChecker.java deleted file mode 100644 index 66c0a47626..0000000000 --- a/src/test/java/org/alfresco/repo/management/subsystems/test/TestPortEarlyPropertyChecker.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * #%L - * Alfresco Remote API - * %% - * 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.management.subsystems.test; - -import java.io.IOException; -import org.alfresco.repo.management.subsystems.PortEarlyPropertyChecker; - -public class TestPortEarlyPropertyChecker extends PortEarlyPropertyChecker -{ - private int blockedPort = -1; - private String wrongHost = ""; - - public TestPortEarlyPropertyChecker(String subsystemName, boolean hasMultiplePorts, - boolean shouldCheckForBlockedPort) - { - super(subsystemName, hasMultiplePorts, shouldCheckForBlockedPort); - } - - public TestPortEarlyPropertyChecker(String subsystemName, String requiredPairedPropertyName, - boolean hasMultiplePorts, boolean shouldCheckForBlockedPort) - { - super(subsystemName, requiredPairedPropertyName, hasMultiplePorts, - shouldCheckForBlockedPort); - } - - public void setBlockedPort(int blockedPort) - { - this.blockedPort = blockedPort; - } - - public void setWrongHost(String wrongHost) - { - this.wrongHost = wrongHost; - } - - @Override - public void checkPort(int portNumber, String host) throws IOException - { - if (portNumber == blockedPort) - { - throw new java.net.BindException(); - } - - if (wrongHost.equals(host)) - { - throw new java.net.UnknownHostException(); - } - } -} diff --git a/src/test/java/org/alfresco/repo/web/scripts/RepositoryContainerTest.java b/src/test/java/org/alfresco/repo/web/scripts/RepositoryContainerTest.java index 05aaae759c..8c8b3f0013 100644 --- a/src/test/java/org/alfresco/repo/web/scripts/RepositoryContainerTest.java +++ b/src/test/java/org/alfresco/repo/web/scripts/RepositoryContainerTest.java @@ -1,28 +1,28 @@ -/* - * #%L - * Alfresco Remote API - * %% - * 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 Remote API + * %% + * 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.web.scripts; import java.sql.SQLException; @@ -42,11 +42,12 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.service.cmr.repository.ContentIOException; import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; -import org.alfresco.util.CronTriggerBean; import org.alfresco.util.PropertyMap; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; +import org.quartz.CronTrigger; +import org.quartz.Scheduler; import org.springframework.extensions.webscripts.Authenticator; import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.PutRequest; @@ -161,13 +162,12 @@ public class RepositoryContainerTest extends BaseWebScriptTest assertEquals(SUCCESS, response.getContentAsString()); // trigger the webscript temp folder cleaner job - CronTriggerBean webscriptsTempFileCleanerJobTrigger = (CronTriggerBean) getServer().getApplicationContext().getBean("webscripts.tempFileCleanerTrigger"); - - webscriptsTempFileCleanerJobTrigger.getScheduler().triggerJobWithVolatileTrigger( - webscriptsTempFileCleanerJobTrigger.getJobDetail().getName(), - webscriptsTempFileCleanerJobTrigger.getJobDetail().getGroup(), - webscriptsTempFileCleanerJobTrigger.getJobDetail().getJobDataMap()); - + CronTrigger webscriptsTempFileCleanerJobTrigger = (CronTrigger) getServer().getApplicationContext().getBean("webscripts.tempFileCleanerTrigger"); + + Scheduler scheduler = (Scheduler) getServer().getApplicationContext().getBean("schedulerFactory"); + + scheduler.triggerJob(webscriptsTempFileCleanerJobTrigger.getJobKey()); + // check that we still can upload file larger than 4 mb, i.e. ensure that cleaner has not deleted temp folder response = sendRequest(new PutRequest("/test/largecontenttest", content, "text/plain"), STATUS_OK); assertEquals(SUCCESS, response.getContentAsString()); diff --git a/src/test/java/org/alfresco/repo/webdav/PutMethodTest.java b/src/test/java/org/alfresco/repo/webdav/PutMethodTest.java index b72d16b620..090475756e 100644 --- a/src/test/java/org/alfresco/repo/webdav/PutMethodTest.java +++ b/src/test/java/org/alfresco/repo/webdav/PutMethodTest.java @@ -25,11 +25,15 @@ */ package org.alfresco.repo.webdav; +import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.model.ContentModel; +import org.alfresco.repo.action.executer.ContentMetadataExtracter; import org.alfresco.repo.model.Repository; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.repo.transaction.RetryingTransactionHelper; +import org.alfresco.rest.api.tests.client.data.Action; +import org.alfresco.service.cmr.action.ActionService; import org.alfresco.service.cmr.coci.CheckOutCheckInService; import org.alfresco.service.cmr.lock.LockService; import org.alfresco.service.cmr.lock.LockStatus; @@ -78,6 +82,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; /** * Unit tests for the {@link PutMethod} class. @@ -114,6 +120,7 @@ public class PutMethodTest private ContentService contentService; private CheckOutCheckInService checkOutCheckInService; private PermissionService permissionService; + private ActionService actionService; private Repository repositoryHelper; private NodeRef companyHomeNodeRef; @@ -148,6 +155,7 @@ public class PutMethodTest checkOutCheckInService = ctx.getBean("CheckOutCheckInService", CheckOutCheckInService.class); permissionService = ctx.getBean("PermissionService", PermissionService.class); namespaceService = ctx.getBean("namespaceService", NamespaceService.class); + actionService = ctx.getBean("ActionService", ActionService.class); AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName()); @@ -805,8 +813,14 @@ public class PutMethodTest String lockHeaderValue = "(<" + WebDAV.OPAQUE_LOCK_TOKEN + lockToken + ">)"; HashMap headers = new HashMap(); headers.put(WebDAV.HEADER_IF, lockHeaderValue); + // Simulate any failure during the content write + // null content is no longer null in MockHttpServletRequest (Spring 5) + ActionService mockActionService = mock(ActionService.class); + when(mockActionService.createAction(ContentMetadataExtracter.EXECUTOR_NAME)) + .thenThrow(new AlfrescoRuntimeException("Negative test")); try { + webDAVHelper.setActionService(mockActionService); // setting a null content executeMethod(WebDAV.METHOD_PUT, fileName, null, headers); @@ -824,6 +838,10 @@ public class PutMethodTest { throw new RuntimeException("Failed to upload a file", e); } + finally + { + webDAVHelper.setActionService(actionService); + } if (fileNoderef != null && nodeService.exists(fileNoderef)) { diff --git a/src/test/java/org/alfresco/rest/api/tests/RepoService.java b/src/test/java/org/alfresco/rest/api/tests/RepoService.java index 4539e077a5..b8490309bb 100644 --- a/src/test/java/org/alfresco/rest/api/tests/RepoService.java +++ b/src/test/java/org/alfresco/rest/api/tests/RepoService.java @@ -145,10 +145,11 @@ import org.apache.commons.logging.LogFactory; import org.json.JSONException; import org.json.simple.JSONObject; import org.json.simple.JSONValue; +import org.quartz.CronTrigger; +import org.quartz.JobDetail; import org.quartz.JobExecutionException; import org.quartz.Scheduler; import org.springframework.context.ApplicationContext; -import org.springframework.scheduling.quartz.JobDetailBean; import com.google.common.collect.AbstractIterator; @@ -185,11 +186,11 @@ public class RepoService protected TenantService tenantService; protected TenantAdminService tenantAdminService; protected ActivityPostDAO postDAO; - protected JobDetailBean feedGeneratorJobDetail; - protected JobDetailBean postLookupJobDetail; - protected JobDetailBean feedCleanerJobDetail; - protected JobDetailBean postCleanerJobDetail; - protected JobDetailBean feedNotifierJobDetail; + protected JobDetail feedGeneratorJobDetail; + protected JobDetail postLookupJobDetail; + protected JobDetail feedCleanerJobDetail; + protected JobDetail postCleanerJobDetail; + protected JobDetail feedNotifierJobDetail; protected ContentStoreCleaner contentStoreCleaner; protected FeedCleaner feedCleaner; protected PersonService personService; @@ -264,27 +265,27 @@ public class RepoService this.transactionHelper = (RetryingTransactionHelper)applicationContext.getBean("retryingTransactionHelper"); Scheduler scheduler = (Scheduler)applicationContext.getBean("schedulerFactory"); - - JobDetailBean contentStoreCleanerJobDetail = (JobDetailBean)applicationContext.getBean("contentStoreCleanerJobDetail"); - scheduler.pauseJob(contentStoreCleanerJobDetail.getName(), contentStoreCleanerJobDetail.getGroup()); + + CronTrigger contentStoreCleanerTrigger = (CronTrigger)applicationContext.getBean("contentStoreCleanerTrigger"); + scheduler.pauseJob(contentStoreCleanerTrigger.getJobKey()); ChildApplicationContextFactory activitiesFeed = (ChildApplicationContextFactory)applicationContext.getBean("ActivitiesFeed"); ApplicationContext activitiesFeedCtx = activitiesFeed.getApplicationContext(); this.postLookup = (PostLookup)activitiesFeedCtx.getBean("postLookup"); this.feedGenerator = (FeedGenerator)activitiesFeedCtx.getBean("feedGenerator"); - this.feedGeneratorJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("feedGeneratorJobDetail"); - this.postLookupJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("postLookupJobDetail"); - this.feedCleanerJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("feedCleanerJobDetail"); - this.postCleanerJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("postCleanerJobDetail"); - this.feedNotifierJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("feedNotifierJobDetail"); + this.feedGeneratorJobDetail = (JobDetail)activitiesFeedCtx.getBean("feedGeneratorJobDetail"); + this.postLookupJobDetail = (JobDetail)activitiesFeedCtx.getBean("postLookupJobDetail"); + this.feedCleanerJobDetail = (JobDetail)activitiesFeedCtx.getBean("feedCleanerJobDetail"); + this.postCleanerJobDetail = (JobDetail)activitiesFeedCtx.getBean("postCleanerJobDetail"); + this.feedNotifierJobDetail = (JobDetail)activitiesFeedCtx.getBean("feedNotifierJobDetail"); this.feedCleaner = (FeedCleaner)activitiesFeedCtx.getBean("feedCleaner"); // Pause activities jobs so that we aren't competing with their scheduled versions - scheduler.pauseJob(feedGeneratorJobDetail.getName(), feedGeneratorJobDetail.getGroup()); - scheduler.pauseJob(postLookupJobDetail.getName(), postLookupJobDetail.getGroup()); - scheduler.pauseJob(feedCleanerJobDetail.getName(), feedCleanerJobDetail.getGroup()); - scheduler.pauseJob(postCleanerJobDetail.getName(), postCleanerJobDetail.getGroup()); - scheduler.pauseJob(feedNotifierJobDetail.getName(), feedNotifierJobDetail.getGroup()); + scheduler.pauseJob(feedGeneratorJobDetail.getKey()); + scheduler.pauseJob(postLookupJobDetail.getKey()); + scheduler.pauseJob(feedCleanerJobDetail.getKey()); + scheduler.pauseJob(postCleanerJobDetail.getKey()); + scheduler.pauseJob(feedNotifierJobDetail.getKey()); this.systemNetwork = new TestNetwork(TenantService.DEFAULT_DOMAIN, true); } diff --git a/src/test/java/org/alfresco/rest/api/tests/TestPublicApiAtomPub10TCK.java b/src/test/java/org/alfresco/rest/api/tests/TestPublicApiAtomPub10TCK.java index dc27dd3e12..752a9a26bb 100644 --- a/src/test/java/org/alfresco/rest/api/tests/TestPublicApiAtomPub10TCK.java +++ b/src/test/java/org/alfresco/rest/api/tests/TestPublicApiAtomPub10TCK.java @@ -35,7 +35,6 @@ 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.domain.hibernate.dialect.AlfrescoOracle9Dialect; import org.alfresco.rest.api.tests.RepoService.TestNetwork; import org.alfresco.util.testing.category.LuceneTests; import org.alfresco.util.testing.category.RedundantTests; @@ -52,7 +51,6 @@ import org.apache.chemistry.opencmis.tck.tests.query.QuerySmokeTest; import org.apache.chemistry.opencmis.tck.tests.versioning.VersioningTestGroup; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.hibernate.dialect.Dialect; import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; @@ -72,9 +70,10 @@ public class TestPublicApiAtomPub10TCK extends AbstractEnterpriseOpenCMIS10TCKTe @Before public void before() throws Exception { - //see REPO-1524 - Dialect dialect = (Dialect) applicationContext.getBean("dialect"); - assumeFalse(dialect instanceof AlfrescoOracle9Dialect); + // see REPO-1524 + // the tests are always run on PostgreSQL only +// Dialect dialect = (Dialect) applicationContext.getBean("dialect"); +// assumeFalse(dialect instanceof Oracle9Dialect); int port = getTestFixture().getJettyComponent().getPort(); TestNetwork network = getTestFixture().getRandomNetwork(); diff --git a/src/test/java/org/alfresco/rest/api/tests/TestPublicApiAtomPub11TCK.java b/src/test/java/org/alfresco/rest/api/tests/TestPublicApiAtomPub11TCK.java index 4e22933a1e..f6b16b6366 100644 --- a/src/test/java/org/alfresco/rest/api/tests/TestPublicApiAtomPub11TCK.java +++ b/src/test/java/org/alfresco/rest/api/tests/TestPublicApiAtomPub11TCK.java @@ -1,44 +1,42 @@ -/* - * #%L - * Alfresco Remote API - * %% - * 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 Remote API + * %% + * 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.rest.api.tests; -import static org.junit.Assume.assumeFalse; - +import static org.junit.Assume.assumeFalse; + import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; -import org.alfresco.opencmis.OpenCMISClientContext; -import org.alfresco.repo.domain.hibernate.dialect.AlfrescoOracle9Dialect; +import org.alfresco.opencmis.OpenCMISClientContext; import org.alfresco.rest.api.tests.RepoService.TestNetwork; import org.apache.chemistry.opencmis.commons.enums.BindingType; import org.apache.chemistry.opencmis.tck.impl.TestParameters; import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hibernate.dialect.Dialect; +import org.apache.commons.logging.LogFactory; import org.junit.AfterClass; import org.junit.Before; @@ -55,10 +53,11 @@ public class TestPublicApiAtomPub11TCK extends AbstractEnterpriseOpenCMIS11TCKTe @Before public void before() throws Exception - { - //see REPO-1524 - Dialect dialect = (Dialect) applicationContext.getBean("dialect"); - assumeFalse(dialect instanceof AlfrescoOracle9Dialect); + { + // see REPO-1524 + // the tests are always run on PostgreSQL only +// Dialect dialect = (Dialect) applicationContext.getBean("dialect"); +// assumeFalse(dialect instanceof Oracle9Dialect); int port = getTestFixture().getJettyComponent().getPort(); TestNetwork network = getTestFixture().getRandomNetwork(); diff --git a/src/test/java/org/alfresco/rest/api/tests/TestPublicApiBrowser11TCK.java b/src/test/java/org/alfresco/rest/api/tests/TestPublicApiBrowser11TCK.java index b46906cf7c..1025aa7a9f 100644 --- a/src/test/java/org/alfresco/rest/api/tests/TestPublicApiBrowser11TCK.java +++ b/src/test/java/org/alfresco/rest/api/tests/TestPublicApiBrowser11TCK.java @@ -1,44 +1,42 @@ -/* - * #%L - * Alfresco Remote API - * %% - * 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 Remote API + * %% + * 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.rest.api.tests; -import static org.junit.Assume.assumeFalse; - +import static org.junit.Assume.assumeFalse; + import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; -import org.alfresco.opencmis.OpenCMISClientContext; -import org.alfresco.repo.domain.hibernate.dialect.AlfrescoOracle9Dialect; +import org.alfresco.opencmis.OpenCMISClientContext; import org.alfresco.rest.api.tests.RepoService.TestNetwork; import org.apache.chemistry.opencmis.commons.enums.BindingType; import org.apache.chemistry.opencmis.tck.impl.TestParameters; import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hibernate.dialect.Dialect; +import org.apache.commons.logging.LogFactory; import org.junit.Before; /** @@ -54,10 +52,11 @@ public class TestPublicApiBrowser11TCK extends AbstractEnterpriseOpenCMIS11TCKTe @Before public void before() throws Exception - { - //see REPO-1524 - Dialect dialect = (Dialect) applicationContext.getBean("dialect"); - assumeFalse(dialect instanceof AlfrescoOracle9Dialect); + { + // see REPO-1524 + // the tests are always run on PostgreSQL only +// Dialect dialect = (Dialect) applicationContext.getBean("dialect"); +// assumeFalse(dialect instanceof Oracle9Dialect); int port = getTestFixture().getJettyComponent().getPort(); TestNetwork network = getTestFixture().getRandomNetwork(); diff --git a/src/test/java/org/alfresco/rest/test/workflow/api/impl/ProcessesImplTest.java b/src/test/java/org/alfresco/rest/test/workflow/api/impl/ProcessesImplTest.java index 652e225b2a..1efabb3c2b 100644 --- a/src/test/java/org/alfresco/rest/test/workflow/api/impl/ProcessesImplTest.java +++ b/src/test/java/org/alfresco/rest/test/workflow/api/impl/ProcessesImplTest.java @@ -34,7 +34,6 @@ import java.util.Map; import javax.transaction.Status; import javax.transaction.UserTransaction; -import org.alfresco.repo.domain.hibernate.dialect.AlfrescoSQLServerDialect; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.workflow.WorkflowModel; import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo; @@ -55,7 +54,6 @@ import org.alfresco.service.cmr.workflow.WorkflowService; import org.alfresco.service.namespace.QName; import org.alfresco.util.ApplicationContextHelper; import org.alfresco.util.testing.category.LuceneTests; -import org.hibernate.dialect.Dialect; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -211,15 +209,16 @@ public class ProcessesImplTest extends TestCase implements RecognizedParamsExtra @Test public void testGetProcessesMatchesIgnoreCaseNoResults() - { - Dialect dialect = (Dialect) applicationContext.getBean("dialect"); - if (dialect instanceof AlfrescoSQLServerDialect) - { + { + // the tests are always run on PostgreSQL only +// Dialect dialect = (Dialect) applicationContext.getBean("dialect"); +// if (dialect instanceof AlfrescoSQLServerDialect) +// { // REPO-1104: we do not run this test on MS SQL server because it will fail // until the Activiti defect related to REPO-1104 will be fixed // this test could fail on other DBs where the LIKE operator behaves as case insensitive - return; - } +// return; +// } CollectionWithPagingInfo result = queryMatchesProcesses("test workflow api calls review and approve"); assertNotNull(result); diff --git a/src/test/resources/alfresco/declarative-spreadsheet-webscript-application-context.xml b/src/test/resources/alfresco/declarative-spreadsheet-webscript-application-context.xml index 6a29c07b85..7e1ab6651a 100644 --- a/src/test/resources/alfresco/declarative-spreadsheet-webscript-application-context.xml +++ b/src/test/resources/alfresco/declarative-spreadsheet-webscript-application-context.xml @@ -1,7 +1,9 @@ - + - diff --git a/src/test/resources/alfresco/quick-share-turned-off-test-context.xml b/src/test/resources/alfresco/quick-share-turned-off-test-context.xml index e3ffeaa0aa..d6afdc081a 100644 --- a/src/test/resources/alfresco/quick-share-turned-off-test-context.xml +++ b/src/test/resources/alfresco/quick-share-turned-off-test-context.xml @@ -1,6 +1,9 @@ - - + + diff --git a/src/test/resources/rest-api-test-context.xml b/src/test/resources/rest-api-test-context.xml index 5c8d47f8cc..9e9a284cf4 100644 --- a/src/test/resources/rest-api-test-context.xml +++ b/src/test/resources/rest-api-test-context.xml @@ -1,13 +1,9 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd"> + diff --git a/src/test/resources/test-rest-context.xml b/src/test/resources/test-rest-context.xml index 04a3d1fd57..00b8f1b499 100644 --- a/src/test/resources/test-rest-context.xml +++ b/src/test/resources/test-rest-context.xml @@ -1,9 +1,9 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">