Clover coverage report - Code Coverage for tapestry release 4.0.1
Coverage timestamp: Fri Mar 31 2006 09:12:14 EST
file stats: LOC: 282   Methods: 40
NCLOC: 216   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ImplMessages.java 0% 57.4% 67.5% 59.3%
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.services.impl;
 16   
 17    import java.net.URL;
 18    import java.util.ArrayList;
 19    import java.util.Collection;
 20    import java.util.List;
 21    import java.util.Locale;
 22   
 23    import javax.servlet.http.HttpServlet;
 24   
 25    import org.apache.hivemind.HiveMind;
 26    import org.apache.hivemind.Location;
 27    import org.apache.hivemind.Resource;
 28    import org.apache.hivemind.impl.MessageFormatter;
 29    import org.apache.tapestry.IComponent;
 30    import org.apache.tapestry.INamespace;
 31    import org.apache.tapestry.engine.IEngineService;
 32    import org.apache.tapestry.parse.OpenToken;
 33    import org.apache.tapestry.services.Infrastructure;
 34    import org.apache.tapestry.spec.IComponentSpecification;
 35    import org.apache.tapestry.spec.IContainedComponent;
 36   
 37    /**
 38    * @author Howard Lewis Ship
 39    * @since 4.0
 40    */
 41    class ImplMessages
 42    {
 43    private final static MessageFormatter _formatter = new MessageFormatter(ImplMessages.class);
 44   
 45  0 static String initializerContribution()
 46    {
 47  0 return _formatter.getMessage("initializer-contribution");
 48    }
 49   
 50  26 static String noApplicationSpecification(HttpServlet servlet)
 51    {
 52  26 return _formatter.format("no-application-specification", servlet.getServletName());
 53    }
 54   
 55  2 static String errorInstantiatingEngine(Class engineClass, Throwable cause)
 56    {
 57  2 return _formatter.format("error-instantiating-engine", engineClass.getName(), cause);
 58    }
 59   
 60  0 static String noTemplateForComponent(String componentId, Locale locale)
 61    {
 62  0 return _formatter.format("no-template-for-component", componentId, locale);
 63    }
 64   
 65  0 static String noTemplateForPage(String pageName, Locale locale)
 66    {
 67  0 return _formatter.format("no-template-for-page", pageName, locale);
 68    }
 69   
 70  0 static String unableToReadTemplate(Object template)
 71    {
 72  0 return _formatter.format("unable-to-read-template", template);
 73    }
 74   
 75  0 static String unableToParseTemplate(Resource resource)
 76    {
 77  0 return _formatter.format("unable-to-parse-template", resource);
 78    }
 79   
 80  0 static String unableToParseSpecification(Resource resource)
 81    {
 82  0 return _formatter.format("unable-to-parse-specification", resource);
 83    }
 84   
 85  0 static String unableToReadInfrastructureProperty(String propertyName, Infrastructure service,
 86    Throwable cause)
 87    {
 88  0 return _formatter.format(
 89    "unable-to-read-infrastructure-property",
 90    propertyName,
 91    service,
 92    cause);
 93    }
 94   
 95  0 static String multipleComponentReferences(IComponent component, String id)
 96    {
 97  0 return _formatter.format("multiple-component-references", component.getExtendedId(), id);
 98    }
 99   
 100  2 static String dupeComponentId(String id, IContainedComponent containedComponent)
 101    {
 102  2 return _formatter.format("dupe-component-id", id, HiveMind
 103    .getLocationString(containedComponent));
 104    }
 105   
 106  0 static String unbalancedCloseTags()
 107    {
 108  0 return _formatter.getMessage("unbalanced-close-tags");
 109    }
 110   
 111  2 static String templateBindingForInformalParameter(IComponent loadComponent,
 112    String parameterName, IComponent component)
 113    {
 114  2 return _formatter.format("template-binding-for-informal-parameter", loadComponent
 115    .getExtendedId(), parameterName, component.getExtendedId());
 116    }
 117   
 118  2 static String templateBindingForReservedParameter(IComponent loadComponent,
 119    String parameterName, IComponent component)
 120    {
 121  2 return _formatter.format("template-binding-for-reserved-parameter", loadComponent
 122    .getExtendedId(), parameterName, component.getExtendedId());
 123    }
 124   
 125  0 static String missingComponentSpec(IComponent component, Collection ids)
 126    {
 127  0 StringBuffer buffer = new StringBuffer();
 128  0 List idList = new ArrayList(ids);
 129  0 int count = idList.size();
 130   
 131  0 for (int i = 0; i < count; i++)
 132    {
 133  0 if (i > 0)
 134  0 buffer.append(", ");
 135   
 136  0 buffer.append(idList.get(i));
 137    }
 138   
 139  0 return _formatter.format("missing-component-spec", component.getExtendedId(), new Integer(
 140    count), buffer.toString());
 141    }
 142   
 143  0 static String bodylessComponent()
 144    {
 145  0 return _formatter.getMessage("bodyless-component");
 146    }
 147   
 148  2 static String dupeTemplateBinding(String name, IComponent component, IComponent loadComponent)
 149    {
 150  2 return _formatter.format(
 151    "dupe-template-binding",
 152    name,
 153    component.getExtendedId(),
 154    loadComponent.getExtendedId());
 155    }
 156   
 157  0 static String unableToLoadProperties(URL url, Throwable cause)
 158    {
 159  0 return _formatter.format("unable-to-load-properties", url, cause);
 160    }
 161   
 162  8 static String noSuchService(String name)
 163    {
 164  8 return _formatter.format("no-such-service", name);
 165    }
 166   
 167  4 static String dupeService(String name, EngineServiceContribution existing)
 168    {
 169  4 return _formatter.format("dupe-service", name, HiveMind.getLocationString(existing));
 170    }
 171   
 172  2 static String unableToParseExpression(String expression, Throwable cause)
 173    {
 174  2 return _formatter.format("unable-to-parse-expression", expression, cause);
 175    }
 176   
 177  6 static String parsedExpression()
 178    {
 179  6 return _formatter.getMessage("parsed-expression");
 180    }
 181   
 182  4 static String unableToReadExpression(String expression, Object target, Throwable cause)
 183    {
 184  4 return _formatter.format("unable-to-read-expression", expression, target, cause);
 185    }
 186   
 187  2 static String unableToWriteExpression(String expression, Object target, Object value,
 188    Throwable cause)
 189    {
 190  2 return _formatter.format("unable-to-write-expression", new Object[]
 191    { expression, target, value, cause });
 192    }
 193   
 194  2 static String isConstantExpressionError(String expression, Exception ex)
 195    {
 196  2 return _formatter.format("is-constant-expression-error", expression, ex);
 197    }
 198   
 199  1314 static String templateParameterName(String name)
 200    {
 201  1314 return _formatter.format("template-parameter-name", name);
 202    }
 203   
 204  776 static String componentPropertySourceDescription(IComponentSpecification spec)
 205    {
 206  776 return _formatter.format("component-property-source-description", spec
 207    .getSpecificationLocation());
 208    }
 209   
 210  144 static String namespacePropertySourceDescription(INamespace namespace)
 211    {
 212  144 return _formatter
 213    .format("namespace-property-source-description", namespace.getExtendedId());
 214    }
 215   
 216  2 static String invalidEncoding(String encoding, Throwable cause)
 217    {
 218  2 return _formatter.format("invalid-encoding", encoding, cause);
 219    }
 220   
 221  4 static String errorResetting(Throwable cause)
 222    {
 223  4 return _formatter.format("error-resetting", cause);
 224    }
 225   
 226  2 static String engineServiceInnerProxyToString(String serviceName)
 227    {
 228  2 return _formatter.format("engine-service-inner-proxy-to-string", serviceName);
 229    }
 230   
 231  2 static String engineServiceOuterProxyToString(String serviceName)
 232    {
 233  2 return _formatter.format("engine-service-outer-proxy-to-string", serviceName);
 234    }
 235   
 236  2 static String serviceNameMismatch(IEngineService service, String expectedName, String actualName)
 237    {
 238  2 return _formatter.format("service-name-mismatch", service, expectedName, actualName);
 239    }
 240   
 241  4 static String infrastructureAlreadyInitialized(String newMode, String initializedMode)
 242    {
 243  4 return _formatter.format("infrastructure-already-initialized", newMode, initializedMode);
 244    }
 245   
 246  4 static String duplicateInfrastructureContribution(InfrastructureContribution conflict,
 247    Location existingLocation)
 248    {
 249  4 return _formatter.format(
 250    "duplicate-infrastructure-contribution",
 251    conflict.getProperty(),
 252    conflict.getMode(),
 253    existingLocation);
 254    }
 255   
 256  4 static String infrastructureNotInitialized()
 257    {
 258  4 return _formatter.getMessage("infrastructure-not-initialized");
 259    }
 260   
 261  4 static String missingInfrastructureProperty(String propertyName)
 262    {
 263  4 return _formatter.format("missing-infrastructure-property", propertyName);
 264    }
 265   
 266  0 public static String usedTemplateParameterAlias(OpenToken token, String attributeName,
 267    String parameterName)
 268    {
 269  0 return _formatter.format("used-template-parameter-alias", new Object[]
 270    { HiveMind.getLocationString(token), token.getType(), attributeName, parameterName });
 271    }
 272   
 273  2 static String engineClassNotFound(String engineClassName)
 274    {
 275  2 return _formatter.format("engine-class-not-found", engineClassName);
 276    }
 277   
 278  4 static String serviceNameIsNull()
 279    {
 280  4 return _formatter.getMessage("service-name-is-null");
 281    }
 282    }