Class addConnectionListener_Test

  • All Implemented Interfaces:
    com.sun.javatest.Test, jakarta.mail.event.ConnectionListener, java.util.EventListener

    public class addConnectionListener_Test
    extends MailTest
    implements jakarta.mail.event.ConnectionListener
    This class tests the addConnectionListener() API. It does this by passing various valid input values and then checking the type/value of the returned object.

    Listen and notifies of open/close events to Folder/Store/Transport.

    api2test: public addConnectionListener(ConnectionListener)

    how2test: Call this API. Then verify that that the notification occur when changes occur to a folder/store/transport. If this happens then this test passed otherwise it fails.

    • Constructor Detail

      • addConnectionListener_Test

        public addConnectionListener_Test()
    • Method Detail

      • main

        public static void main​(java.lang.String[] argv)
      • opened

        public void opened​(jakarta.mail.event.ConnectionEvent e)
        Specified by:
        opened in interface jakarta.mail.event.ConnectionListener
      • closed

        public void closed​(jakarta.mail.event.ConnectionEvent e)
        Specified by:
        closed in interface jakarta.mail.event.ConnectionListener
      • disconnected

        public void disconnected​(jakarta.mail.event.ConnectionEvent e)
        Specified by:
        disconnected in interface jakarta.mail.event.ConnectionListener
      • run

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

        public void dotest​(jakarta.mail.Folder folder)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception