/**
 * TestException.java
 * 
 * @author Created by Omnicore CodeGuide
 */
package edu.sc.seis.gee.task;

import java.util.Map;
import edu.sc.seis.fissuresUtil.exceptionHandler.GUIReporter;
import edu.sc.seis.gee.configurator.ConfigurationException;

public class TestException implements Task {

    public void invoke() {
        GUIReporter.swapGreetingAndHandle(except, message);
    }

    public void configure(Map params) throws ConfigurationException {
        if(params.containsKey("message")) {
            message = (String)params.get("message");
        } else {
            throw new ConfigurationException("TestException task requires a message parameter with the message to be displayed to the user when the exception is thrown");
        }
    }

    public void destroy() {}

    private String message;

    private Exception except = new ConfigurationException("Just a test of the exception handling system");
}