| | 662 | * Test of decodeQuotedPrintable method, of class org.logicprobe.LogicMail.util.StringParser. |
| | 663 | * Soft line-break test. |
| | 664 | */ |
| | 665 | public void testDecodeQuotedPrintable2() { |
| | 666 | System.out.println("decodeQuotedPrintable"); |
| | 667 | String text = "=A1Hol=E1 Se=F1or!=20=20H=\n"+ |
| | 668 | "ow=20are=20you=20today?"; |
| | 669 | String expectedResult = "¡Holá Señor! How are you today?"; |
| | 670 | String result = StringParser.decodeQuotedPrintable(text); |
| | 671 | assertEquals(expectedResult, result); |
| | 672 | } |
| | 673 | |
| | 674 | /** |
| 666 | | String expectedResult = "=A1Hol=E1 Se=F1or!".toLowerCase(); |
| 667 | | String result = StringParser.encodeQuotedPrintable(text).toLowerCase(); |
| | 681 | String expectedResult = "=A1Hol=E1=20Se=F1or!"; |
| | 682 | String result = StringParser.encodeQuotedPrintable(text); |
| | 683 | assertEquals(expectedResult, result); |
| | 684 | } |
| | 685 | |
| | 686 | /** |
| | 687 | * Test of encodeQuotedPrintable method, of class org.logicprobe.LogicMail.util.StringParser. |
| | 688 | * Soft line-break test. |
| | 689 | */ |
| | 690 | public void testEncodeQuotedPrintable2() { |
| | 691 | System.out.println("encodeQuotedPrintable"); |
| | 692 | String text = "¡Holá Señor! ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ¡Holá Señor!"; |
| | 693 | String expectedResult = "=A1Hol=E1=20Se=F1or!=20ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=\r\n0123456789=20=A1Hol=E1=20Se=F1or!"; |
| | 694 | String result = StringParser.encodeQuotedPrintable(text); |
| 725 | | testSuite.addTest(new StringParserTest("decodeQuotedPrintable", new TestMethod() { |
| 726 | | public void run(TestCase tc) { |
| 727 | | ((StringParserTest)tc).testDecodeQuotedPrintable(); |
| 728 | | }})); |
| 729 | | testSuite.addTest(new StringParserTest("encodeQuotedPrintable", new TestMethod() { |
| 730 | | public void run(TestCase tc) { |
| 731 | | ((StringParserTest)tc).testEncodeQuotedPrintable(); |
| | 752 | testSuite.addTest(new StringParserTest("decodeQuotedPrintable1", new TestMethod() { |
| | 753 | public void run(TestCase tc) { |
| | 754 | ((StringParserTest)tc).testDecodeQuotedPrintable1(); |
| | 755 | }})); |
| | 756 | testSuite.addTest(new StringParserTest("decodeQuotedPrintable2", new TestMethod() { |
| | 757 | public void run(TestCase tc) { |
| | 758 | ((StringParserTest)tc).testDecodeQuotedPrintable2(); |
| | 759 | }})); |
| | 760 | testSuite.addTest(new StringParserTest("encodeQuotedPrintable1", new TestMethod() { |
| | 761 | public void run(TestCase tc) { |
| | 762 | ((StringParserTest)tc).testEncodeQuotedPrintable1(); |
| | 763 | }})); |
| | 764 | testSuite.addTest(new StringParserTest("encodeQuotedPrintable2", new TestMethod() { |
| | 765 | public void run(TestCase tc) { |
| | 766 | ((StringParserTest)tc).testEncodeQuotedPrintable2(); |