Hi Ed,

Resources related methods were contributed and added before I know what JUnit 
is (understand more than 1 year 1/2). It's highly possible that the code nedd 
to be improved.

Thanks for your contribution and remarks. I will try to work on it ASAP.

++

Julien

----- Message d'origine ----
De : Ed Smith <[EMAIL PROTECTED]>
À : jwebunit-users@lists.sourceforge.net
Envoyé le : Dimanche, 3 Juin 2007, 22h41mn 34s
Objet : [JWebUnit-users] Resource Bundle Message Handling

In net.sourceforge.jwebunit.junit.WebTester:

 


-       
Why wrap with a RuntimeException instead of a JWebUnit exception (or why not 
avoid wrapping)?  Why dump the exception/stack to the console?


-       
What if I simply want to detect if a resource
exists?  Shouldn't you use an exception that must be advertised for  exceptions 
like  missing resource?


-       
Could you document the exception you do
throw?
-   Support for resources seem incomplete.  Am I missing something?


 


/**


  * Return the value of a web resource based on
its key. This translates to a property file lookup with the locale


  * based on the current TestContext.


  * 


  * @param key name of the web resource.


  * @return value of the web resource, encoded
according to TestContext.


  */


  public String getMessage(String key) {


      String message = "";


      Locale locale = testContext.getLocale();


      try {


          message = ResourceBundle.getBundle(


                 
getTestContext().getResourceBundleName(), locale)


                  .getString(key);


      } catch (Exception e) {


          e.printStackTrace();


          throw new RuntimeException("No
message found for key [" + key


                  + "].", e);


      }


      return message;


  }






       
____________________________________________________________________________________Ready
 for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users





      
_____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to