Author: craigmcc
Date: Thu Dec 21 21:23:13 2006
New Revision: 489557

URL: http://svn.apache.org/viewvc?view=rev&rev=489557
Log:
Add test cases for navigating from a ViewController to a non-ViewController
page, for both the standard and Tiger extensions implementations.  So far, we
cannot duplicate the reported error condition in SHALE-371 but these tests will
help avoid any future regressions in this area.

Added:
    
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview1.java
   (with props)
    
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview2.java
   (with props)
    
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview1.jsp  
 (with props)
    
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview2.jsp  
 (with props)
    
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview1.java
   (with props)
    
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview2.java
   (with props)
    
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview1.jsp   
(with props)
    
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview2.jsp   
(with props)
Modified:
    shale/framework/trunk/shale-apps/pom.xml
    
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/WEB-INF/faces-config.xml
    shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/menu.jsp
    
shale/framework/trunk/shale-apps/shale-test-tiger/src/test/java/org/apache/shale/examples/test/tiger/systest/IntegrationTestCase.java
    
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/WEB-INF/faces-config.xml
    shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/menu.jsp
    
shale/framework/trunk/shale-apps/shale-test-view/src/test/java/org/apache/shale/examples/test/view/systest/IntegrationTestCase.java

Modified: shale/framework/trunk/shale-apps/pom.xml
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/pom.xml?view=diff&rev=489557&r1=489556&r2=489557
==============================================================================
--- shale/framework/trunk/shale-apps/pom.xml (original)
+++ shale/framework/trunk/shale-apps/pom.xml Thu Dec 21 21:23:13 2006
@@ -240,12 +240,12 @@
                 <dependency>
                     <groupId>javax.faces</groupId>
                     <artifactId>jsf-api</artifactId>
-                    <version>1.2_02</version>
+                    <version>1.2_03</version>
                 </dependency>
                 <dependency>
                     <groupId>javax.faces</groupId>
                     <artifactId>jsf-impl</artifactId>
-                    <version>1.2_02</version>
+                    <version>1.2_03</version>
                     <scope>runtime</scope>
                 </dependency>
                 <dependency>
@@ -282,7 +282,7 @@
                 <dependency>
                     <groupId>javax.faces</groupId>
                     <artifactId>jsf-api</artifactId>
-                    <version>1.2_02</version>
+                    <version>1.2_03</version>
                     <scope>provided</scope>
                 </dependency>
                 <dependency>

Added: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview1.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview1.java?view=auto&rev=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview1.java
 (added)
+++ 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview1.java
 Thu Dec 21 21:23:13 2006
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.examples.test.tiger;
+
+import org.apache.shale.tiger.managed.Bean;
+import org.apache.shale.tiger.managed.Property;
+import org.apache.shale.tiger.managed.Scope;
+import org.apache.shale.tiger.view.Destroy;
+import org.apache.shale.tiger.view.Init;
+import org.apache.shale.tiger.view.Preprocess;
+import org.apache.shale.tiger.view.Prerender;
+import org.apache.shale.tiger.view.View;
+
+/**
+ * <p>First page for non-ViewController event tests.</p>
+ */
[EMAIL PROTECTED](name="nonview1", scope=Scope.REQUEST) @View
+public class Nonview1 {
+    
+
+    // ------------------------------------------------------------- 
Constructor
+
+
+    /** Construct an uninitialized instance. */
+    public Nonview1() {
+        System.out.println("Nonview1.constructor()");
+    }
+
+
+    // -------------------------------------------------------------- 
Properties
+
+
+    // The "Recorder" object for this request
+    @Property(value="#{recorder}")
+    private Recorder recorder = null;
+    public Recorder getRecorder() {
+        return this.recorder;
+    }
+    public void setRecorder(Recorder recorder) {
+        this.recorder = recorder;
+    }
+
+
+    // ------------------------------------------------------- Lifecycle 
Methods
+
+
+    /**
+     * <p>Record an init event.</p>
+     */
+    @Init
+    public void init() {
+        getRecorder().record("init1");
+        System.out.println("Nonview1.init()");
+    }
+
+
+    /**
+     * <p>Record a preprocess event.</p>
+     */
+    @Preprocess
+    public void preprocess() {
+        getRecorder().record("preprocess1");
+        System.out.println("Nonview1.preprocess()");
+    }
+
+
+    /**
+     * <p>Record a prerender event.</p>
+     */
+    @Prerender
+    public void prerender() {
+        getRecorder().record("prerender1");
+        System.out.println("Nonview1.prerender()");
+    }
+
+
+    /**
+     * <p>Record a destroy event.</p>
+     */
+    @Destroy
+    public void destroy() {
+        getRecorder().record("destroy1");
+        System.out.println("Nonview1.destroy()");
+    }
+
+
+}

