1 | /* |
2 | * JTiger Unit Testing Framework for J2SE 1.5 |
3 | * Copyright (C) 2005 Tony Morris |
4 | * |
5 | * This software is licenced under the |
6 | * Common Public Licence version 1.0 |
7 | * http://www.opensource.org/licenses/cpl1.0.php |
8 | * |
9 | * You received a copy of this licence with this software. |
10 | */ |
11 | package org.jtiger.ant; |
12 | |
13 | import java.text.MessageFormat; |
14 | import java.util.Arrays; |
15 | import java.util.ResourceBundle; |
16 | import java.util.List; |
17 | |
18 | final class LogMessages |
19 | { |
20 | public static final String BUNDLE = "org/jtiger/ant/LogMessages"; |
21 | |
22 | private LogMessages() |
23 | { |
24 | |
25 | } |
26 | |
27 | public static String usingFixtureClasses(final String... fixtureClasses) |
28 | { |
29 | return MessageFormat.format( |
30 | ResourceBundle.getBundle(LogMessages.BUNDLE).getString("using.fixture.classes"), |
31 | Arrays.toString(fixtureClasses)); |
32 | } |
33 | |
34 | public static String usingDefinitionClass(final String definitionClass) |
35 | { |
36 | return MessageFormat.format( |
37 | ResourceBundle.getBundle(LogMessages.BUNDLE).getString("using.definition.class"), |
38 | definitionClass); |
39 | } |
40 | |
41 | public static String usingSetUpTearDownClass(final String sutdClass) |
42 | { |
43 | return MessageFormat.format( |
44 | ResourceBundle.getBundle(LogMessages.BUNDLE).getString("using.setup.teardown.class"), |
45 | sutdClass); |
46 | } |
47 | |
48 | public static String haltOnFailure(final boolean haltOnFailure) |
49 | { |
50 | return MessageFormat.format( |
51 | ResourceBundle.getBundle(LogMessages.BUNDLE).getString("halt.on.failure"), |
52 | haltOnFailure); |
53 | } |
54 | |
55 | public static String totalNumberOfCategories(final int totalNumberOfCategories) |
56 | { |
57 | return MessageFormat.format( |
58 | ResourceBundle.getBundle(LogMessages.BUNDLE).getString("total.number.of.categories"), |
59 | totalNumberOfCategories); |
60 | } |
61 | |
62 | public static String usingCategoryRegularExpression(final String regex) |
63 | { |
64 | return MessageFormat.format( |
65 | ResourceBundle.getBundle(LogMessages.BUNDLE).getString("using.category.regular.expression"), |
66 | regex); |
67 | } |
68 | |
69 | public static String usingDefaultResultName() |
70 | { |
71 | return ResourceBundle.getBundle(LogMessages.BUNDLE).getString("using.default.result.name"); |
72 | } |
73 | |
74 | public static String usingResultName(final String name) |
75 | { |
76 | return MessageFormat.format( |
77 | ResourceBundle.getBundle(LogMessages.BUNDLE).getString("using.result.name"), |
78 | name); |
79 | } |
80 | |
81 | public static String usingResultParams(final List<Param> params) |
82 | { |
83 | return MessageFormat.format( |
84 | ResourceBundle.getBundle(LogMessages.BUNDLE).getString("using.result.params"), |
85 | params); |
86 | } |
87 | |
88 | public static String usingJUnit() |
89 | { |
90 | return ResourceBundle.getBundle(LogMessages.BUNDLE).getString("using.junit"); |
91 | } |
92 | } |