summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/itmill/toolkit/tests/tickets/Ticket695.java55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/com/itmill/toolkit/tests/tickets/Ticket695.java b/src/com/itmill/toolkit/tests/tickets/Ticket695.java
index fc040d8ba3..8e45c4ca5c 100644
--- a/src/com/itmill/toolkit/tests/tickets/Ticket695.java
+++ b/src/com/itmill/toolkit/tests/tickets/Ticket695.java
@@ -3,6 +3,7 @@ package com.itmill.toolkit.tests.tickets;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
+
import com.itmill.toolkit.Application;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.Window;
@@ -10,31 +11,33 @@ import com.itmill.toolkit.ui.Button.ClickEvent;
public class Ticket695 extends Application {
- private static final long serialVersionUID = 3803150085397590662L;
-
- @Override
- public void init() {
- final Window w = new Window("Serialization test #695");
- setMainWindow(w);
- Button b = new Button("Serialize ApplicationContext");
- w.addComponent(b);
- b.addListener(new Button.ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- try {
- ObjectOutputStream oos = new ObjectOutputStream(buffer);
- oos.writeObject(getContext());
- w.showNotification("ApplicationContext serialized ("
- + buffer.size() + "bytes)");
- } catch (IOException e) {
- e.printStackTrace();
- w
- .showNotification("ApplicationContext serialization failed - see console for stacktrace");
- }
-
- }
- });
- }
+ private static final long serialVersionUID = 3803150085397590662L;
+
+ @Override
+ public void init() {
+ final Window w = new Window("Serialization test #695");
+ setMainWindow(w);
+ Button b = new Button("Serialize ApplicationContext");
+ w.addComponent(b);
+ b.addListener(new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ try {
+ ObjectOutputStream oos = new ObjectOutputStream(buffer);
+ long t = System.currentTimeMillis();
+ oos.writeObject(getContext());
+ w.showNotification("ApplicationContext serialized ("
+ + buffer.size() + "bytes) in "
+ + (System.currentTimeMillis() - t) + "ms");
+ } catch (IOException e) {
+ e.printStackTrace();
+ w
+ .showNotification("ApplicationContext serialization failed - see console for stacktrace");
+ }
+
+ }
+ });
+ }
}