// Path: runners/dmn-tck-runner-jdmn/src/test/java/org/omg/dmn/tck/marshaller/TckMarshallingHelper.java
// public class TckMarshallingHelper {
// 
//     @SuppressWarnings({ "unchecked" })
//     public static final TestCases load(InputStream inputStream)
//             throws JAXBException {
//         JAXBContext context = JAXBContext.newInstance( TestCases.class);
//         Unmarshaller um = context.createUnmarshaller();
// 
//         Object obj = um.unmarshal(inputStream);
//         if (obj instanceof JAXBElement<?> ) {
//             return ((JAXBElement<TestCases>) obj).getValue();
//         } else {
//             return (TestCases) obj;
//         }
//     }
// 
// }
// 
// Path: runners/dmn-tck-reporter/src/main/java/org/omg/dmn/tck/util/ReportHelper.java
// public class ReportHelper {
// 
//     public static void addRowCell(TableRow row, String text, String icon) {
//         row.getText().add( text );
//         row.getIcons().add( icon );
//         row.getRowspan().add( 1 );
//     }
// 
//     public static void addHeader(ReportTable table, String t, String d) {
//         table.getHeaders().add( t );
//         table.getHeaderDetails().add( d );
//     }
// 
//     public static String removeQuotes(String val) {
//         if( val.length() >= 2 && val.startsWith( "\"" ) && val.endsWith( "\"" ) ) {
//             return val.substring( 1, val.length()-1 );
//         }
//         return val;
//     }
// }


import freemarker.template.Configuration;
import freemarker.template.TemplateExceptionHandler;
import org.apache.commons.cli.*;
import org.omg.dmn.tck.marshaller.TckMarshallingHelper;
import org.omg.dmn.tck.marshaller._20160719.TestCases;
import org.omg.dmn.tck.util.ReportHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.bind.JAXBException;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Stream;
            ReportTable table = new ReportTable(  );
            ReportHelper.addHeader( table, "Label", "" );
            ReportHelper.addHeader( table, v.getName(), v.getVersion() );
            rt.put( v.getFileNameId(), table );
        }
        for( Map.Entry<String, List<TestCasesData>> lbl : labels.entrySet() ) {
            for( Vendor v : results.values() ) {
                ReportTable table = rt.get( v.getFileNameId() );
                TableRow row = new TableRow(  );
                ReportHelper.addRowCell( row, lbl.getKey(), "" );
                int success = 0;
                int total = 0;
                for( TestCasesData tcd : lbl.getValue() ) {
                    for( TestCases.TestCase tc : tcd.model.getTestCase() ) {
                        String key = createTestKey( tcd.folder, tcd.testCaseName, tc.getId() );
                        TestResult r = v.getResults().get( key );
                        if( r != null && r.getResult() == TestResult.Result.SUCCESS ) {
                            success++;
                        }
                        total++;
                    }
                }
                String icon = null;
                if( success == total ) {
                    icon = GLYPHICON_SUCCESS;
                } else if( success == 0 ) {
                    icon = GLYPHICON_FAILURE;
                } else {
                    icon = GLYPHICON_WARNING;
                }
// Path: runners/dmn-tck-runner-jdmn/src/test/java/org/omg/dmn/tck/marshaller/TckMarshallingHelper.java
// public class TckMarshallingHelper {
// 
//     @SuppressWarnings({ "unchecked" })
//     public static final TestCases load(InputStream inputStream)
//             throws JAXBException {
//         JAXBContext context = JAXBContext.newInstance( TestCases.class);
//         Unmarshaller um = context.createUnmarshaller();
// 
//         Object obj = um.unmarshal(inputStream);
//         if (obj instanceof JAXBElement<?> ) {
//             return ((JAXBElement<TestCases>) obj).getValue();
//         } else {
//             return (TestCases) obj;
//         }
//     }
// 
// }
// 
// Path: runners/dmn-tck-reporter/src/main/java/org/omg/dmn/tck/util/ReportHelper.java
// public class ReportHelper {
// 
//     public static void addRowCell(TableRow row, String text, String icon) {
//         row.getText().add( text );
//         row.getIcons().add( icon );
//         row.getRowspan().add( 1 );
//     }
// 
//     public static void addHeader(ReportTable table, String t, String d) {
//         table.getHeaders().add( t );
//         table.getHeaderDetails().add( d );
//     }
// 
//     public static String removeQuotes(String val) {
//         if( val.length() >= 2 && val.startsWith( "\"" ) && val.endsWith( "\"" ) ) {
//             return val.substring( 1, val.length()-1 );
//         }
//         return val;
//     }
// }


// Path: runners/dmn-tck-reporter/src/main/java/org/omg/dmn/tck/Reporter.java
import freemarker.template.Configuration;
import freemarker.template.TemplateExceptionHandler;
import org.apache.commons.cli.*;
import org.omg.dmn.tck.marshaller.TckMarshallingHelper;
import org.omg.dmn.tck.marshaller._20160719.TestCases;
import org.omg.dmn.tck.util.ReportHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.bind.JAXBException;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Stream;

            ReportTable table = new ReportTable(  );
            ReportHelper.addHeader( table, "Label", "" );
            ReportHelper.addHeader( table, v.getName(), v.getVersion() );
            rt.put( v.getFileNameId(), table );
        }
        for( Map.Entry<String, List<TestCasesData>> lbl : labels.entrySet() ) {
            for( Vendor v : results.values() ) {
                ReportTable table = rt.get( v.getFileNameId() );
                TableRow row = new TableRow(  );
                ReportHelper.addRowCell( row, lbl.getKey(), "" );
                int success = 0;
                int total = 0;
                for( TestCasesData tcd : lbl.getValue() ) {
                    for( TestCases.TestCase tc : tcd.model.getTestCase() ) {
                        String key = createTestKey( tcd.folder, tcd.testCaseName, tc.getId() );
                        TestResult r = v.getResults().get( key );
                        if( r != null && r.getResult() == TestResult.Result.SUCCESS ) {
                            success++;
                        }
                        total++;
                    }
                }
                String icon = null;
                if( success == total ) {
                    icon = GLYPHICON_SUCCESS;
                } else if( success == 0 ) {
                    icon = GLYPHICON_FAILURE;
                } else {
                    icon = GLYPHICON_WARNING;
                }
                ReportHelper.addRowCell( row, success + "/" + total, icon );