diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-04 14:20:13 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-05 11:39:34 +0300 |
commit | 437e700dfc4173da66d45abd95b6f661d7216218 (patch) | |
tree | b2653dfadd5656dfbc37c14eb6a0037a776efa66 /uitest/src | |
parent | b3525638865cdea297c7f2e32c96221132af949f (diff) | |
download | vaadin-framework-437e700dfc4173da66d45abd95b6f661d7216218.tar.gz vaadin-framework-437e700dfc4173da66d45abd95b6f661d7216218.zip |
Remove transaction listener support (#9402)
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/uitest/src/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java b/uitest/src/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java deleted file mode 100644 index 5927e9c19f..0000000000 --- a/uitest/src/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.vaadin.tests.applicationcontext; - -import com.vaadin.Application; -import com.vaadin.server.ApplicationContext; -import com.vaadin.server.ApplicationContext.TransactionListener; -import com.vaadin.tests.components.TestBase; -import com.vaadin.tests.util.Log; - -public class RemoveTransactionListener extends TestBase { - - private final Log log = new Log(10); - - @Override - protected void setup() { - // Add one listener that will remove itself from within transactionEnd - getMainWindow().getApplication().getContext() - .addTransactionListener(new TransactionListener() { - @Override - public void transactionStart(Application application, - Object transactionData) { - } - - @Override - public void transactionEnd(Application application, - Object transactionData) { - removeListener(this); - log.log("Listener removed in transactionEnd"); - } - }); - - // Add one listener that will remove itself from within transactionStart - getMainWindow().getApplication().getContext() - .addTransactionListener(new TransactionListener() { - @Override - public void transactionStart(Application application, - Object transactionData) { - removeListener(this); - log.log("Listener removed in transactionStart"); - } - - @Override - public void transactionEnd(Application application, - Object transactionData) { - } - }); - - // Add one listener to verify that all listeners are called, as thrown - // ConcurrentModificationException causes subsequent listeners to be - // ignored - getMainWindow().getApplication().getContext() - .addTransactionListener(new TransactionListener() { - @Override - public void transactionStart(Application application, - Object transactionData) { - log.log("transactionStart from last listener"); - } - - @Override - public void transactionEnd(Application application, - Object transactionData) { - log.log("transactionEnd from last listener"); - } - }); - - addComponent(log); - } - - private void removeListener(TransactionListener l) { - ApplicationContext context = getMainWindow().getApplication() - .getContext(); - context.removeTransactionListener(l); - } - - @Override - protected String getDescription() { - return "Tests that a transaction listener can be removed from within the listener."; - } - - @Override - protected Integer getTicketNumber() { - return Integer.valueOf(7065); - } - -} |