Changeset 28592

Show
Ignore:
Timestamp:
01/09/08 11:20:35 (11 months ago)
Author:
sfermigier
Message:

Cosmit / cleanup.

Files:

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  
    4242 
    4343    public static final String NS_XSD = "http://www.w3.org/2001/XMLSchema"; 
     44    private SchemaManagerImpl typeMgr; 
     45    private XSDLoader reader; 
    4446 
    4547    @Override 
     
    4749        super.setUp(); 
    4850        deployContrib("nuxeo-core-schema", "OSGI-INF/SchemaService.xml"); 
     51        typeMgr = getTypeManager(); 
     52        reader = new XSDLoader(typeMgr); 
    4953    } 
    5054 
     
    5963 
    6064    public void testXSDReader() throws Exception { 
    61         SchemaManager typeMgr = getTypeManager(); 
    62         XSDLoader reader = new XSDLoader((SchemaManagerImpl)typeMgr); 
    6365        URL url = getResource("schema/schema.xsd"); 
    6466 
     
    9496 
    9597    public void testFeature() throws Exception { 
    96         SchemaManager typeMgr = getTypeManager(); 
    9798        deployContrib("CoreTestExtensions.xml"); 
    9899        DocumentType docType = typeMgr.getDocumentType("myDoc"); 
     
    113114    @SuppressWarnings("unchecked") 
    114115    public void testSequence() throws Exception { 
    115         SchemaManagerImpl typeMgr = getTypeManager(); 
    116         XSDLoader reader = new XSDLoader(typeMgr); 
    117116        URL url = getResource("schema/testList.xsd"); 
    118117        assertNotNull(url); 
     
    134133    @SuppressWarnings("unchecked") 
    135134    public void testList() throws Exception { 
    136         SchemaManagerImpl typeMgr = getTypeManager(); 
    137         XSDLoader reader = new XSDLoader(typeMgr); 
    138135        URL url = getResource("schema/testList.xsd"); 
    139136        assertNotNull(url); 
     
    154151 
    155152    public void testComplexSchema() throws Exception { 
    156         SchemaManagerImpl typeMgr = getTypeManager(); 
    157         XSDLoader reader = new XSDLoader(typeMgr); 
    158153        URL url = getResource("schema/policy.xsd"); 
    159154        assertNotNull(url); 
  • org.nuxeo.ecm.core/trunk/nuxeo-core/src/main/java/org/nuxeo/ecm/core/NXCore.java

    r21744 r28592  
    3131import org.nuxeo.ecm.core.repository.RepositoryService; 
    3232import org.nuxeo.ecm.core.security.SecurityService; 
    33 import org.nuxeo.runtime.RuntimeService; 
    3433import org.nuxeo.runtime.api.Framework; 
    3534 
     
    4645    private NXCore() { 
    4746    } 
    48  
    49  
    50     // TODO: not used. Remove. 
    51     @Deprecated 
    52     public static RuntimeService getFramework() { 
    53         return Framework.getRuntime(); 
    54     } 
    55  
    5647 
    5748    /** 
  • org.nuxeo.ecm.core/trunk/nuxeo-core/src/test/java/org/nuxeo/ecm/core/event/TestNXRuntimeEventListener.java

    r28564 r28592  
    4242    } 
    4343 
    44     private static CoreEventListenerService getRepositoryListenerService() { 
    45         return NXCore.getCoreEventListenerService(); 
    46     } 
    47  
    4844    public void testNXListenerRegistration() { 
    49         CoreEventListenerService listenerService = getRepositoryListenerService(); 
     45        CoreEventListenerService listenerService = NXCore.getCoreEventListenerService(); 
    5046        EventListener nxListener = listenerService.getEventListenerByName( 
    5147                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  
    2121 
    2222import org.nuxeo.ecm.core.api.ClientException; 
    23 import org.nuxeo.ecm.core.schema.TypeService; 
    2423import org.nuxeo.ecm.platform.ec.placeful.PlacefulServiceImpl; 
    2524import org.nuxeo.ecm.platform.ec.placeful.ejb.interfaces.EJBPlacefulService; 
     
    4948    } 
    5049 
    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  
    5950    public static PlacefulService getPlacefulService() { 
    6051        return (PlacefulService) Framework.getRuntime().getComponent( 
     
    8273 
    8374    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            } 
    9181        } 
    9282        return userManager; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-facade/src/test/java/org/nuxeo/ecm/core/search/ejb/TestSearchService.java

    r28516 r28592  
    2222import org.nuxeo.ecm.core.search.NXSearch; 
    2323import org.nuxeo.ecm.core.search.api.client.SearchService; 
     24import org.nuxeo.runtime.api.Framework; 
    2425import org.nuxeo.runtime.test.NXRuntimeTestCase; 
    2526 
     
    4445 
    4546    public void testPlatformServiceRegistration() { 
    46         SearchService service = runtime.getService(SearchService.class); 
     47        SearchService service = Framework.getLocalService(SearchService.class); 
    4748        assertNotNull(service); 
    4849 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/directory/SuggestBoxBean.java

    r28492 r28592  
    8383                directory.close(); 
    8484            } 
    85             Boolean tooMuchEntries = false; 
    86             return tooMuchEntries; 
     85            return false; 
    8786        } 
    8887    } 
     
    106105    private static String jsonEscaping(String label) { 
    107106        return label.replace("\\", "\\\\\\\\").replace("\"", "\\\\\\\""); 
    108  
    109107    } 
    110108 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-webapp-core/src/main/java/org/nuxeo/ecm/webapp/querymodel/QueryModelActionsBean.java

    r25741 r28592  
    2020package org.nuxeo.ecm.webapp.querymodel; 
    2121 
    22 import static org.jboss.seam.ScopeType.CONVERSATION; 
    23  
    2422import java.io.Serializable; 
    2523import java.util.HashMap; 
    26  
     24import java.util.Map; 
    2725import javax.annotation.security.PermitAll; 
    2826import javax.ejb.Remove; 
     
    3230import org.apache.commons.logging.LogFactory; 
    3331import org.jboss.annotation.ejb.SerializedConcurrentAccess; 
     32import static org.jboss.seam.ScopeType.CONVERSATION; 
    3433import org.jboss.seam.annotations.Destroy; 
    3534import org.jboss.seam.annotations.In; 
     
    7473    transient ResultsProvidersCache resultsProvidersCache; 
    7574 
    76     protected HashMap<String, QueryModel> queryModels; 
     75    protected Map<String, QueryModel> queryModels; 
    7776 
    7877    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  
    2121 
    2222import org.nuxeo.ecm.core.schema.SchemaManager; 
     23import org.nuxeo.ecm.core.schema.TypeService; 
    2324import org.nuxeo.ecm.core.schema.types.Field; 
    2425import org.nuxeo.ecm.core.schema.types.Schema; 
     
    5051        String fieldName = fullName.substring(colonIndex + 1); 
    5152 
    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); 
    5455        SchemaManager typeManager = typeService.getTypeManager(); 
    5556        Schema schema = typeManager.getSchema(schemaName); 
     
    7475        } 
    7576 
    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); 
    7879        SchemaManager typeManager = typeService.getTypeManager(); 
    7980        Field field = typeManager.getField(prefixedName); 
    8081        String schema = field.getDeclaringType().getName(); 
    8182        String name = field.getName().getLocalName(); 
    82         return schema + ":" + name; 
     83        return schema + ':' + name; 
    8384    } 
    8485 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-client/src/test/java/org/nuxeo/ecm/platform/workflow/web/TestProcessDocumentAdapter.java

    r20600 r28592  
    4545    private CoreSession coreSession; 
    4646 
     47    @Override 
    4748    public Repository getRepository() throws Exception { 
    4849        if (repository == null) { 
     
    5657    } 
    5758 
     59    @Override 
    5860    public void releaseRepository() { 
    5961        if (repository != null) { 
     
    7173 
    7274        deploy("OSGI-INF/document-adapter-service-contrib.xml"); 
    73  
    7475    } 
    7576 
     
    8788    } 
    8889 
     90    @Override 
    8991    protected Session getSession() throws Exception { 
    9092        return getRepository().getSession(null); 
     
    9294 
    9395    public void testAdapter() throws Exception { 
    94  
    9596        openCoreSession(); 
    9697 
     
    111112        // Because the test env doesn't expose mandatory workflow EJB for now. 
    112113        assertEquals(0, pdoc.getProcessInfo().length); 
     114    } 
    113115 
    114     } 
    115116} 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-client/src/test/java/org/nuxeo/ecm/platform/workflow/web/TestRegisterWorkflowAction.java

    r19070 r28592  
    3232    ActionService as; 
    3333 
     34    @Override 
    3435    public void setUp() throws Exception { 
    3536        super.setUp(); 
     
    4041    } 
    4142 
     43    @Override 
    4244    public void tearDown() throws Exception { 
    4345        super.tearDown(); 
     
    4547 
    4648    public void testWorkflowsActionsRegistration() { 
    47  
    4849        Action act1 = as.getActionRegistry().getAction("TAB_CONTENT_WORKFLOWS"); 
    4950        assertEquals("action.view.workflow", act1.getLabel()); 
     
    5152        assertEquals("/incl/tabs/document_workflows.xhtml", act1.getLink()); 
    5253        assertTrue(act1.isEnabled()); 
    53  
    5454    } 
    5555 
    5656    public void testTasksActionsRegistration() { 
    57  
    5857        Action act1 = as.getActionRegistry().getAction( 
    5958                "TAB_CONTENT_WORKFLOW_TASKS"); 
     
    6362                .getLink()); 
    6463        assertTrue(act1.isEnabled()); 
    65  
    6664    } 
    6765 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-workflow-test/src/main/java/org/nuxeo/ecm/platform/workflow/testing/WorkflowRepositoryTestCase.java

    r27098 r28592  
    5050    protected EntityManager em; 
    5151 
    52     private MockWAPIService getMockWapiService() { 
     52    private static MockWAPIService getMockWapiService() { 
    5353        return (MockWAPIService) Framework.getRuntime().getComponent( 
    5454                MockWAPIService.COMPONENT_NAME); 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform/src/main/java/org/nuxeo/ecm/platform/ejb/ECServerBean.java

    r22470 r28592  
    6363 
    6464    protected LocationManagerService getLocationManagerService() { 
    65         return (LocationManagerService) Framework 
    66                 .getRuntime().getComponent(LocationManagerService.NAME); 
     65        return (LocationManagerService) Framework.getRuntime().getComponent( 
     66                LocationManagerService.NAME); 
    6767    } 
    6868 
  • org.nuxeo.runtime/trunk/nuxeo-runtime/src/main/java/org/nuxeo/runtime/model/impl/ComponentInstanceImpl.java

    r28513 r28592  
    5353            instance = this; 
    5454        } else { 
    55             // TODO: load class only once when creating the reshgitration info 
     55            // TODO: load class only once when creating the registration info 
    5656            instance = this.ri.context.loadClass(this.ri.implementation) 
    5757                    .newInstance();