diff options
author | John Ahlroos <john@vaadin.com> | 2012-10-24 12:50:19 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-10-24 12:50:19 +0000 |
commit | 85e8f3019b68e89131ed4ab70391128fbdf0f3c0 (patch) | |
tree | c0ea2fb038b68c951e912ff200c402011b886e9b /uitest | |
parent | 84d1a4d033daf17fa2542c6ed1029ec3723a3f04 (diff) | |
parent | 9551d7ca56bb9fced67ced199bf23363ac230f3e (diff) | |
download | vaadin-framework-85e8f3019b68e89131ed4ab70391128fbdf0f3c0.tar.gz vaadin-framework-85e8f3019b68e89131ed4ab70391128fbdf0f3c0.zip |
Merge "Updated ProgressIndicator to use state and rpc (#10008)"
Diffstat (limited to 'uitest')
-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; + } + +} |