super(method);
}
public static WebActionDispatcher suite()
throws IllegalAccessException, InvocationTargetException {
WebActionDispatcher suite = new WebActionDispatcher();
// Test method name that has not been defined
try {
suite.addHandler (new MyActs("notDefined"));
throw new IllegalArgumentException("Illegal action method not detected");
} catch (IllegalArgumentException exc ) {
}
// Test method name that has been defined twice
try {
suite.addHandler (new MyActs("twiceDefined"));
throw new IllegalArgumentException("Illegal action method not detected");
} catch (IllegalArgumentException exc ) {
}
// Test method with illegal return value
try {
suite.addHandler (new MyActs("illegalReturnValue"));
throw new IllegalArgumentException("Illegal action method not detected");
} catch (IllegalArgumentException exc ) {
}
// Test method with illegal parameters
try {
suite.addHandler (new MyActs("illegalFirstParameter"));
throw new IllegalArgumentException("Illegal action method not detected");
} catch (IllegalArgumentException exc ) {
}
try {
suite.addHandler (new MyActs("illegalSecondParameter"));
throw new IllegalArgumentException("Illegal action method not detected");
} catch (IllegalArgumentException exc ) {
}
// Now some valid action methods
suite.addHandler (new MyActs("validMethod1Param1"));
suite.addHandler (new MyActs("validMethod1Param2"));
suite.addHandler (new MyActs("validMethod2Params1"));
suite.addHandler (new MyActs("validMethod2Params2"));
return suite;
}