Clover coverage report - Code Coverage for tapestry-portlet release 4.0-beta-6
Coverage timestamp: Wed Sep 7 2005 18:46:01 EDT
file stats: LOC: 73   Methods: 7
NCLOC: 39   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
PortletWebSession.java - 75% 71.4% 73.3%
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.util.List;
 18   
 19    import javax.portlet.PortletSession;
 20   
 21    import org.apache.hivemind.util.Defense;
 22    import org.apache.tapestry.describe.DescriptionReceiver;
 23    import org.apache.tapestry.web.WebSession;
 24    import org.apache.tapestry.web.WebUtils;
 25   
 26    /**
 27    * Adapts a {@link javax.portlet.PortletSession}as a {@link org.apache.tapestry.web.WebSession}.
 28    *
 29    * @author Howard M. Lewis Ship
 30    * @since 4.0
 31    */
 32    public class PortletWebSession implements WebSession
 33    {
 34    private final PortletSession _portletSession;
 35   
 36  5 public PortletWebSession(final PortletSession portletSession)
 37    {
 38  5 Defense.notNull(portletSession, "portletSession");
 39   
 40  5 _portletSession = portletSession;
 41    }
 42   
 43  0 public void describeTo(DescriptionReceiver receiver)
 44    {
 45  0 receiver.describeAlternate(_portletSession);
 46    }
 47   
 48  1 public String getId()
 49    {
 50  1 return _portletSession.getId();
 51    }
 52   
 53  0 public boolean isNew()
 54    {
 55  0 return _portletSession.isNew();
 56    }
 57   
 58  1 public List getAttributeNames()
 59    {
 60  1 return WebUtils.toSortedList(_portletSession.getAttributeNames());
 61    }
 62   
 63  1 public Object getAttribute(String name)
 64    {
 65  1 return _portletSession.getAttribute(name);
 66    }
 67   
 68  1 public void setAttribute(String name, Object attribute)
 69    {
 70  1 _portletSession.setAttribute(name, attribute);
 71    }
 72   
 73    }