Changeset 28592
- Timestamp:
- 01/09/08 11:20:35 (11 months ago)
- Files:
-
- org.nuxeo.ecm.core/trunk/nuxeo-core-schema/src/test/java/org/nuxeo/ecm/core/schema/TestSchemaLoader.java (modified) (7 diffs)
- org.nuxeo.ecm.core/trunk/nuxeo-core/src/main/java/org/nuxeo/ecm/core/NXCore.java (modified) (2 diffs)
- org.nuxeo.ecm.core/trunk/nuxeo-core/src/test/java/org/nuxeo/ecm/core/event/TestNXRuntimeEventListener.java (modified) (1 diff)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-notification-core/src/main/java/org/nuxeo/ecm/platform/ec/notification/service/NotificationServiceHelper.java (modified) (3 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-facade/src/test/java/org/nuxeo/ecm/core/search/ejb/TestSearchService.java (modified) (2 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/directory/SuggestBoxBean.java (modified) (2 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/querymodel/QueryModelActionsBean.java (modified) (3 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/search/FieldHelper.java (modified) (3 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-client/src/test/java/org/nuxeo/ecm/platform/workflow/web/TestProcessDocumentAdapter.java (modified) (6 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-client/src/test/java/org/nuxeo/ecm/platform/workflow/web/TestRegisterWorkflowAction.java (modified) (5 diffs)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-test/src/main/java/org/nuxeo/ecm/platform/workflow/testing/WorkflowRepositoryTestCase.java (modified) (1 diff)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform/src/main/java/org/nuxeo/ecm/platform/ejb/ECServerBean.java (modified) (1 diff)
- org.nuxeo.runtime/trunk/nuxeo-runtime/src/main/java/org/nuxeo/runtime/model/impl/ComponentInstanceImpl.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.ecm.core/trunk/nuxeo-core-schema/src/test/java/org/nuxeo/ecm/core/schema/TestSchemaLoader.java
r26932 r28592 42 42 43 43 public static final String NS_XSD = "http://www.w3.org/2001/XMLSchema"; 44 private SchemaManagerImpl typeMgr; 45 private XSDLoader reader; 44 46 45 47 @Override … … 47 49 super.setUp(); 48 50 deployContrib("nuxeo-core-schema", "OSGI-INF/SchemaService.xml"); 51 typeMgr = getTypeManager(); 52 reader = new XSDLoader(typeMgr); 49 53 } 50 54 … … 59 63 60 64 public void testXSDReader() throws Exception { 61 SchemaManager typeMgr = getTypeManager();62 XSDLoader reader = new XSDLoader((SchemaManagerImpl)typeMgr);63 65 URL url = getResource("schema/schema.xsd"); 64 66 … … 94 96 95 97 public void testFeature() throws Exception { 96 SchemaManager typeMgr = getTypeManager();97 98 deployContrib("CoreTestExtensions.xml"); 98 99 DocumentType docType = typeMgr.getDocumentType("myDoc"); … … 113 114 @SuppressWarnings("unchecked") 114 115 public void testSequence() throws Exception { 115 SchemaManagerImpl typeMgr = getTypeManager();116 XSDLoader reader = new XSDLoader(typeMgr);117 116 URL url = getResource("schema/testList.xsd"); 118 117 assertNotNull(url); … … 134 133 @SuppressWarnings("unchecked") 135 134 public void testList() throws Exception { 136 SchemaManagerImpl typeMgr = getTypeManager();137 XSDLoader reader = new XSDLoader(typeMgr);138 135 URL url = getResource("schema/testList.xsd"); 139 136 assertNotNull(url); … … 154 151 155 152 public void testComplexSchema() throws Exception { 156 SchemaManagerImpl typeMgr = getTypeManager();157 XSDLoader reader = new XSDLoader(typeMgr);158 153 URL url = getResource("schema/policy.xsd"); 159 154 assertNotNull(url); org.nuxeo.ecm.core/trunk/nuxeo-core/src/main/java/org/nuxeo/ecm/core/NXCore.java
r21744 r28592 31 31 import org.nuxeo.ecm.core.repository.RepositoryService; 32 32 import org.nuxeo.ecm.core.security.SecurityService; 33 import org.nuxeo.runtime.RuntimeService;34 33 import org.nuxeo.runtime.api.Framework; 35 34 … … 46 45 private NXCore() { 47 46 } 48 49 50 // TODO: not used. Remove.51 @Deprecated52 public static RuntimeService getFramework() {53 return Framework.getRuntime();54 }55 56 47 57 48 /** org.nuxeo.ecm.core/trunk/nuxeo-core/src/test/java/org/nuxeo/ecm/core/event/TestNXRuntimeEventListener.java
r28564 r28592 42 42 } 43 43 44 private static CoreEventListenerService getRepositoryListenerService() {45 return NXCore.getCoreEventListenerService();46 }47 48 44 public void testNXListenerRegistration() { 49 CoreEventListenerService listenerService = getRepositoryListenerService();45 CoreEventListenerService listenerService = NXCore.getCoreEventListenerService(); 50 46 EventListener nxListener = listenerService.getEventListenerByName( 51 47 LISTENER_NAME); org.nuxeo.ecm.platform/trunk/nuxeo-platform-notification-core/src/main/java/org/nuxeo/ecm/platform/ec/notification/service/NotificationServiceHelper.java
r28511 r28592 21 21 22 22 import org.nuxeo.ecm.core.api.ClientException; 23 import org.nuxeo.ecm.core.schema.TypeService;24 23 import org.nuxeo.ecm.platform.ec.placeful.PlacefulServiceImpl; 25 24 import org.nuxeo.ecm.platform.ec.placeful.ejb.interfaces.EJBPlacefulService; … … 49 48 } 50 49 51 /**52 * Locates the types service using NXRuntime.53 */54 public static TypeService getTypeService() {55 return (TypeService) Framework.getRuntime().getComponent(56 TypeService.NAME);57 }58 59 50 public static PlacefulService getPlacefulService() { 60 51 return (PlacefulService) Framework.getRuntime().getComponent( … … 82 73 83 74 public static UserManager getUsersService() throws ClientException { 84 if (userManager==null) 85 { 86 try { 87 userManager = Framework.getService(UserManager.class); 88 } catch (Exception e) { 89 throw new ClientException(e); 90 } 75 if (userManager == null) { 76 try { 77 userManager = Framework.getService(UserManager.class); 78 } catch (Exception e) { 79 throw new ClientException(e); 80 } 91 81 } 92 82 return userManager; org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-facade/src/test/java/org/nuxeo/ecm/core/search/ejb/TestSearchService.java
r28516 r28592 22 22 import org.nuxeo.ecm.core.search.NXSearch; 23 23 import org.nuxeo.ecm.core.search.api.client.SearchService; 24 import org.nuxeo.runtime.api.Framework; 24 25 import org.nuxeo.runtime.test.NXRuntimeTestCase; 25 26 … … 44 45 45 46 public void testPlatformServiceRegistration() { 46 SearchService service = runtime.getService(SearchService.class);47 SearchService service = Framework.getLocalService(SearchService.class); 47 48 assertNotNull(service); 48 49 org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/directory/SuggestBoxBean.java
r28492 r28592 83 83 directory.close(); 84 84 } 85 Boolean tooMuchEntries = false; 86 return tooMuchEntries; 85 return false; 87 86 } 88 87 } … … 106 105 private static String jsonEscaping(String label) { 107 106 return label.replace("\\", "\\\\\\\\").replace("\"", "\\\\\\\""); 108 109 107 } 110 108 org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/querymodel/QueryModelActionsBean.java
r25741 r28592 20 20 package org.nuxeo.ecm.webapp.querymodel; 21 21 22 import static org.jboss.seam.ScopeType.CONVERSATION;23 24 22 import java.io.Serializable; 25 23 import java.util.HashMap; 26 24 import java.util.Map; 27 25 import javax.annotation.security.PermitAll; 28 26 import javax.ejb.Remove; … … 32 30 import org.apache.commons.logging.LogFactory; 33 31 import org.jboss.annotation.ejb.SerializedConcurrentAccess; 32 import static org.jboss.seam.ScopeType.CONVERSATION; 34 33 import org.jboss.seam.annotations.Destroy; 35 34 import org.jboss.seam.annotations.In; … … 74 73 transient ResultsProvidersCache resultsProvidersCache; 75 74 76 protected HashMap<String, QueryModel> queryModels;75 protected Map<String, QueryModel> queryModels; 77 76 78 77 protected transient QueryModelService queryModelService; org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/search/FieldHelper.java
r22181 r28592 21 21 22 22 import org.nuxeo.ecm.core.schema.SchemaManager; 23 import org.nuxeo.ecm.core.schema.TypeService; 23 24 import org.nuxeo.ecm.core.schema.types.Field; 24 25 import org.nuxeo.ecm.core.schema.types.Schema; … … 50 51 String fieldName = fullName.substring(colonIndex + 1); 51 52 52 org.nuxeo.ecm.core.schema.TypeService typeService = (org.nuxeo.ecm.core.schema.TypeService) Framework.getRuntime().getComponent(53 org.nuxeo.ecm.core.schema.TypeService.NAME);53 TypeService typeService = (TypeService) Framework.getRuntime().getComponent( 54 TypeService.NAME); 54 55 SchemaManager typeManager = typeService.getTypeManager(); 55 56 Schema schema = typeManager.getSchema(schemaName); … … 74 75 } 75 76 76 org.nuxeo.ecm.core.schema.TypeService typeService = (org.nuxeo.ecm.core.schema.TypeService) Framework.getRuntime().getComponent(77 org.nuxeo.ecm.core.schema.TypeService.NAME);77 TypeService typeService = (TypeService) Framework.getRuntime().getComponent( 78 TypeService.NAME); 78 79 SchemaManager typeManager = typeService.getTypeManager(); 79 80 Field field = typeManager.getField(prefixedName); 80 81 String schema = field.getDeclaringType().getName(); 81 82 String name = field.getName().getLocalName(); 82 return schema + ":"+ name;83 return schema + ':' + name; 83 84 } 84 85 org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-client/src/test/java/org/nuxeo/ecm/platform/workflow/web/TestProcessDocumentAdapter.java
r20600 r28592 45 45 private CoreSession coreSession; 46 46 47 @Override 47 48 public Repository getRepository() throws Exception { 48 49 if (repository == null) { … … 56 57 } 57 58 59 @Override 58 60 public void releaseRepository() { 59 61 if (repository != null) { … … 71 73 72 74 deploy("OSGI-INF/document-adapter-service-contrib.xml"); 73 74 75 } 75 76 … … 87 88 } 88 89 90 @Override 89 91 protected Session getSession() throws Exception { 90 92 return getRepository().getSession(null); … … 92 94 93 95 public void testAdapter() throws Exception { 94 95 96 openCoreSession(); 96 97 … … 111 112 // Because the test env doesn't expose mandatory workflow EJB for now. 112 113 assertEquals(0, pdoc.getProcessInfo().length); 114 } 113 115 114 }115 116 } org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-client/src/test/java/org/nuxeo/ecm/platform/workflow/web/TestRegisterWorkflowAction.java
r19070 r28592 32 32 ActionService as; 33 33 34 @Override 34 35 public void setUp() throws Exception { 35 36 super.setUp(); … … 40 41 } 41 42 43 @Override 42 44 public void tearDown() throws Exception { 43 45 super.tearDown(); … … 45 47 46 48 public void testWorkflowsActionsRegistration() { 47 48 49 Action act1 = as.getActionRegistry().getAction("TAB_CONTENT_WORKFLOWS"); 49 50 assertEquals("action.view.workflow", act1.getLabel()); … … 51 52 assertEquals("/incl/tabs/document_workflows.xhtml", act1.getLink()); 52 53 assertTrue(act1.isEnabled()); 53 54 54 } 55 55 56 56 public void testTasksActionsRegistration() { 57 58 57 Action act1 = as.getActionRegistry().getAction( 59 58 "TAB_CONTENT_WORKFLOW_TASKS"); … … 63 62 .getLink()); 64 63 assertTrue(act1.isEnabled()); 65 66 64 } 67 65 org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-test/src/main/java/org/nuxeo/ecm/platform/workflow/testing/WorkflowRepositoryTestCase.java
r27098 r28592 50 50 protected EntityManager em; 51 51 52 private MockWAPIService getMockWapiService() {52 private static MockWAPIService getMockWapiService() { 53 53 return (MockWAPIService) Framework.getRuntime().getComponent( 54 54 MockWAPIService.COMPONENT_NAME); org.nuxeo.ecm.platform/trunk/nuxeo-platform/src/main/java/org/nuxeo/ecm/platform/ejb/ECServerBean.java
r22470 r28592 63 63 64 64 protected LocationManagerService getLocationManagerService() { 65 return (LocationManagerService) Framework 66 .getRuntime().getComponent(LocationManagerService.NAME);65 return (LocationManagerService) Framework.getRuntime().getComponent( 66 LocationManagerService.NAME); 67 67 } 68 68 org.nuxeo.runtime/trunk/nuxeo-runtime/src/main/java/org/nuxeo/runtime/model/impl/ComponentInstanceImpl.java
r28513 r28592 53 53 instance = this; 54 54 } else { 55 // TODO: load class only once when creating the re shgitration info55 // TODO: load class only once when creating the registration info 56 56 instance = this.ri.context.loadClass(this.ri.implementation) 57 57 .newInstance();
