diff options
3 files changed, 1062 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/upload/TestFileUpload.java b/tests/testbench/com/vaadin/tests/components/upload/TestFileUpload.java new file mode 100644 index 0000000000..10f54e9ce6 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/upload/TestFileUpload.java @@ -0,0 +1,58 @@ +package com.vaadin.tests.components.upload;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.codec.digest.DigestUtils;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Upload;
+import com.vaadin.ui.Upload.FinishedEvent;
+import com.vaadin.ui.Upload.Receiver;
+
+public class TestFileUpload extends TestBase implements Receiver {
+
+ private Log log = new Log(5);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ @Override
+ protected void setup() {
+ Upload u = new Upload("Upload", new Upload.Receiver() {
+
+ public OutputStream receiveUpload(String filename, String mimeType) {
+ return baos;
+ }
+ });
+ u.setDebugId("UPL");
+ u.addListener(new Upload.FinishedListener() {
+
+ public void uploadFinished(FinishedEvent event) {
+ String hash = DigestUtils.md5Hex(baos.toByteArray());
+ log.log("Upload finished. Name: " + event.getFilename()
+ + ", Size: " + baos.size() + ", md5: " + hash);
+ baos.reset();
+ }
+ });
+
+ addComponent(log);
+ addComponent(u);
+ }
+
+ public OutputStream receiveUpload(String filename, String MIMEType) {
+ getMainWindow().showNotification("Receiving upload");
+ return new ByteArrayOutputStream();
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6465;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Creates and prints an MD5 hash of any uploaded file.";
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/upload/file-binary-cb4a65687deb859957ad4b0fd9d67eac.png b/tests/testbench/com/vaadin/tests/components/upload/file-binary-cb4a65687deb859957ad4b0fd9d67eac.png Binary files differnew file mode 100644 index 0000000000..39daa93ea5 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/upload/file-binary-cb4a65687deb859957ad4b0fd9d67eac.png diff --git a/tests/testbench/com/vaadin/tests/components/upload/file-text-6ebed606225d0b6254d45f51aa2dfe9f b/tests/testbench/com/vaadin/tests/components/upload/file-text-6ebed606225d0b6254d45f51aa2dfe9f new file mode 100644 index 0000000000..584a249bba --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/upload/file-text-6ebed606225d0b6254d45f51aa2dfe9f @@ -0,0 +1,1004 @@ +2d98e3c544 +e44d0744f9 +d401ad4c60 +dec8a7e883 +e072cc8f1c +71b9a95d2c +83a23581a1 +3f413b230e +d401ad4c60 +2ace3efb39 +1813c3df93 +b0abbecb03 +c7fa6a137a +76ea0e980d +f2c23a3d97 +b6b8a08ae0 +6fde57d313 +ae70ad98c3 +1ba2d1cde8 +086275ada6 +5afe48f17a +ddbae4b1ee +c87e15e907 +9ceeb040b1 +1ba2d1cde8 +086275ada6 +5afe48f17a +ddbae4b1ee +c87e15e907 +9ceeb040b1 +1ba2d1cde8 +086275ada6 +5afe48f17a +ddbae4b1ee +c87e15e907 +9ceeb040b1 +c39a8209ce +c67c11239a +2d1f563d42 +412578d786 +06bc1fbde7 +6c4593da6b +b669dd2697 +848019e837 +b2f59a63a6 +32e6573a2c +f457b990e5 +fc8ea59ac7 +1ada24fa8d +6573207a6b +6573207a6b +5a4f083e75 +6803cab5e4 +65888eb7c5 +0879a46081 +5b205244ff +bd0a2772c3 +42868f6d11 +2e7afa75bc +c5d7b0707e +9631778b8c +6f07248648 +40e91dbf16 +f96be9a8f7 +a88a1854cb +2fa7fa7d66 +60a35fd7cb +8b372da985 +6a6c67346d +188ce6eb1f +d1c9a169a1 +0bd87a214d +83f053f7a5 +3358a180cb +41ed082e91 +2912187c1d +a0214bceec +f85481335c +f5a142812b +1c14f51af6 +160530c5ad +2912187c1d +8a450f235a +96c5a6946a +6af236ba57 +4d90960935 +f4a5b490e0 +1dd5de37e2 +6650e7ffe2 +e58283083c +fb1fb27b05 +4d90960935 +f4a5b490e0 +1dd5de37e2 +6650e7ffe2 +e58283083c +fb1fb27b05 +f634aced5e +8da7aee58e +929579022b +9eed7a35b7 +3a32cc5d98 +6cff1af7f8 +8065e24c9e +2c31da84c2 +71f40f5448 +d05937e031 +5663969a56 +78b0f40acd +cd6ed372f4 +2479efdeb1 +562cc4ebea +07d606333d +84e4cea4e9 +f634aced5e +8da7aee58e +929579022b +9eed7a35b7 +285b2fdf28 +6cff1af7f8 +8065e24c9e +2c31da84c2 +71f40f5448 +d05937e031 +5663969a56 +78b0f40acd +84f15af378 +2479efdeb1 +562cc4ebea +07d606333d +84e4cea4e9 +6b8fc7e946 +13f6121fd5 +c8b447662b +c85b30a05a +d38a970f96 +961c7e7e21 +642d8c593e +9ad9bff4d5 +3d75060729 +f1ace1aba1 +495a2264fb +38edd8b721 +ae6e3ac06e +5e1474df47 +e8cdf3eb7a +1f980543ec +e278f03128 +59dc7d1abd +4871dc42a3 +eb4182001c +02c2586dfa +38cf0d6100 +21edf67587 +ede8b24dbb +dedacf4a28 +6c3eb4312c +511611906b +5abf574c72 +71cbddf866 +3d391b10ba +4278538caf +9b9ffe9f3d +dc167930ac +7241dffcc7 +59dc7d1abd +4871dc42a3 +eb4182001c +02c2586dfa +83029e8b20 +21edf67587 +ede8b24dbb +dedacf4a28 +6c3eb4312c +511611906b +5abf574c72 +71cbddf866 +3d391b10ba +4278538caf +cd9e816357 +dc167930ac +7241dffcc7 +6b752db85c +a24c73b0ba +bc7770b7d9 +1cceae80cb +3ef6f1e899 +0a5ea8e97a +7ae77759a3 +f9173f3473 +7aca7ef5e3 +349e099e0b +ac9adf6eed +6ef7d70057 +f3c6e5a866 +74c19964ef +212ef0ef42 +f2f6e1ad5b +9f09674473 +1fc5f2ebe3 +f2fb3765b7 +5c8341d0cc +9d3dbf8019 +a5f6722a12 +17d90bca3e +ba58c17074 +5d0a3e0b1e +713f3d8b8f +9b34d18e95 +546ebab2d6 +91ec0af834 +243b879760 +c5875221dd +e8c01b499f +83597d45fe +246870f81c +439e999ef3 +ceda80311c +ea0f2e49bf +8ac9a9bdb8 +4e42ad4ee1 +037d20073d +7585490fd8 +022279d5a5 +b74d7d6726 +f8cfa14fb6 +b01bbf48c9 +7643dc4f96 +6a62a66614 +4a5eb8443b +f2e2d6c15a +0be7b171e7 +204db3a3ca +621b5af801 +81ae7fb274 +3a9f328a17 +f185d2b8b3 +12cb0c8fd6 +805969d565 +4d7bbe799f +7f03271cfc +8e97c9d08d +f8348ce65d +9a65a91b00 +ecc3b9208a +c23fea33d5 +aff2f77e97 +982394c754 +ffe13626d6 +ab071b2cf8 +c43cdb7d85 +48a65d3bc2 +060d9c83dd +2db9573403 +96a6383b79 +7edf1bee25 +b766d4a101 +944bbd16e5 +a51ec022c4 +ea35502afa +83a7178024 +ceb9a449ab +46f9a23ad4 +b44b6830f1 +e59415a949 +a2f8e57e49 +dce3561540 +5982e0753a +42f0eb1795 +8e59741ba7 +3749cc8930 +748979cc52 +5a7864ad06 +1896805fdf +f4649a7cea +c0c9cfd55f +9b0bd0436d +699019ebba +f81fb0687c +bcf3cd73c1 +03a20a0f93 +f785f8cf3a +66bc2b49de +1a2d41b167 +d78605805f +4887353981 +bffd374058 +52f780e615 +5d1ba0c537 +769d29e16a +4793a4ab95 +03abfc1a8b +5f8fe69826 +af7358b342 +39ceafda86 +c9ba8b10d3 +dcd4f8ff63 +cd07265a21 +b3d6f1529c +6da4a60ce7 +db38838b25 +8ae38fe0b2 +27bcf61389 +ab74a0be6e +836655e45e +aa76686f5c +b6b754b376 +cf43cdacab +272bbafa15 +37362cf847 +70d61316c6 +d53aac3273 +f5f0f28ab7 +0b6ccb5dfe +3334d541f0 +a3d97554fa +a643aabf00 +f20ee7c9df +df45121225 +27bcf61389 +ab74a0be6e +836655e45e +aa76686f5c +b6b754b376 +cf43cdacab +272bbafa15 +37362cf847 +70d61316c6 +d53aac3273 +f5f0f28ab7 +0b6ccb5dfe +3334d541f0 +a3d97554fa +a643aabf00 +f20ee7c9df +df45121225 +a69cabd52d +2038bdbfb5 +e1967907e5 +76e579bfe8 +436747ad98 +6f918c8a96 +6fa98bb176 +f059540405 +e4962285ae +bb1a40f77f +1067626ae7 +a52f5910a4 +57f1bccafd +c03c5ddaa0 +0ac1251539 +a69cabd52d +2038bdbfb5 +e1967907e5 +76e579bfe8 +436747ad98 +6f918c8a96 +6fa98bb176 +f059540405 +e4962285ae +bb1a40f77f +1067626ae7 +bc72da3822 +774666adc0 +c03c5ddaa0 +0ac1251539 +3472eda9d1 +5114a311d2 +4c279ac052 +847545f73c +46ecbaddb5 +a2063362d7 +4696f19810 +2e308c8ce7 +e4962285ae +9a1eb4a96f +6b2f6354f0 +a2014ad127 +b10a228fa2 +e879abb300 +65c52dd261 +ae41b2a68a +e969d259f8 +68108671a3 +be768fb98f +94b1c1eec3 +40ec416d24 +509a8791d2 +507b237f3f +24494b5d9c +541692d3be +47a053595e +bd72a3d9de +fa971ab11d +fa64db3c15 +98061c5f66 +ae41b2a68a +e969d259f8 +68108671a3 +be768fb98f +94b1c1eec3 +40ec416d24 +509a8791d2 +507b237f3f +24494b5d9c +541692d3be +47a053595e +bd72a3d9de +fa971ab11d +fa64db3c15 +13a23ac4c8 +ae41b2a68a +e969d259f8 +68108671a3 +be768fb98f +94b1c1eec3 +40ec416d24 +509a8791d2 +507b237f3f +24494b5d9c +541692d3be +47a053595e +bd72a3d9de +fa971ab11d +fa64db3c15 +35769491af +557f4b4038 +7d56c0d312 +7d56c0d312 +5eb479cf57 +1500d72b55 +0cd45baec6 +d739b3fa7c +d739b3fa7c +ea2d10ab74 +638678bf65 +638678bf65 +8482dd6858 +038129579b +038129579b +3adac692b6 +8a6b501d89 +8a6b501d89 +80a95844ff +207d6b8a50 +584c797a5a +3afe807989 +3afe807989 +75504d8e30 +018ff25eaa +018ff25eaa +ec600b6fa1 +4e1235ac36 +2484cac133 +d57528a526 +d57528a526 +a0a2bd8aba +7ef7d97a3e +0b0492597a +57196e9d75 +c4cee1b488 +04891e7670 +3be27be6d6 +46d7cffe93 +7da93b0ce1 +240d2f2b34 +702266d813 +d021601e98 +d320900bd0 +d7553dc537 +0512ac8f5e +d27184f7c9 +866bd94eb1 +c6e2029f12 +5f5ff20ecb +5b27389dbd +9e1adc7ffe +1216b50b12 +b870941c7e +807349164a +c439b0a04d +b746137770 +e8a4112f53 +37a9a41f5f +f8836c7f22 +5accf3b3bd +3cb1baeee9 +cae97cc6d7 +e1327b5dc7 +aa1621c6d2 +519627e8bb +955aec0c93 +e718b14224 +533e0b64e3 +8f4b1713a4 +e3f0346b4b +85e33ed9fa +73ae0f68d5 +a61be1e943 +8386ab637c +c244361db7 +9c720f3b0c +201499c852 +2803e3fb25 +7937932e65 +2ee0f9c250 +e00af0b5d5 +7cc6f2ed15 +3f96b342ab +091a289c02 +a181764387 +844dde0796 +d8d90540f0 +a0f7900589 +f00a677a31 +5990b96022 +ccc53dab0c +3449cc9953 +e4962285ae +7c8c4052d6 +8401ac8bb3 +b83a7b237e +1f348eac96 +bd9d71d01f +8f0bc29b79 +a181764387 +844dde0796 +d8d90540f0 +a0f7900589 +f00a677a31 +5990b96022 +ccc53dab0c +3449cc9953 +e4962285ae +7c8c4052d6 +8401ac8bb3 +8be5cd4017 +185447a319 +bd9d71d01f +8f0bc29b79 +b726adbb26 +cb9733729b +e1967907e5 +797b50f7c5 +69690f6e8c +e1b8425ce3 +6861d192cf +f059540405 +e4962285ae +cd9765c4b2 +36275b4d01 +d2b2c8eb7f +eab16b53cd +9795ae7f99 +1f6a527e64 +b726adbb26 +cb9733729b +e1967907e5 +797b50f7c5 +69690f6e8c +e1b8425ce3 +6861d192cf +f059540405 +e4962285ae +cd9765c4b2 +36275b4d01 +794f7dfe01 +eab16b53cd +9795ae7f99 +1f6a527e64 +60b3d17c20 +a623f84526 +f1989db382 +88aeb0a398 +ec5d693c10 +9abe7fc421 +13fd434f4c +bd00c3df0f +e6e9e0f657 +bbc4ad07dd +ef1abbbd28 +a52f5910a4 +b6ba6b9ef1 +27012d6cb1 +1a91270ad6 +6eb6ae051d +ad112b7063 +783095acbd +691bc6266a +b258b372d9 +662d9ba5aa +159dbebe91 +a26c9dd02f +10227c973c +0ea945e177 +bc72da3822 +27251f2307 +958305b181 +7dda498f11 +387ff50d16 +cfc72207b0 +0710287d3d +dcc8515fe7 +d760df602e +cb1158e54b +1097dbafc6 +3a8f065c79 +3eefb05112 +5cb26a7ecb +d0d2443a6f +6ff92edcfe +16206969f9 +290a1537cb +22320897cd +fa66d2dacb +2f2151d093 +5bc6f9f6dc +1fb093aeb0 +03db1d3acf +0ed4df2b97 +63eb3599ef +82cb8afa50 +717b067a83 +bd72a3d9de +fab07c0332 +467ef61bdb +290a1537cb +2cfd7895d5 +fa66d2dacb +2f2151d093 +5bc6f9f6dc +1fb093aeb0 +03db1d3acf +0ed4df2b97 +63eb3599ef +82cb8afa50 +717b067a83 +bd72a3d9de +fab07c0332 +467ef61bdb +290a1537cb +2cfd7895d5 +fa66d2dacb +2f2151d093 +5bc6f9f6dc +1fb093aeb0 +03db1d3acf +0ed4df2b97 +63eb3599ef +82cb8afa50 +717b067a83 +bd72a3d9de +fab07c0332 +467ef61bdb +7524eb46ab +0c9f478fd5 +7d0f40d76f +c982554bf3 +91bc364a07 +ebc8679b90 +6c8372a5a2 +b76c6bcedb +89f7a43d19 +b2582b3dd7 +867d282139 +c376c14dd9 +8c3c3d6a8d +553ee176a5 +407b1efa9a +c6127c0781 +6db03534f2 +4e6a182635 +b72f894865 +1f5d054542 +25c994409f +484ac441be +5446a48b0e +59590990d7 +4bc3b1bba2 +d320900bd0 +b7fa156d23 +6c43aaf031 +75ea15f150 +bab2a9ac58 +25c1743c3a +a56530a02d +fd80f8cbe8 +727541e3a3 +11af44923f +1f6f5fbffb +792115827d +e8f9201149 +be5a971e4b +bf56d74dc3 +6e455b254a +ceae74e4a7 +57cc64e0be +082cd5e73d +2cad0a8a32 +cf6cd7ec64 +36138417d3 +05352d6cb3 +5e24336f83 +829043273f +16f783ae6f +ab8217a637 +ed4d4cd26e +e00af0b5d5 +f52dd45e7b +e0479138f2 +c17c0ec2b9 +10453f00d1 +b39886c519 +8c7ee78a0f +7e82f87a35 +420d717205 +e51cf16f3c +bd73d44128 +f6bca33fdd +912f780953 +51db8aae6d +de64bbce3c +bfb5f61977 +871700efd5 +c17c0ec2b9 +10453f00d1 +b39886c519 +8c7ee78a0f +7e82f87a35 +420d717205 +e51cf16f3c +bd73d44128 +f6bca33fdd +912f780953 +67b468ba8b +04cbbfca0d +6fec0d4cda +871700efd5 +219a751d31 +b234ceccbb +4d0b8f5b38 +cdec12c44b +f55dea12c8 +eba2c2eed9 +69d83d02eb +2dc33a7b3b +f2e0a28533 +3a6ae4b7e8 +753dba2d02 +d2b2c8eb7f +c052c450d5 +703a1831d0 +945f002006 +1069d9d086 +ebc4023a1e +865103f032 +052010ede4 +eba2c2eed9 +49b9f56b8e +fd65329414 +e67b8e5f1e +ac96e078fa +d89ebad9f4 +794f7dfe01 +9cc98c81f5 +c28bb4aed3 +ccccf6b944 +28c32dc265 +7c2faedec3 +0ce386c764 +50858772d9 +d47d6d0bcf +262fcf273c +76fb8c4083 +7308092f23 +af6c1110a1 +9c0138a1a1 +1d97bd3bcc +34ddf6c714 +93baa8603e +60e4bad93c +14001068f1 +57f1bccafd +b74d53a8cd +b43c894dfd +294a499739 +072610023b +c7ef61051d +f675213593 +e652f6d0c0 +ab4330cc0d +f21aa6de4d +4de9d6b91b +e6a0c14e84 +7dc7772e2a +c75f7d225a +3134500dfd +2e2108dd6a +581fdec789 +d147b32c60 +ff514ac88c +db6c4dc283 +17ff24959a +a665df8dde +eb140cea50 +cf5527376d +ac87a3bdeb +35ef1aa4ca +d484e53c7a +e6c3a4a4f2 +5485e805cd +f4b010a5ec +598dd253ee +b2c27be259 +8bfb764fed +3de481cf0d +b10a228fa2 +95b256ec4a +e70b3dbd59 +a3898c0e6d +4e026c5d2c +17aff60dee +493cc1dd5d +4e0fd44faa +7e5d01a386 +359736c8a8 +216c5acbda +9d99772f35 +6e1b79c64a +c476a6f14f +fd82b868d9 +5f7e638b53 +9c6fd6576b +fa971ab11d +95b256ec4a +e70b3dbd59 +a3898c0e6d +4e026c5d2c +8ab1c97d26 +493cc1dd5d +4e0fd44faa +7e5d01a386 +359736c8a8 +216c5acbda +9d99772f35 +6e1b79c64a +c476a6f14f +fd82b868d9 +5f7e638b53 +9c6fd6576b +fa971ab11d +95b256ec4a +e70b3dbd59 +a3898c0e6d +4e026c5d2c +8ab1c97d26 +493cc1dd5d +4e0fd44faa +7e5d01a386 +359736c8a8 +216c5acbda +9d99772f35 +6e1b79c64a +c476a6f14f +fd82b868d9 +5f7e638b53 +9c6fd6576b +fa971ab11d +4a956faa36 +bb55b3160c +5af6ffef6d +bf3dc62fcb +3b2e22298f +efd580c008 +89385e6cf6 +8922e86a9a +f7dca83f80 +0c10532047 +5db9836d63 +9e5798dc30 +9b7405896d +ab6d82f202 +065da8661b +1166faab0a +4e1235ac36 +6baecac87b +1db20adf2f +24ffb91b69 +c625bf279c +72f7d62113 +49d89ceeda +b2cb43e87a +5171db444c +f49540eb79 +d02fd1e54e +ec132f51cb +c1bd4a5224 +6a5acd847b +43b9b0e006 +76fead51d7 +3137d7e735 +d7553dc537 +6d76d063f4 +a34b400d26 +18f1ac2e67 +4bf79e2811 +7de6f597a6 +7c212aa108 +9dd3b9cd5c +bfe8aa3b09 +3cd63fc1a8 +46cc394aba +17d242d235 +5b09bf443d +cd08b3ffae +fac4569273 +6835dc2ebf +acff901709 +955aec0c93 +c00ea6c82d +8ee7938a98 +b9d18ecceb +4d32ab4cac +61caef0535 +59ba4105c7 +028ce52827 +d7faa1d04b +1e837de27f +dbd78e0841 +2e7b7c56e5 +c18f3ce65c +1b93551234 +a739efda67 +539dd782c8 +28f297cb24 +134e5f40ba +64b7df73b1 +9df5187e93 +333ebb1236 +3c7e60faa4 +52433c2d4d +7756d5f7b1 +f180ba36a6 +9ff38e05c4 +ee74d614ad +b428eb40c6 +a51e528b99 +db1f269799 +bd618d7051 +f9600044c6 +fcc320dc0d +a62b02637a +1f348eac96 +58605611e9 +5bfe081a2b +88faf04a42 +6b88a36c06 +4b771216e4 +18c3e648ad +d4f656c2d2 +d94fd46324 +1f5629925e +ad9d67fada +79df1af7a3 +6d6552a9b5 +62c4e3409c +737afa1bf5 +7321011f8f +86bb9008fb +185447a319 +aec6461e28 +eb39563180 +151217dabb +97f011da49 +6a46617336 +68bd97857d +a55d6d008d +01addfbdd1 +e7999669a4 +fa0a6ab715 +233b4172a5 +b6fce096fc +f7e664f9c9 +2d9bbfed7c +c57d5a5dbd +58e2ae1c5e +eab16b53cd +aec6461e28 +eb39563180 +151217dabb +b70ae742d0 +b74a4186e9 +68bd97857d +a55d6d008d +52880a6232 +e7999669a4 +91650fc43d +233b4172a5 +b6fce096fc +f7e664f9c9 +2d9bbfed7c +b211c84fa4 +58e2ae1c5e +eab16b53cd |