commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ep...@apache.org
Subject cvs commit: jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/settings EmailConfiguration.java
Date Thu, 28 Oct 2004 19:28:03 GMT
epugh       2004/10/28 12:28:03

  Modified:    email/src/test/org/apache/commons/mail HtmlEmailTest.java
                        EmailTest.java MultiPartEmailTest.java
               email/src/java/org/apache/commons/mail Email.java
               email/src/test/org/apache/commons/mail/mocks
                        MockMultiPartEmailConcrete.java
               email/src/test/org/apache/commons/mail/settings
                        EmailConfiguration.java
  Log:
  More checkstyle fixes
  
  Revision  Changes    Path
  1.5       +19 -19    jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/HtmlEmailTest.java
  
  Index: HtmlEmailTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/HtmlEmailTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HtmlEmailTest.java	27 Oct 2004 09:53:45 -0000	1.4
  +++ HtmlEmailTest.java	28 Oct 2004 19:28:02 -0000	1.5
  @@ -58,6 +58,20 @@
       private String strTestUser = EmailConfiguration.TEST_USER;
       /** Mailserver strTestPasswd (set if needed - must be valid) */
       private String strTestPasswd = EmailConfiguration.TEST_PASSWD;
  +    
  +    String[] tests =
  +    {
  +        "",
  +        " ",
  +        "a",
  +        "A",
  +        "?",
  +        "?",
  +        "0123456789",
  +        "012345678901234567890",
  +        "\n",
  +        null
  +    };    
   
       /**
        * @param name name
  @@ -77,41 +91,27 @@
       /** */
       public void testGetSetTextMsg()
       {
  -        String[] tests = 
  -        {
  -            "", " ", "a", "A", "", "", "0123456789", "012345678901234567890", "\n", null
  -        };
   
           for ( int i = 0; i < tests.length; i++ )
           {
  -            this.email.setTextMsg( tests[ i ] );
  -            assertEquals( tests[ i ], this.email.getTextMsg() );
  +            this.email.setTextMsg(tests[i]);
  +            assertEquals(tests[i], this.email.getTextMsg());
           }
       }
   
       /** */
       public void testGetSetHtmlMsg()
       {
  -        String[] tests = 
  -        {
  -            "", " ", "a", "A", "", "", "0123456789", "012345678901234567890", "\n", null
  -        };
  -
           for ( int i = 0; i < tests.length; i++ )
           {
  -            this.email.setHtmlMsg( tests[ i ] );
  -            assertEquals( tests[ i ], this.email.getHtmlMsg() );
  +            this.email.setHtmlMsg(tests[i]);
  +            assertEquals(tests[i], this.email.getHtmlMsg());
           }
       }
   
       /** */
       public void testGetSetMsg()
       {
  -        String[] tests = 
  -        {
  -            "", " ", "a", "A", "", "", "0123456789", "012345678901234567890", "\n"
  -        };
  -
           for ( int i = 0; i < tests.length; i++ )
           {
               this.email.setMsg( tests[ i ] );
  
  
  
  1.5       +16 -62    jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/EmailTest.java
  
  Index: EmailTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/EmailTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EmailTest.java	27 Oct 2004 09:53:45 -0000	1.4
  +++ EmailTest.java	28 Oct 2004 19:28:02 -0000	1.5
  @@ -322,8 +322,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           ArrayList arrExpected = new ArrayList();
           try
  @@ -477,9 +476,8 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  -        
  +                "someone_here@work-address.com.au" };
  +
           ArrayList arrExpected = new ArrayList();
           try
           {
  @@ -530,8 +528,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           ArrayList arrExpected = new ArrayList();
           try
  @@ -571,39 +568,6 @@
           assertEquals(arrExpected.toString(), this.email.getToList().toString());
       }
   
  -//    /** */
  -//    public void testAddToEx()
  -//    {
  -//        // ====================================================================
  -//        // Test Exceptions (Email Invalid)
  -//        // ====================================================================
  -//        String[] testEmailInvalid = { "", " ", "a", null };
  -//        ArrayList arrExpected = new ArrayList();
  -//
  -//        for (int i = 0; i < testEmailInvalid.length; i++)
  -//        {
  -//            try
  -//            {
  -//                // set from 
  -//                this.email.addTo(testEmailInvalid[i]);
  -//                fail("Should have thrown an exception");
  -//            }
  -//            catch (MessagingException e)
  -//            {
  -//                assertTrue(true);
  -//            }
  -//            catch (Exception e)
  -//            {
  -//                e.printStackTrace();
  -//                fail("Unexpected exception thrown");
  -//            }
  -//        }
  -//
  -//        // retrieve and verify
  -//        assertEquals(arrExpected.size(), this.email.getToList().size());
  -//        assertEquals(arrExpected.toString(), this.email.getToList().toString());
  -//    }
  -
       /** */
       public void testAddTo2()
       {
  @@ -614,8 +578,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           String[] testEmailNames = { "Name1", "", null };
   
  @@ -769,8 +732,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           ArrayList arrExpected = new ArrayList();
           try
  @@ -822,8 +784,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           ArrayList arrExpected = new ArrayList();
           try
  @@ -873,8 +834,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           String[] testEmailNames = { "Name1", "", null };
   
  @@ -1010,8 +970,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           ArrayList arrExpected = new ArrayList();
           try
  @@ -1065,8 +1024,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           ArrayList arrExpected = new ArrayList();
           try
  @@ -1118,8 +1076,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           String[] testEmailNames = { "Name1", "", null };
   
  @@ -1270,8 +1227,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           ArrayList arrExpected = new ArrayList();
           try
  @@ -1325,8 +1281,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           ArrayList arrExpected = new ArrayList();
           try
  @@ -1378,8 +1333,7 @@
               {
                   "me@home.com",
                   "joe.doe@apache.org",
  -                "someone_here@work-address.com.au"
  -            };
  +                "someone_here@work-address.com.au" };
   
           String[] testEmailNames = { "Name1", "", null };
   
  @@ -1616,7 +1570,7 @@
               this.email.setSubject("Test Msg Subject");
   
               this.email.setContent(new MimeMultipart("abc123"));
  -        
  +
               Hashtable ht = new Hashtable();
               ht.put("X-Priority", "1");
               ht.put("Disposition-Notification-To", this.strTestMailFrom);
  
  
  
  1.5       +5 -5      jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/MultiPartEmailTest.java
  
  Index: MultiPartEmailTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/MultiPartEmailTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MultiPartEmailTest.java	27 Oct 2004 09:53:45 -0000	1.4
  +++ MultiPartEmailTest.java	28 Oct 2004 19:28:03 -0000	1.5
  @@ -16,6 +16,7 @@
   package org.apache.commons.mail;
   
   import java.io.File;
  +import java.io.IOException;
   import java.net.MalformedURLException;
   import java.net.URL;
   import java.util.Hashtable;
  @@ -425,13 +426,13 @@
       {
           assertTrue(true);
       }
  -      
  +
       /** @todo implement test for AddPart(content, contentType) */
       public void testAddPart()
       {
           assertTrue(true);
       }
  -      
  +
       /** @todo implement test for AddPart(MimeMultipart) */
       public void testAddPart2()
       {
  @@ -479,8 +480,7 @@
                   "0123456789",
                   "012345678901234567890",
                   "\n",
  -                null 
  -           };
  +                null };
   
           for (int i = 0; i < tests.length; i++)
           {
  
  
  
  1.23      +2 -2      jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/Email.java
  
  Index: Email.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/Email.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Email.java	27 Oct 2004 09:53:46 -0000	1.22
  +++ Email.java	28 Oct 2004 19:28:03 -0000	1.23
  @@ -928,4 +928,4 @@
           this.popUsername = newPopUsername;
           this.popPassword = newPopPassword;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +2 -2      jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/mocks/MockMultiPartEmailConcrete.java
  
  Index: MockMultiPartEmailConcrete.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/mocks/MockMultiPartEmailConcrete.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MockMultiPartEmailConcrete.java	27 Oct 2004 09:53:46 -0000	1.3
  +++ MockMultiPartEmailConcrete.java	28 Oct 2004 19:28:03 -0000	1.4
  @@ -50,7 +50,7 @@
               return null;
           }
       }
  -    
  +
       /**
        * @throws MessagingException MessagingException
        */
  
  
  
  1.3       +3 -4      jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/settings/EmailConfiguration.java
  
  Index: EmailConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/test/org/apache/commons/mail/settings/EmailConfiguration.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EmailConfiguration.java	27 Oct 2004 09:53:46 -0000	1.2
  +++ EmailConfiguration.java	28 Oct 2004 19:28:03 -0000	1.3
  @@ -19,7 +19,7 @@
    * @author Eric Pugh
    *
    */
  -public interface EmailConfiguration
  +public final class EmailConfiguration
   {
       /** */
       public static final String MAIL_SERVER = "localhost";
  @@ -34,8 +34,7 @@
       /** */
       public static final String TEST_PASSWD = "passwd";
       /** */
  -    public static final String TEST_URL = 
  -                    "http://www.apache.org/images/asf_logo_wide.gif";
  -
  +    public static final String TEST_URL =
  +        "http://www.apache.org/images/asf_logo_wide.gif";
   
   }
  
  
  

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


Mime
View raw message