Propchange: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview1.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview1.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview2.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview2.java?view=auto&rev=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview2.java
 (added)
+++ 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview2.java
 Thu Dec 21 21:23:13 2006
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.examples.test.tiger;
+
+/**
+ * <p>Second page for non-ViewController event tests.</p>
+ */
+public class Nonview2 {
+    
+
+    // ------------------------------------------------------------- 
Constructor
+
+
+    /** Construct an uninitialized instance. */
+    public Nonview2() {
+        System.out.println("Nonview2.constructor()");
+    }
+
+
+    // -------------------------------------------------------------- 
Properties
+
+
+    // The "Recorder" object for this request
+    private Recorder recorder = null;
+    public Recorder getRecorder() {
+        return this.recorder;
+    }
+    public void setRecorder(Recorder recorder) {
+        this.recorder = recorder;
+    }
+
+
+}

Propchange: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview2.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/WEB-INF/faces-config.xml
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/WEB-INF/faces-config.xml?view=diff&rev=489557&r1=489556&r2=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/WEB-INF/faces-config.xml
 (original)
+++ 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/WEB-INF/faces-config.xml
 Thu Dec 21 21:23:13 2006
@@ -48,6 +48,10 @@
             <to-view-id>/menu.jsp</to-view-id>
         </navigation-case>
         <navigation-case>
+            <from-outcome>nonview2</from-outcome>
+            <to-view-id>/nonview2.jsp</to-view-id>
+        </navigation-case>
+        <navigation-case>
             <from-outcome>standard</from-outcome>
             <to-view-id>/standard.jsp</to-view-id>
         </navigation-case>
@@ -74,6 +78,20 @@
     <!-- Bean "lifecycle2" is declared with annotations -->
 
     <!-- Bean "managed" is declared with annotations -->
+
+    <!-- Bean "nonview1" is declared with annotations -->
+
+    <managed-bean>
+        <managed-bean-name>nonview2</managed-bean-name>
+        <managed-bean-class>
+            org.apache.shale.examples.test.tiger.Nonview2
+        </managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+        <managed-property>
+            <property-name>recorder</property-name>
+            <value>#{recorder}</value>
+        </managed-property>
+    </managed-bean>
 
     <!-- Bean "recorder" is declared with annotations -->
 

Modified: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/menu.jsp
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/menu.jsp?view=diff&rev=489557&r1=489556&r2=489557
==============================================================================
--- shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/menu.jsp 
(original)
+++ shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/menu.jsp 
Thu Dec 21 21:23:13 2006
@@ -35,6 +35,7 @@
         <li><a href="managed.faces">Annotated ViewController and Managed 
Beans</a></li>
         <li><a href="annotated.faces">Annotated ViewController Lifecycle 
Events</a></li>
         <li><a href="lifecycle1.faces">Lifecyle Navigation Events</a></li>
+        <li><a href="nonview1.faces">Navigate to Non-ViewController 
Page</a></li>
         <li><a href="standard.faces">Standard ViewController Lifecycle 
Events</a></li>
         <li><a href="status.faces">Static Status Information</a></li>
         <li><a href="subview1.faces">Subview Lifecycle Events</a></li>

Added: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview1.jsp
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview1.jsp?view=auto&rev=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview1.jsp 
(added)
+++ 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview1.jsp 
Thu Dec 21 21:23:13 2006
@@ -0,0 +1,66 @@
+<%--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id$
+
+--%>
+
+<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
+<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>
+
+<f:view>
+<html>
+<head>
+    <title>Non-ViewController Navigation Test (Page 1)</title>
+</head>
+<body>
+
+    <h3>Non-ViewController Navigation Test (Page 1)</h3>
+
+    <table cellspacing="5">
+        <tr>
+            <th align="center">Name</th>
+            <th align="center">Value</th>
+        </tr>
+        <tr>
+            <th align="right">recorder.events</th>
+            <td><h:outputText id="recorderEvents"
+                           value="#{nonview1.recorder.events}"/></td>
+        </tr>
+    </table>
+
+    <h:form id="form">
+      <h:commandLink id="navigate" value="Navigate" action="nonview2"/>
+    </h:form>
+
+    <h3>Test Description</h3>
+
+    <p>Displays the lifecycle events that have been recorded so far.
+    When this page is initially navigated to, it should be
+    "init1/prerender1/".  When you press the Navigate button, you
+    should advance to page 2, where the event listing should be
+    "init1/preprocess1/" because the second page does not implement
+    ViewController.</p>
+
+    <p>NOTE:  Destroy events do not get listed, because rendering
+    is completed before that method gets called.</p>
+
+    <p><a href="menu.faces">Back</a> to main menu</p>
+
+</body>
+</html>
+</f:view>

