Class MailTest

    • Constructor Summary

      Constructors 
      Constructor Description
      MailTest()
      Create System properties object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.sun.javatest.Status checkMem()
      Check run-time memory and pass/fail status.
      void checkStatus()
      Check testcase pass/fail status.
      jakarta.mail.Store connect2host​(java.lang.String proto, java.lang.String host, java.lang.String user, java.lang.String password)
      Connect to host machine.
      java.io.ByteArrayInputStream createInputStream​(jakarta.mail.Message msg)
      Creates and returns a ByteArrayInputStream for given Message object
      jakarta.mail.Session createSession()
      Create a Session.
      void ExceptionTest​(java.lang.Exception e)
      Deals with exception, produces stack trace, writes test report.
      jakarta.mail.Folder getRootFolder​(jakarta.mail.Store store)
      Get the root folder.
      void handlException​(java.lang.Exception e)
      Deals with exception, produces stack trace, writes test report.
      static void main​(java.lang.String[] argv)
      Default main() method ; overidden in subclasses.
      void parseArgs​(java.lang.String[] argv)
      Get command-line arguments and stuff the values into member fields.
      com.sun.javatest.Status run​(java.lang.String[] argv, java.io.PrintStream log, java.io.PrintStream out)
      Convert streams to Writers.
      com.sun.javatest.Status run​(java.lang.String[] argv, java.io.PrintWriter log, java.io.PrintWriter out)
      Default run() method ; sets i/o streams.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • testname

        public java.lang.String testname
      • protocol

        public java.lang.String protocol
      • transport_protocol

        public java.lang.String transport_protocol
      • host

        public java.lang.String host
      • transport_host

        public java.lang.String transport_host
      • user

        public java.lang.String user
      • password

        public java.lang.String password
      • auth

        public boolean auth
      • mailbox

        public java.lang.String mailbox
      • testbox

        public java.lang.String testbox
      • from

        public java.lang.String from
      • to

        public java.lang.String to
      • rootpath

        public java.lang.String rootpath
      • pattern

        public java.lang.String pattern
      • iofile

        public java.lang.String iofile
      • newName

        public java.lang.String newName
      • subject

        public java.lang.String subject
      • portvalue

        public java.lang.String portvalue
      • tportvalue

        public java.lang.String tportvalue
      • workdir

        public java.lang.String workdir
      • proxy

        public java.lang.String proxy
      • msgcount

        public int msgcount
      • portnum

        public int portnum
      • tportnum

        public int tportnum
      • errors

        public int errors
      • status

        public com.sun.javatest.Status status
      • properties

        public java.util.Properties properties
      • out

        public java.io.PrintWriter out
      • log

        public java.io.PrintWriter log
      • session

        public jakarta.mail.Session session
      • debug

        public boolean debug
    • Constructor Detail

      • MailTest

        public MailTest()
        Create System properties object.
    • Method Detail

      • main

        public static void main​(java.lang.String[] argv)
        Default main() method ; overidden in subclasses.
        Parameters:
        argv - command line arguments
      • run

        public com.sun.javatest.Status run​(java.lang.String[] argv,
                                           java.io.PrintStream log,
                                           java.io.PrintStream out)
        Convert streams to Writers.
        Parameters:
        argv - command line arguments
        log - the log stream
        out - the output stream
        Returns:
        the Status of the test
      • run

        public com.sun.javatest.Status run​(java.lang.String[] argv,
                                           java.io.PrintWriter log,
                                           java.io.PrintWriter out)
        Default run() method ; sets i/o streams.
        Specified by:
        run in interface com.sun.javatest.Test
        Parameters:
        argv - command line arguments
        log - the log stream
        out - the output stream
        Returns:
        null
      • parseArgs

        public void parseArgs​(java.lang.String[] argv)
        Get command-line arguments and stuff the values into member fields.
        Parameters:
        argv - command line arguments
      • createSession

        public jakarta.mail.Session createSession()
        Create a Session.
        Returns:
        the Session
      • connect2host

        public jakarta.mail.Store connect2host​(java.lang.String proto,
                                               java.lang.String host,
                                               java.lang.String user,
                                               java.lang.String password)
        Connect to host machine.
        Parameters:
        proto - the protocol (e.g., "imap")
        host - the host name
        user - the user name
        password - the password
        Returns:
        the Store
      • getRootFolder

        public jakarta.mail.Folder getRootFolder​(jakarta.mail.Store store)
        Get the root folder.
        Parameters:
        store - the Store
        Returns:
        the Folder
      • checkMem

        public com.sun.javatest.Status checkMem()
        Check run-time memory and pass/fail status.
        Returns:
        the Status
      • createInputStream

        public java.io.ByteArrayInputStream createInputStream​(jakarta.mail.Message msg)
        Creates and returns a ByteArrayInputStream for given Message object
        Parameters:
        msg - the Message
        Returns:
        the ByteArrayInputStream
      • checkStatus

        public void checkStatus()
        Check testcase pass/fail status.
      • handlException

        public void handlException​(java.lang.Exception e)
        Deals with exception, produces stack trace, writes test report.
        Parameters:
        e - the Exception
      • ExceptionTest

        public void ExceptionTest​(java.lang.Exception e)
        Deals with exception, produces stack trace, writes test report.
        Parameters:
        e - the Exception