Clover coverage report - Code Coverage for tapestry release 4.0-beta-2
Coverage timestamp: Sat Jul 9 2005 22:02:17 EDT
file stats: LOC: 135   Methods: 14
NCLOC: 94   Classes: 1
30 day Evaluation License registered to hlship@comcast.net Your 30 day evaluation period has expired. Please visit http://www.cenqua.com to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
EnhanceMessages.java 75% 90.5% 92.9% 89.7%
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.IAsset;
 23    import org.apache.tapestry.Tapestry;
 24   
 25    /**
 26    * Messages for this package.
 27    *
 28    * @author Howard Lewis Ship
 29    * @since 4.0
 30    */
 31    class EnhanceMessages
 32    {
 33    protected static MessageFormatter _formatter = new MessageFormatter(EnhanceMessages.class,
 34    "EnhanceStrings");
 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  7 static String claimedProperty(String propertyName)
 67    {
 68  7 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  5 static String initialValueForProperty(String propertyName)
 101    {
 102  5 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 public 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 public 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 public static String classEnhancementFailure(Class baseClass, Throwable cause)
 130    {
 131  1 return _formatter.format("class-enhancement-failure", ClassFabUtils
 132    .getJavaClassName(baseClass), cause);
 133    }
 134   
 135    }