开发者

Running JUnit test in NetBeans gives NoSuchMethodError error on a method whose return type was changed

I have a project in NetBeans with JUnit tests. I made a change to a method return type in a dependent project, and the app runs fine. But when I run the JUnit test from inside NetBeans I get a NoSuchMethodError. 开发者_如何学GoI made sure to clean and build.


The solution was to make a change (any change) to the class which was making the call to the changed method. I then saved the class, then undid the change and saved the class. Then running the JUnit test inside NetBeans worked. It seems like a bug with NetBeans caching. I've had strange issues like this before and I've had to close NetBeans, delete the NetBeans cache folder, and restart NetBeans. But it seems like making a change to that class (and then undoing it) was enough to fix the NetBeans cache.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