Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make IntelliJ Show Full Stack Trace During Failed JUnit Test

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
like image 501
HappyCoder86 Avatar asked Jun 20 '13 14:06

HappyCoder86


People also ask

How do I get JUnit test report in IntelliJ?

on the Test Runner toolbar. If you haven't run any tests yet, and the tool window with the Test Runner toolbar is not available, press Ctrl+Shift+A and type Import Tests from File . In the dialog that opens, select the . xml file with test results and click Open.

How do I print a full stack trace?

Just use new Throwable(). printStackTrace() method and it will print complete stack trace from where a method is called, into the console.


1 Answers

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

like image 126
hce Avatar answered Sep 28 '22 23:09

hce