james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1001747 - in /james/server/trunk: core-library/src/test/java/org/apache/james/services/ pop3server/src/test/java/org/apache/james/pop3server/ remotemanager/src/test/java/org/apache/james/remotemanager/ smtpserver/src/test/java/org/apache/j...
Date Mon, 27 Sep 2010 13:59:25 GMT
Author: eric
Date: Mon Sep 27 13:59:24 2010
New Revision: 1001747

URL: http://svn.apache.org/viewvc?rev=1001747&view=rev
Log:
Fake is Mock - Rework is still needed here to have all the services - to be discussed if we
need to invest in it.

Added:
    james/server/trunk/core-library/src/test/java/org/apache/james/services/MockJSR250Loader.java
      - copied, changed from r1001738, james/server/trunk/core-library/src/test/java/org/apache/james/services/FakeJSR250Loader.java
Removed:
    james/server/trunk/core-library/src/test/java/org/apache/james/services/FakeJSR250Loader.java
Modified:
    james/server/trunk/pop3server/src/test/java/org/apache/james/pop3server/AbstractAsyncPOP3ServerTest.java
    james/server/trunk/remotemanager/src/test/java/org/apache/james/remotemanager/AbstractRemoteManagerTest.java
    james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/AbstractSMTPServerTest.java

Copied: james/server/trunk/core-library/src/test/java/org/apache/james/services/MockJSR250Loader.java
(from r1001738, james/server/trunk/core-library/src/test/java/org/apache/james/services/FakeJSR250Loader.java)
URL: http://svn.apache.org/viewvc/james/server/trunk/core-library/src/test/java/org/apache/james/services/MockJSR250Loader.java?p2=james/server/trunk/core-library/src/test/java/org/apache/james/services/MockJSR250Loader.java&p1=james/server/trunk/core-library/src/test/java/org/apache/james/services/FakeJSR250Loader.java&r1=1001738&r2=1001747&rev=1001747&view=diff
==============================================================================
--- james/server/trunk/core-library/src/test/java/org/apache/james/services/FakeJSR250Loader.java
(original)
+++ james/server/trunk/core-library/src/test/java/org/apache/james/services/MockJSR250Loader.java
Mon Sep 27 13:59:24 2010
@@ -4,7 +4,7 @@
  * distributed with this work for additional information        *
  * regarding copyright ownership.  The ASF licenses this file   *
  * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
+ * "License.class.getName()); you may not use this file except in compliance   *
  * with the License.  You may obtain a copy of the License at   *
  *                                                              *
  *   http://www.apache.org/licenses/LICENSE-2.0                 *
@@ -24,46 +24,52 @@ import java.util.Map;
 
 import org.apache.james.services.AbstractJSR250InstanceFactory;
 
