package com.vaadin.v7.tests.server.components; import java.util.HashMap; import java.util.Map; import org.junit.Before; import com.vaadin.v7.tests.server.component.abstractfield.AbstractFieldValueChangeTestBase; import com.vaadin.v7.ui.AbstractField; import com.vaadin.v7.ui.ComboBox; /** * Check that the value change listener for a combo box is triggered exactly * once when setting the value, at the correct time. * * See Ticket 4394. */ public class ComboBoxValueChangeTest extends AbstractFieldValueChangeTestBase { @Before public void setUp() { ComboBox combo = new ComboBox(); combo.addItem("myvalue"); super.setUp(combo); } @Override protected void setValue(AbstractField field) { Map variables = new HashMap(); variables.put("selected", new String[] { "myvalue" }); ((ComboBox) field).changeVariables(field, variables); } }