2 * Copyright 2000-2014 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.tests.server.component.abstracttextfield;
18 import org.junit.Test;
20 import com.vaadin.tests.design.DeclarativeTestBase;
21 import com.vaadin.ui.AbstractTextField;
22 import com.vaadin.ui.AbstractTextField.TextChangeEventMode;
23 import com.vaadin.ui.TextField;
26 * Tests declarative support for AbstractTextField.
31 public class AbstractTextFieldDeclarativeTest extends
32 DeclarativeTestBase<AbstractTextField> {
35 public void testAttributes() {
36 String design = "<v-text-field null-representation=this-is-null "
37 + "null-setting-allowed='' maxlength=5 columns=3 "
38 + "input-prompt=input text-change-event-mode=eager "
39 + "text-change-timeout=100 />";
40 AbstractTextField tf = new TextField();
41 tf.setNullRepresentation("this-is-null");
42 tf.setNullSettingAllowed(true);
45 tf.setInputPrompt("input");
46 tf.setTextChangeEventMode(TextChangeEventMode.EAGER);
47 tf.setTextChangeTimeout(100);
49 testWrite(design, tf);