aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarGenericTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarGenericTest.java')
-rw-r--r--uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarGenericTest.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarGenericTest.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarGenericTest.java
new file mode 100644
index 0000000000..79797c60a2
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarGenericTest.java
@@ -0,0 +1,55 @@
+package com.vaadin.tests.components.progressindicator;
+
+import java.util.LinkedHashMap;
+
+import com.vaadin.tests.components.abstractfield.AbstractFieldTest;
+import com.vaadin.ui.ProgressBar;
+
+public class ProgressBarGenericTest extends AbstractFieldTest<ProgressBar> {
+
+ private Command<ProgressBar, Boolean> indeterminate = new Command<ProgressBar, Boolean>() {
+
+ @Override
+ public void execute(ProgressBar c, Boolean value, Object data) {
+ c.setIndeterminate(value);
+ }
+ };
+
+ @Override
+ protected Class<ProgressBar> getTestClass() {
+ return ProgressBar.class;
+ }
+
+ @Override
+ protected void createActions() {
+ super.createActions();
+ createBooleanAction("Indeterminate", CATEGORY_FEATURES, false,
+ indeterminate, null);
+ createValueSelection(CATEGORY_FEATURES);
+ createPrimaryStyleNameSelect();
+ }
+
+ /**
+ * @since
+ */
+ protected void createPrimaryStyleNameSelect() {
+ LinkedHashMap<String, String> options = new LinkedHashMap<String, String>();
+ String primaryStyle = getComponent().getPrimaryStyleName();
+ options.put(primaryStyle, primaryStyle);
+ options.put(primaryStyle + "-foo", primaryStyle + "-foo");
+ options.put("foo", "foo");
+ createSelectAction("Primary style name", CATEGORY_DECORATIONS, options,
+ primaryStyle, primaryStyleNameCommand);
+
+ }
+
+ private void createValueSelection(String categorySelection) {
+ LinkedHashMap<String, Object> options = new LinkedHashMap<String, Object>();
+ options.put("null", null);
+ for (float f = 0; f <= 1; f += 0.1) {
+ options.put("" + f, f);
+ }
+ createSelectAction("Value", categorySelection, options, null,
+ setValueCommand);
+ }
+}