Examples of exceptional()


Examples of org.springframework.tests.sample.beans.ITestBean.exceptional()

    TestBean tb = new TestBean();
    ITestBean itb = (ITestBean) advised(tb, ptm, tas);

    checkTransactionStatus(false);
    try {
      itb.exceptional(new OptimisticLockingFailureException(""));
      fail("Should have thrown OptimisticLockingFailureException");
    }
    catch (OptimisticLockingFailureException ex) {
      // expected
    }
View Full Code Here

Examples of org.springframework.tests.sample.beans.ITestBean.exceptional()

    TestBean tb = new TestBean();
    ITestBean itb = (ITestBean) advised(tb, ptm, tas);

    try {
      itb.exceptional(ex);
      fail("Should have thrown exception");
    }
    catch (Throwable t) {
      if (rollbackException) {
        assertEquals("Caught wrong exception", tex, t );
View Full Code Here

Examples of org.springframework.tests.sample.beans.ITestBean.exceptional()

    assertEquals(50, proxy.getAge());
    proxy.setStringArray(new String[] {"str1", "str2"});
    assertTrue(Arrays.equals(new String[] {"str1", "str2"}, proxy.getStringArray()));

    try {
      proxy.exceptional(new IllegalStateException());
      fail("Should have thrown IllegalStateException");
    }
    catch (IllegalStateException ex) {
      // expected
    }
View Full Code Here

Examples of org.springframework.tests.sample.beans.ITestBean.exceptional()

    }
    catch (IllegalStateException ex) {
      // expected
    }
    try {
      proxy.exceptional(new IllegalAccessException());
      fail("Should have thrown IllegalAccessException");
    }
    catch (IllegalAccessException ex) {
      // expected
    }
View Full Code Here

Examples of org.springframework.tests.sample.beans.ITestBean.exceptional()

    NopInterceptor nop = (NopInterceptor) bf.getBean("nopInterceptor");
    assertEquals(0, nop.getCount());

    int newAge = 12;
    // Not advised
    advised.exceptional(null);
    assertEquals(0, nop.getCount());
    advised.setAge(newAge);
    assertEquals(newAge, advised.getAge());
    // Only setter fired
    assertEquals(1, nop.getCount());
View Full Code Here

Examples of org.springframework.tests.sample.beans.TestBean.exceptional()

    NopInterceptor nop = (NopInterceptor) bf.getBean("nopInterceptor");
    assertEquals(0, nop.getCount());

    int newAge = 12;
    // Not advised
    advised.exceptional(null);
    assertEquals(0, nop.getCount());

    // This is proxied
    advised.absquatulate();
    assertEquals(1, nop.getCount());
View Full Code Here

Examples of org.springmodules.beans.ITestBean.exceptional()

    pf.addAdvice(si);

    ITestBean proxy = (ITestBean) pf.getProxy();

    try {
      proxy.exceptional(t);
      fail("Should have aborted with exception");
    }
    catch (Throwable got) {
      if (got.getClass().equals(t.getClass())) {
        // Ok
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.