You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by cr...@apache.org on 2006/07/05 20:01:11 UTC
svn commit: r419299 [1/3] - in /struts/shale/trunk:
shale-remoting/src/main/java/org/apache/shale/remoting/
shale-remoting/src/main/java/org/apache/shale/remoting/faces/
shale-remoting/src/main/java/org/apache/shale/remoting/impl/
shale-spring/src/main...
Author: craigmcc
Date: Wed Jul 5 11:01:09 2006
New Revision: 419299
URL: http://svn.apache.org/viewvc?rev=419299&view=rev
Log:
More first-pass checkstyle corrections for "test" and "remoting".
Modified:
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Constants.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mapping.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mappings.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mechanism.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Processor.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/XhtmlHelper.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/BasicResponseWriter.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/MappingsHelper.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/ResponseFactory.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainContext.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainProcessor.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ClassResourceProcessor.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingImpl.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingsImpl.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java
struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/WebResourceProcessor.java
struts/shale/trunk/shale-spring/src/main/java/org/apache/shale/spring/WebApplicationContextVariableResolver.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractJsfTestCase.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractViewControllerTestCase.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/cargo/CargoTestSetup.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockActionListener.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplication.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationFactory.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationMap.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockEnumeration.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockExternalContext.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockFacesContext.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockFacesContextFactory.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockHttpServletRequest.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockHttpServletResponse.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockHttpSession.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockLifecycle.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockLifecycleFactory.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockMethodBinding.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockNavigationHandler.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockPrincipal.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockPrintWriter.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockPropertyResolver.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockRenderKit.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockRenderKitFactory.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockRequestMap.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockResponseWriter.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockServlet.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockServletConfig.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockServletContext.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockServletOutputStream.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockSessionMap.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockStateManager.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockValueBinding.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockVariableResolver.java
struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockViewHandler.java
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Constants.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Constants.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Constants.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Constants.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -19,8 +19,8 @@
/**
* <p>Manifest constants related to Shale remoting support.</p>
*/
-public class Constants {
-
+public final class Constants {
+
// ------------------------------------------------------------ Constructors
@@ -28,7 +28,7 @@
/**
* <p>Private constructor to avoid instantiation.</p>
*/
- private Constants() {}
+ private Constants() { }
// ------------------------------------------------------ Manifest Constants
@@ -44,7 +44,7 @@
* is used. The {@link Mapping} instance for each pair will be configured
* with <code>Mechanism.CLASS_RESOURCE</code>.</p>
*/
- public static final String CLASS_RESOURCES_PARAM=
+ public static final String CLASS_RESOURCES_PARAM =
"org.apache.shale.remoting.CLASS_RESOURCES";
@@ -58,7 +58,7 @@
* is used. The {@link Mapping} instance for each pair will be configured
* with <code>Mechanism.DYNAMIC_RESOURCE</code>.</p>
*/
- public static final String DYNAMIC_RESOURCES_PARAM=
+ public static final String DYNAMIC_RESOURCES_PARAM =
"org.apache.shale.remoting.DYNAMIC_RESOURCES";
@@ -68,7 +68,7 @@
* the last (or only) servlet definition for a servlet whose class is
* <code>javax.faces.webapp.FacesServlet</code> is used.</p>
*/
- public static final String FACES_SERVLET_NAME_PARAM=
+ public static final String FACES_SERVLET_NAME_PARAM =
"org.apache.shale.remoting.FACES_SERVLET_NAME";
@@ -109,7 +109,7 @@
* The {@link Mapping} instance for each pair will be configured
* with <code>Mechanism.OTHER_RESOURCE</code>.</p>
*/
- public static final String OTHER_RESOURCES_PARAM=
+ public static final String OTHER_RESOURCES_PARAM =
"org.apache.shale.remoting.OTHER_RESOURCES";
@@ -123,7 +123,7 @@
* is used. The {@link Mapping} instance for each pair will be configured
* with <code>Mechanism.WEBAPP_RESOURCE</code>.</p>
*/
- public static final String WEBAPP_RESOURCES_PARAM=
+ public static final String WEBAPP_RESOURCES_PARAM =
"org.apache.shale.remoting.WEBAPP_RESOURCES";
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mapping.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mapping.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mapping.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mapping.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mappings.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mappings.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mappings.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mappings.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -23,7 +23,7 @@
* a particular web application.</p>
*/
public interface Mappings {
-
+
/**
* <p>Add the specified {@link Mapping} to the set of mappings for which
@@ -99,7 +99,7 @@
*
* @param patterns The new list of patterns
*/
- public void setPatterns(String patterns[]);
+ public void setPatterns(String[] patterns);
}
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mechanism.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mechanism.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mechanism.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Mechanism.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -23,14 +23,16 @@
* actually employed to translate the incomfing view identifier into content
* to be supplied as a response.</p>
*/
-public class Mechanism {
-
+public final class Mechanism {
+
// ------------------------------------------------------------ Constructors
/**
* <p>Private constructor to disable creation of new instances.</p>
+ *
+ * @param description Description of this mechanism
*/
private Mechanism(String description) {
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Processor.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Processor.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Processor.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/Processor.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -17,7 +17,6 @@
package org.apache.shale.remoting;
import java.io.IOException;
-import javax.faces.FacesException;
import javax.faces.context.FacesContext;
/**
@@ -25,7 +24,7 @@
* remoting request, and creating the corresponding response.</p>
*/
public interface Processor {
-
+
/**
* <p>Process the current request, producing the corresponding response
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/XhtmlHelper.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/XhtmlHelper.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/XhtmlHelper.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/XhtmlHelper.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -38,7 +38,7 @@
* <p>Instances of this class are stateless and have no side effects.</p>
*/
public class XhtmlHelper {
-
+
// ------------------------------------------------------ Manifest Constants
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/BasicResponseWriter.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/BasicResponseWriter.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/BasicResponseWriter.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/BasicResponseWriter.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -27,7 +27,7 @@
* (such as <code>text/xml</code>).</p>
*/
public class BasicResponseWriter extends ResponseWriter {
-
+
// ------------------------------------------------------------ Constructors
@@ -49,9 +49,27 @@
// ------------------------------------------------------ Instance Variables
+ /**
+ * <p>The character encoding of the response we are creating.</p>
+ */
private String characterEncoding = null;
+
+
+ /**
+ * <p>The content type of the response we are creating.</p>
+ */
private String contentType = "text/html";
- private boolean open = false; // Is an element currently open?
+
+
+ /**
+ * <p>Flag indicating that an element has been started.</p>
+ */
+ private boolean open = false;
+
+
+ /**
+ * <p>The <code>Writer</code> we are wrapping.</p>
+ */
private Writer writer = null;
@@ -62,17 +80,20 @@
// -------------------------------------------------- ResponseWriter Methods
+ /** {@inheritDoc} */
public ResponseWriter cloneWithWriter(Writer writer) {
return new BasicResponseWriter(writer, contentType, characterEncoding);
}
+ /** {@inheritDoc} */
public void endDocument() throws IOException {
finish();
writer.flush();
}
+ /** {@inheritDoc} */
public void endElement(String name) throws IOException {
if (open) {
writer.write("/");
@@ -85,26 +106,31 @@
}
+ /** {@inheritDoc} */
public String getCharacterEncoding() {
return this.characterEncoding;
}
+ /** {@inheritDoc} */
public String getContentType() {
return this.contentType;
}
+ /** {@inheritDoc} */
public void flush() throws IOException {
finish();
}
+ /** {@inheritDoc} */
public void startDocument() throws IOException {
- ; // Do nothing
+ // Do nothing
}
+ /** {@inheritDoc} */
public void startElement(String name, UIComponent component) throws IOException {
if (name == null) {
throw new NullPointerException();
@@ -116,6 +142,7 @@
}
+ /** {@inheritDoc} */
public void writeAttribute(String name, Object value, String property) throws IOException {
if ((name == null) || (value == null)) {
throw new NullPointerException();
@@ -135,6 +162,7 @@
}
+ /** {@inheritDoc} */
public void writeComment(Object comment) throws IOException {
if (comment == null) {
throw new NullPointerException();
@@ -150,6 +178,7 @@
}
+ /** {@inheritDoc} */
public void writeText(Object text, String property) throws IOException {
if (text == null) {
throw new NullPointerException();
@@ -163,7 +192,8 @@
}
- public void writeText(char text[], int off, int len) throws IOException {
+ /** {@inheritDoc} */
+ public void writeText(char[] text, int off, int len) throws IOException {
if (text == null) {
throw new NullPointerException();
}
@@ -175,6 +205,7 @@
}
+ /** {@inheritDoc} */
public void writeURIAttribute(String name, Object value, String property) throws IOException {
if ((name == null) || (value == null)) {
throw new NullPointerException();
@@ -197,13 +228,15 @@
// ---------------------------------------------------------- Writer Methods
+ /** {@inheritDoc} */
public void close() throws IOException {
finish();
writer.close();
}
- public void write(char cbuf[], int off, int len) throws IOException {
+ /** {@inheritDoc} */
+ public void write(char[] cbuf, int off, int len) throws IOException {
finish();
writer.write(cbuf, off, len);
}
@@ -216,6 +249,8 @@
* <p>Write the specified character, filtering if necessary.</p>
*
* @param ch Character to be written
+ *
+ * @exception IOException if an input/output error occurs
*/
private void character(char ch) throws IOException {
@@ -267,6 +302,8 @@
*
* @param writer Writer we are writing to
* @param ch Character to be translated and appended
+ *
+ * @exception IOException if an input/output error occurs
*/
private void numeric(Writer writer, char ch) throws IOException {
@@ -284,8 +321,10 @@
* @param text Character array containing text to be written
* @param off Starting offset (zero relative)
* @param len Number of characters to be written
+ *
+ * @exception IOException if an input/output error occurs
*/
- private void string(char text[], int off, int len) throws IOException {
+ private void string(char[] text, int off, int len) throws IOException {
// Process the specified characters
for (int i = off; i < (off + len); i++) {
@@ -300,6 +339,8 @@
* replacement of characters by corresponding entities).</p>
*
* @param s String to be filtered and written
+ *
+ * @exception IOException if an input/output error occurs
*/
private void string(String s) throws IOException {
@@ -316,11 +357,7 @@
*/
private boolean substitution() {
- if ("UTF-8".equals(characterEncoding) || "UTF-16".equals(characterEncoding)) {
- return false;
- } else {
- return true;
- }
+ return !("UTF-8".equals(characterEncoding) || "UTF-16".equals(characterEncoding));
}
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/MappingsHelper.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/MappingsHelper.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/MappingsHelper.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/MappingsHelper.java Wed Jul 5 11:01:09 2006
@@ -1,19 +1,17 @@
/*
* Copyright 2005-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.
- *
- * $Id$
*/
package org.apache.shale.remoting.faces;
@@ -49,7 +47,7 @@
* @since 1.0.1
*/
public class MappingsHelper {
-
+
// ------------------------------------------------------ Instance Variables
@@ -238,7 +236,7 @@
// Calculate and set the URL patterns that FacesServlet is mapped with
// FIXME - hard coded to "*.faces" for now
- String patterns[] = patterns(context);
+ String[] patterns = patterns(context);
if (log().isTraceEnabled()) {
for (int i = 0; i < patterns.length; i++) {
log().trace("FacesServlet is mapped with URL pattern '" + patterns[i] + "'");
@@ -327,7 +325,7 @@
} finally {
if (stream != null) {
- try { stream.close(); } catch (Exception e) {}
+ try { stream.close(); } catch (Exception e) { ; }
}
}
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -45,7 +45,7 @@
*/
public RemotingPhaseListener() {
}
-
+
// ------------------------------------------------------ Instance Variables
@@ -94,9 +94,9 @@
String resourceId = mapping.mapViewId(context);
if (resourceId != null) {
if (log().isTraceEnabled()) {
- log().trace("View identifier '" + context.getViewRoot().getViewId() +
- "' matched pattern '" + mapping.getPattern() +
- "' with resource id '" + resourceId + "'");
+ log().trace("View identifier '" + context.getViewRoot().getViewId()
+ + "' matched pattern '" + mapping.getPattern()
+ + "' with resource id '" + resourceId + "'");
}
try {
mapping.getProcessor().process(context, resourceId);
@@ -118,7 +118,7 @@
*/
public void beforePhase(PhaseEvent event) {
- ; // No processing required
+ // No processing required
}
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/ResponseFactory.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/ResponseFactory.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/ResponseFactory.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/ResponseFactory.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -16,7 +16,6 @@
package org.apache.shale.remoting.faces;
-import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
@@ -39,7 +38,7 @@
* will be used to manufacture stream or writer instances, if necessary.</p>
*/
public class ResponseFactory {
-
+
// ------------------------------------------------------------ Constructors
@@ -105,7 +104,7 @@
protected ResponseStream createResponseStream(FacesContext context, String contentType) {
Object response = context.getExternalContext().getResponse();
-
+
// Set the content type (if specified)
if (contentType != null) {
try {
@@ -158,7 +157,7 @@
protected ResponseWriter createResponseWriter(FacesContext context, String contentType) {
Object response = context.getExternalContext().getResponse();
-
+
// Set the content type (if specified)
if (contentType != null) {
try {
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -42,7 +42,7 @@
* that serve up static resources.</p>
*/
public abstract class AbstractResourceProcessor implements Processor {
-
+
// ------------------------------------------------------ Instance Variables
@@ -83,8 +83,8 @@
// If not, send an HTTP "not found" response
URL url = getResourceURL(context, resourceId);
if (log().isDebugEnabled()) {
- log().debug("Translated resource id '" + resourceId + "' to URL '" +
- url + "'");
+ log().debug("Translated resource id '" + resourceId + "' to URL '"
+ + url + "'");
}
if (url == null) {
if (log().isTraceEnabled()) {
@@ -99,8 +99,8 @@
// an HTTP "not modified" response if the specified timestamp is
// equal to or later than our application resource timestamp
long ifModifiedSince = ifModifiedSince(context);
- if ((ifModifiedSince >= 0) &&
- ((ifModifiedSince+1000L) >= getLastModified())) {
+ if ((ifModifiedSince >= 0)
+ && ((ifModifiedSince + 1000L) >= getLastModified())) {
if (log().isTraceEnabled()) {
log().trace("Resource '" + resourceId + "' not modified, returning 304");
}
@@ -122,10 +122,10 @@
copyStream(context, inputStream, outputStream);
} finally {
if (outputStream != null) {
- try { outputStream.close(); } catch (Exception e) {}
+ try { outputStream.close(); } catch (Exception e) { ; }
}
if (inputStream != null) {
- try { inputStream.close(); } catch (Exception e) {}
+ try { inputStream.close(); } catch (Exception e) { ; }
}
}
@@ -276,11 +276,13 @@
* @param context <code>FacesContext</code> for the current request
* @param inputStream <code>InputStream</code> to be copied from
* @param outputStream <code>OutputStream</code> to be copied to
+ *
+ * @exception IOException if an input/output error occurs
*/
protected void copyStream(FacesContext context, InputStream inputStream,
OutputStream outputStream) throws IOException {
- byte buffer[] = new byte[getBufferSize()];
+ byte[] buffer = new byte[getBufferSize()];
while (true) {
int len = inputStream.read(buffer);
if (len <= 0) {
@@ -476,8 +478,10 @@
Object response = context.getExternalContext().getResponse();
if (response instanceof HttpServletResponse) {
((HttpServletResponse) response).setHeader("Last-Modified", timestamp);
- } else /* it is a portlet response */ {
- ; // There is no mechanism to set HTTP headers in a portlet response
+ /* else it is a portlet response with mechanism to support this
+ } else {
+ ;
+ */
}
}
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainContext.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainContext.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainContext.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainContext.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -17,7 +17,6 @@
package org.apache.shale.remoting.impl;
import javax.faces.context.FacesContext;
-import org.apache.commons.chain.Context;
import org.apache.commons.chain.impl.ContextBase;
/**
@@ -25,7 +24,7 @@
* or chains executed via Shale Remoting.</p>
*/
public class ChainContext extends ContextBase {
-
+
// ------------------------------------------------------------ Constructors
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainProcessor.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainProcessor.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainProcessor.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ChainProcessor.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -38,7 +38,7 @@
* <code>FacesContext.getCurrentInstance()</code>.</p>
*/
public class ChainProcessor implements Processor {
-
+
// ------------------------------------------------------------ Constructors
@@ -75,9 +75,9 @@
public void process(FacesContext context, String resourceId) throws IOException {
if (log().isDebugEnabled()) {
- log().debug("Translated resource id '" + resourceId + "' to catalog '" +
- mapCatalog(context, resourceId) + "' and command '" +
- mapCommand(context, resourceId) + "'");
+ log().debug("Translated resource id '" + resourceId + "' to catalog '"
+ + mapCatalog(context, resourceId) + "' and command '"
+ + mapCommand(context, resourceId) + "'");
}
// Identify the Commons Chain catalog we will be using
@@ -85,8 +85,8 @@
Catalog catalog = CatalogFactory.getInstance().getCatalog(catalogName);
if (catalog == null) {
if (log().isErrorEnabled()) {
- log().error("Cannot find catalog '" + catalogName + "' for resource '" +
- resourceId + "'");
+ log().error("Cannot find catalog '" + catalogName + "' for resource '"
+ + resourceId + "'");
}
sendNotFound(context, resourceId);
context.responseComplete();
@@ -98,8 +98,8 @@
Command command = catalog.getCommand(commandName);
if (command == null) {
if (log().isErrorEnabled()) {
- log().error("Cannot find command '" + commandName + "' in catalog '" +
- catalogName + "' for resource '" + resourceId + "'");
+ log().error("Cannot find command '" + commandName + "' in catalog '"
+ + catalogName + "' for resource '" + resourceId + "'");
}
sendNotFound(context, resourceId);
context.responseComplete();
@@ -111,9 +111,9 @@
command.execute(createContext(context, resourceId));
} catch (Exception e) {
if (log().isErrorEnabled()) {
- log().error("Exception executing command '" + commandName +
- "' from catalog '" + catalogName + "' for resource '" +
- resourceId + "'", e);
+ log().error("Exception executing command '" + commandName
+ + "' from catalog '" + catalogName + "' for resource '"
+ + resourceId + "'", e);
}
sendServerError(context, resourceId, e);
}
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ClassResourceProcessor.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ClassResourceProcessor.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ClassResourceProcessor.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/ClassResourceProcessor.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -17,9 +17,7 @@
package org.apache.shale.remoting.impl;
import java.net.URL;
-import java.util.Date;
import java.util.ResourceBundle;
-import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -32,7 +30,7 @@
* <code>/org/apache/shale/remoting/MyResource.css</code>).</p>
*/
public class ClassResourceProcessor extends AbstractResourceProcessor {
-
+
// ------------------------------------------------------------ Constructors
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingImpl.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingImpl.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingImpl.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingImpl.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -16,7 +16,6 @@
package org.apache.shale.remoting.impl;
-import javax.faces.application.ViewHandler;
import javax.faces.context.FacesContext;
import org.apache.shale.remoting.Mapping;
import org.apache.shale.remoting.Mappings;
@@ -36,7 +35,7 @@
* returning the remainder.</p>
*/
public class MappingImpl implements Mapping {
-
+
// ------------------------------------------------------------ Constructors
@@ -66,11 +65,40 @@
// ------------------------------------------------------ Instance Variables
+ /**
+ * <p>The {@link Mappings} instance that owns this mapping.</p>
+ */
private Mappings mappings = null;
- private String match = null; // Non-wildcard part of the pattern
+
+
+ /**
+ * <p>The non-wildcard part of the pattern for this mapping.</p>
+ */
+ private String match = null;
+
+
+ /**
+ * <p>The {@link Mechanism} used to produce response for this mapping.</p>
+ */
private Mechanism mechanism = null;
+
+
+ /**
+ * <p>The URL matching pattern for this mapping.</p>
+ */
private String pattern = null;
- private boolean prefix = true; // Are we prefix matching (versus extension mapping)
+
+
+ /**
+ * <p>Flag indicating we are doing prefix matching, versus extension
+ * mapping.</p>
+ */
+ private boolean prefix = true;
+
+
+ /**
+ * <p>The <code>Processor</code> instance for this mapping.</p>
+ */
private Processor processor = null;
@@ -153,7 +181,7 @@
// Acquire the servlet mapping to be used for FacesServlet (if any --
// there will not be such a mapping in a portlet environment)
- String patterns[] = getMappings().getPatterns();
+ String[] patterns = getMappings().getPatterns();
String pattern = null;
if ((patterns != null) && (patterns.length > 0)) {
pattern = patterns[0]; // Arbitrarily choose the first one
@@ -223,6 +251,18 @@
/**
+ * <p>Return the hash code for this object.</p>
+ */
+ public int hashCode() {
+ if (this.pattern == null) {
+ return 0;
+ } else {
+ return this.pattern.hashCode();
+ }
+ }
+
+
+ /**
* <p>Two {@link Mapping}s are equal if they have the same pattern.</p>
*
* @param object Object to which we are tested for equality
@@ -269,7 +309,7 @@
// bug, walk through the URL patterns to which FacesServlet is mapped.
// If we detect an extension matching pattern that is found on our
// current view identifier, strip that and return as well.
- String patterns[] = mappings.getPatterns();
+ String[] patterns = mappings.getPatterns();
if ((patterns == null) || (patterns.length < 1)) {
return viewId;
}
@@ -287,6 +327,5 @@
return viewId;
}
-
}
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingsImpl.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingsImpl.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingsImpl.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MappingsImpl.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -28,7 +28,7 @@
* <p>Default implementation of {@link Mappings}.</p>
*/
public class MappingsImpl implements Mappings, Serializable {
-
+
// ------------------------------------------------------ Instance Variables
@@ -49,7 +49,7 @@
/**
* <p>The list of URL patterns for <code>FacesServlet</code>.</p>
*/
- private String patterns[] = new String[0];
+ private String[] patterns = new String[0];
// -------------------------------------------------------- Mappings Methods
@@ -122,7 +122,7 @@
/** {@inheritDoc} */
- public void setPatterns(String patterns[]) {
+ public void setPatterns(String[] patterns) {
this.patterns = patterns;
}
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -31,7 +31,7 @@
* method, which may be specialized as desired in a subclass.</p>
*/
public class MethodBindingProcessor implements Processor {
-
+
// ------------------------------------------------------------ Constructors
@@ -40,6 +40,9 @@
// ------------------------------------------------------ Instance Variables
+ /**
+ * <p><code>Log</code> instance for this class.</p>
+ */
private transient Log log = null;
@@ -67,9 +70,9 @@
// Create and execute a method binding based on this resource identifier
MethodBinding mb = mapResourceId(context, resourceId);
if (log().isDebugEnabled()) {
- log().debug("Translated resource id '" + resourceId +
- "' to method binding expression '" +
- mb.getExpressionString() + "'");
+ log().debug("Translated resource id '" + resourceId
+ + "' to method binding expression '"
+ + mb.getExpressionString() + "'");
}
mb.invoke(context, new Object[] { });
Modified: struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/WebResourceProcessor.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/WebResourceProcessor.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/WebResourceProcessor.java (original)
+++ struts/shale/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/WebResourceProcessor.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2005-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.
@@ -18,9 +18,7 @@
import java.lang.reflect.Method;
import java.net.URL;
-import java.util.Date;
import java.util.ResourceBundle;
-import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -33,7 +31,7 @@
* <code>/org/apache/shale/remoting/MyResource.css</code>).</p>
*/
public class WebResourceProcessor extends AbstractResourceProcessor {
-
+
// ------------------------------------------------------------ Constructors
@@ -74,7 +72,7 @@
}
// Disallow access to JSP and JSP fragment sources
- if(resourceIdUpper.endsWith(".JSP") || resourceIdUpper.endsWith(".JSPF")) {
+ if (resourceIdUpper.endsWith(".JSP") || resourceIdUpper.endsWith(".JSPF")) {
if (log().isWarnEnabled()) {
log().warn(bundle.getString("resource.refuse"));
log().warn(resourceId);
Modified: struts/shale/trunk/shale-spring/src/main/java/org/apache/shale/spring/WebApplicationContextVariableResolver.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-spring/src/main/java/org/apache/shale/spring/WebApplicationContextVariableResolver.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-spring/src/main/java/org/apache/shale/spring/WebApplicationContextVariableResolver.java (original)
+++ struts/shale/trunk/shale-spring/src/main/java/org/apache/shale/spring/WebApplicationContextVariableResolver.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* Copyright 2004-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.
@@ -30,7 +30,7 @@
* $Id$
*/
public class WebApplicationContextVariableResolver extends VariableResolver {
-
+
// ------------------------------------------------------------- Constructor
@@ -76,7 +76,10 @@
* <p>Resolve variable names known to this resolver; otherwise, delegate to
* the original resolver passed to our constructor.</p>
*
+ * @param context FacesContext for the current request
* @param name Variable name to be resolved
+ *
+ * @exception EvaluationException if an evaluation error occurs
*/
public Object resolveVariable(FacesContext context, String name)
throws EvaluationException {
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractJsfTestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractJsfTestCase.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractJsfTestCase.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractJsfTestCase.java Wed Jul 5 11:01:09 2006
@@ -77,7 +77,11 @@
// ------------------------------------------------------------ Constructors
- // Construct a new instance of this test case.
+ /**
+ * <p>Construct a new instance of this test case.</p>
+ *
+ * @param name Name of this test case
+ */
public AbstractJsfTestCase(String name) {
super(name);
}
@@ -86,14 +90,16 @@
// ---------------------------------------------------- Overall Test Methods
- // Set up instance variables required by this test case.
+ /**
+ * <p>Set up instance variables required by this test case.</p>
+ */
public void setUp() {
-
+
// Set up a new thread context class loader
threadContextClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[0],
this.getClass().getClassLoader()));
-
+
// Set up Servlet API Objects
servletContext = new MockServletContext();
config = new MockServletConfig(servletContext);
@@ -102,7 +108,7 @@
request = new MockHttpServletRequest(session);
request.setServletContext(servletContext);
response = new MockHttpServletResponse();
-
+
// Set up JSF API Objects
FactoryFinder.releaseFactories();
FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY,
@@ -113,7 +119,7 @@
"org.apache.shale.test.mock.MockLifecycleFactory");
FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY,
"org.apache.shale.test.mock.MockRenderKitFactory");
-
+
externalContext =
new MockExternalContext(servletContext, request, response);
lifecycleFactory = (MockLifecycleFactory)
@@ -141,11 +147,13 @@
FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
renderKit = new MockRenderKit();
renderKitFactory.addRenderKit(RenderKitFactory.HTML_BASIC_RENDER_KIT, renderKit);
-
+
}
- // Return the tests included in this test case.
+ /**
+ * <p>Return the tests included in this test case.</p>
+ */
public static Test suite() {
return (new TestSuite());
@@ -153,7 +161,9 @@
}
- // Tear down instance variables required by this test case.
+ /**
+ * <p>Tear down instance variables required by this test case.</p>
+ */
public void tearDown() {
application = null;
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractViewControllerTestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractViewControllerTestCase.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractViewControllerTestCase.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/base/AbstractViewControllerTestCase.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -29,11 +29,15 @@
* the test methods for your test case.</p>
*/
public abstract class AbstractViewControllerTestCase extends AbstractJsfTestCase {
-
+
// ------------------------------------------------------------ Constructors
- // Construct a new instance of this test case.
+ /**
+ * <p>Construct a new instance of this test case.</p>
+ *
+ * @param name Test case name
+ */
public AbstractViewControllerTestCase(String name) {
super(name);
}
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/cargo/CargoTestSetup.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/cargo/CargoTestSetup.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/cargo/CargoTestSetup.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/cargo/CargoTestSetup.java Wed Jul 5 11:01:09 2006
@@ -12,8 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- * $Id$
*/
package org.apache.shale.test.cargo;
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java Wed Jul 5 11:01:09 2006
@@ -1,19 +1,17 @@
/*
* 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.
- *
- * $Id$
*/
package org.apache.shale.test.htmlunit;
@@ -29,9 +27,7 @@
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import java.io.IOException;
import java.net.URL;
-import java.util.ArrayList;
import java.util.Iterator;
-import java.util.List;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@@ -92,6 +88,8 @@
/**
* <p>Set up the instance variables required for this test case.</p>
+ *
+ * @exception Exception if an error occurs
*/
public void setUp() throws Exception {
@@ -134,6 +132,8 @@
/**
* <p>Return the body element for the most recently retrieved page.
* If there is no such element, return <code>null</code>.</p>
+ *
+ * @exception Exception if an error occurs
*/
protected HtmlBody body() throws Exception {
@@ -155,6 +155,8 @@
* <code>null</code>.</p>
*
* @param id Identifier of the requested element.
+ *
+ * @exception Exception if an error occurs
*/
protected HtmlElement element(String id) throws Exception {
@@ -173,6 +175,8 @@
* <code>null</code>.<p>
*
* @param id Identifier of the requested form.
+ *
+ * @exception Exception if an error occurs
*/
protected HtmlForm form(String id) throws Exception {
@@ -191,6 +195,8 @@
/**
* <p>Return the head element for the most recently retrieved page.
* If there is no such element, return <code>null</code>.</p>
+ *
+ * @exception Exception if an error occurs
*/
protected HtmlHead head() throws Exception {
@@ -233,6 +239,7 @@
*
* @exception IllegalArgumentException if the context relative path
* does not begin with a '/' character
+ * @exception Exception if a different error occurs
*/
protected HtmlPage page(String path) throws Exception {
@@ -264,6 +271,8 @@
/**
* <p>Return the page title from the most recently retrieved page.
* Any leading and trailing whitespace will be trimmed.</p>
+ *
+ * @exception Exception if an error occurs
*/
protected String title() throws Exception {
@@ -280,12 +289,13 @@
*
* @exception IllegalArgumentException if the context relative path
* does not begin with a '/' character
+ * @exception Exception if a different error ocurs
*/
protected URL url(String path) throws Exception {
if (path.charAt(0) != '/') {
- throw new IllegalArgumentException("Context path '" + path +
- "' does not start with '/'");
+ throw new IllegalArgumentException("Context path '" + path
+ + "' does not start with '/'");
}
return new URL(url, path.substring(1));
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockActionListener.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockActionListener.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockActionListener.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockActionListener.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -27,7 +27,7 @@
*/
public class MockActionListener implements ActionListener {
-
+
// ------------------------------------------------------------ Constructors
@@ -37,7 +37,7 @@
*/
public MockActionListener() {
}
-
+
// ----------------------------------------------------- Mock Object Methods
@@ -52,9 +52,12 @@
* <p>Process the specified <code>ActionEvent</code>.</p>
*
* @param event Event to be processed
+ *
+ * @exception AbortProcessingException if further event firing
+ * should be skipped
*/
public void processAction(ActionEvent event) throws AbortProcessingException {
- ; // FIXME - provide default implementation
+ // FIXME - provide default implementation
}
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplication.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplication.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplication.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplication.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -129,6 +129,7 @@
// ----------------------------------------------------- Application Methods
+ /** {@inheritDoc} */
public ActionListener getActionListener() {
return this.actionListener;
@@ -136,29 +137,34 @@
}
+ /** {@inheritDoc} */
public void setActionListener(ActionListener actionListener) {
this.actionListener = actionListener;
}
- public Locale getDefaultLocale(){
+ /** {@inheritDoc} */
+ public Locale getDefaultLocale() {
return this.defaultLocale;
}
+ /** {@inheritDoc} */
public void setDefaultLocale(Locale defaultLocale) {
this.defaultLocale = defaultLocale;
}
- public String getDefaultRenderKitId() {
+ /** {@inheritDoc} */
+ public String getDefaultRenderKitId() {
return this.defaultRenderKitId;
}
+ /** {@inheritDoc} */
public void setDefaultRenderKitId(String defaultRenderKitId) {
this.defaultRenderKitId = defaultRenderKitId;
@@ -166,6 +172,7 @@
}
+ /** {@inheritDoc} */
public String getMessageBundle() {
return this.messageBundle;
@@ -173,6 +180,7 @@
}
+ /** {@inheritDoc} */
public void setMessageBundle(String messageBundle) {
this.messageBundle = messageBundle;
@@ -180,6 +188,7 @@
}
+ /** {@inheritDoc} */
public NavigationHandler getNavigationHandler() {
return this.navigationHandler;
@@ -187,6 +196,7 @@
}
+ /** {@inheritDoc} */
public void setNavigationHandler(NavigationHandler navigationHandler) {
this.navigationHandler = navigationHandler;
@@ -194,6 +204,7 @@
}
+ /** {@inheritDoc} */
public PropertyResolver getPropertyResolver() {
return this.propertyResolver;
@@ -201,6 +212,7 @@
}
+ /** {@inheritDoc} */
public void setPropertyResolver(PropertyResolver propertyResolver) {
this.propertyResolver = propertyResolver;
@@ -208,6 +220,7 @@
}
+ /** {@inheritDoc} */
public StateManager getStateManager() {
return this.stateManager;
@@ -215,6 +228,7 @@
}
+ /** {@inheritDoc} */
public void setStateManager(StateManager stateManager) {
this.stateManager = stateManager;
@@ -222,6 +236,7 @@
}
+ /** {@inheritDoc} */
public Iterator getSupportedLocales() {
return this.supportedLocales.iterator();
@@ -229,6 +244,7 @@
}
+ /** {@inheritDoc} */
public void setSupportedLocales(Collection supportedLocales) {
this.supportedLocales = supportedLocales;
@@ -236,12 +252,14 @@
}
+ /** {@inheritDoc} */
public VariableResolver getVariableResolver() {
return this.variableResolver;
}
+ /** {@inheritDoc} */
public void setVariableResolver(VariableResolver variableResolver) {
this.variableResolver = variableResolver;
@@ -249,6 +267,7 @@
}
+ /** {@inheritDoc} */
public ViewHandler getViewHandler() {
return this.viewHandler;
@@ -256,6 +275,7 @@
}
+ /** {@inheritDoc} */
public void setViewHandler(ViewHandler viewHandler) {
this.viewHandler = viewHandler;
@@ -263,6 +283,7 @@
}
+ /** {@inheritDoc} */
public void addComponent(String componentType, String componentClass) {
components.put(componentType, componentClass);
@@ -270,6 +291,7 @@
}
+ /** {@inheritDoc} */
public UIComponent createComponent(String componentType) {
if (componentType == null) {
@@ -277,8 +299,8 @@
}
String componentClass = (String) components.get(componentType);
if (componentClass == null) {
- throw new FacesException("No component class registered for component type '" +
- componentType + "'");
+ throw new FacesException("No component class registered for component type '"
+ + componentType + "'");
}
try {
Class clazz = Class.forName(componentClass);
@@ -290,16 +312,18 @@
}
+ /** {@inheritDoc} */
public UIComponent createComponent(ValueBinding componentBinding,
FacesContext context,
String componentType)
throws FacesException {
- throw new FacesException(new UnsupportedOperationException());
+ throw new FacesException(new UnsupportedOperationException());
}
+ /** {@inheritDoc} */
public Iterator getComponentTypes() {
return (components.keySet().iterator());
@@ -307,6 +331,7 @@
}
+ /** {@inheritDoc} */
public void addConverter(String converterId, String converterClass) {
converters.put(converterId, converterClass);
@@ -314,6 +339,7 @@
}
+ /** {@inheritDoc} */
public void addConverter(Class targetClass, String converterClass) {
converters1.put(targetClass, converterClass);
@@ -321,6 +347,7 @@
}
+ /** {@inheritDoc} */
public Converter createConverter(String converterId) {
String converterClass = (String) converters.get(converterId);
@@ -337,6 +364,7 @@
}
+ /** {@inheritDoc} */
public Converter createConverter(Class targetClass) {
String converterClass = (String) converters1.get(targetClass);
@@ -353,6 +381,7 @@
}
+ /** {@inheritDoc} */
public Iterator getConverterIds() {
return (converters.keySet().iterator());
@@ -360,14 +389,16 @@
}
+ /** {@inheritDoc} */
public Iterator getConverterTypes() {
return (converters1.keySet().iterator());
}
-
- public MethodBinding createMethodBinding(String ref, Class params[]) {
+
+ /** {@inheritDoc} */
+ public MethodBinding createMethodBinding(String ref, Class[] params) {
if (ref == null) {
throw new NullPointerException();
@@ -378,6 +409,7 @@
}
+ /** {@inheritDoc} */
public ValueBinding createValueBinding(String ref) {
if (ref == null) {
@@ -389,6 +421,7 @@
}
+ /** {@inheritDoc} */
public void addValidator(String validatorId, String validatorClass) {
validators.put(validatorId, validatorClass);
@@ -396,6 +429,7 @@
}
+ /** {@inheritDoc} */
public Validator createValidator(String validatorId) {
String validatorClass = (String) validators.get(validatorId);
@@ -409,6 +443,7 @@
}
+ /** {@inheritDoc} */
public Iterator getValidatorIds() {
return (validators.keySet().iterator());
}
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationFactory.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationFactory.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationFactory.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationFactory.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -36,8 +36,6 @@
*/
public MockApplicationFactory() {
- ;
-
}
@@ -47,12 +45,17 @@
// ------------------------------------------------------ Instance Variables
+ /**
+ * <p>The <code>Application</code> instance to be returned by
+ * this factory.</p>
+ */
private Application application = null;
// --------------------------------------------- AppolicationFactory Methods
+ /** {@inheritDoc} */
public Application getApplication() {
if (this.application == null) {
@@ -63,6 +66,7 @@
}
+ /** {@inheritDoc} */
public void setApplication(Application application) {
this.application = application;
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationMap.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationMap.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationMap.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockApplicationMap.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -42,6 +42,8 @@
/**
* <p>Construct a default instance.</p>
+ *
+ * @param context ServletContext whose attributes we are wrapping
*/
public MockApplicationMap(ServletContext context) {
@@ -56,12 +58,16 @@
// ------------------------------------------------------ Instance Variables
+ /**
+ * <p>The <code>ServletContext</code> instance we are wrapping.</p>
+ */
private ServletContext context = null;
-
+
// ------------------------------------------------------------- Map Methods
+ /** {@inheritDoc} */
public void clear() {
Iterator keys = keySet().iterator();
@@ -72,6 +78,7 @@
}
+ /** {@inheritDoc} */
public boolean containsKey(Object key) {
return context.getAttribute(key(key)) != null;
@@ -79,6 +86,7 @@
}
+ /** {@inheritDoc} */
public boolean containsValue(Object value) {
if (value == null) {
@@ -96,6 +104,7 @@
}
+ /** {@inheritDoc} */
public Set entrySet() {
Set set = new HashSet();
@@ -108,6 +117,7 @@
}
+ /** {@inheritDoc} */
public boolean equals(Object o) {
return context.equals(o);
@@ -115,6 +125,7 @@
}
+ /** {@inheritDoc} */
public Object get(Object key) {
return context.getAttribute(key(key));
@@ -122,6 +133,7 @@
}
+ /** {@inheritDoc} */
public int hashCode() {
return context.hashCode();
@@ -129,6 +141,7 @@
}
+ /** {@inheritDoc} */
public boolean isEmpty() {
return size() < 1;
@@ -136,6 +149,7 @@
}
+ /** {@inheritDoc} */
public Set keySet() {
Set set = new HashSet();
@@ -148,6 +162,7 @@
}
+ /** {@inheritDoc} */
public Object put(Object key, Object value) {
if (value == null) {
@@ -161,6 +176,7 @@
}
+ /** {@inheritDoc} */
public void putAll(Map map) {
Iterator keys = map.keySet().iterator();
@@ -172,6 +188,7 @@
}
+ /** {@inheritDoc} */
public Object remove(Object key) {
String skey = key(key);
@@ -182,6 +199,7 @@
}
+ /** {@inheritDoc} */
public int size() {
int n = 0;
@@ -195,6 +213,7 @@
}
+ /** {@inheritDoc} */
public Collection values() {
List list = new ArrayList();
@@ -207,6 +226,11 @@
}
+ /**
+ * <p>Return the specified key, converted to a String.</p>
+ *
+ * @param key The key to convert
+ */
private String key(Object key) {
if (key == null) {
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockEnumeration.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockEnumeration.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockEnumeration.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockEnumeration.java Wed Jul 5 11:01:09 2006
@@ -1,12 +1,12 @@
/*
* 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.
@@ -50,12 +50,16 @@
// ------------------------------------------------------ Instance Variables
+ /**
+ * <p>The <code>Iterator</code> we are wrapping.</p>
+ */
private Iterator iterator;
// ----------------------------------------------------- Enumeration Methods
+ /** {@inheritDoc} */
public boolean hasMoreElements() {
return iterator.hasNext();
@@ -63,6 +67,7 @@
}
+ /** {@inheritDoc} */
public Object nextElement() {
return iterator.next();
Modified: struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockExternalContext.java
URL: http://svn.apache.org/viewvc/struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockExternalContext.java?rev=419299&r1=419298&r2=419299&view=diff
==============================================================================
--- struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockExternalContext.java (original)
+++ struts/shale/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockExternalContext.java Wed Jul 5 11:01:09 2006
@@ -84,27 +84,54 @@
private Map requestParameterMap = new HashMap();
- // ------------------------------------------------- setters for the mock object
+ // ------------------------------------------------- setters for the mock object
- public void addRequestCookieMap(Cookie cookie) {
- requestParameterMap.put(cookie.getName(), cookie);
- }
- public void setRequestCookieMap(Map map) {
- requestParameterMap = map;
- }
+ /**
+ * <p>Add a new cookie for this request.</p>
+ *
+ * @param cookie The new cookie
+ */
+ public void addRequestCookieMap(Cookie cookie) {
+ requestParameterMap.put(cookie.getName(), cookie);
+ }
+
+
+ /**
+ * <p>Set the request cookie map for this request.</p>
+ *
+ * @param map The new request cookie map
+ */
+ public void setRequestCookieMap(Map map) {
+ requestParameterMap = map;
+ }
+
+
+ /**
+ * <p>Add the specified request parameter for this request.</p>
+ *
+ * @param key Parameter name
+ * @param value Parameter value
+ */
+ public void addRequestParameterMap(String key, String value) {
+ requestParameterMap.put(key, value);
+ }
- public void addRequestParameterMap(String key, String value){
- requestParameterMap.put(key, value);
- }
- public void setRequestParameterMap(Map map){
- requestParameterMap = map;
- }
+ /**
+ * <p>Set the request parameter map for this request.</p>
+ *
+ * @param map The new request parameter map
+ */
+ public void setRequestParameterMap(Map map) {
+ requestParameterMap = map;
+ }
- // ------------------------------------------------- ExternalContext Methods
+ // ------------------------------------------------- ExternalContext Methods
+
+ /** {@inheritDoc} */
public void dispatch(String requestURI)
throws IOException, FacesException {
@@ -113,6 +140,7 @@
}
+ /** {@inheritDoc} */
public String encodeActionURL(String sb) {
return sb;
@@ -120,6 +148,7 @@
}
+ /** {@inheritDoc} */
public String encodeNamespace(String aValue) {
return aValue;
@@ -127,6 +156,7 @@
}
+ /** {@inheritDoc} */
public String encodeResourceURL(String sb) {
return sb;
@@ -134,6 +164,7 @@
}
+ /** {@inheritDoc} */
public Map getApplicationMap() {
return this.applicationMap;
@@ -141,6 +172,7 @@
}
+ /** {@inheritDoc} */
public String getAuthType() {
return request.getAuthType();
@@ -148,6 +180,7 @@
}
+ /** {@inheritDoc} */
public Object getContext() {
return context;
@@ -155,6 +188,7 @@
}
+ /** {@inheritDoc} */
public String getInitParameter(String name) {
return context.getInitParameter(name);
@@ -162,6 +196,7 @@
}
+ /** {@inheritDoc} */
public Map getInitParameterMap() {
Map parameterMap = new HashMap();
@@ -175,6 +210,7 @@
}
+ /** {@inheritDoc} */
public String getRemoteUser() {
return request.getRemoteUser();
@@ -182,6 +218,7 @@
}
+ /** {@inheritDoc} */
public Object getRequest() {
return request;
@@ -189,6 +226,7 @@
}
+ /** {@inheritDoc} */
public String getRequestContextPath() {
return request.getContextPath();
@@ -196,6 +234,7 @@
}
+ /** {@inheritDoc} */
public Map getRequestCookieMap() {
return requestCookieMap;
@@ -203,6 +242,7 @@
}
+ /** {@inheritDoc} */
public Map getRequestHeaderMap() {
throw new UnsupportedOperationException();
@@ -210,6 +250,7 @@
}
+ /** {@inheritDoc} */
public Map getRequestHeaderValuesMap() {
throw new UnsupportedOperationException();
@@ -217,6 +258,7 @@
}
+ /** {@inheritDoc} */
public Locale getRequestLocale() {
return request.getLocale();
@@ -224,6 +266,7 @@
}
+ /** {@inheritDoc} */
public Iterator getRequestLocales() {
return new LocalesIterator(request.getLocales());
@@ -231,6 +274,7 @@
}
+ /** {@inheritDoc} */
public Map getRequestMap() {
return requestMap;
@@ -238,6 +282,7 @@
}
+ /** {@inheritDoc} */
public Map getRequestParameterMap() {
return requestParameterMap;
@@ -245,6 +290,7 @@
}
+ /** {@inheritDoc} */
public Iterator getRequestParameterNames() {
throw new UnsupportedOperationException();
@@ -252,6 +298,7 @@
}
+ /** {@inheritDoc} */
public Map getRequestParameterValuesMap() {
throw new UnsupportedOperationException();
@@ -259,6 +306,7 @@
}
+ /** {@inheritDoc} */
public String getRequestPathInfo() {
return request.getPathInfo();
@@ -266,6 +314,7 @@
}
+ /** {@inheritDoc} */
public String getRequestServletPath() {
return request.getServletPath();
@@ -273,6 +322,7 @@
}
+ /** {@inheritDoc} */
public URL getResource(String path) throws MalformedURLException {
return context.getResource(path);
@@ -280,6 +330,7 @@
}
+ /** {@inheritDoc} */
public InputStream getResourceAsStream(String path) {
return context.getResourceAsStream(path);
@@ -287,6 +338,7 @@
}
+ /** {@inheritDoc} */
public Set getResourcePaths(String path) {
throw new UnsupportedOperationException();
@@ -294,6 +346,7 @@
}
+ /** {@inheritDoc} */
public Object getResponse() {
return response;
@@ -301,6 +354,7 @@
}
+ /** {@inheritDoc} */
public Object getSession(boolean create) {
return request.getSession(create);
@@ -308,6 +362,7 @@
}
+ /** {@inheritDoc} */
public Map getSessionMap() {
if (sessionMap == null) {
@@ -319,6 +374,7 @@
}
+ /** {@inheritDoc} */
public java.security.Principal getUserPrincipal() {
return request.getUserPrincipal();
@@ -326,6 +382,7 @@
}
+ /** {@inheritDoc} */
public boolean isUserInRole(String role) {
return request.isUserInRole(role);
@@ -333,6 +390,7 @@
}
+ /** {@inheritDoc} */
public void log(String message) {
context.log(message);
@@ -340,6 +398,7 @@
}
+ /** {@inheritDoc} */
public void log(String message, Throwable throwable) {
context.log(message, throwable);
@@ -347,6 +406,7 @@
}
+ /** {@inheritDoc} */
public void redirect(String requestURI)
throws IOException {
@@ -355,19 +415,35 @@
}
+ /**
+ * <p>Iterator implementation that wraps an enumeration
+ * of Locales for the current request.</p>
+ */
private class LocalesIterator implements Iterator {
- public LocalesIterator(Enumeration locales) {
- this.locales = locales;
- }
+ /**
+ * <p>Construct an iterator wrapping the specified
+ * enumeration.</p>
+ *
+ * @param locales Locales enumeration to wrap
+ */
+ public LocalesIterator(Enumeration locales) {
+ this.locales = locales;
+ }
- private Enumeration locales;
+ /**
+ * <p>The enumeration to be wrapped.</p>
+ */
+ private Enumeration locales;
- public boolean hasNext() { return locales.hasMoreElements(); }
+ /** {@inheritDoc} */
+ public boolean hasNext() { return locales.hasMoreElements(); }
- public Object next() { return locales.nextElement(); }
+ /** {@inheritDoc} */
+ public Object next() { return locales.nextElement(); }
- public void remove() { throw new UnsupportedOperationException(); }
+ /** {@inheritDoc} */
+ public void remove() { throw new UnsupportedOperationException(); }
}