Clover coverage report - Code Coverage for tapestry-portlet release 4.0.1
Coverage timestamp: Fri Mar 31 2006 09:14:58 EST
file stats: LOC: 119   Methods: 13
NCLOC: 66   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PortletWebResponse.java - 68.8% 76.9% 72.4%
coverage coverage
 1    // Copyright 2005 The Apache Software Foundation
 2    //
 3    // Licensed under the Apache License, Version 2.0 (the "License");
 4    // you may not use this file except in compliance with the License.
 5    // You may obtain a copy of the License at
 6    //
 7    // http://www.apache.org/licenses/LICENSE-2.0
 8    //
 9    // Unless required by applicable law or agreed to in writing, software
 10    // distributed under the License is distributed on an "AS IS" BASIS,
 11    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    // See the License for the specific language governing permissions and
 13    // limitations under the License.
 14   
 15    package org.apache.tapestry.portlet;
 16   
 17    import java.io.IOException;
 18    import java.io.OutputStream;
 19    import java.io.PrintWriter;
 20   
 21    import javax.portlet.PortletResponse;
 22   
 23    import org.apache.hivemind.util.Defense;
 24    import org.apache.tapestry.util.ContentType;
 25    import org.apache.tapestry.web.WebResponse;
 26   
 27    /**
 28    * Adapts {@link javax.portlet.PortletResponse} as {@link org.apache.tapestry.web.WebResponse}.
 29    *
 30    * @author Howard M. Lewis Ship
 31    * @since 4.0
 32    */
 33    public class PortletWebResponse implements WebResponse
 34    {
 35    private final PortletResponse _portletResponse;
 36   
 37  34 public PortletWebResponse(PortletResponse portletResponse)
 38    {
 39  34 Defense.notNull(portletResponse, "portletResponse");
 40   
 41  34 _portletResponse = portletResponse;
 42    }
 43   
 44  4 public OutputStream getOutputStream(ContentType contentType) throws IOException
 45    {
 46  4 unsupported("getOutputStream");
 47   
 48  0 return null;
 49    }
 50   
 51  0 public PrintWriter getPrintWriter(ContentType contentType) throws IOException
 52    {
 53  0 unsupported("getPrintWriter");
 54   
 55  0 return null;
 56    }
 57   
 58  4 public String encodeURL(String url)
 59    {
 60  4 return _portletResponse.encodeURL(url);
 61    }
 62   
 63    /** Unsupported. */
 64  2 public void reset()
 65    {
 66  2 unsupported("reset");
 67    }
 68   
 69    /** Unsupported. */
 70  0 public void setContentLength(int contentLength)
 71    {
 72  0 unsupported("setContentLength");
 73    }
 74   
 75    /**
 76    * Returns the empty string. The {@link RenderWebResponse} subclass actually provides a
 77    * real value here.
 78    */
 79  2 public String getNamespace()
 80    {
 81  2 return "";
 82    }
 83   
 84  14 protected final void unsupported(String methodName)
 85    {
 86  14 throw new UnsupportedOperationException(PortletMessages.unsupportedMethod(methodName));
 87    }
 88   
 89    /** Unsupported. */
 90  2 public void setDateHeader(String string, long date)
 91    {
 92  2 unsupported("setDateHeader");
 93    }
 94   
 95    /** Unsupported. */
 96  0 public void setStatus(int status)
 97    {
 98  0 unsupported("setStatus");
 99    }
 100   
 101    /** Unsupported. */
 102  2 public void setHeader(String name, String value)
 103    {
 104  2 unsupported("setHeader");
 105    }
 106   
 107    /** Unsupported. */
 108  2 public void setIntHeader(String name, int value)
 109    {
 110  2 unsupported("setIntHeader");
 111    }
 112   
 113    /** Unsupported. */
 114  2 public void sendError(int statusCode, String message) throws IOException
 115    {
 116  2 unsupported("sendError");
 117    }
 118   
 119    }