Added Bundle base name constant.

This commit is contained in:
Erik C. Thauvin 2015-12-04 01:30:26 -08:00
parent da35797ffb
commit 504fdb6bd5
2 changed files with 7 additions and 2 deletions

View file

@ -46,6 +46,11 @@ import java.util.TreeMap;
*/ */
public class Reasons public class Reasons
{ {
/**
* The resource bundle base name.
*/
public static final String BUNDLE_BASENAME = "net.thauvin.erik.httpstatus.reasons";
/** /**
* The reason phrases map. * The reason phrases map.
*/ */
@ -93,7 +98,7 @@ public class Reasons
*/ */
static static
{ {
final ResourceBundle bundle = ResourceBundle.getBundle("net.thauvin.erik.httpstatus.reasons"); final ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_BASENAME);
for (final String key : bundle.keySet()) for (final String key : bundle.keySet())
{ {
REASON_PHRASES.put(key, bundle.getString(key)); REASON_PHRASES.put(key, bundle.getString(key));

View file

@ -52,7 +52,7 @@ public class ReasonsTest
@DataProvider(name = "reasons") @DataProvider(name = "reasons")
public Object[][] reasons() public Object[][] reasons()
{ {
final ResourceBundle bundle = ResourceBundle.getBundle("net.thauvin.erik.httpstatus.reasons"); final ResourceBundle bundle = ResourceBundle.getBundle(Reasons.BUNDLE_BASENAME);
final Object[][] reasons = new String[bundle.keySet().size()][2]; final Object[][] reasons = new String[bundle.keySet().size()][2];
int i = 0; int i = 0;
for (final String key : bundle.keySet()) for (final String key : bundle.keySet())