aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-10-13 08:46:34 +0000
committerArtur Signell <artur.signell@itmill.com>2009-10-13 08:46:34 +0000
commit82dd1b8b729f892bb8be8b48407046470c06b23c (patch)
tree69513ec3088af5c70e040b6526bc9adc10b944d3
parent365dfea87af9b09abbaa0814c6be883123dc1438 (diff)
downloadvaadin-framework-82dd1b8b729f892bb8be8b48407046470c06b23c.tar.gz
vaadin-framework-82dd1b8b729f892bb8be8b48407046470c06b23c.zip
Merged: Test case and fix for #3524
svn changeset:9180/svn branch:6.2
-rw-r--r--src/com/vaadin/data/validator/RegexpValidator.java6
-rw-r--r--src/com/vaadin/tests/TestSerialization.java12
2 files changed, 14 insertions, 4 deletions
diff --git a/src/com/vaadin/data/validator/RegexpValidator.java b/src/com/vaadin/data/validator/RegexpValidator.java
index 2a3979dcdb..96679418c8 100644
--- a/src/com/vaadin/data/validator/RegexpValidator.java
+++ b/src/com/vaadin/data/validator/RegexpValidator.java
@@ -12,8 +12,8 @@ import java.util.regex.Pattern;
* {@link java.util.regex.Pattern#sum}
* </p>
* <p>
- * See {@link com.vaadin.data.validator.AbstractStringValidator} for
- * more information.
+ * See {@link com.vaadin.data.validator.AbstractStringValidator} for more
+ * information.
* </p>
*
* @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 {