|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| ScriptMessages.java | - | 50% | 50% | 50% |
|
||||||||||||||
| 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.test; | |
| 16 | ||
| 17 | import org.apache.hivemind.impl.MessageFormatter; | |
| 18 | import org.apache.hivemind.service.ClassFabUtils; | |
| 19 | ||
| 20 | /** | |
| 21 | * Container of static methods to format logging and exception messages, used within the | |
| 22 | * org.apache.tapesty.test package (and a few sub-packages). | |
| 23 | * <p> | |
| 24 | * Technically, these are messages for the test package, and this class should be called | |
| 25 | * TestMessages ... but that's always a bad idea (it makes the class look like a JUnit test suite). | |
| 26 | * <p> | |
| 27 | * This class is public, not package private, because some related sub-packages make use of it as | |
| 28 | * well. | |
| 29 | * | |
| 30 | * @author Howard Lewis Ship | |
| 31 | * @since 4.0 | |
| 32 | */ | |
| 33 | public class ScriptMessages | |
| 34 | { | |
| 35 | private final static MessageFormatter _formatter = new MessageFormatter(ScriptMessages.class); | |
| 36 | ||
| 37 | 3 | static String wrongTypeForEnhancement(Class type) |
| 38 | { | |
| 39 | 3 | return _formatter |
| 40 | .format("wrong-type-for-enhancement", ClassFabUtils.getJavaClassName(type)); | |
| 41 | } | |
| 42 | ||
| 43 | 0 | static String unableToInstantiate(Class abstractClass, Throwable cause) |
| 44 | { | |
| 45 | 0 | return _formatter.format("unable-to-instantiate", abstractClass.getName(), cause); |
| 46 | } | |
| 47 | } |
|
||||||||||