// Approach 1:  Testing Shell

import InstructorNotifier1;
import java.io.*;

public class Terminal1 implements SchemeTesterInterface1 {  
    SimpleOutput simpOut;

    public Terminal1 () {
        simpOut = new SimpleOutput();
    }

    public String [] getData() {
        simpOut.println ("Terminal1::SendInfo called with no parameters");
        simpOut.println ("Terminal1 returning the following information string:");

        String [] results = new String [3];
        results[0] = "1";
        results[1] = "/home/walker/152/project.s01/test1.ss";
        results[2] = "";
 
        return results;
        
   }

    public void sendEmail() throws IOException{
        simpOut.println ("Terminal1::sendEmail called with no parameter");

        // since the header indicates an exception might be thrown, the following is included
        if (false)
            throw new IOException ("IOException thrown in sendEmail");

        simpOut.println ("Terminal1::sendEmail formulating message 'test body' with subject 'CSC 151 test'");
        SimpleInput in = new SimpleInput ();

        InstructorNotifier1 mailObj = new InstructorNotifier1 ();
        simpOut.print ("Enter your e-mail address:  ");
        String emailAddress = in.readString();

        mailObj.sendEmail(emailAddress, "CSC 151 test", "test body");

    }

    public void printResults(String results){
        simpOut.println ("Terminal1::sendEmail called with parameter");
        simpOut.println ("     results:"  + results);

        try{
            sendEmail();
        }
        catch (IOException exc){}
    }

} //end Terminal1
