diff options
author | Artur Signell <artur@vaadin.com> | 2012-10-22 16:24:05 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-10-24 15:33:48 +0300 |
commit | 9551d7ca56bb9fced67ced199bf23363ac230f3e (patch) | |
tree | 45b5ab0195d67335c84e5b8e39a143b7f67f5952 /uitest/src/com/vaadin/tests/components/progressindicator | |
parent | 0121af0c28d92db37dea94050f3453ecf46556b9 (diff) | |
download | vaadin-framework-9551d7ca56bb9fced67ced199bf23363ac230f3e.tar.gz vaadin-framework-9551d7ca56bb9fced67ced199bf23363ac230f3e.zip |
Updated ProgressIndicator to use state and rpc (#10008)
Change-Id: Iec3d0c4e9e1432f7dda4aae5c8c4f21cb96f08be
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/progressindicator')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java | 2 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java | 85 |
2 files changed, 86 insertions, 1 deletions
diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java index 9f632ac806..2c58e9226a 100644 --- a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java @@ -21,7 +21,7 @@ public class ProgressIndicatorInvisible extends TestBase { final Button b = new Button("Hide container of progress indicator"); addComponent(b); - b.addListener(new Button.ClickListener() { + b.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { // If we skip hiding the layout, hiding the ProgressIndicator diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java new file mode 100644 index 0000000000..7fb016ff57 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java @@ -0,0 +1,85 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.progressindicator; + +import java.util.LinkedHashMap; + +import com.vaadin.tests.components.abstractfield.AbstractFieldTest; +import com.vaadin.ui.ProgressIndicator; + +public class ProgressIndicatorTest extends AbstractFieldTest<ProgressIndicator> { + ProgressIndicator progress = new ProgressIndicator(); + Command<ProgressIndicator, Float> setValueCommand = new Command<ProgressIndicator, Float>() { + + @Override + public void execute(ProgressIndicator c, Float value, Object data) { + c.setValue(value); + } + }; + private Command<ProgressIndicator, Integer> setPollingIntervalCommand = new Command<ProgressIndicator, Integer>() { + @Override + public void execute(ProgressIndicator c, Integer value, Object data) { + c.setPollingInterval(value); + } + }; + + private Command<ProgressIndicator, Boolean> setIndeterminateCommand = new Command<ProgressIndicator, Boolean>() { + @Override + public void execute(ProgressIndicator c, Boolean value, Object data) { + c.setIndeterminate(value); + } + }; + + @Override + protected void createActions() { + super.createActions(); + createSetValueAction(); + createPollingIntervalAction(); + createIndeterminateToggle(); + }; + + private void createIndeterminateToggle() { + createBooleanAction("Indeterminate", CATEGORY_FEATURES, false, + setIndeterminateCommand); + + } + + private void createPollingIntervalAction() { + LinkedHashMap<String, Integer> valueOptions = new LinkedHashMap<String, Integer>(); + for (int i = 100; i <= 3000; i += 200) { + valueOptions.put(String.valueOf(i), i); + } + createSelectAction("Polling interval", CATEGORY_FEATURES, valueOptions, + "1500", setPollingIntervalCommand); + + } + + private void createSetValueAction() { + LinkedHashMap<String, Float> valueOptions = new LinkedHashMap<String, Float>(); + for (float f = 0.0f; f <= 1.0f; f += 0.1) { + valueOptions.put(String.valueOf(f), f); + } + createSelectAction("Value", CATEGORY_FEATURES, valueOptions, "0.0", + setValueCommand); + + } + + @Override + protected Class<ProgressIndicator> getTestClass() { + return ProgressIndicator.class; + } + +} |