import MailMessage; import SimpleInput; import SimpleOutput; /** * Test the MailMessage class by creating a mail message, changing the fields, * generating a reply to it and it prints the message at each point. */ public class TestMailMessage { /** * Prompt the user to fill in the fields, and set them accordingly. */ public static void main(String[] args) { // prepare for output SimpleOutput out = new SimpleOutput(); // prepare for input SimpleInput in = new SimpleInput(); // prepare the message MailMessage message = new MailMessage(); // prompt user for the date out.println("Enter today's date:"); // set the date message.setDate(in.readString()); // prompt the user for their name and email address out.println("Enter your name and email in the form First Last :"); // set the sender message.setSender(in.readString()); // prompt the user for the recipient out.println("Enter the email name and email address of the person you want"); out.println("to send the message to in the same format:"); // set the recipient message.setRecipient(in.readString()); // prompt the user for the subject out.println("Enter a subject for your email:"); // set the subject message.setSubject(in.readString()); // prompt the user for the body out.println("Enter your message:"); // set the body message.setBody(in.readString()); // print the message out.println(""); out.println("This is your message:"); out.println(message.toString()); // update the message out.println("Now I will update the message:"); out.println("\n"); // prompt user for a new date out.println("Enter a new date:"); // set the new date message.setDate(in.readString()); // prompt the user for their new name and email address out.println("Enter your new name and email in the form First Last :"); // set the new sender message.setSender(in.readString()); // prompt the user for the recipient out.println("Enter the new email name and email address of the person you want"); out.println("to send the message to in the same format:"); // set the new recipient message.setRecipient(in.readString()); // prompt the user for the subject out.println("Enter a new subject for your email:"); // set the new subject message.setSubject(in.readString()); // prompt the user for the body out.println("Enter your new message:"); // set the new body message.setBody(in.readString()); // print the message out.println(""); out.println("This is your new message:"); out.println(message.toString()); // generate a reply to the message out.println("Now I will generate a reply to your message"); out.println("\n"); //prompt the user for the reply date, the message and their quoting preferance out.println("Enter todays date, hit enter, enter your message, hit enter, then"); out.println("enter 1 if you want the original message quoted, if not just hit enter:"); // set the reply date message.makeReply(in.readString(),in.readString(),in.readInt()); //print the reply out.println("This is your reply:"); out.println(message.toString()); } // main(String[]) } // TestMailMessage