Examples of exceptional()


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

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

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

    testBean.haveBirthday();
    assertEquals("Should not have started another transaction", 1, ptm.begun);

    // try with exceptional
    try {
      testBean.exceptional(new IllegalArgumentException("foo"));
      fail("Should NEVER get here");
    }
    catch (Throwable throwable) {
      assertEquals("Should have another started transaction", 2, ptm.begun);
      assertEquals("Should have 1 rolled back transaction", 1, ptm.rollbacks);
View Full Code Here

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

    int[][] intArray = proxy.getNestedIntArray();
    assertTrue(Arrays.equals(new int[] {1, 2, 3}, intArray[0]));
    assertTrue(Arrays.equals(new int[] {4, 5, 6}, intArray[1]));

    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()

    assertEquals(99, proxy.getAge());
    proxy.setAge(50);
    assertEquals(50, proxy.getAge());

    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()

    assertEquals(99, proxy.getAge());
    proxy.setAge(50);
    assertEquals(50, proxy.getAge());

    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
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.