You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by ws...@apache.org on 2006/05/22 06:10:44 UTC
svn commit: r408564 [2/2] - in /struts/shale/trunk/tiger/src:
java/org/apache/shale/tiger/view/ java/org/apache/shale/tiger/view/faces/
test/org/apache/shale/tiger/view/faces/
Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/LifecycleListener2TestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/LifecycleListener2TestCase.java?rev=408564&r1=408563&r2=408564&view=diff
==============================================================================
--- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/LifecycleListener2TestCase.java (original)
+++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/LifecycleListener2TestCase.java Sun May 21 21:10:43 2006
@@ -1,183 +1,183 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-package org.apache.shale.tiger.view.faces;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.view.faces.LifecycleListener;
-
-/**
- * <p>Test case for <code>org.apache.shale.tiger.view.faces.LifecycleListener</code>.</p>
- */
-public class LifecycleListener2TestCase extends AbstractJsfTestCase {
-
-
- // ------------------------------------------------------------ Constructors
-
-
- // Construct a new instance of this test case.
- public LifecycleListener2TestCase(String name) {
- super(name);
- }
-
-
- // ---------------------------------------------------- Overall Test Methods
-
-
- // Set up instance variables required by this test case.
- public void setUp() {
-
- super.setUp();
-
- // Set up our listener and bind it to context/session/request objects
- listener = new LifecycleListener();
- servletContext.addAttributeListener(listener);
- session.addAttributeListener(listener);
- request.addAttributeListener(listener);
-
- }
-
-
- // Return the tests included in this test case.
- public static Test suite() {
-
- return (new TestSuite(LifecycleListener2TestCase.class));
-
- }
-
-
- // Tear down instance variables required by this test case.
- public void tearDown() {
-
-// callbacks = null;
- lifecycle = null;
-
- super.tearDown();
-
- }
-
-
- // ------------------------------------------------------ Instance Variables
-
-
- private LifecycleListener listener = null;
-
-
- // ------------------------------------------------------------ Test Methods
-
-
- // Test standard application bean
- public void testApplicationBean1() {
-
- ApplicationBean1 bean = new ApplicationBean1();
- assertEquals("", bean.log());
- servletContext.setAttribute("bean", bean);
- assertEquals("init/", bean.log());
- servletContext.setAttribute("bean", bean);
- assertEquals("init/destroy/init/", bean.log());
- servletContext.removeAttribute("bean");
- assertEquals("init/destroy/init/destroy/", bean.log());
-
- }
-
-
- // Test annotated application bean
- public void testApplicationBean2() {
-
- ApplicationBean2 bean = new ApplicationBean2();
- assertEquals("", bean.log());
- servletContext.setAttribute("bean", bean);
- assertEquals("init/", bean.log());
- servletContext.setAttribute("bean", bean);
- assertEquals("init/destroy/init/", bean.log());
- servletContext.removeAttribute("bean");
- assertEquals("init/destroy/init/destroy/", bean.log());
-
- }
-
-
- // Test a prisine instance
- public void testPristine() {
-
- ;
-
- }
-
-
- // Test standard request bean
- public void testRequestBean1() {
-
- RequestBean1 bean = new RequestBean1();
- assertEquals("", bean.log());
- request.setAttribute("bean", bean);
- assertEquals("init/", bean.log());
- request.setAttribute("bean", bean);
- assertEquals("init/destroy/init/", bean.log());
- request.removeAttribute("bean");
- assertEquals("init/destroy/init/destroy/", bean.log());
-
- }
-
-
- // Test annotated request bean
- public void testRequestBean2() {
-
- RequestBean2 bean = new RequestBean2();
- assertEquals("", bean.log());
- request.setAttribute("bean", bean);
- assertEquals("init/", bean.log());
- request.setAttribute("bean", bean);
- assertEquals("init/destroy/init/", bean.log());
- request.removeAttribute("bean");
- assertEquals("init/destroy/init/destroy/", bean.log());
-
- }
-
-
- // Test standard session bean
- public void testSessionBean1() {
-
- SessionBean1 bean = new SessionBean1();
- assertEquals("", bean.log());
- session.setAttribute("bean", bean);
- assertEquals("init/", bean.log());
- session.setAttribute("bean", bean);
- assertEquals("init/destroy/init/", bean.log());
- session.removeAttribute("bean");
- assertEquals("init/destroy/init/destroy/", bean.log());
-
- }
-
-
- // Test annotated session bean
- public void testSessionBean2() {
-
- SessionBean2 bean = new SessionBean2();
- assertEquals("", bean.log());
- session.setAttribute("bean", bean);
- assertEquals("init/", bean.log());
- session.setAttribute("bean", bean);
- assertEquals("init/destroy/init/", bean.log());
- session.removeAttribute("bean");
- assertEquals("init/destroy/init/destroy/", bean.log());
-
- }
-
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.shale.tiger.view.faces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.view.faces.LifecycleListener;
+
+/**
+ * <p>Test case for <code>org.apache.shale.tiger.view.faces.LifecycleListener</code>.</p>
+ */
+public class LifecycleListener2TestCase extends AbstractJsfTestCase {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ // Construct a new instance of this test case.
+ public LifecycleListener2TestCase(String name) {
+ super(name);
+ }
+
+
+ // ---------------------------------------------------- Overall Test Methods
+
+
+ // Set up instance variables required by this test case.
+ public void setUp() {
+
+ super.setUp();
+
+ // Set up our listener and bind it to context/session/request objects
+ listener = new LifecycleListener();
+ servletContext.addAttributeListener(listener);
+ session.addAttributeListener(listener);
+ request.addAttributeListener(listener);
+
+ }
+
+
+ // Return the tests included in this test case.
+ public static Test suite() {
+
+ return (new TestSuite(LifecycleListener2TestCase.class));
+
+ }
+
+
+ // Tear down instance variables required by this test case.
+ public void tearDown() {
+
+// callbacks = null;
+ lifecycle = null;
+
+ super.tearDown();
+
+ }
+
+
+ // ------------------------------------------------------ Instance Variables
+
+
+ private LifecycleListener listener = null;
+
+
+ // ------------------------------------------------------------ Test Methods
+
+
+ // Test standard application bean
+ public void testApplicationBean1() {
+
+ ApplicationBean1 bean = new ApplicationBean1();
+ assertEquals("", bean.log());
+ servletContext.setAttribute("bean", bean);
+ assertEquals("init/", bean.log());
+ servletContext.setAttribute("bean", bean);
+ assertEquals("init/destroy/init/", bean.log());
+ servletContext.removeAttribute("bean");
+ assertEquals("init/destroy/init/destroy/", bean.log());
+
+ }
+
+
+ // Test annotated application bean
+ public void testApplicationBean2() {
+
+ ApplicationBean2 bean = new ApplicationBean2();
+ assertEquals("", bean.log());
+ servletContext.setAttribute("bean", bean);
+ assertEquals("init/", bean.log());
+ servletContext.setAttribute("bean", bean);
+ assertEquals("init/destroy/init/", bean.log());
+ servletContext.removeAttribute("bean");
+ assertEquals("init/destroy/init/destroy/", bean.log());
+
+ }
+
+
+ // Test a prisine instance
+ public void testPristine() {
+
+ ;
+
+ }
+
+
+ // Test standard request bean
+ public void testRequestBean1() {
+
+ RequestBean1 bean = new RequestBean1();
+ assertEquals("", bean.log());
+ request.setAttribute("bean", bean);
+ assertEquals("init/", bean.log());
+ request.setAttribute("bean", bean);
+ assertEquals("init/destroy/init/", bean.log());
+ request.removeAttribute("bean");
+ assertEquals("init/destroy/init/destroy/", bean.log());
+
+ }
+
+
+ // Test annotated request bean
+ public void testRequestBean2() {
+
+ RequestBean2 bean = new RequestBean2();
+ assertEquals("", bean.log());
+ request.setAttribute("bean", bean);
+ assertEquals("init/", bean.log());
+ request.setAttribute("bean", bean);
+ assertEquals("init/destroy/init/", bean.log());
+ request.removeAttribute("bean");
+ assertEquals("init/destroy/init/destroy/", bean.log());
+
+ }
+
+
+ // Test standard session bean
+ public void testSessionBean1() {
+
+ SessionBean1 bean = new SessionBean1();
+ assertEquals("", bean.log());
+ session.setAttribute("bean", bean);
+ assertEquals("init/", bean.log());
+ session.setAttribute("bean", bean);
+ assertEquals("init/destroy/init/", bean.log());
+ session.removeAttribute("bean");
+ assertEquals("init/destroy/init/destroy/", bean.log());
+
+ }
+
+
+ // Test annotated session bean
+ public void testSessionBean2() {
+
+ SessionBean2 bean = new SessionBean2();
+ assertEquals("", bean.log());
+ session.setAttribute("bean", bean);
+ assertEquals("init/", bean.log());
+ session.setAttribute("bean", bean);
+ assertEquals("init/destroy/init/", bean.log());
+ session.removeAttribute("bean");
+ assertEquals("init/destroy/init/destroy/", bean.log());
+
+ }
+
+
+}
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/LifecycleListener2TestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/LifecycleListener2TestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean1.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean1.java?rev=408564&r1=408563&r2=408564&view=diff
==============================================================================
--- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean1.java (original)
+++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean1.java Sun May 21 21:10:43 2006
@@ -1,52 +1,52 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-package org.apache.shale.tiger.view.faces;
-
-import org.apache.shale.view.AbstractRequestBean;
-
-/**
- * <p>Test bean that subclasses <code>AbstractRequestBean</code> so we can
- * test pass-through calls to "regular" bean instances.</p>
- */
-public class RequestBean1 extends AbstractRequestBean {
-
-
- private StringBuffer sb = new StringBuffer();
-
-
- // -------------------------------------------------------- Callback Methods
-
-
- public void init() {
- sb.append("init/");
- }
-
-
- public void destroy() {
- sb.append("destroy/");
- }
-
-
- // ---------------------------------------------------------- Public Methods
-
-
- public String log() {
- return sb.toString();
- }
-
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.shale.tiger.view.faces;
+
+import org.apache.shale.view.AbstractRequestBean;
+
+/**
+ * <p>Test bean that subclasses <code>AbstractRequestBean</code> so we can
+ * test pass-through calls to "regular" bean instances.</p>
+ */
+public class RequestBean1 extends AbstractRequestBean {
+
+
+ private StringBuffer sb = new StringBuffer();
+
+
+ // -------------------------------------------------------- Callback Methods
+
+
+ public void init() {
+ sb.append("init/");
+ }
+
+
+ public void destroy() {
+ sb.append("destroy/");
+ }
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public String log() {
+ return sb.toString();
+ }
+
+
+}
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean1.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean1.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean2.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean2.java?rev=408564&r1=408563&r2=408564&view=diff
==============================================================================
--- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean2.java (original)
+++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean2.java Sun May 21 21:10:43 2006
@@ -1,57 +1,57 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-package org.apache.shale.tiger.view.faces;
-
-import org.apache.shale.tiger.view.Destroy;
-import org.apache.shale.tiger.view.Init;
-import org.apache.shale.tiger.view.Request;
-
-/**
- * <p>Test bean that does not subclass <code>AbstractRequestBean</code>,
- * but uses corresponding annotations, so that we can test callback events.</p>
- */
-@Request
-public class RequestBean2 {
-
-
- private StringBuffer sb = new StringBuffer();
-
-
- // -------------------------------------------------------- Callback Methods
-
-
- @Init
- public void doInit() {
- sb.append("init/");
- }
-
-
- @Destroy
- public void doDestroy() {
- sb.append("destroy/");
- }
-
-
- // ---------------------------------------------------------- Public Methods
-
-
- public String log() {
- return sb.toString();
- }
-
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.shale.tiger.view.faces;
+
+import org.apache.shale.tiger.view.Destroy;
+import org.apache.shale.tiger.view.Init;
+import org.apache.shale.tiger.view.Request;
+
+/**
+ * <p>Test bean that does not subclass <code>AbstractRequestBean</code>,
+ * but uses corresponding annotations, so that we can test callback events.</p>
+ */
+@Request
+public class RequestBean2 {
+
+
+ private StringBuffer sb = new StringBuffer();
+
+
+ // -------------------------------------------------------- Callback Methods
+
+
+ @Init
+ public void doInit() {
+ sb.append("init/");
+ }
+
+
+ @Destroy
+ public void doDestroy() {
+ sb.append("destroy/");
+ }
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public String log() {
+ return sb.toString();
+ }
+
+
+}
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/RequestBean2.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean1.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean1.java?rev=408564&r1=408563&r2=408564&view=diff
==============================================================================
--- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean1.java (original)
+++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean1.java Sun May 21 21:10:43 2006
@@ -1,52 +1,52 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-package org.apache.shale.tiger.view.faces;
-
-import org.apache.shale.view.AbstractSessionBean;
-
-/**
- * <p>Test bean that subclasses <code>AbstractSessionBean</code> so we can
- * test pass-through calls to "regular" bean instances.</p>
- */
-public class SessionBean1 extends AbstractSessionBean {
-
-
- private StringBuffer sb = new StringBuffer();
-
-
- // -------------------------------------------------------- Callback Methods
-
-
- public void init() {
- sb.append("init/");
- }
-
-
- public void destroy() {
- sb.append("destroy/");
- }
-
-
- // ---------------------------------------------------------- Public Methods
-
-
- public String log() {
- return sb.toString();
- }
-
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.shale.tiger.view.faces;
+
+import org.apache.shale.view.AbstractSessionBean;
+
+/**
+ * <p>Test bean that subclasses <code>AbstractSessionBean</code> so we can
+ * test pass-through calls to "regular" bean instances.</p>
+ */
+public class SessionBean1 extends AbstractSessionBean {
+
+
+ private StringBuffer sb = new StringBuffer();
+
+
+ // -------------------------------------------------------- Callback Methods
+
+
+ public void init() {
+ sb.append("init/");
+ }
+
+
+ public void destroy() {
+ sb.append("destroy/");
+ }
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public String log() {
+ return sb.toString();
+ }
+
+
+}
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean1.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean1.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean2.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean2.java?rev=408564&r1=408563&r2=408564&view=diff
==============================================================================
--- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean2.java (original)
+++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean2.java Sun May 21 21:10:43 2006
@@ -1,57 +1,57 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-package org.apache.shale.tiger.view.faces;
-
-import org.apache.shale.tiger.view.Destroy;
-import org.apache.shale.tiger.view.Init;
-import org.apache.shale.tiger.view.Session;
-
-/**
- * <p>Test bean that does not subclass <code>AbstractSessionBean</code>,
- * but uses corresponding annotations, so that we can test callback events.</p>
- */
-@Session
-public class SessionBean2 {
-
-
- private StringBuffer sb = new StringBuffer();
-
-
- // -------------------------------------------------------- Callback Methods
-
-
- @Init
- public void doInit() {
- sb.append("init/");
- }
-
-
- @Destroy
- public void doDestroy() {
- sb.append("destroy/");
- }
-
-
- // ---------------------------------------------------------- Public Methods
-
-
- public String log() {
- return sb.toString();
- }
-
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.shale.tiger.view.faces;
+
+import org.apache.shale.tiger.view.Destroy;
+import org.apache.shale.tiger.view.Init;
+import org.apache.shale.tiger.view.Session;
+
+/**
+ * <p>Test bean that does not subclass <code>AbstractSessionBean</code>,
+ * but uses corresponding annotations, so that we can test callback events.</p>
+ */
+@Session
+public class SessionBean2 {
+
+
+ private StringBuffer sb = new StringBuffer();
+
+
+ // -------------------------------------------------------- Callback Methods
+
+
+ @Init
+ public void doInit() {
+ sb.append("init/");
+ }
+
+
+ @Destroy
+ public void doDestroy() {
+ sb.append("destroy/");
+ }
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public String log() {
+ return sb.toString();
+ }
+
+
+}
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/SessionBean2.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/TestViewController.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/TestViewController.java?rev=408564&r1=408563&r2=408564&view=diff
==============================================================================
--- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/TestViewController.java (original)
+++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/TestViewController.java Sun May 21 21:10:43 2006
@@ -1,55 +1,55 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-package org.apache.shale.tiger.view.faces;
-
-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;
-import org.apache.shale.view.ViewController;
-
-/**
- * <p>Test implementation of a view controller that is marked
- * with annotations, rather than implementing the
- * <code>ViewController</code> interface directly.</p>
- */
-@View public class TestViewController {
-
- private StringBuffer sb = new StringBuffer();
-
- @Prerender public void doPrerender() {
- sb.append("prerender/");
- }
-
- @Preprocess public void doPreprocess() {
- sb.append("preprocess/");
- }
-
- @Destroy public void doDestroy() {
- sb.append("destroy/");
- }
-
- @Init public void doInit() {
- sb.append("init/");
- }
-
- public String log() {
- return sb.toString();
- }
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.shale.tiger.view.faces;
+
+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;
+import org.apache.shale.view.ViewController;
+
+/**
+ * <p>Test implementation of a view controller that is marked
+ * with annotations, rather than implementing the
+ * <code>ViewController</code> interface directly.</p>
+ */
+@View public class TestViewController {
+
+ private StringBuffer sb = new StringBuffer();
+
+ @Prerender public void doPrerender() {
+ sb.append("prerender/");
+ }
+
+ @Preprocess public void doPreprocess() {
+ sb.append("preprocess/");
+ }
+
+ @Destroy public void doDestroy() {
+ sb.append("destroy/");
+ }
+
+ @Init public void doInit() {
+ sb.append("init/");
+ }
+
+ public String log() {
+ return sb.toString();
+ }
+
+}
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/TestViewController.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/TestViewController.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2TestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2TestCase.java?rev=408564&r1=408563&r2=408564&view=diff
==============================================================================
--- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2TestCase.java (original)
+++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2TestCase.java Sun May 21 21:10:43 2006
@@ -1,97 +1,97 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed 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.
- */
-
-package org.apache.shale.tiger.view.faces;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * <p>Test case for <code>org.apache.shale.tiger.view.faces.ViewControllerCallbacks2</code>.</p>
- */
-public class ViewControllerCallbacks2TestCase extends TestCase {
-
-
- // ------------------------------------------------------------ Constructors
-
-
- // Construct a new instance of this test case.
- public ViewControllerCallbacks2TestCase(String name) {
- super(name);
- }
-
-
- // ---------------------------------------------------- Overall Test Methods
-
-
- // Set up instance variables required by this test case.
- public void setUp() {
-
- callbacks = new ViewControllerCallbacks2();
-
- }
-
-
- // Return the tests included in this test case.
- public static Test suite() {
-
- return (new TestSuite(ViewControllerCallbacks2TestCase.class));
-
- }
-
-
- // Tear down instance variables required by this test case.
- public void tearDown() {
-
- callbacks = null;
-
- }
-
-
- // ------------------------------------------------------ Instance Variables
-
-
- private ViewControllerCallbacks2 callbacks = null;
-
-
- // ------------------------------------------------------------ Test Methods
-
-
-
- // Test a prisine instance
- public void testPristine() {
-
- ;
-
- }
-
-
- // Test calling all of the appropriate methods in order
- public void testViewControllerCallbacks() {
-
- TestViewController tvc = new TestViewController();
- callbacks.init(tvc);
- callbacks.preprocess(tvc);
- callbacks.prerender(tvc);
- callbacks.destroy(tvc);
- assertEquals("init/preprocess/prerender/destroy/",
- tvc.log());
-
- }
-
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+package org.apache.shale.tiger.view.faces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * <p>Test case for <code>org.apache.shale.tiger.view.faces.ViewControllerCallbacks2</code>.</p>
+ */
+public class ViewControllerCallbacks2TestCase extends TestCase {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ // Construct a new instance of this test case.
+ public ViewControllerCallbacks2TestCase(String name) {
+ super(name);
+ }
+
+
+ // ---------------------------------------------------- Overall Test Methods
+
+
+ // Set up instance variables required by this test case.
+ public void setUp() {
+
+ callbacks = new ViewControllerCallbacks2();
+
+ }
+
+
+ // Return the tests included in this test case.
+ public static Test suite() {
+
+ return (new TestSuite(ViewControllerCallbacks2TestCase.class));
+
+ }
+
+
+ // Tear down instance variables required by this test case.
+ public void tearDown() {
+
+ callbacks = null;
+
+ }
+
+
+ // ------------------------------------------------------ Instance Variables
+
+
+ private ViewControllerCallbacks2 callbacks = null;
+
+
+ // ------------------------------------------------------------ Test Methods
+
+
+
+ // Test a prisine instance
+ public void testPristine() {
+
+ ;
+
+ }
+
+
+ // Test calling all of the appropriate methods in order
+ public void testViewControllerCallbacks() {
+
+ TestViewController tvc = new TestViewController();
+ callbacks.init(tvc);
+ callbacks.preprocess(tvc);
+ callbacks.prerender(tvc);
+ callbacks.destroy(tvc);
+ assertEquals("init/preprocess/prerender/destroy/",
+ tvc.log());
+
+ }
+
+
+}
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2TestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2TestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL