You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mirko Friedenhagen (JIRA)" <ji...@apache.org> on 2016/01/08 22:35:39 UTC

[jira] [Commented] (SUREFIRE-964) TEST-*.xml files generated by Surefire throw validation warnings in Eclipse for no grammer constraints (DTD or XML schema) referenced in the document

    [ https://issues.apache.org/jira/browse/SUREFIRE-964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15089976#comment-15089976 ] 

Mirko Friedenhagen commented on SUREFIRE-964:
---------------------------------------------

Hello [~tibor17], I think the XSD is not correct, see https://issues.jenkins-ci.org/browse/JENKINS-31553 as well.
When I open:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" errors="0" failures="0" name="User sessions"
           tests="12"
           time="66.864949">
    <testcase classname="User sessions" name="Login" time="40.857683">
    </testcase>
    <testcase classname="User sessions" name="Logout"
              time="25.896327">
    </testcase>
</testsuite>
{code}
in IntelliJ I get an error because the namespacing is not correct. Xerces complains with:
{code}
schemaLocation value = 'https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd' must have even number of URI's.
{code}

In the definition for the Maven POM the line in the XSD reads like this:
{code}
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://maven.apache.org/POM/4.0.0" xmlns="http://maven.apache.org/POM/4.0.0">
{code}

so probably the surefire XSD should start with:
{code}
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="https://maven.apache.org/surefire/surefire-test-report" xmlns="https://maven.apache.org/surefire/surefire-test-report">
{code}

and the surefire TEST xml files should start with:
{code}
<testsuite xmlns="https://maven.apache.org/surefire/surefire-test-report" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/surefire/surefire-test-report https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd"
{code}

> TEST-*.xml files generated by Surefire throw validation warnings in Eclipse for no grammer constraints (DTD or XML schema) referenced in the document
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-964
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-964
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Report Plugin
>    Affects Versions: 2.13
>         Environment: Any OS, Eclipse Juno with m2e and m2e-wtp.
>            Reporter: Josh Unger
>            Assignee: Tibor Digana
>            Priority: Trivial
>             Fix For: 2.19
>
>
> 1. Create a Maven project in Eclipse.
> 2. Add a single class and a single test method decorated with @Test.
> {code}
> import org.junit.Test;
> public class ATest
> {
> 	@Test
> 	public void test()
> 	{
> 		
> 	}
> }
> {code}
> 3. Add the necessary information to the POM -
> {code}
> <build>
>     <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-surefire-plugin</artifactId>
>             <version>2.13</version>
>         </plugin>
>     </plugins>
> </build>
> <dependencies>
>     <dependency>
>         <groupId>junit</groupId>
>         <artifactId>junit</artifactId>
>         <version>4.7</version>
>         <scope>test</scope>
>     </dependency>
> </dependencies>
> {code}
> 4. Close Eclipse.
> 5. Edit your .project file to include the validator -
> {code}
> <buildCommand>
>     <name>org.eclipse.wst.validation.validationbuilder</name>
>     <arguments></arguments>
> </buildCommand>
> {code}
> 6. Build from the command line -
> > mvn install
> 7. Open Eclipse.
> EXPECTING: no warnings appear out of the box.  I understand workarounds, but for the benefit of anyone going forward and existing users, there should be no warnings.
> ACTUAL: warning appears -
> Description	Resource	Path	Location	Type
> No grammar constraints (DTD or XML Schema) referenced in the document.	TEST-ATest.xml	/test/target/surefire-reports	line 1	XML Problem



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)