1 36 package org.columba.ristretto.imap; 37 38 import junit.framework.TestCase; 39 40 46 public class MailboxNameUTF7ConverterTest extends TestCase { 47 48 public void testEncode1() { 49 String input = "plain"; 50 51 assertEquals(input, MailboxNameUTF7Converter.encode(input)); 52 } 53 54 public void testEncode2() { 55 String input = "plain&"; 56 57 assertEquals("plain&-", MailboxNameUTF7Converter.encode(input)); 58 } 59 60 public void testEncode3() { 61 String input = "\u00e4bel"; 62 63 assertEquals("&AOQ-bel", MailboxNameUTF7Converter.encode(input)); 64 } 65 66 public void testEncodeNihongo() { 67 String input = "\u65E5\u672C\u8A9E"; 68 69 assertEquals("&ZeVnLIqe-", MailboxNameUTF7Converter.encode(input)); 70 } 71 72 public void testEncodetalef() { 73 String input = "t\u05D0"; 74 75 assertEquals("t&BdA-", MailboxNameUTF7Converter.encode(input)); 76 } 77 78 public void testEncodePath() { 79 String input = "~peter/mail/\u53F0\u5317/\u65E5\u672C\u8A9E"; 80 81 assertEquals("~peter/mail/&U,BTFw-/&ZeVnLIqe-", MailboxNameUTF7Converter.encode(input)); 82 } 83 84 public void testDecodePath() { 85 String input = "~peter/mail/&U,BTFw-/&ZeVnLIqe-"; 86 87 assertEquals("~peter/mail/\u53F0\u5317/\u65E5\u672C\u8A9E", MailboxNameUTF7Converter.decode(input)); 88 } 89 90 public void testDecode2() { 91 String input = "plain"; 92 93 assertEquals("plain", MailboxNameUTF7Converter.decode(input)); 94 } 95 96 public void testDecode3() { 97 String input = "&AOQ-bel"; 98 99 assertEquals("\u00e4bel", MailboxNameUTF7Converter.decode(input)); 100 } 101 102 public void testDecode1() { 103 String input = "plain&-"; 104 105 assertEquals("plain&", MailboxNameUTF7Converter.decode(input)); 106 } 107 108 109 } 110 | Popular Tags |