2017-12-13 2 views
0

TestNG 구현을 6.11에서 6.13.1로 업그레이드 한 후 오류가 발생합니다. 하나의 클래스를 포함하는 TestNG 제품군을 트리거하는 ANT 빌드 (ANT 1.9.4 및 1.10.1에서 동일한 실패로 빌드를 시도 함)가 있습니다. 모든 ANT 설정 물건을 후에는 테스트 실행을 시작하여 TestNG를 호출하고 난 바로 다음과 같은 오류 얻을 : 여기 TestNG가 "javax.xml.parsers.ParserConfigurationException : validation 유효하지 않음"오류를 던지는 이유

[testng] javax.xml.parsers.ParserConfigurationException: validation is not supported 
[testng] at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:100) 
[testng] at org.testng.xml.XMLParser.<clinit>(XMLParser.java:29) 
[testng] at org.testng.xml.Parser.<clinit>(Parser.java:34) 
[testng] at org.testng.TestNG.parseSuite(TestNG.java:290) 
[testng] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:334) 
[testng] at org.testng.TestNG.initializeEverything(TestNG.java:974) 
[testng] at org.testng.TestNG.run(TestNG.java:988) 
[testng] at org.testng.TestNG.privateMain(TestNG.java:1330) 
[testng] at org.testng.TestNG.main(TestNG.java:1299) 
[testng] [TestNG] [ERROR] java.lang.NullPointerException 
[testng] Exception in thread "main" java.lang.NullPointerException 
[testng] at org.testng.TestNG.getStatus(TestNG.java:206) 
[testng] at org.testng.TestNG.main(TestNG.java:1300) 
[testng] The tests failed. 

내 build.xml 파일입니다 : 여기

<project name="6 - GW Testing" default="resolve" xmlns:ivy="antlib:org.apache.ivy.ant"> 
<property name="lib.dir" location="C:/dev/.ivy2/cache" /> 
<property name="res.dir" location="../TestNGReports" /> 
<property name="GWPersistence.ivy.file" value="C:/tmp/svncheckouts/guidewire/GWPersistenceIvy/gwpersistence-ivy.xml"/> 
<property name="GWBroker.ivy.file" value="C:/tmp/svncheckouts/guidewire/GWBrokerIvy/gwbroker-ivy.xml"/> 
<property name="GWRepository.ivy.file" value="C:/tmp/svncheckouts/guidewire/GWRepositoryIvy/gwrepository-ivy.xml"/> 
<property name="GWServices.ivy.file" value="C:/tmp/svncheckouts/guidewire/GWServicesIvy/gwservices-ivy.xml"/> 
<property name="GWTesting.ivy.file" value="C:/tmp/svncheckouts/guidewire/GWTestingIvy/gwtesting-ivy.xml"/> 
<property name="Local.config" location="C:/tmp/regression-configs/guidewire" /> 
<property name="Regression.config" location="${Local.config}/suite" /> 

<path id="lib.classpath"> 
    <fileset dir="${lib.dir}"> 
     <include name="**/*.jar" /> 
    </fileset> 
</path> 

<path id="combined.classpath"> 
    <path refid="lib.classpath" /> 
</path> 

<target name="init" description="initialize the build environment"> 
    <tstamp /> 

    <delete dir="${res.dir}" /> 
    <mkdir dir="${res.dir}" /> 

    <delete dir="C:/Users/qauser/.ivy2/cache/com.idfbins.guidewire" /> 
</target> 

<target name="resolve" depends="init" description="retrieve dependencies with ivy"> 
    <ivy:configure file="C:/dev/.ivy2/ivysettings.xml" /> 

    <ivy:resolve file="${GWPersistence.ivy.file}" /> 
    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" /> 

    <ivy:resolve file="${GWBroker.ivy.file}" /> 
    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" /> 

    <ivy:resolve file="${GWRepository.ivy.file}" /> 
    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" /> 

    <ivy:resolve file="${GWServices.ivy.file}" /> 
    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" /> 

    <ivy:resolve file="${GWTesting.ivy.file}" /> 
    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" /> 

    <ivy:resolve file="../GWRepositoryConfig/suite/ivy.xml" /> 
    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type]-[revision].[ext]" /> 
</target> 

<target name="run-tests-a-test-runner" depends="resolve"> 
    <taskdef name="testng" classpathref="lib.classpath" classname="org.testng.TestNGAntTask"> 
     <classpath> 
      <pathelement location="../../lib/default/testng-6.11.jar"/> 
     </classpath> 
    </taskdef> 

    <delete file="${Local.config}/config.properties" /> 
    <copy file="C:/tmp/svncheckouts/guidewire/GWRepositoryConfig/suite/regression-test-runner.properties" todir="${Local.config}" /> 
    <rename src="${Local.config}/regression-test-runner.properties" dest="${Local.config}/config.properties"/> 
    <echo message="CONFIG FILE: regression-test-runner.properties copied to config.properties" /> 

    <echo message="Running Tests..." /> 
    <testng classpathref="combined.classpath" outputDir="${res.dir}" haltOnfailure="false"> 
     <classpath location="combined.classpath" /> 
     <xmlfileset dir="C:/tmp/svncheckouts/guidewire/JobXMLFiles" includes="a-test-runner.xml"/> 
    </testng> 
    </target> 
</project> 

그리고 나의 스위트 선언입니다 :

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > 
<suite name="A-Test-Runner" verbose="1"> 
<test name="A-Test-Runner"> 
    <classes> 
     <class name="regression.r2.clock.billingcenter.cancel.TestCancellationOnBoundPolicy" /> 
    </classes> 
</test> 

지금까지, 나는 스위트 declarat의 DTD를 제거하기 위해 노력했다 이온, 나는 어느 방향 으로든 변화를 가졌고 ANT와 TestNG의 다양한 버전을 시도했다. 지금까지 제가 일할 수 있었던 유일한 방법은 TestNG 6.11로 되돌아가는 것입니다. 나는 여기서 무슨 일이 벌어지고 있는지를 놓치고있다. 이견있는 사람?

답변

0

CLASSPATH에서이 문제를 일으키는 외부 파서로 연결되는 것처럼 보입니다. 아마도 당신은 pull-parser으로 갈 것 같습니다. 나는 당신의 예외

at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:100)

를보기 때문에

나는이 말을하고있다.

당신은

-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl

+0

가 감사를 통해 지정하여 다시 JDK에서 사용할 수있는 기본 파서 가을에 자바를 강제로이 점점 과거의 시도 할 수 있습니다! 당신이 올바른 방향으로 나를 지적했다. Hibernate가 우리에게 문제를 일으켰다는 것이 밝혀졌습니다. 수정 사항은 포함 된 dom4jj jar를 제외하고 새로운 버전을 포함하는 것입니다. 내가 그것을 파고 들어갈 때까지 아이비의 org 선언이 dom4j에서 어떤 점에서 바뀌었기 때문에 우리가 dom4j의 구 버전 (2007 년경)을 사용하고 있다는 것을 깨닫지 못했습니다. 이 항아리는 xpp3을 포함하고 있습니다. 새로운 dom4j 모듈 (09/2017부터)로 업데이트하면 완벽하게 수정되었습니다. 나는 여전히 xpp3을 사용하고 있다고 생각하지만 이제는 내 xml 파일을 구문 분석 할 수 있습니다. 다시 감사합니다. 너는 생명의 은인이야! – BJHiltbrand

관련 문제