You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ba...@apache.org on 2008/05/10 14:29:55 UTC

svn commit: r655068 - /james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/HeaderTest.java

Author: bago
Date: Sat May 10 05:29:54 2008
New Revision: 655068

URL: http://svn.apache.org/viewvc?rev=655068&view=rev
Log:
Tentative test to prove JSIEVE-19.
Not sure this should work this way but I wrote it so I preferred to commit it before leaving, so others (with better sieve knowledge) can better overview the issue.

Modified:
    james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/HeaderTest.java

Modified: james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/HeaderTest.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/HeaderTest.java?rev=655068&r1=655067&r2=655068&view=diff
==============================================================================
--- james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/HeaderTest.java (original)
+++ james/jsieve/trunk/src/test/java/org/apache/jsieve/junit/HeaderTest.java Sat May 10 05:29:54 2008
@@ -330,5 +330,27 @@
         }
         assertTrue(isTestPassed);
     }
+    
+    /**
+     * Test for square brackets in matching headers
+     * When the "[" is in the first char of the pattern it does not matches.
+     * 
+     * @see http://issues.apache.org/jira/browse/JSIEVE-19
+     */
+    public void testSquareBracketsInMatch() {
+        boolean isTestPassed = false;
+        String script = "if header :matches \"X-Caffeine\" \"[test]*\" {throwTestException;}";
+        try {
+            SieveMailAdapter mail = (SieveMailAdapter) JUnitUtils.createMail();
+            mail.getMessage().addHeader("X-Caffeine", "[test] my subject");
+            JUnitUtils.interpret(mail, script);
+        } catch (MessagingException e) {
+        } catch (ThrowTestException.TestException e) {
+            isTestPassed = true;
+        } catch (ParseException e) {
+        } catch (SieveException e) {
+        }
+        assertTrue(isTestPassed);
+    }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org