[x3d-public] Conformance testing testing.

John Carlson yottzumm at gmail.com
Sat Sep 23 02:22:43 PDT 2023


This is what pops out when I run X3DJSAIL against the conformance tests:

Summary:

Support in X3DJSAIL for an X3D.isValid() boolean method that returns a
boolean is requested to reduce output.

    [apply]
    [apply] WARNING:avoid duplicating a built-in X3D node name as model
title, <meta name='title' content='indexedlineset.x3d'/>Validation report
for C:\x3d-code\www.web3d.org
\x3d\content\examples\ConformanceNist\Appearance\Material\indexedlineset.x3d
    [apply] org.web3d.x3d.sai.InvalidFieldException: IndexedLineSet
containing Coordinate node with 102 values must also include coordIndex
field
    [apply]     at
org.web3d.x3d.jsail.Rendering.IndexedLineSet.validate(IndexedLineSet.java:2781)
    [apply]     at org.web3d.x3d.jsail.Shape.Shape.validate(Shape.java:2074)
    [apply]     at org.web3d.x3d.jsail.Core.Scene.validate(Scene.java:881)
    [apply]     at org.web3d.x3d.jsail.Core.X3D.validate(X3D.java:4563)
    [apply]     at
org.web3d.x3d.jsail.Core.X3D.validationReport(X3D.java:3625)
    [apply]     at Validate.main(Unknown Source)
    [apply] <meta content='Correct definition and compliance of this
conformance scene is maintained by the X3D Working Group,
https://www.web3d.org/working-groups/x3d' name='info'/>
    [apply]
    [apply] *** exception occurred during validation: IndexedLineSet
containing Coordinate node with 102 values must also include coordIndex
field
    [apply] [X3DLoaderDOM] <meta name='info' content='Correct definition
and compliance of this conformance scene is maintained by the X3D Working
Group, https://www.web3d.org/working-groups/x3d'/>
    [apply] Validation report for C:\x3d-code\www.web3d.org
\x3d\content\examples\ConformanceNist\Appearance\Material\indexedlineset_color_first.x3d
    [apply] org.web3d.x3d.sai.InvalidFieldException: IndexedLineSet
containing Coordinate node with 102 values must also include coordIndex
field
    [apply]     at
org.web3d.x3d.jsail.Rendering.IndexedLineSet.validate(IndexedLineSet.java:2781)
    [apply]     at org.web3d.x3d.jsail.Shape.Shape.validate(Shape.java:2074)
    [apply]     at org.web3d.x3d.jsail.Core.Scene.validate(Scene.java:881)
    [apply]     at org.web3d.x3d.jsail.Core.X3D.validate(X3D.java:4563)
    [apply]     at
org.web3d.x3d.jsail.Core.X3D.validationReport(X3D.java:3625)
    [apply]     at Validate.main(Unknown Source)
    [apply] <meta content='Correct definition and compliance of this
conformance scene is maintained by the X3D Working Group,
https://www.web3d.org/working-groups/x3d' name='info'/>
    [apply]
    [apply] *** exception occurred during validation: IndexedLineSet
containing Coordinate node with 102 values must also include coordIndex
field
    [apply] [X3DLoaderDOM] <meta name='info' content='Correct definition
and compliance of this conformance scene is maintained by the X3D Working
Group, https://www.web3d.org/working-groups/x3d'

There are several of these. I can report more if necessary.  I'm guessing
these are negative tests.

There's also more negative tests:

[apply] Validation report for C:\x3d-code\www.web3d.org
\x3d\content\examples\ConformanceNist\Geometry\Cone\texture.x3d
    [apply] <meta content='Correct definition and compliance of this
conformance scene is maintained by the X3D Working Group,
https://www.web3d.org/working-groups/x3d' name='info'/>
    [apply]
    [apply] WARNING_MESSAGE: duplicate statement found: <meta name='Image'
content='texture-front.jpg'/>
    [apply] WARNING_MESSAGE: duplicate statement found: <meta name='Image'
content='texture-rear.jpg'/>
    [apply] WARNING_MESSAGE: duplicate statement found: <meta name='Image'
content='texture-top.jpg'/>
    [apply] WARNING_MESSAGE: duplicate statement found: <meta name='Image'
content='texture-bottom.jpg'/>
    [apply] WARNING_MESSAGE: duplicate statement found: <meta name='Image'
content='texture-left.jpg'/>
    [apply] WARNING_MESSAGE: duplicate statement found: <meta name='Image'
content='texture-right.jpg'/>
    [apply] <meta content='Correct definition and compliance of this
conformance scene is maintained by the X3D Working Group,
https://www.web3d.org/working-groups/x3d' name='info'/>
    [apply] [X3DLoaderDOM] <meta name='info' content='Correct definition
and compliance of this conformance scene is maintained by the X3D Working
Group, https://www.web3d.org/working-groups/x3d'/>

Here's my driver program in Java, you'll have to remove the JSON specific
stuff:  Full environment is here (see build.xml for target batchx3d):
https://github.com/coderextreme/x3dschema


/**
 * Copyright (c) 2022. John Carlson
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of content nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE

*/
import org.w3c.dom.Document;
import javax.json.JsonObject;
import java.io.File;
import java.io.FileWriter;
import org.web3d.x3d.jsail.X3DLoaderDOM;
import org.web3d.x3d.jsail.Core.X3D;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

public class Validate {
        public static void main(String [] args) throws Exception {

                DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
                DocumentBuilder db = dbf.newDocumentBuilder();
                for (int i = 0; i < args.length; i++) {
                        try {
                                X3DLoaderDOM xmlLoader = new X3DLoaderDOM();
                                Document document;
                                File f = new File(args[i]);
                                if (args[i].endsWith(".json") ||
args[i].endsWith(".x3dj")) {
                                        X3DJSONLD loader = new X3DJSONLD();
                                        JsonObject jsobj =
loader.readJsonFile(f);
                                        document =
loader.loadJsonIntoDocument(jsobj);
                                        FileWriter fw = new
FileWriter(args[i].substring(0, args[i].lastIndexOf("."))+".xml");

fw.write((loader.serializeDOM(loader.getX3DVersion(jsobj), document)));
                                        fw.close();
                                } else {
                                        document = db.parse(f);
                                }
                                X3D X3D0 =
(X3D)xmlLoader.toX3dModelInstance(document);
                                String validationResults =
X3D0.validationReport();
                                if (validationResults.startsWith("\n")) {
                                        System.out.println("Validation
report for "+args[i]);

System.err.println(validationResults.trim());
                                } else {
                                        System.out.println("Valid
"+args[i]);
                                }
                        } catch (Exception e) {
                                System.out.println("Invalid "+args[i]);
                                e.printStackTrace();
                        }
                }
        }
}

On Sat, Sep 23, 2023 at 3:19 AM John Carlson <yottzumm at gmail.com> wrote:

> Is conformance testing done only on x3d browsers?   Can I use the tests on
> my versions of X3DJSAIL?  I will work on my X3DJSAIL-based batch XML
> validation tester sometime tonight.  I will also work on developing a batch
> validation of VRML with tovrmlx3d, but AFAIK, it only does onesies, not
> batch.  Michalis?
>
> Then, I’ll introduce my own XML and X3DJSAIL.  I don’t expect any
> differences.
>
> I’m actually testing the conformance tests, not X3DJSAIL.  Do the tests
> distinguish between MFFloat and SFString (of floats) Probably not in XML
> land .  This is critical for conformance testing of VRML (and eventually
> JSON, that’s why I’m on board) browsers and libraries.   So it would be
> good to test X3dToVrml*.xslt which I haven’t ever tried.
>
> Recommendations for batch VRML validation welcome.
>
> Wish me luck!
>
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230923/00426896/attachment-0001.html>


More information about the x3d-public mailing list