Changeset 271
- Timestamp:
- 08/10/08 12:53:19 PM (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/LogicMailTests/src/org/logicprobe/LogicMail/mail/imap/ImapProtocolTest.java
r263 r271 182 182 } 183 183 184 public void testExecuteList () {184 public void testExecuteList1() { 185 185 try { 186 186 // Test top-level inbox … … 199 199 assertEquals(".", result1.delim); 200 200 assertEquals("INBOX", result1.name); 201 201 } catch (Throwable t) { 202 fail("Exception thrown during test: "+t.toString()); 203 t.printStackTrace(); 204 } 205 } 206 207 public void testExecuteList2() { 208 try { 202 209 // Test subfolders of inbox 203 210 instance.addExecuteExpectation( … … 208 215 }); 209 216 210 result = instance.executeList("INBOX.", "%");217 Vector result = instance.executeList("INBOX.", "%"); 211 218 assertNotNull(result); 212 219 assertEquals(2, result.size()); 213 220 assertTrue(result.elementAt(0) instanceof ImapProtocol.ListResponse); 214 221 assertTrue(result.elementAt(1) instanceof ImapProtocol.ListResponse); 215 result1 = (ImapProtocol.ListResponse)result.elementAt(0);222 ImapProtocol.ListResponse result1 = (ImapProtocol.ListResponse)result.elementAt(0); 216 223 ImapProtocol.ListResponse result2 = (ImapProtocol.ListResponse)result.elementAt(1); 217 224 … … 227 234 assertEquals(".", result2.delim); 228 235 assertEquals("INBOX.Sent", result2.name); 229 236 } catch (Throwable t) { 237 fail("Exception thrown during test: "+t.toString()); 238 t.printStackTrace(); 239 } 240 } 241 242 public void testExecuteList3() { 243 try { 230 244 // Test inbox with a NIL delimiter 231 245 instance.addExecuteExpectation( … … 235 249 "* LIST (\\HasNoChildren) \"/\" Sent" 236 250 }); 237 result = instance.executeList("", "%");251 Vector result = instance.executeList("", "%"); 238 252 assertNotNull(result); 239 253 assertEquals(2, result.size()); 240 254 assertTrue(result.elementAt(0) instanceof ImapProtocol.ListResponse); 241 255 assertTrue(result.elementAt(1) instanceof ImapProtocol.ListResponse); 242 result1 = (ImapProtocol.ListResponse)result.elementAt(0);243 result2 = (ImapProtocol.ListResponse)result.elementAt(1);256 ImapProtocol.ListResponse result1 = (ImapProtocol.ListResponse)result.elementAt(0); 257 ImapProtocol.ListResponse result2 = (ImapProtocol.ListResponse)result.elementAt(1); 244 258 245 259 assertTrue(!result1.hasChildren); … … 254 268 assertEquals("/", result2.delim); 255 269 assertEquals("Sent", result2.name); 256 270 } catch (Throwable t) { 271 fail("Exception thrown during test: "+t.toString()); 272 t.printStackTrace(); 273 } 274 } 275 276 public void testExecuteList4() { 277 try { 257 278 // Test parameter in response 258 279 instance.addExecuteExpectation( … … 264 285 }); 265 286 266 result = instance.executeList("INBOX.", "%");287 Vector result = instance.executeList("INBOX.", "%"); 267 288 assertNotNull(result); 268 289 assertEquals(2, result.size()); 269 290 assertTrue(result.elementAt(0) instanceof ImapProtocol.ListResponse); 270 291 assertTrue(result.elementAt(1) instanceof ImapProtocol.ListResponse); 271 result1 = (ImapProtocol.ListResponse)result.elementAt(0);272 result2 = (ImapProtocol.ListResponse)result.elementAt(1);292 ImapProtocol.ListResponse result1 = (ImapProtocol.ListResponse)result.elementAt(0); 293 ImapProtocol.ListResponse result2 = (ImapProtocol.ListResponse)result.elementAt(1); 273 294 274 295 assertTrue(!result1.hasChildren); … … 283 304 assertEquals(".", result2.delim); 284 305 assertEquals("INBOX.Sent", result2.name); 285 306 } catch (Throwable t) { 307 fail("Exception thrown during test: "+t.toString()); 308 t.printStackTrace(); 309 } 310 } 311 312 public void testExecuteList5() { 313 try { 286 314 // Test escaped delimiter 287 315 instance.addExecuteExpectation( … … 292 320 }); 293 321 294 result = instance.executeList("INBOX\\", "%");322 Vector result = instance.executeList("INBOX\\", "%"); 295 323 assertNotNull(result); 296 324 assertEquals(2, result.size()); 297 325 assertTrue(result.elementAt(0) instanceof ImapProtocol.ListResponse); 298 326 assertTrue(result.elementAt(1) instanceof ImapProtocol.ListResponse); 299 result1 = (ImapProtocol.ListResponse)result.elementAt(0);300 result2 = (ImapProtocol.ListResponse)result.elementAt(1);327 ImapProtocol.ListResponse result1 = (ImapProtocol.ListResponse)result.elementAt(0); 328 ImapProtocol.ListResponse result2 = (ImapProtocol.ListResponse)result.elementAt(1); 301 329 302 330 assertTrue(!result1.hasChildren); … … 311 339 assertEquals("\\", result2.delim); 312 340 assertEquals("INBOX\\Sent", result2.name); 313 341 } catch (Throwable t) { 342 fail("Exception thrown during test: "+t.toString()); 343 t.printStackTrace(); 344 } 345 } 346 347 public void testExecuteList6() { 348 try { 314 349 // Test specified-length encoding for path name 315 350 instance.addExecuteExpectation( … … 322 357 }); 323 358 324 result = instance.executeList("2007\\", "%");359 Vector result = instance.executeList("2007\\", "%"); 325 360 assertNotNull(result); 326 361 assertEquals(2, result.size()); 327 362 assertTrue(result.elementAt(0) instanceof ImapProtocol.ListResponse); 328 363 assertTrue(result.elementAt(1) instanceof ImapProtocol.ListResponse); 329 result1 = (ImapProtocol.ListResponse)result.elementAt(0);330 result2 = (ImapProtocol.ListResponse)result.elementAt(1);364 ImapProtocol.ListResponse result1 = (ImapProtocol.ListResponse)result.elementAt(0); 365 ImapProtocol.ListResponse result2 = (ImapProtocol.ListResponse)result.elementAt(1); 331 366 332 367 assertTrue(!result1.hasChildren); … … 341 376 assertEquals("\\", result2.delim); 342 377 assertEquals("2007\\Q4-2007", result2.name); 343 344 378 } catch (Throwable t) { 345 379 fail("Exception thrown during test: "+t.toString()); … … 552 586 suite.addTest(new ImapProtocolTest("executeNamespace", new TestMethod() 553 587 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteNamespace(); } })); 554 suite.addTest(new ImapProtocolTest("executeList", new TestMethod() 555 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteList(); } })); 588 suite.addTest(new ImapProtocolTest("executeList1", new TestMethod() 589 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteList1(); } })); 590 suite.addTest(new ImapProtocolTest("executeList2", new TestMethod() 591 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteList2(); } })); 592 suite.addTest(new ImapProtocolTest("executeList3", new TestMethod() 593 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteList3(); } })); 594 suite.addTest(new ImapProtocolTest("executeList4", new TestMethod() 595 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteList4(); } })); 596 suite.addTest(new ImapProtocolTest("executeList5", new TestMethod() 597 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteList5(); } })); 598 suite.addTest(new ImapProtocolTest("executeList6", new TestMethod() 599 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteList6(); } })); 556 600 suite.addTest(new ImapProtocolTest("executeFetchEnvelope1", new TestMethod() 557 601 { public void run(TestCase tc) {((ImapProtocolTest)tc).testExecuteFetchEnvelope1(); } }));
