1 28 29 package com.idaremedia.antx.tests; 30 31 import junit.framework.TestSuite; 32 33 import com.idaremedia.antx.ut.HTC; 34 import com.idaremedia.antx.ut.HTCUtils; 35 36 import com.idaremedia.antx.NoiseLevel; 37 import com.idaremedia.antx.starters.MsgTask; 38 39 48 49 public final class MsgTaskTest extends HTC 50 { 51 52 public static final String TEST_CATEGORY="CLASS"; 53 54 55 58 public MsgTaskTest(String methodName) 59 { 60 super("MsgTask::",methodName); 61 } 62 63 64 67 public static TestSuite suite() 68 { 69 return new TestSuite(MsgTaskTest.class); 70 } 71 72 73 76 public static TestSuite baseline() 77 { 78 return suite(); } 80 81 82 85 public static void main(String [] argv) 86 { 87 HTCUtils.quickCheck(suite()); 88 } 89 90 91 95 protected void setUp() throws Exception 96 { 97 configureProjectFromResource("msgid.xml"); 98 } 99 100 101 105 public void checkBaseline() 106 { 107 } 109 110 public void testBaseline() 111 { 112 checkBaseline(); 113 } 114 115 public void testEmptyElement() 116 { 117 expectLog("testEmptyElement",""); 118 } 119 120 public void testEmptyMsgId() 121 { 122 expectLog("testEmptyMsgId",""); 123 } 124 125 public void testEmptyMsgIdWithDefaultMsg() 126 { 127 expectLog("testEmptyMsgIdWithDefaultMsg","Helloworld"); 128 } 129 130 public void testNoMsgIdWithDefaultMsg() 131 { 132 expectLog("testNoMsgIdWithDefaultMsg","Hellopeoples"); 133 } 134 135 138 public void testMissingIdWithMessage_AntX04() 139 { 140 expectLog("testMissingIdWithMessage_AntX04", 141 "The Fall Back Inlined Message"); 142 } 143 144 145 148 public void testMissingIdWithDefaultMsg_AntX04() 149 { 150 expectLog("testMissingIdWithDefaultMsg_AntX04", 151 "The Nested Fall Back Message"); 152 } 153 154 public void testDefaultNoiseLevel() 155 { 156 MsgTask t= new MsgTask(); 157 assertIdent(t.getDefaultMsgLevel(), 158 NoiseLevel.INFO,"default.noiselevel"); 159 expectLog("testDefaultNoiseLevel",""); 160 } 161 162 public void testLowNoiseLevel() 163 { 164 expectFullLogContaining("testDebugNoiseLevel","DebugHello"); 165 } 166 167 public void testLegitMsgIdFound() 168 { 169 expectLogContaining("testLegitMsgIdFound", 170 InitUISMTaskTest.DBG_MSG_OTHER_UISTRINGS); 171 println("LOG: ",getLog()); 172 } 173 174 177 public void testLegitIdWithMessage_AntX04() 178 { 179 String log = runTarget("testLegitIdWithMessage_AntX04"); 180 println("LOG: ",getLog()); 181 verifyOccurances(log,InitUISMTaskTest.DBG_MSG_OTHER_UISTRINGS,1); 182 verifyOccurances(log,"ERROR YOU SHOULD NOT BE HERE",0); 183 } 184 185 public void testMsgArgSubstitution() 186 { 187 String log = runTarget("testArgSubstitution"); 188 verifyOccurances(log,"Mulder",1); 189 verifyOccurances(log,"Sculley",1); 190 verifyOccurances(log,"Seekrits",2); 191 } 192 193 public void testEchoLikeParameters() 194 { 195 expectLog("testEchoLikeParameters","JustLikeTheEchoTask"); 196 } 197 198 199 public void testPropertyMsgIdsUsed_AntX03() 200 { 201 String log = runTarget("testPropertyMsgIdsUsed_AntX03"); 202 verifyOccurances(log,"Whups! echo_",1); 203 verifyOccurances(log,"|||!",1); 204 verifyOccurances(log,"booboo.msgid",1); } 206 } 207 208 209 | Popular Tags |