summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/resources/NonExistingFileResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/resources/NonExistingFileResource.java')
-rw-r--r--uitest/src/com/vaadin/tests/resources/NonExistingFileResource.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/resources/NonExistingFileResource.java b/uitest/src/com/vaadin/tests/resources/NonExistingFileResource.java
new file mode 100644
index 0000000000..eb8559f746
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/resources/NonExistingFileResource.java
@@ -0,0 +1,48 @@
+package com.vaadin.tests.resources;
+
+import java.io.File;
+
+import com.vaadin.server.FileResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+
+public class NonExistingFileResource extends TestBase {
+
+ @Override
+ protected void setup() {
+ Button existing = createButton("WEB-INF/web.xml");
+ Button nonExisting = createButton("WEB-INF/web2.xml");
+ addComponent(existing);
+ addComponent(nonExisting);
+
+ }
+
+ private Button createButton(final String filename) {
+ Button b = new Button("Download " + filename);
+ b.addListener(new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ FileResource res = new FileResource(new File(getContext()
+ .getBaseDirectory() + "/" + filename));
+ getMainWindow().open(res);
+
+ }
+ });
+ return b;
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}