Clover coverage report - Code Coverage for tapestry release 3.1-alpha-1
Coverage timestamp: Mon Feb 21 2005 09:16:14 EST
file stats: LOC: 92   Methods: 7
NCLOC: 45   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
Go.java 50% 83.3% 71.4% 76.2%
coverage coverage
 1   
 // Copyright 2004, 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.wml;
 16   
 
 17   
 import org.apache.hivemind.ApplicationRuntimeException;
 18   
 import org.apache.tapestry.IMarkupWriter;
 19   
 import org.apache.tapestry.IRequestCycle;
 20   
 import org.apache.tapestry.Tapestry;
 21   
 import org.apache.tapestry.engine.ILink;
 22   
 import org.apache.tapestry.form.Form;
 23   
 import org.apache.tapestry.valid.IValidationDelegate;
 24   
 
 25   
 /**
 26   
  *  The go element declares a go task, indicating navigation to a URI. If the URI
 27   
  *  names a WML card or deck, it is displayed. 
 28   
  *
 29   
  *  @author David Solis
 30   
  *  @since 3.0
 31   
  *
 32   
  **/
 33   
 
 34   
 public abstract class Go extends Form
 35   
 {
 36   
 
 37   
     /** @since 3.0 **/
 38   
 
 39  5
     protected void writeAttributes(IMarkupWriter writer, ILink link)
 40   
     {
 41  5
         String method = getMethod();
 42   
 
 43  5
         writer.begin(getTag());
 44  5
         writer.attribute("method", (method == null) ? "post" : method);
 45  5
         writer.attribute("href", link.getURL(null, false));
 46   
     }
 47   
 
 48   
     /** @since 3.0 **/
 49   
 
 50  28
     protected void writeHiddenField(IMarkupWriter writer, String name, String value)
 51   
     {
 52  28
         writer.beginEmpty("postfield");
 53  28
         writer.attribute("name", name);
 54  28
         writer.attribute("value", value);
 55  28
         writer.println();
 56   
     }
 57   
 
 58   
     /**
 59   
      *  This component doesn't support event handlers.
 60   
      *
 61   
      **/
 62  5
     protected void emitEventHandlers(IMarkupWriter writer, IRequestCycle cycle)
 63   
     {
 64   
     }
 65   
 
 66   
     /**
 67   
      *  This component doesn't support delegate.
 68   
      *
 69   
      **/
 70  0
     public IValidationDelegate getDelegate()
 71   
     {
 72  0
         return null;
 73   
     }
 74   
 
 75  0
     public void setDelegate(IValidationDelegate delegate)
 76   
     {
 77  0
         throw new ApplicationRuntimeException(
 78   
             Tapestry.format("unsupported-property", this, "delegate"));
 79   
     }
 80   
 
 81  10
     protected String getTag()
 82   
     {
 83  10
         return "go";
 84   
     }
 85   
 
 86   
 
 87  10
     protected String getDisplayName()
 88   
     {
 89  10
         return "Go";
 90   
     }
 91   
 }
 92