You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2006/08/01 19:44:01 UTC
svn commit: r427657 [2/42] - in /myfaces:
core/trunk/api/src/main/java/javax/faces/component/
core/trunk/api/src/test/java/javax/faces/
core/trunk/api/src/test/java/javax/faces/application/
core/trunk/api/src/test/java/javax/faces/component/ core/trunk...
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/_PrimitiveArrayIterator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/_PrimitiveArrayIterator.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/_PrimitiveArrayIterator.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/_PrimitiveArrayIterator.java Tue Aug 1 10:43:28 2006
@@ -1,56 +1,56 @@
-/*
- * Copyright 2004 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 javax.faces.component;
-
-import java.lang.reflect.Array;
-import java.util.Iterator;
-
-/**
- * This utility iterator uses reflection to iterate over primitive arrays.
- */
-class _PrimitiveArrayIterator implements Iterator
-{
- public _PrimitiveArrayIterator(Object primitiveArray)
- {
- if (primitiveArray == null ||
- !primitiveArray.getClass().isArray())
- {
- throw new IllegalArgumentException("Requires a primitive array");
- }
-
- _primitiveArray = primitiveArray;
- _size = Array.getLength(primitiveArray);
- }
-
- public boolean hasNext()
- {
- return (_position < _size);
- }
-
- public Object next()
- {
- return Array.get(_primitiveArray, _position++);
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
-
- private Object _primitiveArray;
- private int _size;
- private int _position;
-}
+/*
+ * Copyright 2004 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 javax.faces.component;
+
+import java.lang.reflect.Array;
+import java.util.Iterator;
+
+/**
+ * This utility iterator uses reflection to iterate over primitive arrays.
+ */
+class _PrimitiveArrayIterator implements Iterator
+{
+ public _PrimitiveArrayIterator(Object primitiveArray)
+ {
+ if (primitiveArray == null ||
+ !primitiveArray.getClass().isArray())
+ {
+ throw new IllegalArgumentException("Requires a primitive array");
+ }
+
+ _primitiveArray = primitiveArray;
+ _size = Array.getLength(primitiveArray);
+ }
+
+ public boolean hasNext()
+ {
+ return (_position < _size);
+ }
+
+ public Object next()
+ {
+ return Array.get(_primitiveArray, _position++);
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ private Object _primitiveArray;
+ private int _size;
+ private int _position;
+}
Propchange: myfaces/core/trunk/api/src/main/java/javax/faces/component/_PrimitiveArrayIterator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/FacesExceptionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/FactoryFinderTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/api/src/test/java/javax/faces/Messages_xx_TEST.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/test/java/javax/faces/Messages_xx_TEST.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/test/java/javax/faces/Messages_xx_TEST.java (original)
+++ myfaces/core/trunk/api/src/test/java/javax/faces/Messages_xx_TEST.java Tue Aug 1 10:43:28 2006
@@ -1,32 +1,32 @@
-/*
- * Copyright 2004 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 javax.faces;
-
-import java.util.ListResourceBundle;
-import javax.faces.component.UIInput;
-
-public class Messages_xx_TEST extends ListResourceBundle
-{
- protected Object[][] getContents()
- {
- return _CONTENTS;
- }
-
- private static final Object[][] _CONTENTS = {
- {UIInput.REQUIRED_MESSAGE_ID, "Required value not found for component with id {0}"},
- };
-
-}
+/*
+ * Copyright 2004 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 javax.faces;
+
+import java.util.ListResourceBundle;
+import javax.faces.component.UIInput;
+
+public class Messages_xx_TEST extends ListResourceBundle
+{
+ protected Object[][] getContents()
+ {
+ return _CONTENTS;
+ }
+
+ private static final Object[][] _CONTENTS = {
+ {UIInput.REQUIRED_MESSAGE_ID, "Required value not found for component with id {0}"},
+ };
+
+}
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/Messages_xx_TEST.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/application/FacesMessageTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/application/StateManagerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/api/src/test/java/javax/faces/component/UIComponentBaseTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/test/java/javax/faces/component/UIComponentBaseTest.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/test/java/javax/faces/component/UIComponentBaseTest.java (original)
+++ myfaces/core/trunk/api/src/test/java/javax/faces/component/UIComponentBaseTest.java Tue Aug 1 10:43:28 2006
@@ -1,435 +1,435 @@
-/*
- * Copyright 2004-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 javax.faces.component;
-
-import javax.faces.el.ValueBinding;
-
-import junit.framework.Test;
-
-import org.apache.shale.test.base.AbstractJsfTestCase;
-import org.apache.shale.test.mock.MockRenderKitFactory;
-import org.apache.shale.test.mock.MockValueBinding;
-
-public class UIComponentBaseTest extends AbstractJsfTestCase {
- private UIComponentBase mock = null;
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(UIComponentBaseTest.class);
- }
-
- public UIComponentBaseTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return null; // keep this method or maven won't run it
- }
-
- public void setUp() {
- super.setUp();
- // TODO remove this line once shale-test goes alpha, see MYFACES-1155
- facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
- mock = new UIComponentMock();
- }
-
- public void tearDown() {
- super.tearDown();
- mock = null;
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.isRendered()'
- */
- public void testIsRendered() {
- // defaults to true
- assertTrue(mock.isRendered());
- }
-
- public void testIsRenderedValueSet() {
- mock.setRendered(true);
- assertTrue(mock.isRendered());
- mock.setRendered(false);
- assertFalse(mock.isRendered());
- }
-
- public void testIsRenderedBinding() {
-
- ValueBinding vb = new MockValueBinding(application,
- "#{requestScope.foo}");
- externalContext.getRequestMap().put("foo", new Boolean(false));
-
- mock.setValueBinding("rendered", vb);
- assertFalse(mock.isRendered());
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getRendersChildren()'
- */
- public void testGetRendersChildren() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getChildCount()'
- */
- public void testGetChildCount() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.UIComponentBase()'
- */
- public void testUIComponentBase() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getAttributes()'
- */
- public void testGetAttributes() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getValueBinding(String)'
- */
- public void testGetValueBindingString() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.setValueBinding(String, ValueBinding)'
- */
- public void testSetValueBindingStringValueBinding() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getClientId(FacesContext)'
- */
- public void testGetClientIdFacesContext() {
-
- UIInput input = createInputInTree();
-
- String str = input.getClientId(facesContext);
-
- assertEquals(str, "data:input");
-
- UIData uiData = (UIData) input.getParent().getParent();
-
- uiData.setRowIndex(1);
-
- str = input.getClientId(facesContext);
- }
-
- private UIInput createInputInTree() {
- UIViewRoot viewRoot = facesContext.getViewRoot();
- viewRoot.setId("root");
-
- UIData uiData = new UIData();
- uiData.setId("data");
-
- UIColumn column = new UIColumn();
-
- uiData.getChildren().add(column);
-
- UIInput input = new UIInput();
- input.setId("input");
-
- column.getChildren().add(input);
-
- viewRoot.getChildren().add(uiData);
-
- return input;
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getId()'
- */
- public void testGetId() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.setId(String)'
- */
- public void testSetIdString() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getParent()'
- */
- public void testGetParent() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.setParent(UIComponent)'
- */
- public void testSetParentUIComponent() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getChildren()'
- */
- public void testGetChildren() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.findComponent(String)'
- */
- public void testFindComponentString() {
-
- UIInput input = createInputInTree();
-
- UIComponent comp = input.findComponent(":data:input");
-
- assertEquals(input, comp);
-
- comp = input.findComponent("input");
-
- assertEquals(input, comp);
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getFacets()'
- */
- public void testGetFacets() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getFacet(String)'
- */
- public void testGetFacetString() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getFacetsAndChildren()'
- */
- public void testGetFacetsAndChildren() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.broadcast(FacesEvent)'
- */
- public void testBroadcastFacesEvent() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.decode(FacesContext)'
- */
- public void testDecodeFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.encodeBegin(FacesContext)'
- */
- public void testEncodeBeginFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.encodeChildren(FacesContext)'
- */
- public void testEncodeChildrenFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.encodeEnd(FacesContext)'
- */
- public void testEncodeEndFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.addFacesListener(FacesListener)'
- */
- public void testAddFacesListenerFacesListener() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getFacesListeners(Class)'
- */
- public void testGetFacesListenersClass() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.removeFacesListener(FacesListener)'
- */
- public void testRemoveFacesListenerFacesListener() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.queueEvent(FacesEvent)'
- */
- public void testQueueEventFacesEvent() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.processDecodes(FacesContext)'
- */
- public void testProcessDecodesFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.processValidators(FacesContext)'
- */
- public void testProcessValidatorsFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.processUpdates(FacesContext)'
- */
- public void testProcessUpdatesFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.processSaveState(FacesContext)'
- */
- public void testProcessSaveStateFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.processRestoreState(FacesContext, Object)'
- */
- public void testProcessRestoreStateFacesContextObject() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getFacesContext()'
- */
- public void testGetFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getRenderer(FacesContext)'
- */
- public void testGetRendererFacesContext() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getPathToComponent(UIComponent)'
- */
- public void testGetPathToComponent() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.isTransient()'
- */
- public void testIsTransient() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.setTransient(boolean)'
- */
- public void testSetTransient() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.saveAttachedState(FacesContext, Object)'
- */
- public void testSaveAttachedState() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.restoreAttachedState(FacesContext, Object)'
- */
- public void testRestoreAttachedState() {
-
- }
-
- public void testSaveState() throws Exception {
-
- try {
- String id = "id";
- String rendererType = "Whumpy";
- mock.setId(id);
- mock.setRendered(true);
- mock.setRendererType(rendererType);
- Object value[] = (Object[]) mock.saveState(facesContext);
- assertEquals(id, value[0]);
- assertEquals(Boolean.TRUE, value[1]);
- assertEquals(rendererType, value[2]);
-
- assertNull(value[3]);
- assertNull(value[4]);
- assertNull(value[5]);
- assertNull(value[6]);
- } catch (NullPointerException e) {
- fail("Should not throw an exception");
- }
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.restoreState(FacesContext, Object)'
- */
- public void testRestoreState() {
-
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.setRendererType(String)'
- */
- public void testSetRendererType() {
- assertNull(mock.getRendererType());
- }
-
- public void testSetRendererTypeStringValue() {
- String rendererType = "BlueBlorf";
- mock.setRendererType(rendererType);
- assertEquals(mock.getRendererType(), rendererType);
- }
-
- public void testSetRendererTypeStringBinding() {
-
- String whumpy = "Whumpy";
-
- ValueBinding vb = new MockValueBinding(application,
- "#{requestScope.foo}");
- externalContext.getRequestMap().put("foo", whumpy);
-
- mock.setValueBinding("rendererType", vb);
- assertEquals(mock.getRendererType(), whumpy);
-
- }
-
-}
+/*
+ * Copyright 2004-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 javax.faces.component;
+
+import javax.faces.el.ValueBinding;
+
+import junit.framework.Test;
+
+import org.apache.shale.test.base.AbstractJsfTestCase;
+import org.apache.shale.test.mock.MockRenderKitFactory;
+import org.apache.shale.test.mock.MockValueBinding;
+
+public class UIComponentBaseTest extends AbstractJsfTestCase {
+ private UIComponentBase mock = null;
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(UIComponentBaseTest.class);
+ }
+
+ public UIComponentBaseTest(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ return null; // keep this method or maven won't run it
+ }
+
+ public void setUp() {
+ super.setUp();
+ // TODO remove this line once shale-test goes alpha, see MYFACES-1155
+ facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
+ mock = new UIComponentMock();
+ }
+
+ public void tearDown() {
+ super.tearDown();
+ mock = null;
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.isRendered()'
+ */
+ public void testIsRendered() {
+ // defaults to true
+ assertTrue(mock.isRendered());
+ }
+
+ public void testIsRenderedValueSet() {
+ mock.setRendered(true);
+ assertTrue(mock.isRendered());
+ mock.setRendered(false);
+ assertFalse(mock.isRendered());
+ }
+
+ public void testIsRenderedBinding() {
+
+ ValueBinding vb = new MockValueBinding(application,
+ "#{requestScope.foo}");
+ externalContext.getRequestMap().put("foo", new Boolean(false));
+
+ mock.setValueBinding("rendered", vb);
+ assertFalse(mock.isRendered());
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getRendersChildren()'
+ */
+ public void testGetRendersChildren() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getChildCount()'
+ */
+ public void testGetChildCount() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.UIComponentBase()'
+ */
+ public void testUIComponentBase() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getAttributes()'
+ */
+ public void testGetAttributes() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getValueBinding(String)'
+ */
+ public void testGetValueBindingString() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.setValueBinding(String, ValueBinding)'
+ */
+ public void testSetValueBindingStringValueBinding() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getClientId(FacesContext)'
+ */
+ public void testGetClientIdFacesContext() {
+
+ UIInput input = createInputInTree();
+
+ String str = input.getClientId(facesContext);
+
+ assertEquals(str, "data:input");
+
+ UIData uiData = (UIData) input.getParent().getParent();
+
+ uiData.setRowIndex(1);
+
+ str = input.getClientId(facesContext);
+ }
+
+ private UIInput createInputInTree() {
+ UIViewRoot viewRoot = facesContext.getViewRoot();
+ viewRoot.setId("root");
+
+ UIData uiData = new UIData();
+ uiData.setId("data");
+
+ UIColumn column = new UIColumn();
+
+ uiData.getChildren().add(column);
+
+ UIInput input = new UIInput();
+ input.setId("input");
+
+ column.getChildren().add(input);
+
+ viewRoot.getChildren().add(uiData);
+
+ return input;
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getId()'
+ */
+ public void testGetId() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.setId(String)'
+ */
+ public void testSetIdString() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getParent()'
+ */
+ public void testGetParent() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.setParent(UIComponent)'
+ */
+ public void testSetParentUIComponent() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getChildren()'
+ */
+ public void testGetChildren() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.findComponent(String)'
+ */
+ public void testFindComponentString() {
+
+ UIInput input = createInputInTree();
+
+ UIComponent comp = input.findComponent(":data:input");
+
+ assertEquals(input, comp);
+
+ comp = input.findComponent("input");
+
+ assertEquals(input, comp);
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getFacets()'
+ */
+ public void testGetFacets() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getFacet(String)'
+ */
+ public void testGetFacetString() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getFacetsAndChildren()'
+ */
+ public void testGetFacetsAndChildren() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.broadcast(FacesEvent)'
+ */
+ public void testBroadcastFacesEvent() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.decode(FacesContext)'
+ */
+ public void testDecodeFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.encodeBegin(FacesContext)'
+ */
+ public void testEncodeBeginFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.encodeChildren(FacesContext)'
+ */
+ public void testEncodeChildrenFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.encodeEnd(FacesContext)'
+ */
+ public void testEncodeEndFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.addFacesListener(FacesListener)'
+ */
+ public void testAddFacesListenerFacesListener() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getFacesListeners(Class)'
+ */
+ public void testGetFacesListenersClass() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.removeFacesListener(FacesListener)'
+ */
+ public void testRemoveFacesListenerFacesListener() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.queueEvent(FacesEvent)'
+ */
+ public void testQueueEventFacesEvent() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.processDecodes(FacesContext)'
+ */
+ public void testProcessDecodesFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.processValidators(FacesContext)'
+ */
+ public void testProcessValidatorsFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.processUpdates(FacesContext)'
+ */
+ public void testProcessUpdatesFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.processSaveState(FacesContext)'
+ */
+ public void testProcessSaveStateFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.processRestoreState(FacesContext, Object)'
+ */
+ public void testProcessRestoreStateFacesContextObject() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getFacesContext()'
+ */
+ public void testGetFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getRenderer(FacesContext)'
+ */
+ public void testGetRendererFacesContext() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getPathToComponent(UIComponent)'
+ */
+ public void testGetPathToComponent() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.isTransient()'
+ */
+ public void testIsTransient() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.setTransient(boolean)'
+ */
+ public void testSetTransient() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.saveAttachedState(FacesContext, Object)'
+ */
+ public void testSaveAttachedState() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.restoreAttachedState(FacesContext, Object)'
+ */
+ public void testRestoreAttachedState() {
+
+ }
+
+ public void testSaveState() throws Exception {
+
+ try {
+ String id = "id";
+ String rendererType = "Whumpy";
+ mock.setId(id);
+ mock.setRendered(true);
+ mock.setRendererType(rendererType);
+ Object value[] = (Object[]) mock.saveState(facesContext);
+ assertEquals(id, value[0]);
+ assertEquals(Boolean.TRUE, value[1]);
+ assertEquals(rendererType, value[2]);
+
+ assertNull(value[3]);
+ assertNull(value[4]);
+ assertNull(value[5]);
+ assertNull(value[6]);
+ } catch (NullPointerException e) {
+ fail("Should not throw an exception");
+ }
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.restoreState(FacesContext, Object)'
+ */
+ public void testRestoreState() {
+
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.setRendererType(String)'
+ */
+ public void testSetRendererType() {
+ assertNull(mock.getRendererType());
+ }
+
+ public void testSetRendererTypeStringValue() {
+ String rendererType = "BlueBlorf";
+ mock.setRendererType(rendererType);
+ assertEquals(mock.getRendererType(), rendererType);
+ }
+
+ public void testSetRendererTypeStringBinding() {
+
+ String whumpy = "Whumpy";
+
+ ValueBinding vb = new MockValueBinding(application,
+ "#{requestScope.foo}");
+ externalContext.getRequestMap().put("foo", whumpy);
+
+ mock.setValueBinding("rendererType", vb);
+ assertEquals(mock.getRendererType(), whumpy);
+
+ }
+
+}
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/component/UIComponentBaseTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/component/UIComponentMock.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/api/src/test/java/javax/faces/component/UISelectManyTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/test/java/javax/faces/component/UISelectManyTest.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/test/java/javax/faces/component/UISelectManyTest.java (original)
+++ myfaces/core/trunk/api/src/test/java/javax/faces/component/UISelectManyTest.java Tue Aug 1 10:43:28 2006
@@ -1,170 +1,170 @@
-/*
- * Copyright 2004-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 javax.faces.component;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-
-import org.apache.shale.test.base.AbstractJsfTestCase;
-
-import junit.framework.Test;
-
-public class UISelectManyTest extends AbstractJsfTestCase {
-
- public UISelectManyTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return null; // keep this method or maven won't run it
- }
-
- public void testValidateRequiredNull() {
-
- facesContext.getViewRoot().setLocale(_TEST_LOCALE);
-
- UISelectMany selectMany = new UISelectMany();
- selectMany.setId("selectMany");
- selectMany.setRendererType(null);
- selectMany.setRequired(true);
- List children = selectMany.getChildren();
-
- UISelectItem one = new UISelectItem();
- one.setItemValue(new Integer(1));
- children.add(one);
-
- UISelectItem two = new UISelectItem();
- two.setItemValue(new Integer(2));
- children.add(two);
-
- UISelectItem three = new UISelectItem();
- three.setItemValue(new Integer(3));
- children.add(three);
-
- selectMany.validateValue(facesContext, null);
-
- assertFalse(selectMany.isValid());
- }
-
- public void testValidateRequiredEmptyList() {
-
- facesContext.getViewRoot().setLocale(_TEST_LOCALE);
-
- UISelectMany selectMany = new UISelectMany();
- selectMany.setId("selectMany");
- selectMany.setRendererType(null);
- selectMany.setRequired(true);
- List children = selectMany.getChildren();
-
- UISelectItem one = new UISelectItem();
- one.setItemValue(new Integer(1));
- children.add(one);
-
- UISelectItem two = new UISelectItem();
- two.setItemValue(new Integer(2));
- children.add(two);
-
- UISelectItem three = new UISelectItem();
- three.setItemValue(new Integer(3));
- children.add(three);
-
- selectMany.validateValue(facesContext, Collections.EMPTY_LIST);
-
- assertFalse(selectMany.isValid());
- }
-
- public void testValidateIntArray() {
-
- facesContext.getViewRoot().setLocale(_TEST_LOCALE);
-
- UISelectMany selectMany = new UISelectMany();
- selectMany.setId("selectMany");
- selectMany.setRendererType(null);
- List children = selectMany.getChildren();
-
- UISelectItem one = new UISelectItem();
- one.setItemValue(new Integer(1));
- children.add(one);
-
- UISelectItem two = new UISelectItem();
- two.setItemValue(new Integer(2));
- children.add(two);
-
- UISelectItem three = new UISelectItem();
- three.setItemValue(new Integer(3));
- children.add(three);
-
- selectMany.validateValue(facesContext, new int[] { 2, 3 });
-
- assertTrue(selectMany.isValid());
- }
-
- public void testValidateStringArray() {
-
- facesContext.getViewRoot().setLocale(_TEST_LOCALE);
-
- UISelectMany selectMany = new UISelectMany();
- selectMany.setId("selectMany");
- selectMany.setRendererType(null);
- List children = selectMany.getChildren();
-
- UISelectItem one = new UISelectItem();
- one.setItemValue("1");
- children.add(one);
-
- UISelectItem two = new UISelectItem();
- two.setItemValue("2");
- children.add(two);
-
- UISelectItem three = new UISelectItem();
- three.setItemValue("3");
- children.add(three);
-
- selectMany.validateValue(facesContext, new String[] { "2", "3" });
-
- assertTrue(selectMany.isValid());
- }
-
- public void testValidateStringList() {
-
- facesContext.getViewRoot().setLocale(_TEST_LOCALE);
-
- UISelectMany selectMany = new UISelectMany();
- selectMany.setId("selectMany");
- selectMany.setRendererType(null);
- List children = selectMany.getChildren();
-
- UISelectItem one = new UISelectItem();
- one.setItemValue("1");
- children.add(one);
-
- UISelectItem two = new UISelectItem();
- two.setItemValue("2");
- children.add(two);
-
- UISelectItem three = new UISelectItem();
- three.setItemValue("3");
- children.add(three);
-
- selectMany.validateValue(facesContext, Arrays.asList(new String[] { "2", "3" }));
-
- assertTrue(selectMany.isValid());
- }
-
- static private final Locale _TEST_LOCALE = new Locale("xx", "TEST");
-}
+/*
+ * Copyright 2004-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 javax.faces.component;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.shale.test.base.AbstractJsfTestCase;
+
+import junit.framework.Test;
+
+public class UISelectManyTest extends AbstractJsfTestCase {
+
+ public UISelectManyTest(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ return null; // keep this method or maven won't run it
+ }
+
+ public void testValidateRequiredNull() {
+
+ facesContext.getViewRoot().setLocale(_TEST_LOCALE);
+
+ UISelectMany selectMany = new UISelectMany();
+ selectMany.setId("selectMany");
+ selectMany.setRendererType(null);
+ selectMany.setRequired(true);
+ List children = selectMany.getChildren();
+
+ UISelectItem one = new UISelectItem();
+ one.setItemValue(new Integer(1));
+ children.add(one);
+
+ UISelectItem two = new UISelectItem();
+ two.setItemValue(new Integer(2));
+ children.add(two);
+
+ UISelectItem three = new UISelectItem();
+ three.setItemValue(new Integer(3));
+ children.add(three);
+
+ selectMany.validateValue(facesContext, null);
+
+ assertFalse(selectMany.isValid());
+ }
+
+ public void testValidateRequiredEmptyList() {
+
+ facesContext.getViewRoot().setLocale(_TEST_LOCALE);
+
+ UISelectMany selectMany = new UISelectMany();
+ selectMany.setId("selectMany");
+ selectMany.setRendererType(null);
+ selectMany.setRequired(true);
+ List children = selectMany.getChildren();
+
+ UISelectItem one = new UISelectItem();
+ one.setItemValue(new Integer(1));
+ children.add(one);
+
+ UISelectItem two = new UISelectItem();
+ two.setItemValue(new Integer(2));
+ children.add(two);
+
+ UISelectItem three = new UISelectItem();
+ three.setItemValue(new Integer(3));
+ children.add(three);
+
+ selectMany.validateValue(facesContext, Collections.EMPTY_LIST);
+
+ assertFalse(selectMany.isValid());
+ }
+
+ public void testValidateIntArray() {
+
+ facesContext.getViewRoot().setLocale(_TEST_LOCALE);
+
+ UISelectMany selectMany = new UISelectMany();
+ selectMany.setId("selectMany");
+ selectMany.setRendererType(null);
+ List children = selectMany.getChildren();
+
+ UISelectItem one = new UISelectItem();
+ one.setItemValue(new Integer(1));
+ children.add(one);
+
+ UISelectItem two = new UISelectItem();
+ two.setItemValue(new Integer(2));
+ children.add(two);
+
+ UISelectItem three = new UISelectItem();
+ three.setItemValue(new Integer(3));
+ children.add(three);
+
+ selectMany.validateValue(facesContext, new int[] { 2, 3 });
+
+ assertTrue(selectMany.isValid());
+ }
+
+ public void testValidateStringArray() {
+
+ facesContext.getViewRoot().setLocale(_TEST_LOCALE);
+
+ UISelectMany selectMany = new UISelectMany();
+ selectMany.setId("selectMany");
+ selectMany.setRendererType(null);
+ List children = selectMany.getChildren();
+
+ UISelectItem one = new UISelectItem();
+ one.setItemValue("1");
+ children.add(one);
+
+ UISelectItem two = new UISelectItem();
+ two.setItemValue("2");
+ children.add(two);
+
+ UISelectItem three = new UISelectItem();
+ three.setItemValue("3");
+ children.add(three);
+
+ selectMany.validateValue(facesContext, new String[] { "2", "3" });
+
+ assertTrue(selectMany.isValid());
+ }
+
+ public void testValidateStringList() {
+
+ facesContext.getViewRoot().setLocale(_TEST_LOCALE);
+
+ UISelectMany selectMany = new UISelectMany();
+ selectMany.setId("selectMany");
+ selectMany.setRendererType(null);
+ List children = selectMany.getChildren();
+
+ UISelectItem one = new UISelectItem();
+ one.setItemValue("1");
+ children.add(one);
+
+ UISelectItem two = new UISelectItem();
+ two.setItemValue("2");
+ children.add(two);
+
+ UISelectItem three = new UISelectItem();
+ three.setItemValue("3");
+ children.add(three);
+
+ selectMany.validateValue(facesContext, Arrays.asList(new String[] { "2", "3" }));
+
+ assertTrue(selectMany.isValid());
+ }
+
+ static private final Locale _TEST_LOCALE = new Locale("xx", "TEST");
+}
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/component/UISelectManyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/component/_AttachedListStateWrapperTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/component/_AttachedStateWrapperTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/api/src/test/java/javax/faces/convert/DateTimeConverterTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/test/java/javax/faces/convert/DateTimeConverterTest.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/test/java/javax/faces/convert/DateTimeConverterTest.java (original)
+++ myfaces/core/trunk/api/src/test/java/javax/faces/convert/DateTimeConverterTest.java Tue Aug 1 10:43:28 2006
@@ -1,109 +1,109 @@
-/*
- * Copyright 2004-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 javax.faces.convert;
-
-import org.apache.shale.test.base.AbstractJsfTestCase;
-
-import javax.faces.component.UIInput;
-import javax.faces.context.FacesContext;
-import java.util.Date;
-import java.util.TimeZone;
-import java.text.SimpleDateFormat;
-
-import junit.framework.Test;
-
-public class DateTimeConverterTest extends AbstractJsfTestCase
-{
- private DateTimeConverter mock;
-
- public static void main(String[] args)
- {
- junit.textui.TestRunner.run(DateTimeConverterTest.class);
- }
-
- public static Test suite() {
- return null; // keep this method or maven won't run it
- }
-
- public DateTimeConverterTest(String name)
- {
- super(name);
- }
-
- public void setUp()
- {
- super.setUp();
-
- mock = new DateTimeConverter();
- mock.setTimeZone(TimeZone.getDefault());
-
- }
-
- public void tearDown()
- {
- super.tearDown();
-
- mock = null;
- }
-
- /*
- * Test method for 'javax.faces.component.UIComponentBase.getAsObject()'
- */
- public void testGetAsObject()
- {
-
- UIInput input = new UIInput();
-
- mock.setPattern("MM/dd/yyyy");
-
- //should trow a ConverterException
- try
- {
- mock.getAsObject(FacesContext.getCurrentInstance(),input,"15/15/15");
-
- assertTrue("this date should not be parsable - and it is, so this is wrong.",false);
- }
- catch (ConverterException e)
- {
-
- }
-
- //should not trow a ConverterException
- try
- {
- Date date = (Date) mock.getAsObject(FacesContext.getCurrentInstance(),input,"12/01/01");
-
- SimpleDateFormat format = new SimpleDateFormat("MM/dd/yy");
- format.setTimeZone(TimeZone.getDefault());
-
- String str = format.format(date);
-
- assertEquals("12/01/01",str);
-
- format = new SimpleDateFormat("MM/dd/yyyy");
- format.setTimeZone(TimeZone.getDefault());
-
- str = format.format(date);
-
- assertEquals("12/01/0001",str);
- }
- catch (ConverterException e)
- {
- assertTrue("this date should not be parsable - and it is, so this is wrong.",false);
- }
- }
-}
+/*
+ * Copyright 2004-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 javax.faces.convert;
+
+import org.apache.shale.test.base.AbstractJsfTestCase;
+
+import javax.faces.component.UIInput;
+import javax.faces.context.FacesContext;
+import java.util.Date;
+import java.util.TimeZone;
+import java.text.SimpleDateFormat;
+
+import junit.framework.Test;
+
+public class DateTimeConverterTest extends AbstractJsfTestCase
+{
+ private DateTimeConverter mock;
+
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.run(DateTimeConverterTest.class);
+ }
+
+ public static Test suite() {
+ return null; // keep this method or maven won't run it
+ }
+
+ public DateTimeConverterTest(String name)
+ {
+ super(name);
+ }
+
+ public void setUp()
+ {
+ super.setUp();
+
+ mock = new DateTimeConverter();
+ mock.setTimeZone(TimeZone.getDefault());
+
+ }
+
+ public void tearDown()
+ {
+ super.tearDown();
+
+ mock = null;
+ }
+
+ /*
+ * Test method for 'javax.faces.component.UIComponentBase.getAsObject()'
+ */
+ public void testGetAsObject()
+ {
+
+ UIInput input = new UIInput();
+
+ mock.setPattern("MM/dd/yyyy");
+
+ //should trow a ConverterException
+ try
+ {
+ mock.getAsObject(FacesContext.getCurrentInstance(),input,"15/15/15");
+
+ assertTrue("this date should not be parsable - and it is, so this is wrong.",false);
+ }
+ catch (ConverterException e)
+ {
+
+ }
+
+ //should not trow a ConverterException
+ try
+ {
+ Date date = (Date) mock.getAsObject(FacesContext.getCurrentInstance(),input,"12/01/01");
+
+ SimpleDateFormat format = new SimpleDateFormat("MM/dd/yy");
+ format.setTimeZone(TimeZone.getDefault());
+
+ String str = format.format(date);
+
+ assertEquals("12/01/01",str);
+
+ format = new SimpleDateFormat("MM/dd/yyyy");
+ format.setTimeZone(TimeZone.getDefault());
+
+ str = format.format(date);
+
+ assertEquals("12/01/0001",str);
+ }
+ catch (ConverterException e)
+ {
+ assertTrue("this date should not be parsable - and it is, so this is wrong.",false);
+ }
+ }
+}
Propchange: myfaces/core/trunk/api/src/test/java/javax/faces/convert/DateTimeConverterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/org/apache/myfaces/mock/api/Mock2ApplicationFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/api/src/test/java/org/apache/myfaces/mock/api/MockApplicationFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java Tue Aug 1 10:43:28 2006
@@ -1,142 +1,142 @@
-/*
- * Copyright 2004-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.myfaces.config;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.context.ExternalContext;
-
-import org.apache.myfaces.config.element.ManagedBean;
-import org.apache.myfaces.config.element.NavigationCase;
-import org.apache.myfaces.config.element.NavigationRule;
-import org.apache.myfaces.shared_impl.util.ClassUtils;
-
-public class FacesConfigValidator
-{
-
- public static final String VALIDATE_CONTEXT_PARAM = "org.apache.myfaces.VALIDATE";
-
- private FacesConfigValidator(){
- // hidden
- }
-
- public static List validate(ExternalContext ctx, String ctxPath){
-
- RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(ctx);
-
- Map managedBeansMap = runtimeConfig.getManagedBeans();
-
- Iterator managedBeans = managedBeansMap == null ? null :
- managedBeansMap.values() == null ? null :
- managedBeansMap.values().iterator();
-
- Iterator navRules = runtimeConfig.getNavigationRules() == null ?
- null : runtimeConfig.getNavigationRules().iterator();
-
- return validate(managedBeans, navRules, ctxPath);
-
- }
-
- public static List validate(Iterator managedBeans, Iterator navRules, String ctxPath){
-
- List list = new ArrayList();
-
- if(navRules != null)
- validateNavRules(navRules, list, ctxPath);
-
- if(managedBeans != null)
- validateManagedBeans(managedBeans, list);
-
- return list;
- }
-
- private static void validateNavRules(Iterator navRules, List list, String ctxPath){
-
- while(navRules.hasNext()){
-
- NavigationRule navRule = (NavigationRule) navRules.next();
-
- validateNavRule(navRule, list, ctxPath);
-
- }
-
- }
-
- private static void validateNavRule(NavigationRule navRule, List list, String ctxPath){
-
- String fromId = navRule.getFromViewId();
- String filePath = ctxPath + fromId;
-
- if(fromId != null && ! "*".equals(fromId) && ! new File(filePath).exists())
- list.add("File for navigation 'from id' does not exist " + filePath);
-
- Collection cases = navRule.getNavigationCases();
-
- Iterator iterator = cases.iterator();
-
- while(iterator.hasNext()){
-
- NavigationCase caze = (NavigationCase) iterator.next();
-
- String toViewPath = ctxPath + caze.getToViewId();
-
- if(! new File(toViewPath).exists())
- list.add("File for navigation 'to id' does not exist " + toViewPath);
-
- }
-
- }
-
- private static void validateManagedBeans(Iterator managedBeans, List list){
-
- while(managedBeans.hasNext()){
-
- ManagedBean managedBean = (ManagedBean) managedBeans.next();
-
- validateManagedBean(managedBean, list);
-
- }
-
- }
-
- private static void validateManagedBean(ManagedBean managedBean, List list){
-
- String className = managedBean.getManagedBeanClassName();
-
- try
- {
- Class clazz = ClassUtils.classForName(className);
- }
- catch (ClassNotFoundException e)
- {
-
- String msg = "Could not locate class "
- + className + " for managed bean '" + managedBean.getManagedBeanName() + "'";
-
- list.add(msg);
-
- }
-
- }
-
+/*
+ * Copyright 2004-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.myfaces.config;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.ExternalContext;
+
+import org.apache.myfaces.config.element.ManagedBean;
+import org.apache.myfaces.config.element.NavigationCase;
+import org.apache.myfaces.config.element.NavigationRule;
+import org.apache.myfaces.shared_impl.util.ClassUtils;
+
+public class FacesConfigValidator
+{
+
+ public static final String VALIDATE_CONTEXT_PARAM = "org.apache.myfaces.VALIDATE";
+
+ private FacesConfigValidator(){
+ // hidden
+ }
+
+ public static List validate(ExternalContext ctx, String ctxPath){
+
+ RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(ctx);
+
+ Map managedBeansMap = runtimeConfig.getManagedBeans();
+
+ Iterator managedBeans = managedBeansMap == null ? null :
+ managedBeansMap.values() == null ? null :
+ managedBeansMap.values().iterator();
+
+ Iterator navRules = runtimeConfig.getNavigationRules() == null ?
+ null : runtimeConfig.getNavigationRules().iterator();
+
+ return validate(managedBeans, navRules, ctxPath);
+
+ }
+
+ public static List validate(Iterator managedBeans, Iterator navRules, String ctxPath){
+
+ List list = new ArrayList();
+
+ if(navRules != null)
+ validateNavRules(navRules, list, ctxPath);
+
+ if(managedBeans != null)
+ validateManagedBeans(managedBeans, list);
+
+ return list;
+ }
+
+ private static void validateNavRules(Iterator navRules, List list, String ctxPath){
+
+ while(navRules.hasNext()){
+
+ NavigationRule navRule = (NavigationRule) navRules.next();
+
+ validateNavRule(navRule, list, ctxPath);
+
+ }
+
+ }
+
+ private static void validateNavRule(NavigationRule navRule, List list, String ctxPath){
+
+ String fromId = navRule.getFromViewId();
+ String filePath = ctxPath + fromId;
+
+ if(fromId != null && ! "*".equals(fromId) && ! new File(filePath).exists())
+ list.add("File for navigation 'from id' does not exist " + filePath);
+
+ Collection cases = navRule.getNavigationCases();
+
+ Iterator iterator = cases.iterator();
+
+ while(iterator.hasNext()){
+
+ NavigationCase caze = (NavigationCase) iterator.next();
+
+ String toViewPath = ctxPath + caze.getToViewId();
+
+ if(! new File(toViewPath).exists())
+ list.add("File for navigation 'to id' does not exist " + toViewPath);
+
+ }
+
+ }
+
+ private static void validateManagedBeans(Iterator managedBeans, List list){
+
+ while(managedBeans.hasNext()){
+
+ ManagedBean managedBean = (ManagedBean) managedBeans.next();
+
+ validateManagedBean(managedBean, list);
+
+ }
+
+ }
+
+ private static void validateManagedBean(ManagedBean managedBean, List list){
+
+ String className = managedBean.getManagedBeanClassName();
+
+ try
+ {
+ Class clazz = ClassUtils.classForName(className);
+ }
+ catch (ClassNotFoundException e)
+ {
+
+ String msg = "Could not locate class "
+ + className + " for managed bean '" + managedBean.getManagedBeanName() + "'";
+
+ list.add(msg);
+
+ }
+
+ }
+
}
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigValidator.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/LastVariableResolverInChain.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/LastVariableResolverInChain.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/LastVariableResolverInChain.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/LastVariableResolverInChain.java Tue Aug 1 10:43:28 2006
@@ -1,44 +1,44 @@
-/*
- * Copyright 2004 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.myfaces.config;
-
-import javax.faces.el.VariableResolver;
-import javax.faces.el.EvaluationException;
-import javax.faces.context.FacesContext;
-
-/**
- * Represents the last Variable resolver in the chain - is added to be able to
- * through an Evaluation Exception, even if any third-party Variable Resolver is
- * added to the mix.
- *
- * @author Martin Marinschek (latest modification by $Author: dennisbyrne $)
- * @version $Revision: 375880 $ $Date: 2006-02-08 08:27:18 +0100 (Mi, 08 Feb 2006) $
- */
-public class LastVariableResolverInChain extends VariableResolver
-{
- private VariableResolver delegate;
-
- public LastVariableResolverInChain(VariableResolver variableResolver)
- {
- delegate = variableResolver;
- }
-
- // METHODS
- public Object resolveVariable(FacesContext facesContext, String name) throws EvaluationException
- {
- return delegate.resolveVariable(facesContext, name);
- }
-}
+/*
+ * Copyright 2004 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.myfaces.config;
+
+import javax.faces.el.VariableResolver;
+import javax.faces.el.EvaluationException;
+import javax.faces.context.FacesContext;
+
+/**
+ * Represents the last Variable resolver in the chain - is added to be able to
+ * through an Evaluation Exception, even if any third-party Variable Resolver is
+ * added to the mix.
+ *
+ * @author Martin Marinschek (latest modification by $Author: dennisbyrne $)
+ * @version $Revision: 375880 $ $Date: 2006-02-08 08:27:18 +0100 (Mi, 08 Feb 2006) $
+ */
+public class LastVariableResolverInChain extends VariableResolver
+{
+ private VariableResolver delegate;
+
+ public LastVariableResolverInChain(VariableResolver variableResolver)
+ {
+ delegate = variableResolver;
+ }
+
+ // METHODS
+ public Object resolveVariable(FacesContext facesContext, String name) throws EvaluationException
+ {
+ return delegate.resolveVariable(facesContext, name);
+ }
+}
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/LastVariableResolverInChain.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java Tue Aug 1 10:43:28 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.myfaces.lifecycle;
-
-import java.util.HashMap;
-import java.util.Map;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-import javax.faces.lifecycle.Lifecycle;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * This class encapsulates the logic used to call PhaseListeners. It was
- * needed because of issue 9 of the JSF 1.2 spec. See section 11.3 for more
- * details.
- *
- * @author Stan Silvert
- */
-class PhaseListenerManager {
-
- private static final Log log = LogFactory.getLog(PhaseListenerManager.class);
-
- private Lifecycle lifecycle;
- private FacesContext facesContext;
- private PhaseListener[] phaseListeners;
-
- // Tracks success in the beforePhase. Listeners that throw an exception
- // in beforePhase or were never called because a previous listener threw
- // an exception should not have its afterPhase called
- private Map listenerSuccessMap = new HashMap();
-
- /** Creates a new instance of PhaseListenerManager */
- PhaseListenerManager(Lifecycle lifecycle, FacesContext facesContext, PhaseListener[] phaseListeners) {
- this.lifecycle = lifecycle;
- this.facesContext = facesContext;
- this.phaseListeners = phaseListeners;
- }
-
- private boolean isListenerForThisPhase(PhaseListener phaseListener, PhaseId phaseId) {
- int listenerPhaseId = phaseListener.getPhaseId().getOrdinal();
- return (listenerPhaseId == PhaseId.ANY_PHASE.getOrdinal() ||
- listenerPhaseId == phaseId.getOrdinal());
- }
-
- void informPhaseListenersBefore(PhaseId phaseId) {
- boolean[] beforePhaseSuccess = new boolean[phaseListeners.length];
- listenerSuccessMap.put(phaseId, beforePhaseSuccess);
-
- for (int i = 0; i < phaseListeners.length; i++) {
- PhaseListener phaseListener = phaseListeners[i];
- if (isListenerForThisPhase(phaseListener, phaseId)) {
- try {
- phaseListener.beforePhase(new PhaseEvent(facesContext, phaseId, lifecycle));
- beforePhaseSuccess[i] = true;
- } catch (Exception e) {
- beforePhaseSuccess[i] = false; // redundant - for clarity
- log.error("Exception in PhaseListener " + phaseId.toString() + " beforePhase.", e);
- return;
- }
- }
- }
- }
-
- void informPhaseListenersAfter(PhaseId phaseId) {
- boolean[] beforePhaseSuccess = (boolean[])listenerSuccessMap.get(phaseId);
-
- for (int i = phaseListeners.length - 1; i >= 0; i--) {
- PhaseListener phaseListener = phaseListeners[i];
- if (isListenerForThisPhase(phaseListener, phaseId)
- && beforePhaseSuccess[i]) {
- try {
- phaseListener.afterPhase(new PhaseEvent(facesContext, phaseId, lifecycle));
- } catch (Exception e) {
- log.error("Exception in PhaseListener " + phaseId.toString() + " afterPhase", e);
- }
- }
- }
-
- }
-}
+/*
+ * 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.myfaces.lifecycle;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import javax.faces.lifecycle.Lifecycle;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This class encapsulates the logic used to call PhaseListeners. It was
+ * needed because of issue 9 of the JSF 1.2 spec. See section 11.3 for more
+ * details.
+ *
+ * @author Stan Silvert
+ */
+class PhaseListenerManager {
+
+ private static final Log log = LogFactory.getLog(PhaseListenerManager.class);
+
+ private Lifecycle lifecycle;
+ private FacesContext facesContext;
+ private PhaseListener[] phaseListeners;
+
+ // Tracks success in the beforePhase. Listeners that throw an exception
+ // in beforePhase or were never called because a previous listener threw
+ // an exception should not have its afterPhase called
+ private Map listenerSuccessMap = new HashMap();
+
+ /** Creates a new instance of PhaseListenerManager */
+ PhaseListenerManager(Lifecycle lifecycle, FacesContext facesContext, PhaseListener[] phaseListeners) {
+ this.lifecycle = lifecycle;
+ this.facesContext = facesContext;
+ this.phaseListeners = phaseListeners;
+ }
+
+ private boolean isListenerForThisPhase(PhaseListener phaseListener, PhaseId phaseId) {
+ int listenerPhaseId = phaseListener.getPhaseId().getOrdinal();
+ return (listenerPhaseId == PhaseId.ANY_PHASE.getOrdinal() ||
+ listenerPhaseId == phaseId.getOrdinal());
+ }
+
+ void informPhaseListenersBefore(PhaseId phaseId) {
+ boolean[] beforePhaseSuccess = new boolean[phaseListeners.length];
+ listenerSuccessMap.put(phaseId, beforePhaseSuccess);
+
+ for (int i = 0; i < phaseListeners.length; i++) {
+ PhaseListener phaseListener = phaseListeners[i];
+ if (isListenerForThisPhase(phaseListener, phaseId)) {
+ try {
+ phaseListener.beforePhase(new PhaseEvent(facesContext, phaseId, lifecycle));
+ beforePhaseSuccess[i] = true;
+ } catch (Exception e) {
+ beforePhaseSuccess[i] = false; // redundant - for clarity
+ log.error("Exception in PhaseListener " + phaseId.toString() + " beforePhase.", e);
+ return;
+ }
+ }
+ }
+ }
+
+ void informPhaseListenersAfter(PhaseId phaseId) {
+ boolean[] beforePhaseSuccess = (boolean[])listenerSuccessMap.get(phaseId);
+
+ for (int i = phaseListeners.length - 1; i >= 0; i--) {
+ PhaseListener phaseListener = phaseListeners[i];
+ if (isListenerForThisPhase(phaseListener, phaseId)
+ && beforePhaseSuccess[i]) {
+ try {
+ phaseListener.afterPhase(new PhaseEvent(facesContext, phaseId, lifecycle));
+ } catch (Exception e) {
+ log.error("Exception in PhaseListener " + phaseId.toString() + " afterPhase", e);
+ }
+ }
+ }
+
+ }
+}
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/PortletUtil.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/taglib/html/HtmlInputHiddenTag.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/taglib/html/HtmlInputHiddenTag.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/taglib/html/HtmlInputHiddenTag.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/taglib/html/HtmlInputHiddenTag.java Tue Aug 1 10:43:28 2006
@@ -1,34 +1,34 @@
-/*
- * Copyright 2005 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.myfaces.taglib.html;
-
-import org.apache.myfaces.shared_impl.taglib.html.HtmlInputHiddenTagBase;
-
-import javax.faces.component.html.HtmlInputHidden;
-
-/**
- * @author Manfred Geiler
- * @author Martin Marinschek
- * @version $Revision$ $Date: $
- */
-public class HtmlInputHiddenTag
- extends HtmlInputHiddenTagBase
-{
- public String getComponentType()
- {
- return HtmlInputHidden.COMPONENT_TYPE;
- }
-}
+/*
+ * Copyright 2005 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.myfaces.taglib.html;
+
+import org.apache.myfaces.shared_impl.taglib.html.HtmlInputHiddenTagBase;
+
+import javax.faces.component.html.HtmlInputHidden;
+
+/**
+ * @author Manfred Geiler
+ * @author Martin Marinschek
+ * @version $Revision$ $Date: $
+ */
+public class HtmlInputHiddenTag
+ extends HtmlInputHiddenTagBase
+{
+ public String getComponentType()
+ {
+ return HtmlInputHidden.COMPONENT_TYPE;
+ }
+}
Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/taglib/html/HtmlInputHiddenTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/application/jsp/JspStateManagerImplTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/config/AbstractManagedBeanBuilderTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/config/AbstractManagedBeanBuilderTestCase.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/config/AbstractManagedBeanBuilderTestCase.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/config/AbstractManagedBeanBuilderTestCase.java Tue Aug 1 10:43:28 2006
@@ -1,133 +1,133 @@
-package org.apache.myfaces.config;
-
-/**
- * Creates an environment to easily test the creation and initialization of
- * managed beans.
- *
- * @author Dennis C. Byrne
- */
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-
-import javax.faces.application.Application;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.application.ApplicationImpl;
-import org.apache.myfaces.config.ManagedBeanBuilder;
-import org.apache.myfaces.config.impl.digester.elements.ListEntries;
-import org.apache.myfaces.config.impl.digester.elements.ManagedBean;
-import org.apache.myfaces.config.impl.digester.elements.ManagedProperty;
-import org.apache.myfaces.config.impl.digester.elements.MapEntries;
-import org.apache.myfaces.config.impl.digester.elements.ListEntries.Entry;
-import org.apache.myfaces.el.PropertyResolverImpl;
-import org.apache.shale.test.mock.MockFacesContext;
-
-import junit.framework.TestCase;
-
-public abstract class AbstractManagedBeanBuilderTestCase extends TestCase {
-
- private static Log log = LogFactory.getLog(AbstractManagedBeanBuilderTestCase.class);
- protected MangedBeanExample example;
-
- // managed property values
- protected static final List MANAGED_LIST = new ArrayList();
- protected static final Map MANAGED_MAP = new HashMap();
- protected static final String INJECTED_VALUE = "tatiana";
-
- /**
- * Skips digester and manually builds and configures a managed bean.
- */
-
- protected void setUp() throws Exception {
- ManagedBeanBuilder managedBeanBuilder = new ManagedBeanBuilder();
- ManagedBean managedBean = new ManagedBean();
-
- managedBean.setBeanClass(MangedBeanExample.class.getName());
- managedBean.setName("managed");
- managedBean.setScope("request");
-
- // test methods of children will want to make sure these values come
- // out on the other end of this.
- MANAGED_LIST.add("0");
- MANAGED_LIST.add("1");
- MANAGED_LIST.add("2");
- MANAGED_MAP.put("0", "0");
- MANAGED_MAP.put("1", "1");
- MANAGED_MAP.put("2", "2");
-
- ManagedProperty managedProperty = new ManagedProperty();
- managedProperty.setPropertyName("managedProperty");
- managedProperty.setValue(INJECTED_VALUE);
-
- ManagedProperty managedList = new ManagedProperty();
- managedList.setPropertyName("managedList");
- ListEntries listEntries = makeListEntries();
- managedList.setListEntries(listEntries);
-
- ManagedProperty writeOnlyList = new ManagedProperty();
- writeOnlyList.setPropertyName("writeOnlyList");
- ListEntries writeOnlyListEntries = makeListEntries();
- writeOnlyList.setListEntries(writeOnlyListEntries);
-
- ManagedProperty managedMap = new ManagedProperty();
- managedMap.setPropertyName("managedMap");
- MapEntries mapEntries = makeMapEntries();
- managedMap.setMapEntries(mapEntries);
-
- ManagedProperty writeOnlyMap = new ManagedProperty();
- writeOnlyMap.setPropertyName("writeOnlyMap");
- MapEntries writeOnlyMapEntries = makeMapEntries();
- writeOnlyMap.setMapEntries(writeOnlyMapEntries);
-
- managedBean.addProperty(managedProperty);
- managedBean.addProperty(managedList);
- managedBean.addProperty(writeOnlyList);
- managedBean.addProperty(managedMap);
- managedBean.addProperty(writeOnlyMap);
-
- // provide the minimal environment
- Application application = null;
- application = new ApplicationImpl();
- application.setPropertyResolver(new PropertyResolverImpl());
- MockFacesContext facesContext = new MockFacesContext();
- facesContext.setApplication(application);
-
- // simulate a managed bean creation
- example = (MangedBeanExample) managedBeanBuilder
- .buildManagedBean(facesContext, managedBean);
- }
-
- protected void tearDown() throws Exception {
- example = null;
- MANAGED_LIST.clear();
- MANAGED_MAP.clear();
- }
-
- private ListEntries makeListEntries(){
- ListEntries listEntries = new ListEntries();
-
- for(int i = 0; i < MANAGED_LIST.size(); i++){
- Entry entry = new Entry();
- entry.setValue((String) MANAGED_LIST.get(i));
- listEntries.addEntry(entry);
- }
- return listEntries;
- }
-
- private MapEntries makeMapEntries(){
- MapEntries mapEntries = new MapEntries();
-
- for(int i = 0 ; i < MANAGED_MAP.size(); i++){
- MapEntries.Entry mapEntry = new MapEntries.Entry();
- mapEntry.setKey((String) MANAGED_MAP.get(i + ""));
- mapEntry.setValue((String) MANAGED_MAP.get(i + ""));
- mapEntries.addEntry(mapEntry);
- }
- return mapEntries;
- }
-
-}
+package org.apache.myfaces.config;
+
+/**
+ * Creates an environment to easily test the creation and initialization of
+ * managed beans.
+ *
+ * @author Dennis C. Byrne
+ */
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+
+import javax.faces.application.Application;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.application.ApplicationImpl;
+import org.apache.myfaces.config.ManagedBeanBuilder;
+import org.apache.myfaces.config.impl.digester.elements.ListEntries;
+import org.apache.myfaces.config.impl.digester.elements.ManagedBean;
+import org.apache.myfaces.config.impl.digester.elements.ManagedProperty;
+import org.apache.myfaces.config.impl.digester.elements.MapEntries;
+import org.apache.myfaces.config.impl.digester.elements.ListEntries.Entry;
+import org.apache.myfaces.el.PropertyResolverImpl;
+import org.apache.shale.test.mock.MockFacesContext;
+
+import junit.framework.TestCase;
+
+public abstract class AbstractManagedBeanBuilderTestCase extends TestCase {
+
+ private static Log log = LogFactory.getLog(AbstractManagedBeanBuilderTestCase.class);
+ protected MangedBeanExample example;
+
+ // managed property values
+ protected static final List MANAGED_LIST = new ArrayList();
+ protected static final Map MANAGED_MAP = new HashMap();
+ protected static final String INJECTED_VALUE = "tatiana";
+
+ /**
+ * Skips digester and manually builds and configures a managed bean.
+ */
+
+ protected void setUp() throws Exception {
+ ManagedBeanBuilder managedBeanBuilder = new ManagedBeanBuilder();
+ ManagedBean managedBean = new ManagedBean();
+
+ managedBean.setBeanClass(MangedBeanExample.class.getName());
+ managedBean.setName("managed");
+ managedBean.setScope("request");
+
+ // test methods of children will want to make sure these values come
+ // out on the other end of this.
+ MANAGED_LIST.add("0");
+ MANAGED_LIST.add("1");
+ MANAGED_LIST.add("2");
+ MANAGED_MAP.put("0", "0");
+ MANAGED_MAP.put("1", "1");
+ MANAGED_MAP.put("2", "2");
+
+ ManagedProperty managedProperty = new ManagedProperty();
+ managedProperty.setPropertyName("managedProperty");
+ managedProperty.setValue(INJECTED_VALUE);
+
+ ManagedProperty managedList = new ManagedProperty();
+ managedList.setPropertyName("managedList");
+ ListEntries listEntries = makeListEntries();
+ managedList.setListEntries(listEntries);
+
+ ManagedProperty writeOnlyList = new ManagedProperty();
+ writeOnlyList.setPropertyName("writeOnlyList");
+ ListEntries writeOnlyListEntries = makeListEntries();
+ writeOnlyList.setListEntries(writeOnlyListEntries);
+
+ ManagedProperty managedMap = new ManagedProperty();
+ managedMap.setPropertyName("managedMap");
+ MapEntries mapEntries = makeMapEntries();
+ managedMap.setMapEntries(mapEntries);
+
+ ManagedProperty writeOnlyMap = new ManagedProperty();
+ writeOnlyMap.setPropertyName("writeOnlyMap");
+ MapEntries writeOnlyMapEntries = makeMapEntries();
+ writeOnlyMap.setMapEntries(writeOnlyMapEntries);
+
+ managedBean.addProperty(managedProperty);
+ managedBean.addProperty(managedList);
+ managedBean.addProperty(writeOnlyList);
+ managedBean.addProperty(managedMap);
+ managedBean.addProperty(writeOnlyMap);
+
+ // provide the minimal environment
+ Application application = null;
+ application = new ApplicationImpl();
+ application.setPropertyResolver(new PropertyResolverImpl());
+ MockFacesContext facesContext = new MockFacesContext();
+ facesContext.setApplication(application);
+
+ // simulate a managed bean creation
+ example = (MangedBeanExample) managedBeanBuilder
+ .buildManagedBean(facesContext, managedBean);
+ }
+
+ protected void tearDown() throws Exception {
+ example = null;
+ MANAGED_LIST.clear();
+ MANAGED_MAP.clear();
+ }
+
+ private ListEntries makeListEntries(){
+ ListEntries listEntries = new ListEntries();
+
+ for(int i = 0; i < MANAGED_LIST.size(); i++){
+ Entry entry = new Entry();
+ entry.setValue((String) MANAGED_LIST.get(i));
+ listEntries.addEntry(entry);
+ }
+ return listEntries;
+ }
+
+ private MapEntries makeMapEntries(){
+ MapEntries mapEntries = new MapEntries();
+
+ for(int i = 0 ; i < MANAGED_MAP.size(); i++){
+ MapEntries.Entry mapEntry = new MapEntries.Entry();
+ mapEntry.setKey((String) MANAGED_MAP.get(i + ""));
+ mapEntry.setValue((String) MANAGED_MAP.get(i + ""));
+ mapEntries.addEntry(mapEntry);
+ }
+ return mapEntries;
+ }
+
+}
Propchange: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/config/AbstractManagedBeanBuilderTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native