-public class FakeJSR250Loader extends AbstractJSR250InstanceFactory {
+public class MockJSR250Loader extends AbstractJSR250InstanceFactory {
 
     private final Map<String, Object> servicesByName;
+    
     private final Map<String, String> mappings = new HashMap<String, String>();
-    public FakeJSR250Loader() {
+
+    public MockJSR250Loader() {
+
         servicesByName = new HashMap<String, Object>();
-        servicesByName.put("org.apache.james.LoaderService", this);
-        
-        mappings.put("James", "org.apache.james.services.MailServer");
-        mappings.put("filesystem", "org.apache.james.services.FileSystem");
-        mappings.put("dnsservice", "org.apache.james.api.dnsservice.DNSService");
-        mappings.put("mailstore", "org.apache.avalon.cornerstone.services.store.Store");
-        mappings.put("users-store", "org.apache.james.api.user.UsersStore");
-        mappings.put("localusersrepository", "org.apache.james.api.user.UsersRepository");
-        mappings.put("spoolrepository", "org.apache.james.services.SpoolRepository");
-        mappings.put("domainlist", "org.apache.james.api.domainlist.DomainList");
-        mappings.put("sockets", "org.apache.avalon.cornerstone.services.sockets.SocketManager");
-        mappings.put("scheduler", "org.apache.avalon.cornerstone.services.scheduler.TimeScheduler");
-        mappings.put("database-connections", "org.apache.avalon.cornerstone.services.datasources.DataSourceSelector");
-        mappings.put("defaultvirtualusertable", "org.apache.james.api.vut.VirtualUserTable");
-        mappings.put("virtualusertablemanagement", "org.apache.james.api.vut.management.VirtualUserTableManagement");
-
-        mappings.put("spoolmanager", "org.apache.james.services.SpoolManager");
-        mappings.put("matcherpackages", "org.apache.james.transport.MatcherLoader");
-        mappings.put("mailetpackages", "org.apache.james.transport.MailetLoader");
-        mappings.put("virtualusertable-store", "org.apache.james.api.vut.VirtualUserTableStore");
-        mappings.put("imapserver", "org.org.apache.jsieve.mailet.Poster");
-        mappings.put("threadmanager", "org.apache.avalon.cornerstone.services.threads.ThreadManager");
-        mappings.put("spoolmanagement", "org.apache.james.management.SpoolManagementService");
-        mappings.put("bayesiananalyzermanagement", "org.apache.james.management.BayesianAnalyzerManagementService");
-        mappings.put("processormanagement", "org.apache.james.management.ProcessorManagementService");
-        mappings.put("virtualusertablemanagementservice", "org.apache.james.api.vut.management.VirtualUserTableManagementService");
-        mappings.put("domainlistmanagement", "org.apache.james.management.DomainListManagementService");
-        mappings.put("nntp-repository", "org.apache.james.nntpserver.repository.NNTPRepository");
+
+// TODO Do we still need that?
+//        servicesByName.put(org.apache.james.LoaderService, this);
+
+        mappings.put("James", org.apache.james.services.MailServer.class.getName());
+        mappings.put("filesystem", org.apache.james.services.FileSystem.class.getName());
+        mappings.put("dnsservice", org.apache.james.dnsservice.api.DNSService.class.getName());
+        mappings.put("users-store", org.apache.james.api.user.UsersStore.class.getName());
+        mappings.put("localusersrepository", org.apache.james.api.user.UsersRepository.class.getName());
+        mappings.put("defaultvirtualusertable", org.apache.james.api.vut.VirtualUserTable.class.getName());
+        mappings.put("virtualusertablemanagement", org.apache.james.api.vut.management.VirtualUserTableManagement.class.getName());
+
+// TODO Review the needed services
+/*
+        mappings.put("domainlist", org.apache.james.api.domainlist.DomainList.class.getName());
+        mappings.put("mailstore", org.apache.avalon.cornerstone.services.store.Store.class.getName());
+        mappings.put("spoolrepository", org.apache.james.services.SpoolRepository.class.getName());
+        mappings.put("sockets", org.apache.avalon.cornerstone.services.sockets.SocketManager.class.getName());
+        mappings.put("scheduler", org.apache.avalon.cornerstone.services.scheduler.TimeScheduler.class.getName());
+        mappings.put("database-connections", org.apache.avalon.cornerstone.services.datasources.DataSourceSelector.class.getName());
+        mappings.put("spoolmanager", org.apache.james.services.SpoolManager.class.getName());
+        mappings.put("matcherpackages", org.apache.james.transport.MatcherLoader.class.getName());
+        mappings.put("mailetpackages", org.apache.james.transport.MailetLoader.class.getName());
+        mappings.put("virtualusertable-store", org.apache.james.api.vut.VirtualUserTableStore.class.getName());
+        mappings.put("imapserver", org.org.apache.jsieve.mailet.Poster.class.getName());
+        mappings.put("threadmanager", org.apache.avalon.cornerstone.services.threads.ThreadManager.class.getName());
+        mappings.put("spoolmanagement", org.apache.james.management.SpoolManagementService.class.getName());
+        mappings.put("bayesiananalyzermanagement", org.apache.james.management.BayesianAnalyzerManagementService.class.getName());
+        mappings.put("processormanagement", org.apache.james.management.ProcessorManagementService.class.getName());
+        mappings.put("virtualusertablemanagementservice", org.apache.james.api.vut.management.VirtualUserTableManagementService.class.getName());
+        mappings.put("domainlistmanagement", org.apache.james.management.DomainListManagementService.class.getName());
+        mappings.put("nntp-repository", org.apache.james.nntpserver.repository.NNTPRepository.class.getName());
+*/
     }
-    
 
     public Object get(String name) { 
         Object service = servicesByName.get(mapName(name));
-        
         return service;
     }
     
@@ -75,14 +81,13 @@ public class FakeJSR250Loader extends Ab
         return newName;
     }
    
-
     public void put(String role, Object service) {
         servicesByName.put(role, service);
     }
 
-
 	@Override
 	public Object getObjectForName(String name) {
 		return get(name);
 	}
+
 }

Modified: james/server/trunk/pop3server/src/test/java/org/apache/james/pop3server/AbstractAsyncPOP3ServerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/test/java/org/apache/james/pop3server/AbstractAsyncPOP3ServerTest.java?rev=1001747&r1=1001746&r2=1001747&view=diff
==============================================================================
--- james/server/trunk/pop3server/src/test/java/org/apache/james/pop3server/AbstractAsyncPOP3ServerTest.java
(original)
+++ james/server/trunk/pop3server/src/test/java/org/apache/james/pop3server/AbstractAsyncPOP3ServerTest.java
Mon Sep 27 13:59:24 2010
@@ -36,7 +36,7 @@ import org.apache.commons.logging.impl.S
 import org.apache.commons.net.pop3.POP3Client;
 import org.apache.commons.net.pop3.POP3MessageInfo;
 import org.apache.commons.net.pop3.POP3Reply;
-import org.apache.james.services.FakeJSR250Loader;
+import org.apache.james.services.MockJSR250Loader;
 import org.apache.james.services.MockFileSystem;
 import org.apache.james.services.MockMailServer;
 import org.apache.james.api.user.UsersRepository;
@@ -63,7 +63,7 @@ public abstract class AbstractAsyncPOP3S
     private POP3TestConfiguration m_testConfiguration;
     private MockUsersRepository m_usersRepository = new MockUsersRepository();
     private POP3Client m_pop3Protocol = null;
-    private FakeJSR250Loader serviceManager;
+    private MockJSR250Loader serviceManager;
     protected DNSService dnsservice;
     protected MockFileSystem fSystem;
     protected ProtocolHandlerChainImpl chain;
@@ -96,7 +96,7 @@ public abstract class AbstractAsyncPOP3S
     
     
     protected void setUpServiceManager() throws Exception {
-        serviceManager = new FakeJSR250Loader();
+        serviceManager = new MockJSR250Loader();
 
         m_mailServer = new MockMailServer();
         serviceManager.put(MailServer.ROLE, m_mailServer);

Modified: james/server/trunk/remotemanager/src/test/java/org/apache/james/remotemanager/AbstractRemoteManagerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/remotemanager/src/test/java/org/apache/james/remotemanager/AbstractRemoteManagerTest.java?rev=1001747&r1=1001746&r2=1001747&view=diff
==============================================================================
--- james/server/trunk/remotemanager/src/test/java/org/apache/james/remotemanager/AbstractRemoteManagerTest.java
(original)
+++ james/server/trunk/remotemanager/src/test/java/org/apache/james/remotemanager/AbstractRemoteManagerTest.java
Mon Sep 27 13:59:24 2010
@@ -38,7 +38,7 @@ import org.apache.commons.logging.impl.S
 import org.apache.commons.net.telnet.TelnetClient;
 import org.apache.james.api.domainlist.ManageableDomainList;
 import org.apache.james.api.domainlist.SimpleDomainList;
-import org.apache.james.services.FakeJSR250Loader;
+import org.apache.james.services.MockJSR250Loader;
 import org.apache.james.services.MockFileSystem;
 import org.apache.james.services.MockMailServer;
 import org.apache.james.api.user.UsersRepository;
@@ -73,7 +73,7 @@ public abstract class AbstractRemoteMana
 	private TelnetClient m_telnetClient;
 	private MockUsersRepository m_mockUsersRepository;
 	protected MockMailServer mailServer;
-	private FakeJSR250Loader serviceManager;
+	private MockJSR250Loader serviceManager;
 	private MockUsersStore usersStore;
 	protected DNSService dnsservice;
 	protected MockFileSystem filesystem;
@@ -178,7 +178,7 @@ public abstract class AbstractRemoteMana
 	}
 
 	protected void setUpFakeLoader() throws Exception {
-		serviceManager = new FakeJSR250Loader();
+		serviceManager = new MockJSR250Loader();
 
 		m_mockUsersRepository = new MockUsersRepository();
 

Modified: james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/AbstractSMTPServerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/AbstractSMTPServerTest.java?rev=1001747&r1=1001746&r2=1001747&view=diff
==============================================================================
--- james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/AbstractSMTPServerTest.java
(original)
+++ james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/AbstractSMTPServerTest.java
Mon Sep 27 13:59:24 2010
@@ -41,7 +41,7 @@ import junit.framework.TestCase;
 import org.apache.commons.logging.impl.SimpleLog;
 import org.apache.commons.net.smtp.SMTPClient;
 import org.apache.commons.net.smtp.SMTPReply;
-import org.apache.james.services.FakeJSR250Loader;
+import org.apache.james.services.MockJSR250Loader;
 import org.apache.james.api.user.UsersRepository;
 import org.apache.james.api.vut.VirtualUserTableStore;
 import org.apache.james.dnsservice.api.DNSService;
@@ -145,7 +145,7 @@ public abstract class AbstractSMTPServer
     //private SMTPServer m_smtpServer;
     protected SMTPTestConfiguration m_testConfiguration;
     protected MockUsersRepository m_usersRepository = new MockUsersRepository();
-    protected FakeJSR250Loader m_serviceManager;
+    protected MockJSR250Loader m_serviceManager;
     protected AlterableDNSServer m_dnsServer;
     protected MockMailStore store;
     protected MockFileSystem fileSystem;
@@ -211,7 +211,7 @@ public abstract class AbstractSMTPServer
     }
 
     protected void setUpFakeLoader() throws Exception {
-        m_serviceManager = new FakeJSR250Loader();
+        m_serviceManager = new MockJSR250Loader();
         m_mailServer = new MockMailServer();
         m_serviceManager.put(MailServer.ROLE, m_mailServer);
         m_serviceManager.put(UsersRepository.ROLE, m_usersRepository);



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message