]> review.fuel-infra Code Review - packages/trusty/mysql-wsrep-5.6.git/blob
926ae6109d81c4d298497b84a262897737d29691
[packages/trusty/mysql-wsrep-5.6.git] /
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;
19
20 import com.mysql.clusterj.core.util.I18NHelper;
21 import testsuite.clusterj.AbstractClusterJCoreTest;
22
23 public class I18NTest extends AbstractClusterJCoreTest {
24
25     public void test() {
26         I18NHelper helper = I18NHelper.getInstance(I18NTest.class);
27         String msg0 = helper.message("MSG_0");
28         errorIfNotEqual("Failure on message resolution", "Message", msg0);
29         String msg1 = helper.message("MSG_1", 1);
30         errorIfNotEqual("Failure on message resolution", "Message 1", msg1);
31         String msg2 = helper.message("MSG_2", 1, "2");
32         errorIfNotEqual("Failure on message resolution", "Message 1 2", msg2);
33         String msg3 = helper.message("MSG_3", 1, 2.0, 3);
34         errorIfNotEqual("Failure on message resolution", "Message 1 2 3", msg3);
35         String msg4 = helper.message("MSG_4", 1, 2, 3L, 4);
36         errorIfNotEqual("Failure on message resolution", "Message 1 2 3 4", msg4);
37         String msg5 = helper.message("MSG_5", 1, 2, 3, 4F, 5);
38         errorIfNotEqual("Failure on message resolution", "Message 1 2 3 4 5", msg5);
39         try {
40             String msg6 = helper.message("MSG_6", 1, 2, 3, 4, 5, 6);
41             // bad; should not find MSG_6 in bundle
42             error("Should not find MSG_6 in bundle; returned: " + msg6);
43         } catch (Exception ex) {
44             // good catch
45         }
46         failOnError();
47     }
48
49 }