Messages { public static String getString( String key ) { try { return getBundle().getString( key ); } catch ( MissingResourceException e ) { return '!' + key + '!'; } }  static String getString( String key ); static String getString( String key, String param1 ); static String getString( String key, String param1, String param2 ); static String getString( String key, String param1, String param2, String param3 ); static String getString( String key, String param1, String param2, String param3, String param4 ); static String getErrorString( String key ); static String getErrorString( String key, String param1 ); static String getErrorString( String key, String param1, String param2 ); static String getErrorString( String key, String param1, String param2, String param3 ); static void main( String[] args );  }
@Test public void testGetMessages() throws Exception { assertEquals( "Wrong message returned", "Normal", Messages.getString( "XmlSerializer.stateNormal" ) ); assertEquals( "Wrong message returned", "Unknown Host: localhost", Messages.getString( "StopJettyServer.ERROR_0003_UNKNOWN_HOST", "localhost" ) ); assertEquals( "Wrong message returned", "Client request for URI \"A\" failed. Reason for failure: B.", Messages.getString( "ThreadSafeHttpClient.ERROR_0001_CLIENT_REQUEST_FAILED", "A", "B" ) ); }
@Test public void testBadEncoding() { assertEquals( "!test.bad_encode1!", Messages.getString( "test.bad_encode1" ) ); }