Clover coverage report - Code Coverage for tapestry release 4.0.2
Coverage timestamp: Thu Apr 13 2006 10:52:06 EDT
file stats: LOC: 158   Methods: 18
NCLOC: 114   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
EnhanceMessages.java 75% 92% 94.4% 91.5%
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, Class baseClass,
 37    Class enhancedClass)
 38    {
 39  1 return _formatter.format("no-impl-for-abstract-method", new Object[]
 40    { method, declareClass.getName(), baseClass.getName(), enhancedClass.getName() });
 41    }
 42   
 43  1 static String unimplementedInterfaceMethod(Method method, Class baseClass, Class enhancedClass)
 44    {
 45  1 return _formatter.format(
 46    "unimplemented-interface-method",
 47    method,
 48    baseClass.getName(),
 49    enhancedClass.getName());
 50    }
 51   
 52  0 static String unabelToIntrospectClass(Class targetClass, Throwable cause)
 53    {
 54  0 return _formatter.format("unable-to-introspect-class", targetClass.getName(), cause);
 55    }
 56   
 57  2 static String propertyTypeMismatch(Class componentClass, String propertyName,
 58    Class actualPropertyType, Class expectedPropertyType)
 59    {
 60  2 return _formatter.format("property-type-mismatch", new Object[]
 61    { componentClass.getName(), propertyName,
 62    ClassFabUtils.getJavaClassName(actualPropertyType),
 63    ClassFabUtils.getJavaClassName(expectedPropertyType) });
 64    }
 65   
 66  15 static String errorAddingProperty(String propertyName, Class componentClass, Throwable cause)
 67    {
 68  15 return _formatter.format(
 69    "error-adding-property",
 70    propertyName,
 71    componentClass.getName(),
 72    cause);
 73    }
 74   
 75  9 static String claimedProperty(String propertyName)
 76    {
 77  9 return _formatter.format("claimed-property", propertyName);
 78    }
 79   
 80  1 static String instantiationFailure(Constructor c, Object[] parameters, String classFab,
 81    Throwable cause)
 82    {
 83  1 int count = Tapestry.size(parameters);
 84  1 StringBuffer buffer = new StringBuffer("[");
 85  1 for (int i = 0; i < count; i++)
 86    {
 87  1 if (i > 0)
 88  0 buffer.append(", ");
 89  1 buffer.append(parameters[i]);
 90    }
 91   
 92  1 buffer.append("]");
 93   
 94  1 return _formatter.format("instantiation-failure", new Object[]
 95    { c.getDeclaringClass().getName(), c, buffer.toString(), classFab, cause });
 96    }
 97   
 98  1 static String locatedValueIsNull(String objectReference)
 99    {
 100  1 return _formatter.format("located-value-is-null", objectReference);
 101    }
 102   
 103  1 static String incompatibleInjectType(String locator, Object value, Class propertyType)
 104    {
 105  1 return _formatter.format("incompatible-inject-type", locator, value, ClassFabUtils
 106    .getJavaClassName(propertyType));
 107    }
 108   
 109  7 static String initialValueForProperty(String propertyName)
 110    {
 111  7 return _formatter.format("initial-value-for-property", propertyName);
 112    }
 113   
 114  2 static String unknownInjectType(String propertyName, String injectType)
 115    {
 116  2 return _formatter.format("unknown-inject-type", propertyName, injectType);
 117    }
 118   
 119  1 static String wrongTypeForProperty(String propertyName, Class propertyType, Class requiredType)
 120    {
 121  1 return _formatter.format("wrong-type-for-property", propertyName, ClassFabUtils
 122    .getJavaClassName(propertyType), ClassFabUtils.getJavaClassName(requiredType));
 123    }
 124   
 125  1 static String wrongTypeForPageInjection(String propertyName, Class propertyType)
 126    {
 127  1 return _formatter.format("wrong-type-for-page-injection", propertyName, ClassFabUtils
 128    .getJavaClassName(propertyType));
 129    }
 130   
 131  1 static String incompatiblePropertyType(String propertyName, Class propertyType,
 132    Class expectedType)
 133    {
 134  1 return _formatter.format("incompatible-property-type", propertyName, ClassFabUtils
 135    .getJavaClassName(propertyType), ClassFabUtils.getJavaClassName(expectedType));
 136    }
 137   
 138  1 static String classEnhancementFailure(Class baseClass, Throwable cause)
 139    {
 140  1 return _formatter.format("class-enhancement-failure", ClassFabUtils
 141    .getJavaClassName(baseClass), cause);
 142    }
 143   
 144  1 static String methodConflict(MethodSignature sig, Location existing)
 145    {
 146  1 return _formatter.format("method-conflict", sig, existing);
 147    }
 148   
 149  1 static String readonlyProperty(String propertyName, Method writeMethod)
 150    {
 151  1 return _formatter.format("readonly-property", propertyName, writeMethod);
 152    }
 153   
 154  1 static String mustBeBoolean(String propertyName)
 155    {
 156  1 return _formatter.format("must-be-boolean", propertyName);
 157    }
 158    }