Class getMessage_Test

  • All Implemented Interfaces:
    com.sun.javatest.Test

    public class getMessage_Test
    extends MailTest
    This class tests the getMessage(int) API. It does this by passing various valid input values and then checking the type of the returned object.

    Get the Message object corresponding to the given message number

    api2test: public getMessage(int param) throws MessageException

    how2test: Call this API with int message id. Check that it returns an object

    of type Message. If so then the testcase passes otherwise it fails.

    a) Test fetching the Message object corresponding to the given message number with the specified range 1...N

    b) Repeated calls to getMessage with the same message number will return the same Message object. Check for this.

    c) Test fetching a message that has been marked for deletion.

    d) Test for 0 and N+1 message numbers. It should throw an exception!

    // This will throw an invalid message number exception, so we are // skipping this testcase.

    • Constructor Detail

      • getMessage_Test

        public getMessage_Test()
    • Method Detail

      • main

        public static void main​(java.lang.String[] argv)
      • 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