389390391392393394395396397398399
Lockable lockable = proxy; assertTrue("Already locked", lockable.locked()); lockable.lock(); assertTrue("Real target ignores locking", lockable.locked()); try { lockable.unlock(); fail(); } catch (UnsupportedOperationException ex) { // Ok }
466467468469470471472473474475476
fail("Should be locked"); } catch (IllegalStateException ex) { // Ok } lockable.unlock(); itb.setName("Tony"); } @Test public void testAspectMethodThrowsExceptionLegalOnSignature() {