Uploaded image for project: 'Spring Data Neo4j'
  1. Spring Data Neo4j
  2. DATAGRAPH-952

Null pointer after rollback in test

    XMLWordPrintable

    Details

    • Type: Defect
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.2 RC1 (Ingalls), 5.0 M1 (Kay)
    • Component/s: CORE
    • Labels:
      None

      Description

      I have a test which tests an exception is thrown for a data integrity violation.

      The structure is essentially:

      @RunWith(SpringJUnit4ClassRunner.class)
      @ContextConfiguration(....)
      @Transactional
      @Rollback // optional here, 
      public class MyTest {
      ...
          @Test(expected = DataIntegrityViolationException.class)
          public void shouldTrowRollbackException() throws Exception {
          ...
          }
      }
      

      Whole test case is linked in the Reference URL:

      Using versions:
      SDN 4.2.0-BUILD-SNAPSHOT
      OGM: 2.1.0

      Exception:

      java.lang.NullPointerException
          at org.springframework.data.neo4j.transaction.Neo4jTransactionManager.doRollback(Neo4jTransactionManager.java:275)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:853)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:830)
          at org.springframework.test.context.transaction.TransactionContext.endTransaction(TransactionContext.java:125)
          at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:227)
          at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:319)
          at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:94)
          at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
          at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
          at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
          at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
          at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
          at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
          at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
          at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
          at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
          at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
          at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
      
      

        Attachments

          Activity

            People

            Assignee:
            nmervaillie Nicolas Mervaillie
            Reporter:
            mangrish Mark Angrish
            Last updater:
            Spring Issues Spring Issues
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: