Project

Profile

Help

How to connect?
Download (2.75 KB) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.6.0.7 / hen / csource / samples / FotsResultsDocument.cs @ aa733b18

1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using Saxon.Api;
6

    
7
namespace TestRunner
8
{
9
    class FotsResultsDocument: ResultsDocument
10
    {
11

    
12
        public FotsResultsDocument(string rdir, Spec sp)
13
            : base(rdir, sp)
14
        {
15
            
16
        }
17

    
18
        public override void writeResultFilePreamble(Processor processor, XdmNode catalog) { 
19
                    createWriter(processor);
20
        String today =  DateTime.Now.ToString();
21
        XdmNode outermost = (XdmNode)catalog.EnumerateAxis(XdmAxis.Child, new QName(FOTestSuiteDriver.CNS, "catalog")).Current;
22
        results.WriteStartElement("test-suite-result", FOTestSuiteDriver.RNS);
23
        results.WriteStartElement("submission");
24
        results.WriteAttributeString("anonymous", "false");
25

    
26
        results.WriteStartElement("created");
27
        results.WriteAttributeString("by", "Michael Kay");
28
        results.WriteAttributeString("email", "mike@saxonica.com");
29
        results.WriteAttributeString("organization", "Saxonica");
30
        results.WriteAttributeString("on", today);
31
        results.WriteEndElement();
32

    
33
        results.WriteStartElement("test-run");
34
        results.WriteAttributeString("test-suite-version", outermost.GetAttributeValue(new QName("", "version")));
35
        results.WriteAttributeString("date-run", today);
36
        results.WriteEndElement();
37

    
38
        results.WriteStartElement("notes");
39
        results.WriteEndElement(); // notes
40

    
41
        results.WriteEndElement(); // submission
42

    
43
        results.WriteStartElement("product");
44

    
45
        results.WriteAttributeString("vendor", "Saxonica");
46
        results.WriteAttributeString("name", "Saxon-EEN");
47
        results.WriteAttributeString("version", processor.ProductVersion);
48
        results.WriteAttributeString("released", "false");
49
        results.WriteAttributeString("open-source", "false");
50
        results.WriteAttributeString("language", ((SpecAttr)spec.GetAttr()).svname);
51

    
52

    
53
        /*Map<String, FOTestSuiteDriver.Dependency> dependencyMap = ((FOTestSuiteDriver)testDriver).getDependencyMap();
54
        if (!dependencyMap.isEmpty()) {
55
            for (Map.Entry<String, FOTestSuiteDriver.Dependency> entry : dependencyMap.entrySet()) {
56
                FOTestSuiteDriver.Dependency dep = entry.getValue();
57
                if (!"spec".Equals(dep.dType)) {
58
                    results.writeStartElement("dependency");
59
                    results.writeAttribute("type", dep.dType);
60
                    results.writeAttribute("value", entry.getKey());
61
                    results.writeAttribute("satisfied", Boolean.toString(dep.satisfied));
62
                    results.writeEndElement(); //dependency
63
                }
64
            }*/
65
            //TODO
66

    
67
        results.WriteEndElement(); //product
68
        }
69
    }
70
}
(9-9/24)