HiromuHota / pdi-git-plugin

SpoonGit allows you to manage versions of local Kettle files without leaving Spoon. In addition to Git, Subversion is also supported.
Apache License 2.0
29 stars 12 forks source link

java.lang.NullPointerException when running unit tests #13

Closed HiromuHota closed 6 years ago

HiromuHota commented 6 years ago

The following error happened on my laptop.

Tests run: 14, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 1.279 sec <<< FAILURE!
testVisualDiff(org.pentaho.di.git.spoon.GitControllerTest)  Time elapsed: 0.494 sec  <<< FAILURE!
Wanted but not invoked:
gitController.loadMainPerspective();
-> at org.pentaho.di.git.spoon.GitControllerTest.testVisualDiff(GitControllerTest.java:231)

However, there were other interactions with this mock:
-> at org.pentaho.di.git.spoon.GitControllerTest.setUp(GitControllerTest.java:69)
-> at org.pentaho.di.git.spoon.GitControllerTest.setUp(GitControllerTest.java:69)
-> at org.pentaho.di.git.spoon.GitControllerTest.setUp(GitControllerTest.java:70)
-> at org.pentaho.di.git.spoon.GitControllerTest.setUp(GitControllerTest.java:70)
-> at org.pentaho.di.git.spoon.GitControllerTest.setUp(GitControllerTest.java:72)
-> at org.pentaho.di.git.spoon.GitControllerTest.setUp(GitControllerTest.java:82)
-> at org.pentaho.di.git.spoon.GitControllerTest.testVisualDiff(GitControllerTest.java:220)
-> at org.pentaho.di.git.spoon.GitControllerTest.testVisualDiff(GitControllerTest.java:220)
-> at org.pentaho.di.git.spoon.GitControllerTest.testVisualDiff(GitControllerTest.java:228)
-> at org.pentaho.di.git.spoon.GitControllerTest.testVisualDiff(GitControllerTest.java:228)
-> at org.pentaho.di.git.spoon.GitControllerTest.testVisualDiff(GitControllerTest.java:228)
-> at org.pentaho.di.git.spoon.GitControllerTest.testVisualDiff(GitControllerTest.java:228)

    at org.pentaho.di.git.spoon.GitControllerTest.testVisualDiff(GitControllerTest.java:231)
    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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    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.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    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 org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testOpenFile(org.pentaho.di.git.spoon.GitControllerTest)  Time elapsed: 0.014 sec  <<< ERROR!
java.lang.NullPointerException
    at org.pentaho.di.git.spoon.GitController.showMessageBox(GitController.java:832)
    at org.pentaho.di.git.spoon.GitController.lambda$openFile$1(GitController.java:338)
    at java.util.Collections$2.tryAdvance(Collections.java:4717)
    at java.util.Collections$2.forEachRemaining(Collections.java:4725)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    at org.pentaho.di.git.spoon.GitController.openFile(GitController.java:316)
    at org.pentaho.di.git.spoon.GitControllerTest.testOpenFile(GitControllerTest.java:202)
    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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    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.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    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 org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
HiromuHota commented 6 years ago

Debugging found that the following exception occurred in org.pentaho.di.trans.TransMeta.loadXML(Node, String, IMetaStore, Repository, boolean, VariableSpace, OverwritePrompter), but not properly logged

org.pentaho.di.core.exception.KettleXMLException: 
Unexpected problem reading shared objects from XML file : null
Database type not found!

A quick-fix for this error is to remove ~/.kettle/shared.xml.