2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.shale.view;
19  
20  import junit.framework.Test;
21  import junit.framework.TestSuite;
22  
23  /***
24   * <p>Test case for <code>AbstractViewController</code>.</p>
25   */
26  public class ConcreteViewControllerTestCase extends ConcreteFacesBeanTestCase {
27      
28      // ------------------------------------------------------------ Constructors
29  
30  
31      // Construct a new instance of this test case.
32      public ConcreteViewControllerTestCase(String name) {
33          super(name);
34      }
35  
36  
37      // ---------------------------------------------------- Overall Test Methods
38  
39  
40      // Set up instance variables required by this test case.
41      protected void setUp() throws Exception {
42  
43          super.setUp();
44  
45          // Set up the instance we will be testing
46          bean = new ConcreteViewController();
47  
48      }
49  
50  
51      // Return the tests included in this test case.
52      public static Test suite() {
53  
54          return (new TestSuite(ConcreteViewControllerTestCase.class));
55  
56      }
57  
58  
59      // Tear down instance variables required by this test case.
60      protected void tearDown() throws Exception {
61  
62          bean = null;
63          super.tearDown();
64  
65      }
66  
67  
68      // ------------------------------------------------------------ Test Methods
69  
70  
71      // Test access to the postBack property
72      public void testPostBack() {
73  
74          ConcreteViewController cvc = (ConcreteViewController) bean;
75          assertTrue(!cvc.isPostBack());
76          cvc.setPostBack(true);
77          assertTrue(cvc.isPostBack());
78  
79      }
80  
81  
82  }