From: Ronald B. <rb...@rb...> - 2020-10-26 10:16:18
|
Hi Chander, this is a know problem. Background: The CSS parser used by HtmlUnit is implemented based on the JavaCC parser generator. Because of the way JavaCC works, the (generated) parser is a really huge class file (containing huge methods) nearly at the limits of the JVM class byte code. On the other hand Jacoco instruments the byte code (adds more operations) to keep track of the called methods. This is done with a more or less poor approach - without taking the limits of the JVM in mind. As a result the instrumented bytecode is no longer loadable. For your tests i suggest to exclude the whole HtmlUnit CssParser (and maybe HtmlUnit itself) from Jacoco instrumentation. I guess you like to check the code coverage of your classes and not for HtmlUnit oder the CssParser. Thanks for using HtmlUnit RBRi On Sun, 25 Oct 2020 22:14:18 -0500 Chander wrote: > >Hi group, >When I run the unit tests with htmlunit and maven pom has jacaco plugin as >dependency I get the following error. The unit tests don't fail but the >console displays the following error.. How do I prevent this error from >happening? > >Caused by: >org.jacoco.agent.rt.internal_43f5073.asm.MethodTooLargeException: Method >too large: >com/gargoylesoftware/htmlunit/javascript/host/css/StyleAttributes$Definition.<clinit> >()V >at >org.jacoco.agent.rt.internal_43f5073.asm.MethodWriter.computeMethodInfoSize(MethodWriter.java:2087) >at >org.jacoco.agent.rt.internal_43f5073.asm.ClassWriter.toByteArray(ClassWriter.java:447) >at >org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:90) >at >org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:107) >.... 100 more >java.lang.instrument.IllegalClassFormatException: Error while instrumenting >com/gargoylesoftware/css/parser/javacc/CSS3ParserTokenManager. > >Thank You >Chander > > > >----< Inline text [text-plain-04.txt] >------------------ > > > > >----< Inline text [text-plain-05.txt] >------------------ > >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |