Examples of exceptional()


Examples of org.springframework.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.beans.ITestBean.exceptional()

    proxied.setAge(26);
    assertEquals(2, cca.getCalls());
    assertEquals(26, proxied.getAge());
    assertEquals(4, cca.getCalls());
    try {
      proxied.exceptional(new CannotGetJdbcConnectionException("foo", (SQLException)null));
      fail("Should have thrown CannotGetJdbcConnectionException");
    }
    catch (CannotGetJdbcConnectionException ex) {
      // expected
    }
View Full Code Here

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

    assertEquals(age, proxied.getAge());
    assertEquals(2, car.getCalls());
    Exception exc = new Exception();
    // On exception it won't be invoked
    try {
      proxied.exceptional(exc);
      fail();
    }
    catch (Throwable t) {
      assertSame(exc, t);
    }
View Full Code Here

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

    AopProxy aop = createAopProxy(pc);

    try {
      ITestBean tb = (ITestBean) aop.getProxy();
      // Note: exception param below isn't used
      tb.exceptional(expectedException);
      fail("Should have thrown exception raised by interceptor");
    }
    catch (Exception thrown) {
      assertEquals("exception matches", expectedException, thrown);
    }
View Full Code Here

Examples of org.springframework.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.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.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.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.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.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
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.