Package org.apache.jsieve.utils

Examples of org.apache.jsieve.utils.SieveEnvelopeMailAdapter


     */
    public void testIfEnvelopeAllMatchesTrue() {
        boolean isTestPassed = false;
        String script = "if envelope :all :matches \"From\" \"*@domain\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here


     */
    public void testIfEnvelopeAllContainsTrue() {
        boolean isTestPassed = false;
        String script = "if envelope :all :contains \"From\" \"r@dom\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

     */
    public void testIfEnvelopeLocalpartIsTrue() {
        boolean isTestPassed = false;
        String script = "if envelope :localpart :is \"From\" \"user\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

     */
    public void testIfEnvelopeLocalpartMatchesTrue() {
        boolean isTestPassed = false;
        String script = "if envelope :localpart :matches \"From\" \"*er\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

     */
    public void testIfEnvelopeLocalpartContainsTrue() {
        boolean isTestPassed = false;
        String script = "if envelope :localpart :contains \"From\" \"r\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

    public void testIfEnvelopeDomainIsTrue() {
        boolean isTestPassed = false;
        String script = "if envelope :domain :is \"From\" \"domain\" {throwTestException;}";

        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

     */
    public void testIfEnvelopeDomainMatchesTrue() {
        boolean isTestPassed = false;
        String script = "if envelope :domain :matches \"From\" \"*main\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

     */
    public void testIfEnvelopeDomainContainsTrue() {
        boolean isTestPassed = false;
        String script = "if envelope :domain :contains \"From\" \"dom\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("user@domain");
            JUnitUtils.interpret(mail, script);
        } catch (ThrowTestException.TestException e) {
            isTestPassed = true;
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

     */
    public void testIfEnvelopeAllIsFalse() {
        boolean isTestPassed = false;
        String script = "if envelope :all :is \"From\" \"user@domain\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("tweety@pie");
            JUnitUtils.interpret(mail, script);
            isTestPassed = true;
        } catch (ThrowTestException.TestException e) {
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

     */
    public void testIfEnvelopeAllMatchesFalse() {
        boolean isTestPassed = false;
        String script = "if envelope :all :matches \"From\" \"(.*)@domain\" {throwTestException;}";
        try {
            SieveEnvelopeMailAdapter mail = JUnitUtils.createEnvelopeMail();
            mail.setEnvelopeFrom("bugs@bunny");
            JUnitUtils.interpret(mail, script);
            isTestPassed = true;
        } catch (ThrowTestException.TestException e) {
        } catch (ParseException e) {
        } catch (SieveException e) {
View Full Code Here

TOP

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

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.