Java ResourceBundle 在web自动化测试中使用的好处。。

6 views
Skip to first unread message

jester xu

unread,
Aug 16, 2011, 1:52:19 AM8/16/11
to WATF Forum
ResourceBundle最大的好处是可以使你的程序国际化,在bundle文件名后加上国家、语言关键字,那系统就会自动载入相应的bundle
文件。
  比如:
  bundle.properties 缺省
  bundle_zh.properties 中文
  bundle_ja.properties 日文
  ResourceBundle bundle= ResourceBundle.getBundle( "bundle ");
  如果你的系统是中文的,那就会自动加载bundle_zh.properties
  需要注意的是,多字节编码的bundle需要用native2ascii转成unicode编码。

在自动测试WATF框架中采用ResourceBundle可以应用到本地化测试中的。。

Reply all
Reply to author
Forward
0 new messages