Propchange: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview1.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview1.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview2.jsp
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview2.jsp?view=auto&rev=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview2.jsp 
(added)
+++ 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview2.jsp 
Thu Dec 21 21:23:13 2006
@@ -0,0 +1,62 @@
+<%--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id$
+
+--%>
+
+<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
+<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>
+
+<f:view>
+<html>
+<head>
+    <title>Non-ViewController Navigation Test (Page 2)</title>
+</head>
+<body>
+
+    <h3>Non-ViewController Navigation Test (Page 2)</h3>
+
+    <table cellspacing="5">
+        <tr>
+            <th align="center">Name</th>
+            <th align="center">Value</th>
+        </tr>
+        <tr>
+            <th align="right">recorder.events</th>
+            <td><h:outputText id="recorderEvents"
+                           value="#{nonview2.recorder.events}"/></td>
+        </tr>
+    </table>
+
+    <h3>Test Description</h3>
+
+    <p>Displays the lifecycle events that have been recorded so far.
+    When this page is initially navigated to, it should be
+    "init1/prerender1/".  When you press the Navigate button, you
+    should advance to page 2, where the event listing should be
+    "init1/preprocess1/" because the second page does not implement
+    ViewController.</p>
+
+    <p>NOTE:  Destroy events do not get listed, because rendering
+    is completed before that method gets called.</p>
+
+    <p><a href="menu.faces">Back</a> to main menu</p>
+
+</body>
+</html>
+</f:view>

Propchange: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview2.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview2.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: 
shale/framework/trunk/shale-apps/shale-test-tiger/src/test/java/org/apache/shale/examples/test/tiger/systest/IntegrationTestCase.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/test/java/org/apache/shale/examples/test/tiger/systest/IntegrationTestCase.java?view=diff&rev=489557&r1=489556&r2=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-tiger/src/test/java/org/apache/shale/examples/test/tiger/systest/IntegrationTestCase.java
 (original)
+++ 
shale/framework/trunk/shale-apps/shale-test-tiger/src/test/java/org/apache/shale/examples/test/tiger/systest/IntegrationTestCase.java
 Thu Dec 21 21:23:13 2006
@@ -258,6 +258,36 @@
     }
 
 
