From 0c8611307c6f5d7a0146ede14600dc6b87aaba07 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 8 Apr 2010 07:41:52 +0000 Subject: Test case for empty and null captions (#3846) svn changeset:12371/svn branch:6.3 --- .../tests/components/caption/EmptyCaptions.html | 32 +++++++++++++ .../tests/components/caption/EmptyCaptions.java | 56 ++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 tests/src/com/vaadin/tests/components/caption/EmptyCaptions.html create mode 100644 tests/src/com/vaadin/tests/components/caption/EmptyCaptions.java diff --git a/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.html b/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.html new file mode 100644 index 0000000000..dc98bbacbb --- /dev/null +++ b/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.html @@ -0,0 +1,32 @@ + + + + + + +EmptyCaptions + + + + + + + + + + + + + + + + + + + + + + +
EmptyCaptions
open/run/com.vaadin.tests.components.caption.EmptyCaptions
waitForVaadin
screenCaptureinitial
+ + diff --git a/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.java b/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.java new file mode 100644 index 0000000000..86f0bd6b9d --- /dev/null +++ b/tests/src/com/vaadin/tests/components/caption/EmptyCaptions.java @@ -0,0 +1,56 @@ +package com.vaadin.tests.components.caption; + +import com.vaadin.terminal.UserError; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.TextField; + +public class EmptyCaptions extends TestBase { + + @Override + protected void setup() { + TextField tf; + + tf = new TextField(null, "Null caption"); + addComponent(tf); + + tf = new TextField("", "Empty caption"); + addComponent(tf); + + tf = new TextField(" ", "Space as caption"); + addComponent(tf); + + tf = new TextField(null, "Null caption, required"); + tf.setRequired(true); + addComponent(tf); + tf = new TextField("", "Empty caption, required"); + tf.setRequired(true); + addComponent(tf); + tf = new TextField(" ", "Space as caption, required"); + tf.setRequired(true); + addComponent(tf); + + tf = new TextField(null, "Null caption, error"); + tf.setComponentError(new UserError("error")); + addComponent(tf); + + tf = new TextField("", "Empty caption, error"); + tf.setComponentError(new UserError("error")); + addComponent(tf); + + tf = new TextField(" ", "Space as caption, error"); + tf.setComponentError(new UserError("error")); + addComponent(tf); + + } + + @Override + protected String getDescription() { + return "Null caption should never use space while a non-null caption always should use space."; + } + + @Override + protected Integer getTicketNumber() { + return 3846; + } + +} -- cgit v1.2.3