From 82dd1b8b729f892bb8be8b48407046470c06b23c Mon Sep 17 00:00:00 2001
From: Artur Signell
- * See {@link com.vaadin.data.validator.AbstractStringValidator} for - * more information. + * See {@link com.vaadin.data.validator.AbstractStringValidator} for more + * information. *
* * @author IT Mill Ltd. @@ -26,7 +26,7 @@ public class RegexpValidator extends AbstractStringValidator { private Pattern pattern; private boolean complete; - private Matcher matcher = null; + private transient Matcher matcher = null; /** * Creates a validator for checking that the regular expression matches the diff --git a/src/com/vaadin/tests/TestSerialization.java b/src/com/vaadin/tests/TestSerialization.java index 8b5595fbbc..1ee7f3c1ac 100644 --- a/src/com/vaadin/tests/TestSerialization.java +++ b/src/com/vaadin/tests/TestSerialization.java @@ -12,10 +12,18 @@ import junit.framework.TestCase; import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; import com.vaadin.data.util.MethodProperty; +import com.vaadin.data.validator.RegexpValidator; import com.vaadin.ui.Form; public class TestSerialization extends TestCase { + public void testValidators() throws Exception { + RegexpValidator validator = new RegexpValidator(".*", "Error"); + validator.isValid("aaa"); + RegexpValidator validator2 = (RegexpValidator) serializeAndDeserialize(validator); + validator2.isValid("aaa"); + } + public void testForm() throws Exception { Form f = new Form(); String propertyId = "My property"; @@ -56,7 +64,7 @@ public class TestSerialization extends TestCase { serializeAndDeserialize(mp); } - private static void serializeAndDeserialize(Serializable s) + private static Serializable serializeAndDeserialize(Serializable s) throws IOException, ClassNotFoundException { // Serialize and deserialize @@ -73,6 +81,8 @@ public class TestSerialization extends TestCase { } else { System.out.println(s + " does NOT equal " + s2); } + + return s2; } public static class Data implements Serializable { -- cgit v1.2.3