]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for portal URL generation for render requests (#8785)
authorArtur Signell <artur@vaadin.com>
Fri, 11 May 2012 19:35:25 +0000 (22:35 +0300)
committerArtur Signell <artur@vaadin.com>
Sun, 13 May 2012 17:35:38 +0000 (20:35 +0300)
tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java

index 8dbbc6983ccac2ab9b6eb518ba6b49c7d9032a49..7ba6f2c0c0cb73b0f1fd7ad8b64e7f12f198189f 100644 (file)
@@ -1,5 +1,7 @@
 package com.vaadin.tests.integration;
 
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -28,6 +30,8 @@ import com.vaadin.ui.Notification;
 import com.vaadin.ui.Root;
 import com.vaadin.ui.Root.LegacyWindow;
 import com.vaadin.ui.TextField;
+import com.vaadin.ui.Upload;
+import com.vaadin.ui.Upload.Receiver;
 
 /**
  * Adapted from old PortletDemo to support integration testing.
@@ -67,6 +71,14 @@ public class JSR286PortletApplication extends Application.LegacyApplication {
         portletMax.setEnabled(false);
         main.addComponent(portletMax);
 
+        Upload upload = new Upload("Upload a file", new Receiver() {
+
+            public OutputStream receiveUpload(String filename, String mimeType) {
+                return new ByteArrayOutputStream();
+            }
+        });
+        main.addComponent(upload);
+
         if (getContext() instanceof PortletApplicationContext2) {
             PortletApplicationContext2 ctx = (PortletApplicationContext2) getContext();
             ctx.addPortletListener(this, new DemoPortletListener());