Project

Profile

Help

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

he / src / samples / cs / TestRunner10.0 / FotsResultsDocument.cs @ be17ef52

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
            System.Collections.IEnumerator iter = catalog.EnumerateAxis(XdmAxis.Child, new QName(QT3TestSuiteDriver.CNS, "catalog"));
22
            if (!iter.MoveNext()) {
23
                throw new Exception("Outermost element of catalog file must be Q{"+QT3TestSuiteDriver.CNS+"}catalog");
24
            }
25
        XdmNode outermost = (XdmNode)iter.Current;
26
        results.WriteStartElement("test-suite-result", QT3TestSuiteDriver.RNS);
27
        results.WriteStartElement("submission");
28
        results.WriteAttributeString("anonymous", "false");
29

    
30
        results.WriteStartElement("created");
31
        results.WriteAttributeString("by", "Michael Kay");
32
        results.WriteAttributeString("email", "mike@saxonica.com");
33
        results.WriteAttributeString("organization", "Saxonica");
34
        results.WriteAttributeString("on", today);
35
        results.WriteEndElement();
36

    
37
        results.WriteStartElement("test-run");
38
        results.WriteAttributeString("test-suite-version", outermost.GetAttributeValue(new QName("", "version")));
39
        results.WriteAttributeString("date-run", today);
40
        results.WriteEndElement();
41

    
42
        results.WriteStartElement("notes");
43
        results.WriteEndElement(); // notes
44

    
45
        results.WriteEndElement(); // submission
46

    
47
        results.WriteStartElement("product");
48

    
49
        results.WriteAttributeString("vendor", "Saxonica");
50
        results.WriteAttributeString("name", "Saxon-EEN");
51
        results.WriteAttributeString("version", processor.ProductVersion);
52
        results.WriteAttributeString("released", "false");
53
        results.WriteAttributeString("open-source", "false");
54
        results.WriteAttributeString("language", ((SpecAttr)spec.GetAttr()).svname);
55

    
56

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

    
71
        results.WriteEndElement(); //product
72
        }
73
    }
74
}
(4-4/19)