Clover coverage report - Code Coverage for tapestry release 4.0-beta-1
Coverage timestamp: Fri Jun 24 2005 14:32:46 EDT
file stats: LOC: 121   Methods: 12
NCLOC: 82   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
EnhanceMessages.java 75% 89.5% 91.7% 88.6%
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.enhance;
 16   
 17    import java.lang.reflect.Constructor;
 18    import java.lang.reflect.Method;
 19   
 20    import org.apache.hivemind.impl.MessageFormatter;
 21    import org.apache.hivemind.service.ClassFabUtils;
 22    import org.apache.tapestry.Tapestry;
 23   
 24    /**
 25    * Messages for this package.
 26    *
 27    * @author Howard Lewis Ship
 28    * @since 4.0
 29    */
 30    class EnhanceMessages
 31    {
 32    protected static MessageFormatter _formatter = new MessageFormatter(EnhanceMessages.class,
 33    "EnhanceStrings");
 34   
 35  1 static String noImplForAbstractMethod(Method method, Class declareClass, String className,
 36    Class enhancedClass)
 37    {
 38  1 return _formatter.format("no-impl-for-abstract-method", new Object[]
 39    { method, declareClass.getName(), className, enhancedClass.getName() });
 40    }
 41   
 42  0 static String unabelToIntrospectClass(Class targetClass, Throwable cause)
 43    {
 44  0 return _formatter.format("unable-to-introspect-class", targetClass.getName(), cause);
 45    }
 46   
 47  2 static String propertyTypeMismatch(Class componentClass, String propertyName,
 48    Class actualPropertyType, Class expectedPropertyType)
 49    {
 50  2 return _formatter.format("property-type-mismatch", new Object[]
 51    { componentClass.getName(), propertyName,
 52    ClassFabUtils.getJavaClassName(actualPropertyType),
 53    ClassFabUtils.getJavaClassName(expectedPropertyType) });
 54    }
 55   
 56  15 static String errorAddingProperty(String propertyName, Class componentClass, Throwable cause)
 57    {
 58  15 return _formatter.format(
 59    "error-adding-property",
 60    propertyName,
 61    componentClass.getName(),
 62    cause);
 63    }
 64   
 65  7 static String claimedProperty(String propertyName)
 66    {
 67  7 return _formatter.format("claimed-property", propertyName);
 68    }
 69   
 70  1 static String instantiationFailure(Constructor c, Object[] parameters, String classFab,
 71    Throwable cause)
 72    {
 73  1 int count = Tapestry.size(parameters);
 74  1 StringBuffer buffer = new StringBuffer("[");
 75  1 for (int i = 0; i < count; i++)
 76    {
 77  1 if (i > 0)
 78  0 buffer.append(", ");
 79  1 buffer.append(parameters[i]);
 80    }
 81   
 82  1 buffer.append("]");
 83   
 84  1 return _formatter.format("instantiation-failure", new Object[]
 85    { c.getDeclaringClass().getName(), c, buffer.toString(), classFab, cause });
 86    }
 87   
 88  1 static String locatedValueIsNull(String objectReference)
 89    {
 90  1 return _formatter.format("located-value-is-null", objectReference);
 91    }
 92   
 93  1 static String incompatibleInjectType(String locator, Object value, Class propertyType)
 94    {
 95  1 return _formatter.format("incompatible-inject-type", locator, value, ClassFabUtils
 96    .getJavaClassName(propertyType));
 97    }
 98   
 99  5 static String initialValueForProperty(String propertyName)
 100    {
 101  5 return _formatter.format("initial-value-for-property", propertyName);
 102    }
 103   
 104  2 static String unknownInjectType(String propertyName, String injectType)
 105    {
 106  2 return _formatter.format("unknown-inject-type", propertyName, injectType);
 107    }
 108   
 109  1 static String wrongTypeForProperty(String propertyName, Class propertyType, Class requiredType)
 110    {
 111  1 return _formatter.format("wrong-type-for-property", propertyName, ClassFabUtils
 112    .getJavaClassName(propertyType), ClassFabUtils.getJavaClassName(requiredType));
 113    }
 114   
 115  1 public static String wrongTypeForPageInjection(String propertyName, Class propertyType)
 116    {
 117  1 return _formatter.format("wrong-type-for-page-injection", propertyName, ClassFabUtils
 118    .getJavaClassName(propertyType));
 119    }
 120   
 121    }