1 64 65 package com.jcorporate.expresso.core.i18n; 66 67 import com.jcorporate.expresso.core.misc.StringUtil; 68 import junit.framework.Test; 69 import junit.framework.TestCase; 70 import junit.framework.TestSuite; 71 import org.apache.log4j.Logger; 72 73 74 81 public class MessagesTest 82 extends TestCase { 83 private static Logger log = Logger.getLogger(MessagesTest.class); 84 85 90 public MessagesTest(String name) { 91 super(name); 92 } 93 94 99 public int countTestCases() { 100 return 1; 101 } 102 103 107 protected void setUp() 108 throws Exception { 109 110 } 111 112 113 117 protected void tearDown() 118 throws Exception { 119 } 120 121 122 125 public void testSimpleMessage() { 126 try { 127 String returned = Messages.getString("com.jcorporate.expresso.core.ExpressoSchema", 128 "TestMessage"); 129 130 if (!returned.equals("This is a test")) { 131 fail("Didn't get 'This is a test', got '" + 132 StringUtil.notNull(returned) + "' instead"); 133 } 134 } catch (Exception ce) { 135 log.error(ce); 136 fail("Messages exception occurred - see log"); 137 } 138 } 139 140 143 public void testComplexMessage() { 144 145 154 } 155 156 161 public static Test suite() { 162 TestSuite suite = new TestSuite(MessagesTest.class); 163 164 return suite; 165 } 166 167 } 168 169 | Popular Tags |