diff --git a/source/java/org/alfresco/service/ServiceRegistry.java b/source/java/org/alfresco/service/ServiceRegistry.java index ae5e43e64d..ff3aa7c27f 100644 --- a/source/java/org/alfresco/service/ServiceRegistry.java +++ b/source/java/org/alfresco/service/ServiceRegistry.java @@ -143,8 +143,8 @@ public interface ServiceRegistry // CMIS static final QName CMIS_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "CMISService"); - static final QName CMIS_DICTIONARY_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "CMISDictionaryService"); - static final QName CMIS_QUERY_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "CMISQueryService"); + static final QName CMIS_DICTIONARY_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "OpenCMISDictionaryService"); + static final QName CMIS_QUERY_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "OpenCMISQueryService"); static final QName IMAP_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "ImapService"); static final QName PUBLIC_SERVICE_ACCESS_SERVICE = QName.createQName(NamespaceService.ALFRESCO_URI, "PublicServiceAccessService"); diff --git a/source/test-java/org/alfresco/Repository01TestSuite.java b/source/test-java/org/alfresco/Repository01TestSuite.java index 08d0f18621..8936c680b9 100644 --- a/source/test-java/org/alfresco/Repository01TestSuite.java +++ b/source/test-java/org/alfresco/Repository01TestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2014 Alfresco Software Limited. + * Copyright (C) 2005-2015 Alfresco Software Limited. * * This file is part of Alfresco * @@ -412,6 +412,7 @@ public class Repository01TestSuite extends TestSuite suite.addTest(new JUnit4TestAdapter(org.alfresco.repo.attributes.PropTablesCleanupJobIntegrationTest.class)); suite.addTestSuite(org.alfresco.repo.dictionary.DictionaryModelTypeTest.class); suite.addTestSuite(org.alfresco.repo.tagging.UpdateTagScopesActionExecuterTest.class); + suite.addTest(new JUnit4TestAdapter(org.alfresco.service.ServiceRegistryTest.class)); } static void tests66(TestSuite suite) diff --git a/source/test-java/org/alfresco/service/ServiceRegistryTest.java b/source/test-java/org/alfresco/service/ServiceRegistryTest.java new file mode 100644 index 0000000000..86f8f1ce56 --- /dev/null +++ b/source/test-java/org/alfresco/service/ServiceRegistryTest.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2005-2015 Alfresco Software Limited. + * + * This file is part of Alfresco + * + * 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 . + */ +package org.alfresco.service; + +import static org.junit.Assert.fail; + +import java.lang.reflect.Method; + +import org.alfresco.util.ApplicationContextHelper; +import org.junit.Before; +import org.junit.Test; +import org.springframework.context.ApplicationContext; + +public class ServiceRegistryTest +{ + protected static ApplicationContext ctx = ApplicationContextHelper.getApplicationContext(); + + protected ServiceRegistry serviceRegistry; + + @Before + public void before() throws Exception + { + serviceRegistry = (ServiceRegistry) ctx.getBean("ServiceRegistry"); + } + + @Test + public void testServiceRegistryGetters() throws Exception + { + Method[] methods = serviceRegistry.getClass().getMethods(); + for (Method method : methods) + { + if (method.getName().startsWith("get") && (method.getParameterTypes().length == 0)) + { + try + { + method.invoke(serviceRegistry, null); + } + catch (java.lang.reflect.InvocationTargetException i) + { + if (i.getTargetException() instanceof UnsupportedOperationException) + { + continue; + } + fail("Failed to invoke " + method.getName() + " : " + i.getTargetException().getMessage()); + } + catch (Exception e) + { + fail("Failed to invoke " + method.getName() + " : " + e.getMessage()); + } + + } + } + } +}