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.slider;
18 import org.junit.Test;
20 import com.vaadin.shared.ui.slider.SliderOrientation;
21 import com.vaadin.tests.design.DeclarativeTestBase;
22 import com.vaadin.ui.Slider;
25 * Tests declarative support for implementations of {@link Slider}.
30 public class SliderDeclarativeTest extends DeclarativeTestBase<Slider> {
33 public void testDefault() {
34 String design = "<vaadin-slider>";
36 Slider expected = new Slider();
38 testRead(design, expected);
39 testWrite(design, expected);
43 public void testHorizontal() {
44 String design = "<vaadin-slider min=10 max=20 resolution=1 value=12.3>";
46 Slider expected = new Slider();
47 expected.setMin(10.0);
48 expected.setMax(20.0);
49 expected.setResolution(1);
50 expected.setValue(12.3);
52 testRead(design, expected);
53 testWrite(design, expected);
57 public void testVertical() {
58 String design = "<vaadin-slider vertical>";
60 Slider expected = new Slider();
61 expected.setOrientation(SliderOrientation.VERTICAL);
63 testRead(design, expected);
64 testWrite(design, expected);
68 public void testReadOnlyValue() {
69 String design = "<vaadin-slider readonly min=10 max=20 resolution=1 value=12.3>";
71 Slider expected = new Slider();
72 expected.setMin(10.0);
73 expected.setMax(20.0);
74 expected.setResolution(1);
75 expected.setValue(12.3);
76 expected.setReadOnly(true);
78 testRead(design, expected);
79 testWrite(design, expected);