+    // Test /nonview1.jsp and /nonview2.jsp
+    public void testNonview() throws Exception {
+
+        HtmlElement element;
+        page("/nonview1.faces");
+        assertEquals("Non-ViewController Navigation Test (Page 1)", title());
+
+        // Validate values for initial non-postback call
+        
+        element = element("recorderEvents");
+        assertNotNull(element);
+        assertEquals("init1/prerender1/", element.asText());
+
+        // Click the navigate hyperlink
+
+        HtmlAnchor anchor = (HtmlAnchor) element("form:navigate");
+        assertNotNull(anchor);
+        link(anchor);
+
+        // Validate values for subsequent postback call
+        
+        assertEquals("Non-ViewController Navigation Test (Page 2)", title());
+
+        element = element("recorderEvents");
+        assertNotNull(element);
+        assertEquals("init1/preprocess1/", element.asText());
+
+    }
+
+
     // Test /standard.jsp
     public void testStandard() throws Exception {
 

Added: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview1.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview1.java?view=auto&rev=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview1.java
 (added)
+++ 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview1.java
 Thu Dec 21 21:23:13 2006
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.examples.test.view;
+
+import org.apache.shale.view.AbstractViewController;
+
+/**
+ * <p>First page for non-ViewController event tests.</p>
+ */
+public class Nonview1 extends AbstractViewController {
+    
+
+    // ------------------------------------------------------------- 
Constructor
+
+
+    /** Construct an uninitialized instance. */
+    public Nonview1() {
+        System.out.println("Nonview1.constructor()");
+    }
+
+
+    // -------------------------------------------------------------- 
Properties
+
+
+    // The "Recorder" object for this request
+    private Recorder recorder = null;
+    public Recorder getRecorder() {
+        return this.recorder;
+    }
+    public void setRecorder(Recorder recorder) {
+        this.recorder = recorder;
+    }
+
+
+    // ------------------------------------------------------- Lifecycle 
Methods
+
+
+    /**
+     * <p>Record an init event.</p>
+     */
+    public void init() {
+        getRecorder().record("init1");
+        System.out.println("Nonview1.init()");
+    }
+
+
+    /**
+     * <p>Record a preprocess event.</p>
+     */
+    public void preprocess() {
+        getRecorder().record("preprocess1");
+        System.out.println("Nonview1.preprocess()");
+    }
+
+
+    /**
+     * <p>Record a prerender event.</p>
+     */
+    public void prerender() {
+        getRecorder().record("prerender1");
+        System.out.println("Nonview1.prerender()");
+    }
+
+
+    /**
+     * <p>Record a destroy event.</p>
+     */
+    public void destroy() {
+        getRecorder().record("destroy1");
+        System.out.println("Nonview1.destroy()");
+    }
+
+
+}

Propchange: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview1.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview1.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview2.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview2.java?view=auto&rev=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview2.java
 (added)
+++ 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview2.java
 Thu Dec 21 21:23:13 2006
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.examples.test.view;
+
+/**
+ * <p>Second page for non-ViewController event tests.</p>
+ */
+public class Nonview2 {
+    
+
+    // ------------------------------------------------------------- 
Constructor
+
+
+    /** Construct an uninitialized instance. */
+    public Nonview2() {
+        System.out.println("Nonview2.constructor()");
+    }
+
+
+    // -------------------------------------------------------------- 
Properties
+
+
+    // The "Recorder" object for this request
+    private Recorder recorder = null;
+    public Recorder getRecorder() {
+        return this.recorder;
+    }
+    public void setRecorder(Recorder recorder) {
+        this.recorder = recorder;
+    }
+
+
+}

Propchange: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview2.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/WEB-INF/faces-config.xml
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/WEB-INF/faces-config.xml?view=diff&rev=489557&r1=489556&r2=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/WEB-INF/faces-config.xml
 (original)
+++ 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/WEB-INF/faces-config.xml
 Thu Dec 21 21:23:13 2006
@@ -40,6 +40,10 @@
             <to-view-id>/menu.jsp</to-view-id>
         </navigation-case>
         <navigation-case>
+            <from-outcome>nonview2</from-outcome>
+            <to-view-id>/nonview2.jsp</to-view-id>
+        </navigation-case>
+        <navigation-case>
             <from-outcome>standard</from-outcome>
             <to-view-id>/standard.jsp</to-view-id>
         </navigation-case>
@@ -72,6 +76,30 @@
         <managed-bean-name>lifecycle2</managed-bean-name>
         <managed-bean-class>
             org.apache.shale.examples.test.view.Lifecycle2
+        </managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+        <managed-property>
+            <property-name>recorder</property-name>
+            <value>#{recorder}</value>
+        </managed-property>
+    </managed-bean>
+
+    <managed-bean>
+        <managed-bean-name>nonview1</managed-bean-name>
+        <managed-bean-class>
+            org.apache.shale.examples.test.view.Nonview1
+        </managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+        <managed-property>
+            <property-name>recorder</property-name>
+            <value>#{recorder}</value>
+        </managed-property>
+    </managed-bean>
+
+    <managed-bean>
+        <managed-bean-name>nonview2</managed-bean-name>
+        <managed-bean-class>
+            org.apache.shale.examples.test.view.Nonview2
         </managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
         <managed-property>

Modified: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/menu.jsp
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/menu.jsp?view=diff&rev=489557&r1=489556&r2=489557
==============================================================================
--- shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/menu.jsp 
(original)
+++ shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/menu.jsp 
Thu Dec 21 21:23:13 2006
@@ -33,6 +33,7 @@
 
     <ul>
         <li><a href="lifecycle1.faces">Lifecyle Navigation Events</a></li>
+        <li><a href="nonview1.faces">Navigate to Non-ViewController 
Page</a></li>
         <li><a href="standard.faces">Standard ViewController Lifecycle 
Events</a></li>
         <li><a href="status.faces">Static Status Information</a></li>
         <li><a href="subview1.faces">Subview Lifecycle Events</a></li>

Added: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview1.jsp
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview1.jsp?view=auto&rev=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview1.jsp 
(added)
+++ 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview1.jsp 
Thu Dec 21 21:23:13 2006
@@ -0,0 +1,66 @@
+<%--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id$
+
+--%>
+
+<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
+<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>
+
+<f:view>
+<html>
+<head>
+    <title>Non-ViewController Navigation Test (Page 1)</title>
+</head>
+<body>
+
+    <h3>Non-ViewController Navigation Test (Page 1)</h3>
+
+    <table cellspacing="5">
+        <tr>
+            <th align="center">Name</th>
+            <th align="center">Value</th>
+        </tr>
+        <tr>
+            <th align="right">recorder.events</th>
+            <td><h:outputText id="recorderEvents"
+                           value="#{nonview1.recorder.events}"/></td>
+        </tr>
+    </table>
+
+    <h:form id="form">
+      <h:commandLink id="navigate" value="Navigate" action="nonview2"/>
+    </h:form>
+
+    <h3>Test Description</h3>
+
+    <p>Displays the lifecycle events that have been recorded so far.
+    When this page is initially navigated to, it should be
+    "init1/prerender1/".  When you press the Navigate button, you
+    should advance to page 2, where the event listing should be
+    "init1/preprocess1/" because the second page does not implement
+    ViewController.</p>
+
+    <p>NOTE:  Destroy events do not get listed, because rendering
+    is completed before that method gets called.</p>
+
+    <p><a href="menu.faces">Back</a> to main menu</p>
+
+</body>
+</html>
+</f:view>

Propchange: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview1.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview1.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview2.jsp
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview2.jsp?view=auto&rev=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview2.jsp 
(added)
+++ 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview2.jsp 
Thu Dec 21 21:23:13 2006
@@ -0,0 +1,62 @@
+<%--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id$
+
+--%>
+
+<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
+<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"; %>
+
+<f:view>
+<html>
+<head>
+    <title>Non-ViewController Navigation Test (Page 2)</title>
+</head>
+<body>
+
+    <h3>Non-ViewController Navigation Test (Page 2)</h3>
+
+    <table cellspacing="5">
+        <tr>
+            <th align="center">Name</th>
+            <th align="center">Value</th>
+        </tr>
+        <tr>
+            <th align="right">recorder.events</th>
+            <td><h:outputText id="recorderEvents"
+                           value="#{nonview2.recorder.events}"/></td>
+        </tr>
+    </table>
+
+    <h3>Test Description</h3>
+
+    <p>Displays the lifecycle events that have been recorded so far.
+    When this page is initially navigated to, it should be
+    "init1/prerender1/".  When you press the Navigate button, you
+    should advance to page 2, where the event listing should be
+    "init1/preprocess1/" because the second page does not implement
+    ViewController.</p>
+
+    <p>NOTE:  Destroy events do not get listed, because rendering
+    is completed before that method gets called.</p>
+
+    <p><a href="menu.faces">Back</a> to main menu</p>
+
+</body>
+</html>
+</f:view>

Propchange: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview2.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview2.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: 
shale/framework/trunk/shale-apps/shale-test-view/src/test/java/org/apache/shale/examples/test/view/systest/IntegrationTestCase.java
URL: 
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/test/java/org/apache/shale/examples/test/view/systest/IntegrationTestCase.java?view=diff&rev=489557&r1=489556&r2=489557
==============================================================================
--- 
shale/framework/trunk/shale-apps/shale-test-view/src/test/java/org/apache/shale/examples/test/view/systest/IntegrationTestCase.java
 (original)
+++ 
shale/framework/trunk/shale-apps/shale-test-view/src/test/java/org/apache/shale/examples/test/view/systest/IntegrationTestCase.java
 Thu Dec 21 21:23:13 2006
@@ -123,6 +123,36 @@
     }
 
 
+    // Test /nonview1.jsp and /nonview2.jsp
+    public void testNonview() throws Exception {
+
+        HtmlElement element;
+        page("/nonview1.faces");
+        assertEquals("Non-ViewController Navigation Test (Page 1)", title());
+
+        // Validate values for initial non-postback call
+        
+        element = element("recorderEvents");
+        assertNotNull(element);
+        assertEquals("init1/prerender1/", element.asText());
+
+        // Click the navigate hyperlink
+
+        HtmlAnchor anchor = (HtmlAnchor) element("form:navigate");
+        assertNotNull(anchor);
+        link(anchor);
+
+        // Validate values for subsequent postback call
+        
+        assertEquals("Non-ViewController Navigation Test (Page 2)", title());
+
+        element = element("recorderEvents");
+        assertNotNull(element);
+        assertEquals("init1/preprocess1/", element.asText());
+
+    }
+
+
     // Test /standard.jsp
     public void testStandard() throws Exception {
 


Reply via email to