You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2011/02/03 17:12:41 UTC
svn commit: r1066849 [1/2] - in
/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src:
main/java/org/apache/tiles/request/portlet/
main/java/org/apache/tiles/request/portlet/delegate/
main/java/org/apache/tiles/request/portlet/extractor/ test/ja...
Author: apetrelli
Date: Thu Feb 3 16:12:39 2011
New Revision: 1066849
URL: http://svn.apache.org/viewvc?rev=1066849&view=rev
Log:
TILESSB-38
Fixed tiles-request-portlet code style.
Added:
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/package-info.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/package-info.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/package-info.java
Removed:
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/package.html
Modified:
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ActionPortletRequest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/EventPortletRequest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/PortletRequest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/RenderPortletRequest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ResourcePortletRequest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegate.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegate.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/RequestDelegate.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/ResponseDelegate.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMap.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegate.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegate.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractor.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/HeaderExtractor.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractor.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ParameterExtractor.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractor.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractor.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractor.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ActionPortletRequestTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/EventPortletRequestTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletApplicationContextTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletRequestTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/RenderPortletRequestTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ResourcePortletRequestTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegateTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegateTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMapTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegateTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegateTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractorTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/extractor/HeaderExtractorTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractorTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/extractor/ParameterExtractorTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractorTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractorTest.java
tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractorTest.java
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ActionPortletRequest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ActionPortletRequest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ActionPortletRequest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ActionPortletRequest.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet;
import javax.portlet.ActionRequest;
@@ -8,8 +28,21 @@ import org.apache.tiles.request.Applicat
import org.apache.tiles.request.portlet.delegate.StateAwareRequestDelegate;
import org.apache.tiles.request.portlet.delegate.StateAwareResponseDelegate;
+/**
+ * Portlet request for an {@link ActionRequest}.
+ *
+ * @version $Rev$ $Date$
+ */
public class ActionPortletRequest extends PortletRequest {
+ /**
+ * Constructor.
+ *
+ * @param applicationContext The application context.
+ * @param context The portlet context.
+ * @param request The portlet request.
+ * @param response The portlet response.
+ */
public ActionPortletRequest(ApplicationContext applicationContext,
PortletContext context, ActionRequest request, ActionResponse response) {
super(applicationContext, context, request, response,
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/EventPortletRequest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/EventPortletRequest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/EventPortletRequest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/EventPortletRequest.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet;
import javax.portlet.EventRequest;
@@ -8,8 +28,21 @@ import org.apache.tiles.request.Applicat
import org.apache.tiles.request.portlet.delegate.StateAwareRequestDelegate;
import org.apache.tiles.request.portlet.delegate.StateAwareResponseDelegate;
+/**
+ * Portlet request for an {@link EventRequest}.
+ *
+ * @version $Rev$ $Date$
+ */
public class EventPortletRequest extends PortletRequest {
+ /**
+ * Constructor.
+ *
+ * @param applicationContext The application context.
+ * @param context The portlet context.
+ * @param request The portlet request.
+ * @param response The portlet response.
+ */
public EventPortletRequest(ApplicationContext applicationContext,
PortletContext context, EventRequest request,
EventResponse response) {
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/PortletRequest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/PortletRequest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/PortletRequest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/PortletRequest.java Thu Feb 3 16:12:39 2011
@@ -51,6 +51,9 @@ import org.apache.tiles.request.portlet.
*/
public class PortletRequest extends AbstractClientRequest {
+ /**
+ * The native available scopes.
+ */
private static final String[] SCOPES = {"request", "portletSession", "session", "application"};
/**
@@ -76,6 +79,9 @@ public class PortletRequest extends Abst
*/
protected javax.portlet.PortletRequest request = null;
+ /**
+ * The delegate to get information about parameters.
+ */
protected RequestDelegate requestDelegate;
@@ -91,6 +97,9 @@ public class PortletRequest extends Abst
*/
protected PortletResponse response = null;
+ /**
+ * The delegate to get information from a response (output stream, writer, etc.).
+ */
protected ResponseDelegate responseDelegate;
@@ -154,6 +163,11 @@ public class PortletRequest extends Abst
return (this.response);
}
+ /**
+ * Returns the portlet context.
+ *
+ * @return The portlet context.
+ */
public PortletContext getPortletContext() {
return context;
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/RenderPortletRequest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/RenderPortletRequest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/RenderPortletRequest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/RenderPortletRequest.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet;
import javax.portlet.PortletContext;
@@ -8,8 +28,21 @@ import org.apache.tiles.request.Applicat
import org.apache.tiles.request.portlet.delegate.MimeResponseDelegate;
import org.apache.tiles.request.portlet.delegate.PortletRequestDelegate;
+/**
+ * Portlet request for a {@link RenderRequest}.
+ *
+ * @version $Rev$ $Date$
+ */
public class RenderPortletRequest extends PortletRequest {
+ /**
+ * Constructor.
+ *
+ * @param applicationContext The application context.
+ * @param context The portlet context.
+ * @param request The portlet request.
+ * @param response The portlet response.
+ */
public RenderPortletRequest(ApplicationContext applicationContext,
PortletContext context, RenderRequest request,
RenderResponse response) {
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ResourcePortletRequest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ResourcePortletRequest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ResourcePortletRequest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/ResourcePortletRequest.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet;
import javax.portlet.PortletContext;
@@ -8,8 +28,21 @@ import org.apache.tiles.request.Applicat
import org.apache.tiles.request.portlet.delegate.MimeResponseDelegate;
import org.apache.tiles.request.portlet.delegate.PortletRequestDelegate;
+/**
+ * Portlet request for a {@link ResourceRequest}.
+ *
+ * @version $Rev$ $Date$
+ */
public class ResourcePortletRequest extends PortletRequest {
+ /**
+ * Constructor.
+ *
+ * @param applicationContext The application context.
+ * @param context The portlet context.
+ * @param request The portlet request.
+ * @param response The portlet response.
+ */
public ResourcePortletRequest(ApplicationContext applicationContext,
PortletContext context, ResourceRequest request,
ResourceResponse response) {
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegate.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegate.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegate.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegate.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.delegate;
import java.io.IOException;
@@ -7,10 +27,23 @@ import java.io.Writer;
import javax.portlet.MimeResponse;
+/**
+ * Response delegate in case of {@link MimeResponse}.
+ *
+ * @version $Rev$ $Date$
+ */
public class MimeResponseDelegate implements ResponseDelegate {
+ /**
+ * The response.
+ */
private MimeResponse response;
+ /**
+ * Constructor.
+ *
+ * @param response The response.
+ */
public MimeResponseDelegate(MimeResponse response) {
this.response = response;
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegate.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegate.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegate.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegate.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.delegate;
import java.util.Map;
@@ -7,8 +27,16 @@ import javax.portlet.PortletRequest;
import org.apache.tiles.request.collection.ReadOnlyEnumerationMap;
import org.apache.tiles.request.portlet.extractor.ParameterExtractor;
+/**
+ * Request delegate in case of simple Portlet request.
+ *
+ * @version $Rev$ $Date$
+ */
public class PortletRequestDelegate implements RequestDelegate {
+ /**
+ * The request.
+ */
private PortletRequest request;
/**
@@ -23,6 +51,11 @@ public class PortletRequestDelegate impl
*/
private Map<String, String[]> paramValues = null;
+ /**
+ * Constructor.
+ *
+ * @param request The request.
+ */
public PortletRequestDelegate(PortletRequest request) {
this.request = request;
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/RequestDelegate.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/RequestDelegate.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/RequestDelegate.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/RequestDelegate.java Thu Feb 3 16:12:39 2011
@@ -1,10 +1,45 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.delegate;
import java.util.Map;
+/**
+ * Exposes the parameters of a portlet request, if available.
+ *
+ * @version $Rev$ $Date$
+ */
public interface RequestDelegate {
+ /**
+ * The parameters, as single values.
+ *
+ * @return The parameters.
+ */
Map<String, String> getParam();
+ /**
+ * The parameters, with values as array of strings.
+ *
+ * @return The parameters.
+ */
Map<String, String[]> getParamValues();
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/ResponseDelegate.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/ResponseDelegate.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/ResponseDelegate.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/ResponseDelegate.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.delegate;
import java.io.IOException;
@@ -5,15 +25,48 @@ import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
+/**
+ * Exposes features of a response, if they are available.
+ *
+ * @version $Rev$ $Date$
+ */
public interface ResponseDelegate {
+ /**
+ * Returns the output stream.
+ *
+ * @return The output stream.
+ * @throws IOException If the underlying response causes a problem.
+ */
OutputStream getOutputStream() throws IOException;
+ /**
+ * Returns the print writer.
+ *
+ * @return The print writer.
+ * @throws IOException If the underlying response causes a problem.
+ */
PrintWriter getPrintWriter() throws IOException;
+ /**
+ * Returns the writer.
+ *
+ * @return The writer.
+ * @throws IOException If the underlying response causes a problem.
+ */
Writer getWriter() throws IOException;
+ /**
+ * Sets the content type of the response.
+ *
+ * @param contentType The content type.
+ */
void setContentType(String contentType);
+ /**
+ * Checks if the response is committed.
+ *
+ * @return <code>true</code> if the response is committed.
+ */
boolean isResponseCommitted();
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMap.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMap.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMap.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMap.java Thu Feb 3 16:12:39 2011
@@ -1,15 +1,52 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.delegate;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
+/**
+ * Parameter map to be used when the response is a {@link javax.portlet.StateAwareResponse}.
+ *
+ * @version $Rev$ $Date$
+ */
public class StateAwareParameterMap implements Map<String, String[]> {
+ /**
+ * The request parameter map.
+ */
private Map<String, String[]> requestMap;
+ /**
+ * The response parameter map.
+ */
private Map<String, String[]> responseMap;
+ /**
+ * Constructor.
+ *
+ * @param requestMap The request parameter map.
+ * @param responseMap The response parameter map.
+ */
public StateAwareParameterMap(Map<String, String[]> requestMap,
Map<String, String[]> responseMap) {
this.requestMap = requestMap;
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegate.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegate.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegate.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegate.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.delegate;
import java.util.Map;
@@ -8,12 +28,30 @@ import javax.portlet.StateAwareResponse;
import org.apache.tiles.request.collection.AddableParameterMap;
import org.apache.tiles.request.portlet.extractor.StateAwareParameterExtractor;
+/**
+ * Exposes parameters getting them from a portlet reques and allowing to be put
+ * into a {@link StateAwareResponse}.
+ *
+ * @version $Rev$ $Date$
+ */
public class StateAwareRequestDelegate implements RequestDelegate {
+ /**
+ * The request.
+ */
private PortletRequest request;
+ /**
+ * The response.
+ */
private StateAwareResponse response;
+ /**
+ * Constructor.
+ *
+ * @param request The request.
+ * @param response The response.
+ */
public StateAwareRequestDelegate(PortletRequest request,
StateAwareResponse response) {
this.request = request;
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegate.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegate.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegate.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegate.java Thu Feb 3 16:12:39 2011
@@ -1,9 +1,35 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.delegate;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
+/**
+ * A state aware response does not allow to access to the output stream and similar,
+ * so it is, essentially, a feature blocker.
+ *
+ * @version $Rev$ $Date$
+ */
public class StateAwareResponseDelegate implements ResponseDelegate {
@Override
Added: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/package-info.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/package-info.java?rev=1066849&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/package-info.java (added)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/delegate/package-info.java Thu Feb 3 16:12:39 2011
@@ -0,0 +1,24 @@
+/*
+ * $Id: package-info.java 1049711 2010-12-15 21:12:00Z apetrelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * Delegations to map all the different types of request and responses.
+ */
+package org.apache.tiles.request.portlet.delegate;
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractor.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractor.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractor.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractor.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.extractor;
import java.util.Enumeration;
@@ -6,10 +26,23 @@ import javax.portlet.PortletContext;
import org.apache.tiles.request.attribute.AttributeExtractor;
+/**
+ * Extracts attributes from portlet application scope.
+ *
+ * @version $Rev$ $Date$
+ */
public class ApplicationScopeExtractor implements AttributeExtractor {
+ /**
+ * The portlet context.
+ */
private PortletContext context;
+ /**
+ * Constructor.
+ *
+ * @param context The portlet context.
+ */
public ApplicationScopeExtractor(PortletContext context) {
this.context = context;
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/HeaderExtractor.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/HeaderExtractor.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/HeaderExtractor.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/HeaderExtractor.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.extractor;
import java.util.Enumeration;
@@ -7,12 +27,29 @@ import javax.portlet.PortletResponse;
import org.apache.tiles.request.attribute.EnumeratedValuesExtractor;
+/**
+ * Extracts and puts headers in portlet requests and responses.
+ *
+ * @version $Rev$ $Date$
+ */
public class HeaderExtractor implements EnumeratedValuesExtractor {
+ /**
+ * The request.
+ */
private PortletRequest request;
+ /**
+ * The response.
+ */
private PortletResponse response;
+ /**
+ * Constructor.
+ *
+ * @param request The request.
+ * @param response The response.
+ */
public HeaderExtractor(PortletRequest request,
PortletResponse response) {
this.request = request;
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractor.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractor.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractor.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractor.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.extractor;
import java.util.Enumeration;
@@ -6,10 +26,23 @@ import javax.portlet.PortletContext;
import org.apache.tiles.request.attribute.HasKeys;
+/**
+ * Extracts init parameters from a portlet context.
+ *
+ * @version $Rev$ $Date$
+ */
public class InitParameterExtractor implements HasKeys<String> {
+ /**
+ * The portlet context.
+ */
private PortletContext context;
+ /**
+ * Constructor.
+ *
+ * @param context The portlet context.
+ */
public InitParameterExtractor(PortletContext context) {
this.context = context;
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ParameterExtractor.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ParameterExtractor.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ParameterExtractor.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/ParameterExtractor.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.extractor;
import java.util.Enumeration;
@@ -6,10 +26,23 @@ import javax.portlet.PortletRequest;
import org.apache.tiles.request.attribute.HasKeys;
+/**
+ * Extracts parameters from a portlet request.
+ *
+ * @version $Rev$ $Date$
+ */
public class ParameterExtractor implements HasKeys<String> {
+ /**
+ * The portlet request.
+ */
private PortletRequest request;
+ /**
+ * Constructor.
+ *
+ * @param request The portlet request.
+ */
public ParameterExtractor(PortletRequest request) {
this.request = request;
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractor.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractor.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractor.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractor.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.extractor;
import java.util.Enumeration;
@@ -6,10 +26,23 @@ import javax.portlet.PortletRequest;
import org.apache.tiles.request.attribute.AttributeExtractor;
+/**
+ * Extracts attributes from request scope of a portlet request.
+ *
+ * @version $Rev$ $Date$
+ */
public class RequestScopeExtractor implements AttributeExtractor {
+ /**
+ * The portlet request.
+ */
private PortletRequest request;
+ /**
+ * Constructor.
+ *
+ * @param request The portlet request.
+ */
public RequestScopeExtractor(PortletRequest request) {
this.request = request;
}
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractor.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractor.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractor.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractor.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.extractor;
import java.util.Enumeration;
@@ -7,12 +27,29 @@ import javax.portlet.PortletSession;
import org.apache.tiles.request.attribute.AttributeExtractor;
+/**
+ * Extracts attributes from the session scope of a portlet request.
+ *
+ * @version $Rev$ $Date$
+ */
public class SessionScopeExtractor implements AttributeExtractor {
+ /**
+ * The portlet request.
+ */
private PortletRequest request;
+ /**
+ * The subscope (application or portlet).
+ */
private int scope;
+ /**
+ * Constructor.
+ *
+ * @param request The request.
+ * @param scope The subscope (application or portlet).
+ */
public SessionScopeExtractor(PortletRequest request, int scope) {
this.request = request;
if (scope != PortletSession.APPLICATION_SCOPE
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractor.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractor.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractor.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractor.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet.extractor;
import javax.portlet.PortletRequest;
@@ -5,10 +25,24 @@ import javax.portlet.StateAwareResponse;
import org.apache.tiles.request.attribute.HasAddableKeys;
+/**
+ * Extracts parameters from a request and allows putting render parameters in a state aware response.
+ *
+ * @version $Rev$ $Date$
+ */
public class StateAwareParameterExtractor extends ParameterExtractor implements HasAddableKeys<String> {
+ /**
+ * The portlet response.
+ */
private StateAwareResponse response;
+ /**
+ * Constructor.
+ *
+ * @param request The portlet request.
+ * @param response The portlet response.
+ */
public StateAwareParameterExtractor(PortletRequest request, StateAwareResponse response) {
super(request);
this.response = response;
Added: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/package-info.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/package-info.java?rev=1066849&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/package-info.java (added)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/extractor/package-info.java Thu Feb 3 16:12:39 2011
@@ -0,0 +1,24 @@
+/*
+ * $Id: package-info.java 1049711 2010-12-15 21:12:00Z apetrelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * Extractors to get scopes from Portlet requests.
+ */
+package org.apache.tiles.request.portlet.extractor;
Added: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/package-info.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/package-info.java?rev=1066849&view=auto
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/package-info.java (added)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/main/java/org/apache/tiles/request/portlet/package-info.java Thu Feb 3 16:12:39 2011
@@ -0,0 +1,24 @@
+/*
+ * $Id: package-info.java 1049711 2010-12-15 21:12:00Z apetrelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * Support of Tiles requests to portlets.
+ */
+package org.apache.tiles.request.portlet;
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ActionPortletRequestTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ActionPortletRequestTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ActionPortletRequestTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ActionPortletRequestTest.java Thu Feb 3 16:12:39 2011
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet;
@@ -25,14 +42,17 @@ import org.junit.Test;
public class ActionPortletRequestTest {
/**
- * Test method for {@link org.apache.tiles.request.portlet.ActionPortletRequest#ActionPortletRequest(org.apache.tiles.request.ApplicationContext, javax.portlet.PortletContext, javax.portlet.ActionRequest, javax.portlet.ActionResponse)}.
+ * Test method for
+ * {@link ActionPortletRequest#ActionPortletRequest(ApplicationContext,
+ * PortletContext, ActionRequest, ActionResponse)}.
* @throws NoSuchFieldException If something goes wrong.
* @throws SecurityException If something goes wrong.
* @throws IllegalAccessException If something goes wrong.
* @throws IllegalArgumentException If something goes wrong.
*/
@Test
- public void testActionPortletRequest() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
+ public void testActionPortletRequest() throws NoSuchFieldException,
+ IllegalAccessException {
ApplicationContext applicationContext = createMock(ApplicationContext.class);
PortletContext portletContext = createMock(PortletContext.class);
ActionRequest request = createMock(ActionRequest.class);
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/EventPortletRequestTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/EventPortletRequestTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/EventPortletRequestTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/EventPortletRequestTest.java Thu Feb 3 16:12:39 2011
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet;
@@ -25,14 +42,15 @@ import org.junit.Test;
public class EventPortletRequestTest {
/**
- * Test method for {@link org.apache.tiles.request.portlet.EventPortletRequest#EventPortletRequest(org.apache.tiles.request.ApplicationContext, javax.portlet.PortletContext, javax.portlet.EventRequest, javax.portlet.EventResponse)}.
+ * Test method for
+ * {@link EventPortletRequest#EventPortletRequest(ApplicationContext, PortletContext, EventRequest, EventResponse)}.
* @throws NoSuchFieldException If something goes wrong.
* @throws SecurityException If something goes wrong.
* @throws IllegalAccessException If something goes wrong.
* @throws IllegalArgumentException If something goes wrong.
*/
@Test
- public void testEventPortletRequest() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
+ public void testEventPortletRequest() throws NoSuchFieldException, IllegalAccessException {
ApplicationContext applicationContext = createMock(ApplicationContext.class);
PortletContext portletContext = createMock(PortletContext.class);
EventRequest request = createMock(EventRequest.class);
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletApplicationContextTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletApplicationContextTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletApplicationContextTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletApplicationContextTest.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet;
import static org.easymock.EasyMock.*;
@@ -22,8 +42,14 @@ import org.junit.Test;
*/
public class PortletApplicationContextTest {
+ /**
+ * The portlet context.
+ */
private PortletContext portletContext;
+ /**
+ * The application context.
+ */
private PortletApplicationContext context;
/**
@@ -68,7 +94,6 @@ public class PortletApplicationContextTe
/**
* Test method for {@link org.apache.tiles.request.portlet.PortletApplicationContext#getInitParams()}.
*/
- @SuppressWarnings("unchecked")
@Test
public void testGetInitParams() {
replay(portletContext);
@@ -91,7 +116,7 @@ public class PortletApplicationContextTe
}
/**
- * Test method for {@link org.apache.tiles.request.portlet.PortletApplicationContext#getResources(java.lang.String)}.
+ * Test method for {@link PortletApplicationContext#getResources(String)}.
* @throws IOException If something goes wrong.
*/
@Test
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletRequestTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletRequestTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletRequestTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/PortletRequestTest.java Thu Feb 3 16:12:39 2011
@@ -1,3 +1,23 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.tiles.request.portlet;
import static org.easymock.EasyMock.*;
@@ -31,18 +51,39 @@ import org.junit.Test;
*/
public class PortletRequestTest {
+ /**
+ * The application context.
+ */
private ApplicationContext applicationContext;
+ /**
+ * The portlet context.
+ */
private PortletContext portletContext;
+ /**
+ * The request.
+ */
private javax.portlet.PortletRequest request;
+ /**
+ * The response.
+ */
private PortletResponse response;
+ /**
+ * The request to test.
+ */
private PortletRequest req;
+ /**
+ * The request delegate.
+ */
private RequestDelegate requestDelegate;
+ /**
+ * The response delegate.
+ */
private ResponseDelegate responseDelegate;
/**
@@ -81,9 +122,8 @@ public class PortletRequestTest {
/**
* Test method for {@link org.apache.tiles.request.portlet.PortletRequest#doForward(java.lang.String)}.
* @throws IOException If something goes wrong.
- * @throws PortletException If something goes wrong.
*/
- @Test(expected=IOException.class)
+ @Test(expected = IOException.class)
public void testDoForwardNoDispatcher() throws IOException {
expect(responseDelegate.isResponseCommitted()).andReturn(false);
expect(portletContext.getRequestDispatcher("/my/path")).andReturn(null);
@@ -101,7 +141,7 @@ public class PortletRequestTest {
* @throws IOException If something goes wrong.
* @throws PortletException If something goes wrong.
*/
- @Test(expected=IOException.class)
+ @Test(expected = IOException.class)
public void testDoForwardPortletException() throws PortletException, IOException {
PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);
@@ -157,7 +197,7 @@ public class PortletRequestTest {
* Test method for {@link org.apache.tiles.request.portlet.PortletRequest#doInclude(java.lang.String)}.
* @throws IOException If something goes wrong.
*/
- @Test(expected=IOException.class)
+ @Test(expected = IOException.class)
public void testDoIncludeNoDispatcher() throws IOException {
expect(portletContext.getRequestDispatcher("/my/path")).andReturn(null);
@@ -174,7 +214,7 @@ public class PortletRequestTest {
* @throws IOException If something goes wrong.
* @throws PortletException If something goes wrong.
*/
- @Test(expected=IOException.class)
+ @Test(expected = IOException.class)
public void testDoIncludePortletException() throws IOException, PortletException {
PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/RenderPortletRequestTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/RenderPortletRequestTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/RenderPortletRequestTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/RenderPortletRequestTest.java Thu Feb 3 16:12:39 2011
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet;
@@ -25,14 +42,16 @@ import org.junit.Test;
public class RenderPortletRequestTest {
/**
- * Test method for {@link org.apache.tiles.request.portlet.RenderPortletRequest#RenderPortletRequest(org.apache.tiles.request.ApplicationContext, javax.portlet.PortletContext, javax.portlet.RenderRequest, javax.portlet.RenderResponse)}.
+ * Test method for
+ * {@link RenderPortletRequest#RenderPortletRequest(ApplicationContext, PortletContext,
+ * RenderRequest, RenderResponse)}.
* @throws NoSuchFieldException If something goes wrong.
* @throws SecurityException If something goes wrong.
* @throws IllegalAccessException If something goes wrong.
* @throws IllegalArgumentException If something goes wrong.
*/
@Test
- public void testRenderPortletRequest() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
+ public void testRenderPortletRequest() throws NoSuchFieldException, IllegalAccessException {
ApplicationContext applicationContext = createMock(ApplicationContext.class);
PortletContext portletContext = createMock(PortletContext.class);
RenderRequest request = createMock(RenderRequest.class);
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ResourcePortletRequestTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ResourcePortletRequestTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ResourcePortletRequestTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/ResourcePortletRequestTest.java Thu Feb 3 16:12:39 2011
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet;
@@ -25,14 +42,16 @@ import org.junit.Test;
public class ResourcePortletRequestTest {
/**
- * Test method for {@link org.apache.tiles.request.portlet.ResourcePortletRequest#ResourcePortletRequest(org.apache.tiles.request.ApplicationContext, javax.portlet.PortletContext, javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)}.
+ * Test method for
+ * {@link ResourcePortletRequest#ResourcePortletRequest(ApplicationContext, PortletContext,
+ * ResourceRequest, ResourceResponse)}.
* @throws NoSuchFieldException If something goes wrong.
* @throws SecurityException If something goes wrong.
* @throws IllegalAccessException If something goes wrong.
* @throws IllegalArgumentException If something goes wrong.
*/
@Test
- public void testResourcePortletRequest() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
+ public void testResourcePortletRequest() throws NoSuchFieldException, IllegalAccessException {
ApplicationContext applicationContext = createMock(ApplicationContext.class);
PortletContext portletContext = createMock(PortletContext.class);
ResourceRequest request = createMock(ResourceRequest.class);
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegateTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegateTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegateTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegateTest.java Thu Feb 3 16:12:39 2011
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet.delegate;
@@ -22,8 +39,14 @@ import org.junit.Test;
*/
public class MimeResponseDelegateTest {
+ /**
+ * The response.
+ */
private MimeResponse response;
+ /**
+ * The delegate to test.
+ */
private MimeResponseDelegate delegate;
/**
@@ -93,7 +116,7 @@ public class MimeResponseDelegateTest {
}
/**
- * Test method for {@link org.apache.tiles.request.portlet.delegate.MimeResponseDelegate#setContentType(java.lang.String)}.
+ * Test method for {@link MimeResponseDelegate#setContentType(String)}.
*/
@Test
public void testSetContentType() {
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegateTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegateTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegateTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegateTest.java Thu Feb 3 16:12:39 2011
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet.delegate;
@@ -21,8 +38,14 @@ import org.junit.Test;
*/
public class PortletRequestDelegateTest {
+ /**
+ * The request.
+ */
private PortletRequest request;
+ /**
+ * The delegate to test.
+ */
private PortletRequestDelegate delegate;
/**
@@ -37,7 +60,6 @@ public class PortletRequestDelegateTest
/**
* Test method for {@link org.apache.tiles.request.portlet.delegate.PortletRequestDelegate#getParam()}.
*/
- @SuppressWarnings("unchecked")
@Test
public void testGetParam() {
replay(request);
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMapTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMapTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMapTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareParameterMapTest.java Thu Feb 3 16:12:39 2011
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet.delegate;
@@ -21,10 +38,19 @@ import org.junit.Test;
*/
public class StateAwareParameterMapTest {
+ /**
+ * The request map.
+ */
private Map<String, String[]> requestMap;
+ /**
+ * The response map.
+ */
private Map<String, String[]> responseMap;
+ /**
+ * The map to test.
+ */
private StateAwareParameterMap map;
/**
@@ -52,7 +78,7 @@ public class StateAwareParameterMapTest
}
/**
- * Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareParameterMap#containsKey(java.lang.Object)}.
+ * Test method for {@link StateAwareParameterMap#containsKey(Object)}.
*/
@Test
public void testContainsKey() {
@@ -64,7 +90,7 @@ public class StateAwareParameterMapTest
}
/**
- * Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareParameterMap#containsValue(java.lang.Object)}.
+ * Test method for {@link StateAwareParameterMap#containsValue(Object)}.
*/
@Test
public void testContainsValue() {
@@ -132,7 +158,7 @@ public class StateAwareParameterMapTest
}
/**
- * Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareParameterMap#put(java.lang.String, java.lang.String[])}.
+ * Test method for {@link StateAwareParameterMap#put(String, String[])}.
*/
@Test
public void testPut() {
@@ -159,7 +185,7 @@ public class StateAwareParameterMapTest
}
/**
- * Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareParameterMap#remove(java.lang.Object)}.
+ * Test method for {@link StateAwareParameterMap#remove(Object)}.
*/
@Test
public void testRemove() {
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegateTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegateTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegateTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareRequestDelegateTest.java Thu Feb 3 16:12:39 2011
@@ -1,5 +1,22 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet.delegate;
@@ -23,10 +40,19 @@ import org.junit.Test;
*/
public class StateAwareRequestDelegateTest {
+ /**
+ * The request.
+ */
private PortletRequest request;
+ /**
+ * The response.
+ */
private StateAwareResponse response;
+ /**
+ * The delegate to test.
+ */
private StateAwareRequestDelegate delegate;
/**
Modified: tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegateTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegateTest.java?rev=1066849&r1=1066848&r2=1066849&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegateTest.java (original)
+++ tiles/sandbox/trunk/tiles-request/tiles-request-portlet/src/test/java/org/apache/tiles/request/portlet/delegate/StateAwareResponseDelegateTest.java Thu Feb 3 16:12:39 2011
@@ -1,12 +1,27 @@
-/**
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
*
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.tiles.request.portlet.delegate;
import static org.junit.Assert.*;
-import java.io.IOException;
-
import org.junit.Before;
import org.junit.Test;
@@ -17,6 +32,9 @@ import org.junit.Test;
*/
public class StateAwareResponseDelegateTest {
+ /**
+ * The delegate to test.
+ */
private StateAwareResponseDelegate delegate;
/**
@@ -29,33 +47,30 @@ public class StateAwareResponseDelegateT
/**
* Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareResponseDelegate#getOutputStream()}.
- * @throws IOException If something goes wrong.
*/
- @Test(expected=UnsupportedOperationException.class)
+ @Test(expected = UnsupportedOperationException.class)
public void testGetOutputStream() {
delegate.getOutputStream();
}
/**
* Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareResponseDelegate#getPrintWriter()}.
- * @throws IOException If something goes wrong.
*/
- @Test(expected=UnsupportedOperationException.class)
+ @Test(expected = UnsupportedOperationException.class)
public void testGetPrintWriter() {
delegate.getPrintWriter();
}
/**
* Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareResponseDelegate#getWriter()}.
- * @throws IOException If something goes wrong.
*/
- @Test(expected=UnsupportedOperationException.class)
+ @Test(expected = UnsupportedOperationException.class)
public void testGetWriter() {
delegate.getWriter();
}
/**
- * Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareResponseDelegate#isResponseCommitted()}.
+ * Test method for {@link StateAwareResponseDelegate#isResponseCommitted()}.
*/
@Test
public void testIsResponseCommitted() {
@@ -63,9 +78,9 @@ public class StateAwareResponseDelegateT
}
/**
- * Test method for {@link org.apache.tiles.request.portlet.delegate.StateAwareResponseDelegate#setContentType(java.lang.String)}.
+ * Test method for {@link StateAwareResponseDelegate#setContentType(java.lang.String)}.
*/
- @Test(expected=UnsupportedOperationException.class)
+ @Test(expected = UnsupportedOperationException.class)
public void testSetContentType() {
delegate.setContentType("text/html");
}