Author: craigmcc
Date: Sat Dec 23 12:51:40 2006
New Revision: 489925
URL: http://svn.apache.org/viewvc?view=rev&rev=489925
Log:
Add an additional use case for each test application to further exercise the
scenario reported in SHALE-371 -- this time, the destination bean is not
registered with a ViewControllerMapper compatible managed bean name at all.
Added:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview3.java
(with props)
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview4.java
(with props)
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview3.jsp
(with props)
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview4.jsp
(with props)
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview3.java
(with props)
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview4.java
(with props)
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview3.jsp
(with props)
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview4.jsp
(with props)
Modified:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle1.java
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle2.java
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/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle1.java
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle1.java?view=diff&rev=489925&r1=489924&r2=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle1.java
(original)
+++
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle1.java
Sat Dec 23 12:51:40 2006
@@ -58,6 +58,7 @@
@Init
public void init() {
getRecorder().record("init1");
+ System.out.println("Lifecycle1.init()");
}
@@ -67,6 +68,7 @@
@Preprocess
public void preprocess() {
getRecorder().record("preprocess1");
+ System.out.println("Lifecycle1.preprocess()");
}
@@ -76,6 +78,7 @@
@Prerender
public void prerender() {
getRecorder().record("prerender1");
+ System.out.println("Lifecycle1.prerender()");
}
@@ -85,6 +88,7 @@
@Destroy
public void destroy() {
getRecorder().record("destroy1");
+ System.out.println("Lifecycle1.destroy()");
}
Modified:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle2.java
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle2.java?view=diff&rev=489925&r1=489924&r2=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle2.java
(original)
+++
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Lifecycle2.java
Sat Dec 23 12:51:40 2006
@@ -58,6 +58,7 @@
@Init
public void init() {
getRecorder().record("init2");
+ System.out.println("Lifecycle2.init()");
}
@@ -67,6 +68,7 @@
@Preprocess
public void preprocess() {
getRecorder().record("preprocess2");
+ System.out.println("Lifecycle2.preprocess()");
}
@@ -76,6 +78,7 @@
@Prerender
public void prerender() {
getRecorder().record("prerender2");
+ System.out.println("Lifecycle2.prerender()");
}
@@ -85,6 +88,7 @@
@Destroy
public void destroy() {
getRecorder().record("destroy2");
+ System.out.println("Lifecycle2.destroy()");
}
Added:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview3.java
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview3.java?view=auto&rev=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview3.java
(added)
+++
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview3.java
Sat Dec 23 12:51:40 2006
@@ -0,0 +1,106 @@
+/*
+ * 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. This is different from
+ * the use case tested by Nonview1 and Nonview2, because Nonview4 will not be
+ * registered with a ViewControllerMapper compatible name.</p>
+ */
[EMAIL PROTECTED](name="nonview3", scope=Scope.REQUEST) @View
+public class Nonview3 {
+
+
+ // -------------------------------------------------------------
Constructor
+
+
+ /** Construct an uninitialized instance. */
+ public Nonview3() {
+ System.out.println("Nonview3.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("init3");
+ System.out.println("Nonview3.init()");
+ }
+
+
+ /**
+ * <p>Record a preprocess event.</p>
+ */
+ @Preprocess
+ public void preprocess() {
+ getRecorder().record("preprocess3");
+ System.out.println("Nonview3.preprocess()");
+ }
+
+
+ /**
+ * <p>Record a prerender event.</p>
+ */
+ @Prerender
+ public void prerender() {
+ getRecorder().record("prerender3");
+ System.out.println("Nonview3.prerender()");
+ }
+
+
+ /**
+ * <p>Record a destroy event.</p>
+ */
+ @Destroy
+ public void destroy() {
+ getRecorder().record("destroy3");
+ System.out.println("Nonview3.destroy()");
+ }
+
+
+}
Propchange:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview3.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview3.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/Nonview4.java
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview4.java?view=auto&rev=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview4.java
(added)
+++
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview4.java
Sat Dec 23 12:51:40 2006
@@ -0,0 +1,51 @@
+/*
+ * 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. This bean is *not*
+ * registered with a ViewControllerMapper compatible managed bean name.</p>
+ */
+public class Nonview4 {
+
+
+ // -------------------------------------------------------------
Constructor
+
+
+ /** Construct an uninitialized instance. */
+ public Nonview4() {
+ System.out.println("Nonview4.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/Nonview4.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/java/org/apache/shale/examples/test/tiger/Nonview4.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=489925&r1=489924&r2=489925
==============================================================================
---
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
Sat Dec 23 12:51:40 2006
@@ -52,6 +52,10 @@
<to-view-id>/nonview2.jsp</to-view-id>
</navigation-case>
<navigation-case>
+ <from-outcome>nonview4</from-outcome>
+ <to-view-id>/nonview4.jsp</to-view-id>
+ </navigation-case>
+ <navigation-case>
<from-outcome>standard</from-outcome>
<to-view-id>/standard.jsp</to-view-id>
</navigation-case>
@@ -85,6 +89,21 @@
<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 "nonview3" is declared with annotations -->
+
+ <!-- Deliberate mismatch on name versus ViewcontrollerMapper compatible -->
+ <managed-bean>
+ <managed-bean-name>nonview4x</managed-bean-name>
+ <managed-bean-class>
+ org.apache.shale.examples.test.tiger.Nonview4
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
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=489925&r1=489924&r2=489925
==============================================================================
--- 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
Sat Dec 23 12:51:40 2006
@@ -36,6 +36,7 @@
<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="nonview3.faces">Navigate to Non-ViewController Page
2</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/nonview3.jsp
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview3.jsp?view=auto&rev=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview3.jsp
(added)
+++
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview3.jsp
Sat Dec 23 12:51:40 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 2 (Page 1)</title>
+</head>
+<body>
+
+ <h3>Non-ViewController Navigation Test 2 (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="#{nonview3.recorder.events}"/></td>
+ </tr>
+ </table>
+
+ <h:form id="form">
+ <h:commandLink id="navigate" value="Navigate" action="nonview4"/>
+ </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
+ "init3/prerender3/". When you press the Navigate button, you
+ should advance to page 2, where the event listing should be
+ "init3/preprocess3/" because the second page does not have a
+ ViewControllerMapper compatible managed bean name.</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/nonview3.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview3.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview4.jsp
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview4.jsp?view=auto&rev=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview4.jsp
(added)
+++
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview4.jsp
Sat Dec 23 12:51:40 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 2 (Page 2)</title>
+</head>
+<body>
+
+ <h3>Non-ViewController Navigation Test 2 (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="#{nonview4x.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
+ "init3/prerender3/". When you press the Navigate button, you
+ should advance to page 2, where the event listing should be
+ "init3/preprocess3/" because the second page does not have a
+ ViewControllerMapper compatible managed bean name.</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/nonview4.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
shale/framework/trunk/shale-apps/shale-test-tiger/src/main/webapp/nonview4.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=489925&r1=489924&r2=489925
==============================================================================
---
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
Sat Dec 23 12:51:40 2006
@@ -288,6 +288,36 @@
}
+ // Test /nonview3.jsp and /nonview4.jsp
+ public void testNonview2() throws Exception {
+
+ HtmlElement element;
+ page("/nonview3.faces");
+ assertEquals("Non-ViewController Navigation Test 2 (Page 1)", title());
+
+ // Validate values for initial non-postback call
+
+ element = element("recorderEvents");
+ assertNotNull(element);
+ assertEquals("init3/prerender3/", 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 2 (Page 2)", title());
+
+ element = element("recorderEvents");
+ assertNotNull(element);
+ assertEquals("init3/preprocess3/", 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/Nonview3.java
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview3.java?view=auto&rev=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview3.java
(added)
+++
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview3.java
Sat Dec 23 12:51:40 2006
@@ -0,0 +1,94 @@
+/*
+ * 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. This is different
+ * from the use case represented by Nonview1 and Nonview2, because our
+ * destination (Nonview4) will not be registered as a managed bean with
+ * a ViewControllerMapper compatible name at all.</p>
+ */
+public class Nonview3 extends AbstractViewController {
+
+
+ // -------------------------------------------------------------
Constructor
+
+
+ /** Construct an uninitialized instance. */
+ public Nonview3() {
+ System.out.println("Nonview3.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("init3");
+ System.out.println("Nonview3.init()");
+ }
+
+
+ /**
+ * <p>Record a preprocess event.</p>
+ */
+ public void preprocess() {
+ getRecorder().record("preprocess3");
+ System.out.println("Nonview3.preprocess()");
+ }
+
+
+ /**
+ * <p>Record a prerender event.</p>
+ */
+ public void prerender() {
+ getRecorder().record("prerender3");
+ System.out.println("Nonview3.prerender()");
+ }
+
+
+ /**
+ * <p>Record a destroy event.</p>
+ */
+ public void destroy() {
+ getRecorder().record("destroy3");
+ System.out.println("Nonview3.destroy()");
+ }
+
+
+}
Propchange:
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview3.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview3.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/Nonview4.java
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview4.java?view=auto&rev=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview4.java
(added)
+++
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview4.java
Sat Dec 23 12:51:40 2006
@@ -0,0 +1,52 @@
+/*
+ * 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. This bean will
+ * <strong>not</strong> be registered with a ViewControllerMapper compatible
+ * managed bean name.</p>
+ */
+public class Nonview4 {
+
+
+ // -------------------------------------------------------------
Constructor
+
+
+ /** Construct an uninitialized instance. */
+ public Nonview4() {
+ System.out.println("Nonview4.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/Nonview4.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
shale/framework/trunk/shale-apps/shale-test-view/src/main/java/org/apache/shale/examples/test/view/Nonview4.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=489925&r1=489924&r2=489925
==============================================================================
---
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
Sat Dec 23 12:51:40 2006
@@ -44,6 +44,10 @@
<to-view-id>/nonview2.jsp</to-view-id>
</navigation-case>
<navigation-case>
+ <from-outcome>nonview4</from-outcome>
+ <to-view-id>/nonview4.jsp</to-view-id>
+ </navigation-case>
+ <navigation-case>
<from-outcome>standard</from-outcome>
<to-view-id>/standard.jsp</to-view-id>
</navigation-case>
@@ -100,6 +104,31 @@
<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>
+ <property-name>recorder</property-name>
+ <value>#{recorder}</value>
+ </managed-property>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>nonview3</managed-bean-name>
+ <managed-bean-class>
+ org.apache.shale.examples.test.view.Nonview3
+ </managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>recorder</property-name>
+ <value>#{recorder}</value>
+ </managed-property>
+ </managed-bean>
+
+ <!-- nonview4 is explicitly *not* registered with a compatible name -->
+ <managed-bean>
+ <managed-bean-name>nonview4x</managed-bean-name>
+ <managed-bean-class>
+ org.apache.shale.examples.test.view.Nonview4
</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=489925&r1=489924&r2=489925
==============================================================================
--- 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
Sat Dec 23 12:51:40 2006
@@ -34,6 +34,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="nonview3.faces">Navigate to Non-ViewController Page
(2)</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/nonview3.jsp
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview3.jsp?view=auto&rev=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview3.jsp
(added)
+++
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview3.jsp
Sat Dec 23 12:51:40 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 2 (Page 1)</title>
+</head>
+<body>
+
+ <h3>Non-ViewController Navigation Test 2 (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="#{nonview3.recorder.events}"/></td>
+ </tr>
+ </table>
+
+ <h:form id="form">
+ <h:commandLink id="navigate" value="Navigate" action="nonview4"/>
+ </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
+ "init3/prerender3/". When you press the Navigate button, you
+ should advance to page 2, where the event listing should be
+ "init3/preprocess3/" because the second page does not have a
+ ViewControllerMapper compatible backing bean name.</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/nonview3.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview3.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added:
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview4.jsp
URL:
http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview4.jsp?view=auto&rev=489925
==============================================================================
---
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview4.jsp
(added)
+++
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview4.jsp
Sat Dec 23 12:51:40 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 2 (Page 2)</title>
+</head>
+<body>
+
+ <h3>Non-ViewController Navigation Test 2 (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="#{nonview4x.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
+ "init3/prerender3/". When you press the Navigate button, you
+ should advance to page 2, where the event listing should be
+ "init3/preprocess3/" because the second page does not have a
+ ViewControllerMapper compatible backing bean name.</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/nonview4.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
shale/framework/trunk/shale-apps/shale-test-view/src/main/webapp/nonview4.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=489925&r1=489924&r2=489925
==============================================================================
---
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
Sat Dec 23 12:51:40 2006
@@ -153,6 +153,36 @@
}
+ // Test /nonview3.jsp and /nonview4.jsp
+ public void testNonview2() throws Exception {
+
+ HtmlElement element;
+ page("/nonview3.faces");
+ assertEquals("Non-ViewController Navigation Test 2 (Page 1)", title());
+
+ // Validate values for initial non-postback call
+
+ element = element("recorderEvents");
+ assertNotNull(element);
+ assertEquals("init3/prerender3/", 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 2 (Page 2)", title());
+
+ element = element("recorderEvents");
+ assertNotNull(element);
+ assertEquals("init3/preprocess3/", element.asText());
+
+ }
+
+
// Test /standard.jsp
public void testStandard() throws Exception {