MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
I18NDeeperTest.java
1 /*
2  Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 package testsuite.clusterj.util.deeper;
19 
20 import com.mysql.clusterj.core.util.I18NHelper;
21 import testsuite.clusterj.AbstractClusterJCoreTest;
22 
24 
28  public void test() {
30  String msg0 = helper.message("MSG_0");
31  errorIfNotEqual("Failure on message resolution", "Message", msg0);
32  String msg1 = helper.message("MSG_1", 1);
33  errorIfNotEqual("Failure on message resolution", "Message 1", msg1);
34  String msg2 = helper.message("MSG_2", 1, "2");
35  errorIfNotEqual("Failure on message resolution", "Message 1 2", msg2);
36  String msg3 = helper.message("MSG_3", 1, 2.0, 3);
37  errorIfNotEqual("Failure on message resolution", "Message 1 2 3", msg3);
38  String msg4 = helper.message("MSG_4", 1, 2, 3L, 4);
39  errorIfNotEqual("Failure on message resolution", "Message 1 2 3 4", msg4);
40  String msg5 = helper.message("MSG_5", 1, 2, 3, 4F, 5);
41  errorIfNotEqual("Failure on message resolution", "Message 1 2 3 4 5", msg5);
42  try {
43  String msg6 = helper.message("MSG_6", 1, 2, 3, 4, 5, 6);
44  // bad; should not find MSG_6 in bundle
45  error("Should not find MSG_6 in bundle; returned: " + msg6);
46  } catch (Exception ex) {
47  // good catch
48  }
49  failOnError();
50  }
51 
52 }