Clover coverage report - Code Coverage for tapestry release 4.0-beta-9
Coverage timestamp: Sat Oct 1 2005 08:36:20 EDT
file stats: LOC: 149   Methods: 17
NCLOC: 106   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
EnhanceMessages.java 75% 91.7% 94.1% 91.1%
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.Location;
 21    import org.apache.hivemind.impl.MessageFormatter;
 22    import org.apache.hivemind.service.ClassFabUtils;
 23    import org.apache.hivemind.service.MethodSignature;
 24    import org.apache.tapestry.Tapestry;
 25   
 26    /**
 27    * Messages for this package.
 28    *
 29    * @author Howard Lewis Ship
 30    * @since 4.0
 31    */
 32    class EnhanceMessages
 33    {
 34    private final static MessageFormatter _formatter = new MessageFormatter(EnhanceMessages.class);
 35   
 36  1 static String noImplForAbstractMethod(Method method, Class declareClass, String className,
 37    Class enhancedClass)
 38    {
 39  1 return _formatter.format("no-impl-for-abstract-method", new Object[]
 40    { method, declareClass.getName(), className, enhancedClass.getName() });
 41    }
 42   
 43  0 static String unabelToIntrospectClass(Class targetClass, Throwable cause)
 44    {
 45  0 return _formatter.format("unable-to-introspect-class", targetClass.getName(), cause);
 46    }
 47   
 48  2 static String propertyTypeMismatch(Class componentClass, String propertyName,
 49    Class actualPropertyType, Class expectedPropertyType)
 50    {
 51  2 return _formatter.format("property-type-mismatch", new Object[]
 52    { componentClass.getName(), propertyName,
 53    ClassFabUtils.getJavaClassName(actualPropertyType),
 54    ClassFabUtils.getJavaClassName(expectedPropertyType) });
 55    }
 56   
 57  15 static String errorAddingProperty(String propertyName, Class componentClass, Throwable cause)
 58    {
 59  15 return _formatter.format(
 60    "error-adding-property",
 61    propertyName,
 62    componentClass.getName(),
 63    cause);
 64    }
 65   
 66  9 static String claimedProperty(String propertyName)
 67    {
 68  9 return _formatter.format("claimed-property", propertyName);
 69    }
 70   
 71  1 static String instantiationFailure(Constructor c, Object[] parameters, String classFab,
 72    Throwable cause)
 73    {
 74  1 int count = Tapestry.size(parameters);
 75  1 StringBuffer buffer = new StringBuffer("[");
 76  1 for (int i = 0; i < count; i++)
 77    {
 78  1 if (i > 0)
 79  0 buffer.append(", ");
 80  1 buffer.append(parameters[i]);
 81    }
 82   
 83  1 buffer.append("]");
 84   
 85  1 return _formatter.format("instantiation-failure", new Object[]
 86    { c.getDeclaringClass().getName(), c, buffer.toString(), classFab, cause });
 87    }
 88   
 89  1 static String locatedValueIsNull(String objectReference)
 90    {
 91  1 return _formatter.format("located-value-is-null", objectReference);
 92    }
 93   
 94  1 static String incompatibleInjectType(String locator, Object value, Class propertyType)
 95    {
 96  1 return _formatter.format("incompatible-inject-type", locator, value, ClassFabUtils
 97    .getJavaClassName(propertyType));
 98    }
 99   
 100  7 static String initialValueForProperty(String propertyName)
 101    {
 102  7 return _formatter.format("initial-value-for-property", propertyName);
 103    }
 104   
 105  2 static String unknownInjectType(String propertyName, String injectType)
 106    {
 107  2 return _formatter.format("unknown-inject-type", propertyName, injectType);
 108    }
 109   
 110  1 static String wrongTypeForProperty(String propertyName, Class propertyType, Class requiredType)
 111    {
 112  1 return _formatter.format("wrong-type-for-property", propertyName, ClassFabUtils
 113    .getJavaClassName(propertyType), ClassFabUtils.getJavaClassName(requiredType));
 114    }
 115   
 116  1 static String wrongTypeForPageInjection(String propertyName, Class propertyType)
 117    {
 118  1 return _formatter.format("wrong-type-for-page-injection", propertyName, ClassFabUtils
 119    .getJavaClassName(propertyType));
 120    }
 121   
 122  1 static String incompatiblePropertyType(String propertyName, Class propertyType,
 123    Class expectedType)
 124    {
 125  1 return _formatter.format("incompatible-property-type", propertyName, ClassFabUtils
 126    .getJavaClassName(propertyType), ClassFabUtils.getJavaClassName(expectedType));
 127    }
 128   
 129  1 static String classEnhancementFailure(Class baseClass, Throwable cause)
 130    {
 131  1 return _formatter.format("class-enhancement-failure", ClassFabUtils
 132    .getJavaClassName(baseClass), cause);
 133    }
 134   
 135  1 static String methodConflict(MethodSignature sig, Location existing)
 136    {
 137  1 return _formatter.format("method-conflict", sig, existing);
 138    }
 139   
 140  1 static String readonlyProperty(String propertyName, Method writeMethod)
 141    {
 142  1 return _formatter.format("readonly-property", propertyName, writeMethod);
 143    }
 144   
 145  1 static String mustBeBoolean(String propertyName)
 146    {
 147  1 return _formatter.format("must-be-boolean", propertyName);
 148    }
 149    }