james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject svn commit: r1726770 [3/3] - in /james/project/trunk: mailbox/api/src/main/java/org/apache/james/mailbox/model/ mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/ mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/ mailbox/hbase/s...
Date Tue, 26 Jan 2016 10:48:35 GMT
Modified: james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/RemoteAddrInNetworkTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/RemoteAddrInNetworkTest.java?rev=1726770&r1=1726769&r2=1726770&view=diff
==============================================================================
--- james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/RemoteAddrInNetworkTest.java
(original)
+++ james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/RemoteAddrInNetworkTest.java
Tue Jan 26 10:48:32 2016
@@ -63,7 +63,6 @@ public class RemoteAddrInNetworkTest ext
 
     @Override
     protected String getAllowedNetworks() {
-        String ALLOWED_NETWORK = "192.168.200.0/24";
-        return ALLOWED_NETWORK;
+        return "192.168.200.0/24";
     }
 }

Modified: james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/RemoteAddrNotInNetworkTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/RemoteAddrNotInNetworkTest.java?rev=1726770&r1=1726769&r2=1726770&view=diff
==============================================================================
--- james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/RemoteAddrNotInNetworkTest.java
(original)
+++ james/project/trunk/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/RemoteAddrNotInNetworkTest.java
Tue Jan 26 10:48:32 2016
@@ -63,7 +63,6 @@ public class RemoteAddrNotInNetworkTest
 
     @Override
     protected String getAllowedNetworks() {
-        String ALLOWED_NETWORK = "192.168.200.0/24";
-        return ALLOWED_NETWORK;
+        return "192.168.200.0/24";
     }
 }

