01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307
20: * USA
21: *
22: *
23: *
24: */
25: /*
26: * $Header: /home/projects/mule/scm/mule/mule/src/test/java/org/mule/test/config/MessagesTestCase.java,v 1.4 2005/06/23 08:01:27 gnt Exp $
27: * $Revision: 1.4 $
28: * $Date: 2005/06/23 08:01:27 $
29: * ------------------------------------------------------------------------------------------------------
30: *
31: * Copyright (c) SymphonySoft Limited. All rights reserved.
32: * http://www.symphonysoft.com
33: *
34: * The software in this package is published under the terms of the BSD
35: * style license a copy of which has been included with this distribution in
36: * the LICENSE.txt file.
37: */
38: package com.bostechcorp.cbesb.common.i18n;
39:
40: import java.util.MissingResourceException;
41:
42: import junit.framework.TestCase;
43:
44: public class MessagesTestCase extends TestCase {
45:
46: public void testBadBundle() {
47: try {
48: new Message("blah", 1);
49: fail("should throw resource bundle not found exception");
50: } catch (MissingResourceException e) {
51: assertTrue(e.getMessage().startsWith("Can't find bundle"));
52: }
53: }
54:
55: public void testGoodBundle() {
56: Message message = new Message("test", 1, "one", "two", "three");
57: assertEquals("Testing, Testing, one, two, three", message
58: .getMessage());
59: assertEquals("test", message.getBundle());
60: assertEquals(1, message.getCode());
61: }
62: }
|