summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Dukadinov2012-03-22 12:18:26 (EDT)
committerJordan Dukadinov2012-04-04 09:01:11 (EDT)
commitfc59407fa91cbcb54e437b2743cd8516ea54aed1 (patch)
treed4a9f5904f2ee5ed4ca6da925dc99802ce69b990
parent76e92d9c124dcf2ddd7873d46838dac45dfae6c2 (diff)
downloadorg.eclipse.riena-fc59407fa91cbcb54e437b2743cd8516ea54aed1.zip
org.eclipse.riena-fc59407fa91cbcb54e437b2743cd8516ea54aed1.tar.gz
org.eclipse.riena-fc59407fa91cbcb54e437b2743cd8516ea54aed1.tar.bz2
Test case for bug 374184 - Missing error marker when
combining ValidCharacters and MinLength validations
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java
index b908043..0a6684d 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TextRidgetTest2.java
@@ -1852,6 +1852,24 @@ public final class TextRidgetTest2 extends AbstractSWTRidgetTest {
assertEquals(modelHolder.getBean().getText2(), ridget.getText());
}
+
+ public void testVetoValidationWithOnEditRule() {
+ final Text control = getWidget();
+ final ITextRidget ridget = getRidget();
+
+ ridget.bindToModel(bean, TestBean.PROPERTY);
+ ridget.addValidationRule(new MinLength(2), ValidationTime.ON_UI_CONTROL_EDIT);
+ ridget.addValidationRule(new ValidCharacters(ValidCharacters.VALID_NUMBERS), ValidationTime.ON_UI_CONTROL_EDIT);
+
+ UITestHelper.sendString(control.getDisplay(), "1");
+ assertEquals(1, ridget.getMarkers().size());
+ assertEquals("'1' is less than 2 characters long.", ((IMessageMarker) ridget.getMarkers().iterator().next()).getMessage());
+
+ UITestHelper.sendString(control.getDisplay(), "a");
+ assertEquals(1, ridget.getMarkers().size());
+ assertEquals("'1' is less than 2 characters long.", ((IMessageMarker) ridget.getMarkers().iterator().next()).getMessage());
+ }
+
// helping methods
//////////////////