james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Burrell Donkin (JIRA)" <server-...@james.apache.org>
Subject [jira] Commented: (JAMES-850) RemoteDeliveryTest intermitant failure
Date Sun, 03 Aug 2008 21:59:44 GMT

    [ https://issues.apache.org/jira/browse/JAMES-850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619382#action_12619382
] 

Robert Burrell Donkin commented on JAMES-850:
---------------------------------------------

It's hard to know whether an intermittent fault is fixed but I've been running today and it
hasn't failed so far. It's a reasonbly clean solution. Would need more comments before committing
but please give it a try.


Index: mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/SMTPAddressFailedException.java
===================================================================
--- mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/SMTPAddressFailedException.java
(revision 682219)
+++ mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/SMTPAddressFailedException.java
(working copy)
@@ -47,7 +47,7 @@
      * @param err
      *            An error message for the exception.
      */
-    SMTPAddressFailedException(InternetAddress addr, java.lang.String cmd, int rc, java.lang.String
err) {
+    public SMTPAddressFailedException(InternetAddress addr, java.lang.String cmd, int rc,
java.lang.String err) {
         super(err);
         this.cmd = cmd;
         this.rc = rc;
Index: mailets-function/src/test/java/org/apache/james/transport/mailets/RemoteDeliveryTest.java
===================================================================
--- mailets-function/src/test/java/org/apache/james/transport/mailets/RemoteDeliveryTest.java
(revision 682219)
+++ mailets-function/src/test/java/org/apache/james/transport/mailets/RemoteDeliveryTest.java
(working copy)
@@ -19,16 +19,47 @@
 
 package org.apache.james.transport.mailets;
 
+import org.apache.james.core.MailImpl;
 import org.apache.james.transport.remotedeliverytester.AbstractRemoteDeliveryTest;
 import org.apache.james.transport.remotedeliverytester.RemoteDeliveryTestable;
+import org.apache.james.transport.remotedeliverytester.SMTPAddressFailedException;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.Properties;
 
+import javax.mail.internet.InternetAddress;
+
 /**
  * Tester for the standard RemoteDelivery Mailet
  */
 public class RemoteDeliveryTest extends AbstractRemoteDeliveryTest {
     
+    private static Object cloneSerializableObject(Object o) throws IOException, ClassNotFoundException
{
+        ByteArrayOutputStream b = new ByteArrayOutputStream();
+        ObjectOutputStream out = new ObjectOutputStream(b);
+        out.writeObject(o);
+        out.flush();
+        out.close();
+        ByteArrayInputStream bi=new ByteArrayInputStream(b.toByteArray());
+        ObjectInputStream in = new ObjectInputStream(bi);
+        Object no = in.readObject();
+        return no;
+    }
+    
+    static {
+        try {
+            cloneSerializableObject(new SMTPAddressFailedException(new InternetAddress(),
"Whatever", 1, "Another"));
+        } catch (Throwable t) {
+            System.err.println("CANNOT SERIALIZE CLASS");
+            t.printStackTrace(); 
+        }
+    }
+    
+
     public RemoteDeliveryTestable getDeliverer() {
         StandardRemoteDeliveryTestable d = new StandardRemoteDeliveryTestable();
         d.logEnabled = true;


> RemoteDeliveryTest intermitant failure
> --------------------------------------
>
>                 Key: JAMES-850
>                 URL: https://issues.apache.org/jira/browse/JAMES-850
>             Project: James
>          Issue Type: Test
>    Affects Versions: Trunk
>         Environment: GNULinux/Gentoo
> % java -version
> java version "1.5.0_16"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
> Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-b02, mixed mode)
> % cat /proc/cpuinfo 
> processor	: 0
> vendor_id	: AuthenticAMD
> cpu family	: 15
> model		: 67
> model name	: AMD Athlon(tm) 64 X2 Dual Core Processor 5600+
> stepping	: 3
> cpu MHz		: 1000.000
> cache size	: 1024 KB
> physical id	: 0
> siblings	: 2
> core id		: 0
> cpu cores	: 2
> fpu		: yes
> fpu_exception	: yes
> cpuid level	: 1
> wp		: yes
> flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush
mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16
lahf_lm cmp_legacy svm extapic cr8_legacy
> bogomips	: 2012.31
> TLB size	: 1024 4K pages
> clflush size	: 64
> cache_alignment	: 64
> address sizes	: 40 bits physical, 48 bits virtual
> power management: ts fid vid ttp tm stc
> processor	: 1
> vendor_id	: AuthenticAMD
> cpu family	: 15
> model		: 67
> model name	: AMD Athlon(tm) 64 X2 Dual Core Processor 5600+
> stepping	: 3
> cpu MHz		: 1000.000
> cache size	: 1024 KB
> physical id	: 0
> siblings	: 2
> core id		: 1
> cpu cores	: 2
> fpu		: yes
> fpu_exception	: yes
> cpuid level	: 1
> wp		: yes
> flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush
mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16
lahf_lm cmp_legacy svm extapic cr8_legacy
> bogomips	: 2012.31
> TLB size	: 1024 4K pages
> clflush size	: 64
> cache_alignment	: 64
> address sizes	: 40 bits physical, 48 bits virtual
> power management: ts fid vid ttp tm stc
>            Reporter: Robert Burrell Donkin
>            Priority: Critical
>         Attachments: TEST-org.apache.james.transport.mailets.RemoteDeliveryTest - expected-continuation.txt,
TEST-org.apache.james.transport.mailets.RemoteDeliveryTest.txt, TEST-org.apache.james.transport.mailets.RemoteDeliveryTest.txt,
TEST-org.apache.james.transport.mailets.RemoteDeliveryTest.txt, TEST-org.apache.james.transport.mailets.RemoteDeliveryTest.txt,
TEST-org.apache.james.transport.mailets.RemoteDeliveryTest.txt
>
>
> Open to track information related to intermittent failures of this test

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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