diff options
author | Artur Signell <artur.signell@itmill.com> | 2009-11-10 15:10:01 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2009-11-10 15:10:01 +0000 |
commit | aee045e3d09ef620743f5d0bc6e66065d9ea9b28 (patch) | |
tree | 667066a36dac3385d6ed1ff954fcaf51887f3515 /tests | |
parent | 7f65fde61b2251b4c756df54a2b8e3a0fb3fe7b3 (diff) | |
download | vaadin-framework-aee045e3d09ef620743f5d0bc6e66065d9ea9b28.tar.gz vaadin-framework-aee045e3d09ef620743f5d0bc6e66065d9ea9b28.zip |
Merged fix and test case for #3525 - "Cannot re-enable a disabled upload component" from 6.1
svn changeset:9714/svn branch:6.2
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/vaadin/tests/components/upload/TestUpload.java | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/upload/TestUpload.java b/tests/src/com/vaadin/tests/components/upload/TestUpload.java new file mode 100644 index 0000000000..5b1590196b --- /dev/null +++ b/tests/src/com/vaadin/tests/components/upload/TestUpload.java @@ -0,0 +1,79 @@ +package com.vaadin.tests.components.upload;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.vaadin.tests.components.ComponentTestCase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Upload;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Upload.FinishedEvent;
+import com.vaadin.ui.Upload.Receiver;
+
+public class TestUpload extends ComponentTestCase implements Receiver {
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 3525;
+ }
+
+ @Override
+ protected void setup() {
+ super.setup();
+ Upload u;
+
+ u = new Upload("Undefined wide upload", this);
+ u.setSizeUndefined();
+ addTestComponent(u);
+
+ u.addListener(new Upload.FinishedListener() {
+ public void uploadFinished(FinishedEvent event) {
+ getMainWindow().showNotification("Done");
+ }
+ });
+
+ u = new Upload("300px wide upload", this);
+ u.setWidth("300px");
+ addTestComponent(u);
+
+ addTestComponent(new Button("blah"));
+
+ }
+
+ @Override
+ protected List<Component> createActions() {
+ List<Component> actions = new ArrayList<Component>();
+
+ CheckBox enabled = new CheckBox("Enabled", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ for (Component c : getTestComponents()) {
+ c.setEnabled(event.getButton().booleanValue());
+ }
+
+ }
+ });
+ enabled.setValue(true);
+ enabled.setImmediate(true);
+ actions.add(enabled);
+
+ return actions;
+ }
+
+ public OutputStream receiveUpload(String filename, String MIMEType) {
+ getMainWindow().showNotification("Receiving upload");
+ return new ByteArrayOutputStream();
+ }
+
+}
|