What exactly are you trying to test? Are you trying to test the optimistic locking? You didn't write that. If you want to test that you actually have optimistic locking turned on, then you can do that by checking the metadata.
On Fri, Oct 8, 2010 at 3:27 AM, CREMONINI Daniele <[email protected]> wrote: > Hi everybody, > > My problem is I have to test a Page that should prevent lost updates via > optimistic lock checking. > > I resolved the problem using JPA optimistic lock and if I use two different > browsers then the Page works in the desired way. > > The problem comes in the test phase: to emulate two concurrent sessions I > would instantiate two pages accessing to the same object (record) on the > database this way having two sessions that I will call A and B. > Then on the session A I update and save (everything is expected to be > correct), then on session B I update and save (an exception is expected to be > thrown). > > My approach might be > > final WicketTester.DummyWebApplication testWebApplication1 = new > WicketTester.DummyWebApplication() ... > final WicketTester.DummyWebApplication testWebApplication2 = new > WicketTester.DummyWebApplication() ... > > ... > > tester1 = new MyAppWicketTester(testWebApplication); > tester2 = new MyAppWicketTester(testWebApplication); > > tester1.startPage(new ITestPageSource() ... > tester2.startPage(new ITestPageSource() ... > > but as soon as run the complete set of test anything "blow up". > > Do you have any suggestion? > Thanks > Daniele Cremonini > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
