diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-21 10:30:25 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-21 09:30:13 +0000 |
commit | 19baf19b7ef1a372154ba8bcbd5e35fb6ec1f3ef (patch) | |
tree | 1fd5b7ab249ab65308f5bf4ba00237710a36404f /uitest/src | |
parent | 519f95fe6999546ff23fc68296ae588cb5d5d6fc (diff) | |
download | vaadin-framework-19baf19b7ef1a372154ba8bcbd5e35fb6ec1f3ef.tar.gz vaadin-framework-19baf19b7ef1a372154ba8bcbd5e35fb6ec1f3ef.zip |
Add shorthands for locking the session (#10225)
Change-Id: Ic2f3843a48a6e26af848208e9495473853146fbe
Diffstat (limited to 'uitest/src')
4 files changed, 12 insertions, 12 deletions
diff --git a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java index 57c4e3c7b9..82d876d9cb 100644 --- a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java @@ -34,11 +34,11 @@ public class ThreadLocalInstances extends AbstractTestCase { Thread thread = new Thread() { @Override public void run() { - getSession().getLock().lock(); + getSession().lock(); try { reportCurrentStatus("background thread"); } finally { - getSession().getLock().unlock(); + getSession().unlock(); } } }; diff --git a/uitest/src/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java b/uitest/src/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java index 44fc77d142..bcae4dc6d9 100644 --- a/uitest/src/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java +++ b/uitest/src/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java @@ -36,11 +36,11 @@ public class RowUpdateShouldRetainContextMenu extends TestBase { sleep(1000); } catch (InterruptedException ie) { } - getContext().getLock().lock(); + getContext().lock(); try { indicator.setValue(progress += 0.01); } finally { - getContext().getLock().unlock(); + getContext().unlock(); } } } diff --git a/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java b/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java index 1df2ab0ae1..95d5ea59d5 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java +++ b/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java @@ -43,7 +43,7 @@ public class TableFirstRowFlicker extends LegacyApplication { @Override public void run() { while (t != null) { - t.getUI().getSession().getLock().lock(); + t.getUI().getSession().lock(); try { int firstId = t.getCurrentPageFirstItemIndex(); Object selected = t.getValue(); @@ -53,7 +53,7 @@ public class TableFirstRowFlicker extends LegacyApplication { // lighter alternative for all of above // t.refreshRowCache(); } finally { - t.getUI().getSession().getLock().unlock(); + t.getUI().getSession().unlock(); } try { Thread.sleep(500); diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java index 8fdc60f293..ebf68fce9a 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java @@ -47,7 +47,7 @@ public class MassInsertMemoryLeakTestApp extends LegacyApplication { @Override public void start() { - getContext().getLock().lock(); + getContext().lock(); try { proggress.setVisible(true); proggress.setValue(new Float(0)); @@ -56,7 +56,7 @@ public class MassInsertMemoryLeakTestApp extends LegacyApplication { proggress.setCaption(""); super.start(); } finally { - getContext().getLock().unlock(); + getContext().unlock(); } } @@ -78,14 +78,14 @@ public class MassInsertMemoryLeakTestApp extends LegacyApplication { getRandonName()); } c.commit(); - getContext().getLock().lock(); + getContext().lock(); try { proggress .setValue(new Float((1.0f * cent) / cents)); proggress.setCaption("" + 100 * cent + " rows inserted"); } finally { - getContext().getLock().unlock(); + getContext().unlock(); } } } catch (SQLException e) { @@ -95,13 +95,13 @@ public class MassInsertMemoryLeakTestApp extends LegacyApplication { e.printStackTrace(); } } - getContext().getLock().lock(); + getContext().lock(); try { proggress.setVisible(false); proggress.setPollingInterval(0); process.setEnabled(true); } finally { - getContext().getLock().unlock(); + getContext().unlock(); } } } |