Announcement Announcement Module
Collapse
No announcement yet.
throwing exceptions from test methods Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • throwing exceptions from test methods

    Hi,

    I have been trying to use ExpectedException and Test(expected=NullPointerException.class) annotations, in order to indicate to my JUnit test to expect an exception to be thrown from a test function. Prior to deriving from AbstractTransactionalDataSourceSpringContextTests, my test worked fine, but since i started deriving from this class, my test fails. I have checked and my function still throws the excepction, but it is not regarded as expected.

    is the use of ExpectedException annotation not supported with AbstractTransactionalDataSourceSpringContextTests?

    thank you,
    shahar.

  • #2
    Shahar,

    is your question related in any way to the Spring Integration project? If not (which I suspect), please address it to the appropriate section. In your case, I think it's the Core Container.

    Marius

    PS: In short, AbstractTransactionalDataSourceSpringContextTests is JUnit 3 based, while you are trying to use it in a JUnit 4 test, that's why it doesn't work. If you want more details, please address the question in the Core Container section.

    Comment


    • #3
      Done.
      Thank you.

      Comment

      Working...
      X