01: /*
02: * Copyright 2005-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
05: * in compliance with the License. You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software distributed under the License
10: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11: * or implied. See the License for the specific language governing permissions and limitations under
12: * the License.
13: */
14:
15: package org.strecks.controller;
16:
17: import org.strecks.action.basic.BasicController;
18: import org.strecks.action.basic.BasicDispatchController;
19: import org.strecks.action.basic.BasicFormController;
20: import org.strecks.action.basic.BasicSubmitController;
21: import org.strecks.action.navigable.NavigableController;
22: import org.strecks.action.navigable.NavigableDispatchController;
23: import org.strecks.action.navigable.NavigableFormController;
24: import org.strecks.action.navigable.NavigableSubmitController;
25: import org.strecks.controller.implicit.ImplicitBasicAction;
26: import org.strecks.controller.implicit.ImplicitBasicDispatchAction;
27: import org.strecks.controller.implicit.ImplicitBasicFormAction;
28: import org.strecks.controller.implicit.ImplicitBasicSubmitAction;
29: import org.strecks.controller.implicit.ImplicitNavigableAction;
30: import org.strecks.controller.implicit.ImplicitNavigableDispatchAction;
31: import org.strecks.controller.implicit.ImplicitNavigableFormAction;
32: import org.strecks.controller.implicit.ImplicitNavigableSubmitAction;
33: import org.testng.annotations.BeforeMethod;
34: import org.testng.annotations.Test;
35:
36: /**
37: * @author Phil Zoio
38: */
39: public class TestImplicitActionCreation {
40:
41: private ActionCreatorImpl actionCreator;
42:
43: @BeforeMethod
44: public void setUp() {
45: actionCreator = new ActionCreatorImpl();
46: }
47:
48: /**
49: * Coarse grained test on happy path. Creates controller action and actionBean which satisfy mutual depependency
50: * requirements
51: */
52: @Test
53: public void testActionCreate() throws Exception {
54:
55: assert actionCreator.createAction(ImplicitBasicAction.class) instanceof BasicController;
56: assert actionCreator
57: .createAction(ImplicitBasicFormAction.class) instanceof BasicFormController;
58: assert actionCreator
59: .createAction(ImplicitBasicSubmitAction.class) instanceof BasicSubmitController;
60: assert actionCreator
61: .createAction(ImplicitBasicDispatchAction.class) instanceof BasicDispatchController;
62:
63: assert actionCreator
64: .createAction(ImplicitNavigableAction.class) instanceof NavigableController;
65: assert actionCreator
66: .createAction(ImplicitNavigableFormAction.class) instanceof NavigableFormController;
67: assert actionCreator
68: .createAction(ImplicitNavigableSubmitAction.class) instanceof NavigableSubmitController;
69: assert actionCreator
70: .createAction(ImplicitNavigableDispatchAction.class) instanceof NavigableDispatchController;
71:
72: }
73: }
|