Modified: james/project/trunk/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java?rev=1726770&r1=1726769&r2=1726770&view=diff
==============================================================================
--- james/project/trunk/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java
(original)
+++ james/project/trunk/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyImapSession.java
Tue Jan 26 10:48:32 2016
@@ -129,8 +129,7 @@ public class NettyImapSession implements
      * org.apache.james.imap.api.process.ImapSession#getAttribute(java.lang.String)
      */
     public Object getAttribute(String key) {
-        final Object result = attributesByKey.get(key);
-        return result;
+        return attributesByKey.get(key);
     }
 
     /**

Modified: james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SpamAssassinHandlerTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SpamAssassinHandlerTest.java?rev=1726770&r1=1726769&r2=1726770&view=diff
==============================================================================
--- james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SpamAssassinHandlerTest.java
(original)
+++ james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SpamAssassinHandlerTest.java
Tue Jan 26 10:48:32 2016
@@ -43,7 +43,8 @@ public class SpamAssassinHandlerTest {
 
     private SMTPSession setupMockedSMTPSession(final Mail mail) {
         mockedMail = mail;
-        SMTPSession mockedSMTPSession = new BaseFakeSMTPSession() {
+
+        return new BaseFakeSMTPSession() {
 
             private final HashMap<String, Object> sstate = new HashMap<String, Object>();
             private final HashMap<String, Object> connectionState = new HashMap<String,
Object>();
@@ -85,8 +86,6 @@ public class SpamAssassinHandlerTest {
             }
         };
 
-        return mockedSMTPSession;
-
     }
 
     private Mail setupMockedMail(MimeMessage message) {

Modified: james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/URIRBLHandlerTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/URIRBLHandlerTest.java?rev=1726770&r1=1726769&r2=1726770&view=diff
==============================================================================
--- james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/URIRBLHandlerTest.java
(original)
+++ james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/URIRBLHandlerTest.java
Tue Jan 26 10:48:32 2016
@@ -54,7 +54,8 @@ public class URIRBLHandlerTest {
 
     private SMTPSession setupMockedSMTPSession(final Mail mail) {
         mockedMail = mail;
-        SMTPSession mockedSMTPSession = new BaseFakeSMTPSession() {
+
+        return new BaseFakeSMTPSession() {
 
             private boolean relayingAllowed;
 
@@ -98,8 +99,6 @@ public class URIRBLHandlerTest {
             }
         };
 
-        return mockedSMTPSession;
-
     }
 
     private Mail setupMockedMail(MimeMessage message) {
@@ -138,7 +137,8 @@ public class URIRBLHandlerTest {
      * 
      */
     private DNSService setupMockedDnsServer() {
-        DNSService mockedDnsServer = new MockDNSService() {
+
+        return new MockDNSService() {
 
             @Override
             public Collection<String> findTXTRecords(String hostname) {
@@ -165,8 +165,6 @@ public class URIRBLHandlerTest {
                 throw new UnsupportedOperationException("getByName(" + host + ") not implemented
by this mock");
             }
         };
-
-        return mockedDnsServer;
     }
 
     @Test

Modified: james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java?rev=1726770&r1=1726769&r2=1726770&view=diff
==============================================================================
--- james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java
(original)
+++ james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java
Tue Jan 26 10:48:32 2016
@@ -73,7 +73,8 @@ public class ValidRcptHandlerTest {
 
     private SMTPSession setupMockedSMTPSession(final SMTPConfiguration conf, final MailAddress
rcpt,
                                                final boolean relayingAllowed) {
-        SMTPSession session = new BaseFakeSMTPSession() {
+
+        return new BaseFakeSMTPSession() {
 
             @Override
             public boolean isRelayingAllowed() {
@@ -106,12 +107,10 @@ public class ValidRcptHandlerTest {
                 }
             }
         };
-
-        return session;
     }
 
     private RecipientRewriteTable setUpRecipientRewriteTable() {
-        final RecipientRewriteTable table = new RecipientRewriteTable() {
+        return new RecipientRewriteTable() {
 
             @Override
             public Mappings getMappings(String user, String domain) throws ErrorMappingException,
@@ -200,11 +199,11 @@ public class ValidRcptHandlerTest {
 
             }
         };
-        return table;
     }
 
     private SMTPConfiguration setupMockedSMTPConfiguration() {
-        SMTPConfiguration conf = new SMTPConfiguration() {
+
+        return new SMTPConfiguration() {
 
             @Override
             public String getHelloName() {
@@ -248,8 +247,6 @@ public class ValidRcptHandlerTest {
                 return null;
             }
         };
-
-        return conf;
     }
 
     @Test

Modified: james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptMXTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptMXTest.java?rev=1726770&r1=1726769&r2=1726770&view=diff
==============================================================================
--- james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptMXTest.java
(original)
+++ james/project/trunk/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptMXTest.java
Tue Jan 26 10:48:32 2016
@@ -42,7 +42,7 @@ public class ValidRcptMXTest {
     private final static String LOOPBACK = "127.0.0.1";
 
     private SMTPSession setupMockedSMTPSession(final MailAddress rcpt) {
-        SMTPSession session = new BaseFakeSMTPSession() {
+        return new BaseFakeSMTPSession() {
 
             private final HashMap<String, Object> sstate = new HashMap<String, Object>();
             private final HashMap<String, Object> connectionState = new HashMap<String,
Object>();
@@ -71,11 +71,11 @@ public class ValidRcptMXTest {
                 }
             }
         };
-        return session;
     }
 
     private DNSService setupMockedDNSServer() {
-        DNSService dns = new MockDNSService() {
+
+        return new MockDNSService() {
 
             @Override
             public Collection<String> findMXRecords(String hostname) {
@@ -97,8 +97,6 @@ public class ValidRcptMXTest {
                 throw new UnknownHostException("Unknown host");
             }
         };
-
-        return dns;
     }
 
     @Test

Modified: james/project/trunk/server/queue/queue-api/src/test/java/org/apache/james/queue/api/mock/MockMailQueue.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/queue/queue-api/src/test/java/org/apache/james/queue/api/mock/MockMailQueue.java?rev=1726770&r1=1726769&r2=1726770&view=diff
==============================================================================
--- james/project/trunk/server/queue/queue-api/src/test/java/org/apache/james/queue/api/mock/MockMailQueue.java
(original)
+++ james/project/trunk/server/queue/queue-api/src/test/java/org/apache/james/queue/api/mock/MockMailQueue.java
Tue Jan 26 10:48:32 2016
@@ -85,9 +85,8 @@ public class MockMailQueue implements Ma
             ((MailImpl) mail).writeMessageTo(baos);
             log.trace("mimemessage stream: >>>" + new String(baos.toByteArray())
+ "<<<");
             bais = new ByteArrayInputStream(baos.toByteArray());
-            Mail newMail = (Mail) new MailImpl("MockMailCopy" + new Random().nextLong(),
+            return new MailImpl("MockMailCopy" + new Random().nextLong(),
                     mail.getSender(), mail.getRecipients(), bais);
-            return newMail;
         } catch (MessagingException ex) {
             log.error("", ex);
             throw new RuntimeException(ex);



---------------------------------------------------------------------
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