运行testng测试的异常

时间:2015-11-18 14:53:35

标签: java maven testng

当我尝试在项目上运行testng测试时,我遇到了这个异常:

    -------------------------------------------------------
     T E S T S
    -------------------------------------------------------
    Running TestSuite

    Results :

    Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5.512s
    [INFO] Finished at: Wed Nov 18 14:45:14 GMT 2015
    [INFO] Final Memory: 21M/213M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14:test (default-test) on project owr: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.14:test failed: There was an error in the forked process
    [ERROR] org.testng.TestNGException:
    [ERROR] Cannot instantiate class com.openet.report.parsers.JMeterJtlParserTest

测试并不总是在JMeterJtlParserTest上失败,它似乎在每次运行时都会发生变化。在堆栈跟踪的后面它有:

    [ERROR] Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
    [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    [ERROR] at java.security.AccessController.doPrivileged(Native Method)
    [ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    [ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

这是我的依赖树:

    [INFO] +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.48.0:test
    [INFO] |  +- org.seleniumhq.selenium:selenium-support:jar:2.48.0:test
    [INFO] |  |  \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.48.0:test
    [INFO] |  |     +- cglib:cglib-nodep:jar:2.1_3:test
    [INFO] |  |     +- com.google.code.gson:gson:jar:2.2.2:test
    [INFO] |  |     +- org.seleniumhq.selenium:selenium-api:jar:2.48.0:test
    [INFO] |  |     +- com.google.guava:guava:jar:14.0.1:test
    [INFO] |  |     +- org.apache.commons:commons-exec:jar:1.3:test
    [INFO] |  |     +- net.java.dev.jna:jna:jar:4.1.0:test
    [INFO] |  |     \- net.java.dev.jna:jna-platform:jar:4.1.0:test
    [INFO] |  +- net.sourceforge.htmlunit:htmlunit:jar:2.18:test
    [INFO] |  |  +- xalan:xalan:jar:2.7.2:test
    [INFO] |  |  |  \- xalan:serializer:jar:2.7.2:test
    [INFO] |  |  +- commons-collections:commons-collections:jar:3.2.1:test
    [INFO] |  |  +- org.apache.commons:commons-lang3:jar:3.0:test
    [INFO] |  |  +- org.apache.httpcomponents:httpmime:jar:4.5:test
    [INFO] |  |  +- commons-codec:commons-codec:jar:1.4:test
    [INFO] |  |  +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.17:test
    [INFO] |  |  +- xerces:xercesImpl:jar:2.11.0:test
    [INFO] |  |  +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:test
    [INFO] |  |  +- net.sourceforge.cssparser:cssparser:jar:0.9.16:test
    [INFO] |  |  |  \- org.w3c.css:sac:jar:1.3:test
    [INFO] |  |  \- org.eclipse.jetty.websocket:websocket-client:jar:9.2.12.v20150709:test
    [INFO] |  |     +- org.eclipse.jetty:jetty-util:jar:9.2.12.v20150709:test
    [INFO] |  |     +- org.eclipse.jetty:jetty-io:jar:9.2.12.v20150709:test
    [INFO] |  |     \- org.eclipse.jetty.websocket:websocket-common:jar:9.2.12.v20150709:test
    [INFO] |  |        \- org.eclipse.jetty.websocket:websocket-api:jar:9.2.12.v20150709:test
    [INFO] |  \- org.apache.httpcomponents:httpclient:jar:4.5:test
    [INFO] |     \- org.apache.httpcomponents:httpcore:jar:4.4.1:test
    [INFO] +- org.apache.commons:commons-math3:jar:3.1.1:compile
    [INFO] +- net.sourceforge.javacsv:javacsv:jar:2.0:compile
    [INFO] +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
    [INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
    [INFO] +- commons-digester:commons-digester:jar:2.1:compile
    [INFO] +- org.xwiki.platform:xwiki-core-xmlrpc-client:jar:3.0.1:compile
    [INFO] |  \- org.codehaus.swizzle:swizzle-confluence:jar:xwiki:1.2-20080419:compile
    [INFO] +- org.apache.ws.commons:ws-commons-util:jar:1.0.1:compile
    [INFO] |  +- junit:junit:jar:4.4:compile
    [INFO] |  \- xml-apis:xml-apis:jar:1.0.b2:compile
    [INFO] +- org.apache.xmlrpc:xmlrpc-client:jar:3.1.3:compile
    [INFO] +- org.apache.xmlrpc:xmlrpc-common:jar:3.1.3:compile
    [INFO] |  \- org.apache.ws.commons.util:ws-commons-util:jar:1.0.2:compile
    [INFO] +- org.xwiki.platform:xwiki-core-xmlrpc-model:jar:3.0:compile
    [INFO] +- org.codehaus.swizzle:swizzle-confluence:jar:1.6.2:compile
    [INFO] |  \- org.sonatype.sisu:sisu-xmlrpc-client:jar:1.0.0:compile
    [INFO] |     +- org.sonatype.sisu:sisu-xmlrpc-common:jar:1.0.0:compile
    [INFO] |     \- com.ning:async-http-client:jar:1.3.3:compile
    [INFO] |        \- org.jboss.netty:netty:jar:3.2.3.Final:compile
    [INFO] +- org.apache.log4j:log4j:jar:1.2.15:compile
    [INFO] +- commons-io:commons-io:jar:2.4:compile
    [INFO] +- org.slf4j:slf4j-api:jar:1.7.5:compile
    [INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.5:runtime
    [INFO] |  \- log4j:log4j:jar:1.2.17:runtime
    [INFO] +- jfree:jfreechart:jar:1.0.13:compile
    [INFO] |  \- jfree:jcommon:jar:1.0.16:compile
    [INFO] +- org.testng:testng:jar:6.3.1:test
    [INFO] |  +- org.beanshell:bsh:jar:2.0b4:test
    [INFO] |  +- com.beust:jcommander:jar:1.12:test
    [INFO] |  \- org.yaml:snakeyaml:jar:1.6:test
    [INFO] \- net.sf.saxon:Saxon-HE:jar:9.6.0-5:compile

0 个答案:

没有答案