shutterfly / easytest-core

The core module of EasyTest Framework. This includes the core classes for performing Data Driven Testing in Java
0 stars 0 forks source link

CSVDataLoader#writeOutputData throws NPE when running a single test #2

Closed skuenzli closed 10 years ago

skuenzli commented 10 years ago

CSVDataLoader#writeOutputData (sometimes) throws NPE when running a single test. I think this may only occur when there are multiple parameters being passed-into the test method, but I haven't looked too deeply.

The caused-by stack is:

Caused by: java.lang.NullPointerException: null
    at org.easetech.easytest.loader.CSVDataLoader.writeOutputData(CSVDataLoader.java:386)
    at org.easetech.easytest.loader.CSVDataLoader.writeDataToCSV(CSVDataLoader.java:351)
    at org.easetech.easytest.loader.CSVDataLoader.writeData(CSVDataLoader.java:184)
    at org.easetech.easytest.util.RunAftersWithOutputData.writeData(RunAftersWithOutputData.java:154)
    at org.easetech.easytest.util.RunAftersWithOutputData.evaluate(RunAftersWithOutputData.java:133)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:254)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:149)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

The issue is reproducible in IntelliJ.

The full stack from a maven2 execution is:

    at org.easetech.easytest.util.RunAftersWithOutputData.writeData(RunAftersWithOutputData.java:157)
    at org.easetech.easytest.util.RunAftersWithOutputData.evaluate(RunAftersWithOutputData.java:133)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:254)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:149)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
    at org.easetech.easytest.loader.CSVDataLoader.writeDataToCSV(CSVDataLoader.java:368)
    at org.easetech.easytest.loader.CSVDataLoader.writeData(CSVDataLoader.java:184)
    at org.easetech.easytest.util.RunAftersWithOutputData.writeData(RunAftersWithOutputData.java:154)
    at org.easetech.easytest.util.RunAftersWithOutputData.evaluate(RunAftersWithOutputData.java:133)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:254)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:149)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.NullPointerException: null
    at org.easetech.easytest.loader.CSVDataLoader.writeOutputData(CSVDataLoader.java:386)
    at org.easetech.easytest.loader.CSVDataLoader.writeDataToCSV(CSVDataLoader.java:351)
    at org.easetech.easytest.loader.CSVDataLoader.writeData(CSVDataLoader.java:184)
    at org.easetech.easytest.util.RunAftersWithOutputData.writeData(RunAftersWithOutputData.java:154)
    at org.easetech.easytest.util.RunAftersWithOutputData.evaluate(RunAftersWithOutputData.java:133)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:254)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:149)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
skuenzli commented 10 years ago

fixed by d64b48a