Package org.apache.jsieve.utils

Examples of org.apache.jsieve.utils.SieveMailAdapter


     */
    public void testSpecialCharsEscapingInMatchFalse() {
        boolean isTestPassed = false;
        String script = "if header :matches \"X-Caffeine\" \"my,?,\\?,\\\\?,*,\\*,\\\\*,pattern\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("X-Caffeine",
                    "my,x,x,q,foo,bar,*,pattern");
            JUnitUtils.interpret(mail, script);
            isTestPassed = true;
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
View Full Code Here


     */
    public void testIfAddressAllIsTrue() {
        boolean isTestPassed = false;
        String script = "if address :all :is \"From\" \"user@domain\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From", "user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
View Full Code Here

     */
    public void testCaseInsensitiveHeaderName() {
        boolean isTestPassed = false;
        String script = "if address :all :is \"from\" \"user@domain\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From", "user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
View Full Code Here

     */
    public void testTreatmentOfEmbededSpacesInHeaderName() {
        boolean isTestPassed = false;
        String script = "if address :all :is \"From\" \"user@domain\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From ", "user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
View Full Code Here

     */
    public void testOctetComparatorTrue() {
        boolean isTestPassed = false;
        String script = "if address :comparator \"i;octet\" :all :is \"From\" \"uSeR@dOmAiN\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From ", "uSeR@dOmAiN");
            JUnitUtils.interpret(mail, script);
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
View Full Code Here

     */
    public void testOctetComparatorFalse() {
        boolean isTestPassed = false;
        String script = "if address :comparator \"i;octet\" :all :is \"From\" \"uSeR@dOmAiN\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From ", "user@domain");
            JUnitUtils.interpret(mail, script);
            isTestPassed = true;
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
        } catch (ParseException e) {
View Full Code Here

     */
    public void testAsciiComparatorTrue() {
        boolean isTestPassed = false;
        String script = "if address :comparator \"i;ascii-casemap\" :all :is \"From\" \"uSeR@dOmAiN\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From ", "user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
View Full Code Here

     */
    public void testAsciiComparatorFalse() {
        boolean isTestPassed = false;
        String script = "if address :comparator \"i;ascii-casemap\" :all :is \"From\" \"uSeR@dOmAiN\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From ", "user@domain1");
            JUnitUtils.interpret(mail, script);
            isTestPassed = true;
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
        } catch (ParseException e) {
View Full Code Here

     */
    public void testIfAddressAllIsMultiTrue1() {
        boolean isTestPassed = false;
        String script = "if address :all :is [\"From\", \"To\"] \"user@domain\" {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From", "user@domain");
            mail.getMessage().addHeader("To", "user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
View Full Code Here

     */
    public void testIfAddressAllIsMultiTrue2() {
        boolean isTestPassed = false;
        String script = "if address :all :is [\"From\", \"To\"] [\"user@domain\", \"tweety@pie\"] {throwTestException;}";
        try {
            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
            mail.getMessage().addHeader("From", "user@domain");
            mail.getMessage().addHeader("To", "user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (MessagingException e) {
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
View Full Code Here

TOP

Related Classes of org.apache.jsieve.utils.SieveMailAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.