Make IntelliJ Show Full Stack Trace During Failed JUnit Test

陌路散爱 提交于 2021-02-07 11:28:36

问题


When I run a Junit test and it fails, if the stacktace is super long, Intellij always cuts it off a the end with "... x More". How can I make IntelliJ show the entire stacktrace?

Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
    at org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:38)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:526)
    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:257)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    ... 54 more


Process finished with exit code 255

回答1:


I think, the "... x more" message occurs only when you have exceptions which are wrapped by the previous exception. it means that the last x lines of the initial exception are the same as x lines missing in the caused by exception. It has nothing todo with IntelliJ. The jvm avoids repeating the trace info, as it does not provide new info.

see also this answer



来源:https://stackoverflow.com/questions/17216411/make-intellij-show-full-stack-trace-during-failed-junit-test

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!