// Path: src/adql-validator/src/cds/adql/validation/ValidationException.java
// public class ValidationException extends Exception {
// 
//     public ValidationException() {
//         super();
//     }
// 
//     public ValidationException(String s) {
//         super(s);
//     }
// 
//     public ValidationException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public ValidationException(Throwable throwable) {
//         super(throwable);
//     }
// 
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/Contact.java
// public class Contact {
// 
//     public String name = null;
// 
//     public URL url = null;
// 
//     @Override
//     public String toString() {
//         return "Contact{name='" + name + '\'' + ", url=" + url + '}';
//     }
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/Publisher.java
// public class Publisher {
// 
//     public String name = null;
// 
//     public URL url = null;
// 
//     @Override
//     public String toString() {
//         return "Publisher{name='" + name + '\'' + ", url=" + url + '}';
//     }
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/ValidationQuery.java
// public class ValidationQuery {
// 
//     /** Unique ID of this test in an entire validation tests set. */
//     public final UUID id;
// 
//     /** Human description of this test. */
//     public String description = null;
// 
//     /** The ADQL query to test. */
//     public String query = null;
// 
//     /** Indicate whether the query is expected to be valid or not. */
//     public boolean isValid = false;
// 
//     /** Query's ADQL version target. */
//     public ADQLVersion adqlVersion = ValidationSetParser.DEFAULT_ADQL_VERSION;
// 
//     /**
//      * Create a {@link ValidationQuery} with a generated UUID.
//      */
//     public ValidationQuery(){
//         this((UUID)null);
//     }
// 
//     /**
//      * Create a {@link ValidationQuery} with the given UUID.
//      *
//      * @param id    UUID of this validation test.
//      *              <i>If NULL, one will be automatically generated.</i>
//      */
//     public ValidationQuery(final UUID id){
//         this.id = (id == null) ? UUID.randomUUID() : id;
//     }
// 
//     /**
//      * Create a {@link ValidationQuery} with the given UUID.
//      *
//      * @param id    UUID of this validation test.
//      *              <i>If NULL, one will be automatically generated.</i>
//      */
//     public ValidationQuery(final String id){
//         this.id = (id == null || id.trim().length() == 0) ? UUID.randomUUID() : UUID.fromString(id);
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final ValidationQuery testQuery = (ValidationQuery) o;
//         return id.equals(testQuery.id);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(id);
//     }
// 
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/ValidationSet.java
// public class ValidationSet {
// 
//     /** Person/Entity to contact in case of question/comment about this set. */
//     public Contact contact = null;
// 
//     /** Person/Entity who published this set. */
//     public Publisher publisher = null;
// 
//     /** Human description of this entire set.*/
//     public String description = null;
// 
//     /** Set of all Validation Tests included inside this set.
//      * <p>
//      *     It contains only unique items: no two {@link ValidationQuery}
//      *     instances have the same UUID.
//      * </p> */
//     public final Set<ValidationQuery> queries = new LinkedHashSet<>(30);
// 
// }


import cds.adql.validation.ValidationException;
import cds.adql.validation.query.Contact;
import cds.adql.validation.query.Publisher;
import cds.adql.validation.query.ValidationQuery;
import cds.adql.validation.query.ValidationSet;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import static org.junit.jupiter.api.Assertions.*;
    @Test
    void passNoQuery() {
        // Trigger the 'pass' event with no query:
        report.validating(null);

        // Check the output:
        assertEquals(0, out.toByteArray().length);
        assertEquals(0, err.toByteArray().length);
    }

    @Test
    void passNoStats() {
        // Create a validation set:
        final ValidationSet vSet = new ValidationSet();
        final ValidationQuery QUERY = new ValidationQuery();
        vSet.queries.add(QUERY);

        // Trigger the 'pass' event:
        final String SET_NAME = "TEST";
        report.start(vSet, SET_NAME);
        report.validating(QUERY);
        report.pass(QUERY);

        // Check the output:
        assertEquals(generateReportHeader(SET_NAME, 1) +
                "1/1 - "+QUERY.id+" - SUCCESS" + LINE_SEP +
                TextReport.LIGHT_SEP + LINE_SEP +
                "Description: -" + LINE_SEP +
                "Query      : "   + LINE_SEP +
                "Expected   : failure" + LINE_SEP +
// Path: src/adql-validator/src/cds/adql/validation/ValidationException.java
// public class ValidationException extends Exception {
// 
//     public ValidationException() {
//         super();
//     }
// 
//     public ValidationException(String s) {
//         super(s);
//     }
// 
//     public ValidationException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public ValidationException(Throwable throwable) {
//         super(throwable);
//     }
// 
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/Contact.java
// public class Contact {
// 
//     public String name = null;
// 
//     public URL url = null;
// 
//     @Override
//     public String toString() {
//         return "Contact{name='" + name + '\'' + ", url=" + url + '}';
//     }
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/Publisher.java
// public class Publisher {
// 
//     public String name = null;
// 
//     public URL url = null;
// 
//     @Override
//     public String toString() {
//         return "Publisher{name='" + name + '\'' + ", url=" + url + '}';
//     }
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/ValidationQuery.java
// public class ValidationQuery {
// 
//     /** Unique ID of this test in an entire validation tests set. */
//     public final UUID id;
// 
//     /** Human description of this test. */
//     public String description = null;
// 
//     /** The ADQL query to test. */
//     public String query = null;
// 
//     /** Indicate whether the query is expected to be valid or not. */
//     public boolean isValid = false;
// 
//     /** Query's ADQL version target. */
//     public ADQLVersion adqlVersion = ValidationSetParser.DEFAULT_ADQL_VERSION;
// 
//     /**
//      * Create a {@link ValidationQuery} with a generated UUID.
//      */
//     public ValidationQuery(){
//         this((UUID)null);
//     }
// 
//     /**
//      * Create a {@link ValidationQuery} with the given UUID.
//      *
//      * @param id    UUID of this validation test.
//      *              <i>If NULL, one will be automatically generated.</i>
//      */
//     public ValidationQuery(final UUID id){
//         this.id = (id == null) ? UUID.randomUUID() : id;
//     }
// 
//     /**
//      * Create a {@link ValidationQuery} with the given UUID.
//      *
//      * @param id    UUID of this validation test.
//      *              <i>If NULL, one will be automatically generated.</i>
//      */
//     public ValidationQuery(final String id){
//         this.id = (id == null || id.trim().length() == 0) ? UUID.randomUUID() : UUID.fromString(id);
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final ValidationQuery testQuery = (ValidationQuery) o;
//         return id.equals(testQuery.id);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(id);
//     }
// 
// }
// 
// Path: src/adql-validator/src/cds/adql/validation/query/ValidationSet.java
// public class ValidationSet {
// 
//     /** Person/Entity to contact in case of question/comment about this set. */
//     public Contact contact = null;
// 
//     /** Person/Entity who published this set. */
//     public Publisher publisher = null;
// 
//     /** Human description of this entire set.*/
//     public String description = null;
// 
//     /** Set of all Validation Tests included inside this set.
//      * <p>
//      *     It contains only unique items: no two {@link ValidationQuery}
//      *     instances have the same UUID.
//      * </p> */
//     public final Set<ValidationQuery> queries = new LinkedHashSet<>(30);
// 
// }


// Path: src/adql-validator/test/cds/adql/validation/report/TextReportTest.java
import cds.adql.validation.ValidationException;
import cds.adql.validation.query.Contact;
import cds.adql.validation.query.Publisher;
import cds.adql.validation.query.ValidationQuery;
import cds.adql.validation.query.ValidationSet;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import static org.junit.jupiter.api.Assertions.*;

    @Test
    void passNoQuery() {
        // Trigger the 'pass' event with no query:
        report.validating(null);

        // Check the output:
        assertEquals(0, out.toByteArray().length);
        assertEquals(0, err.toByteArray().length);
    }

    @Test
    void passNoStats() {
        // Create a validation set:
        final ValidationSet vSet = new ValidationSet();
        final ValidationQuery QUERY = new ValidationQuery();
        vSet.queries.add(QUERY);

        // Trigger the 'pass' event:
        final String SET_NAME = "TEST";
        report.start(vSet, SET_NAME);
        report.validating(QUERY);
        report.pass(QUERY);

        // Check the output:
        assertEquals(generateReportHeader(SET_NAME, 1) +
                "1/1 - "+QUERY.id+" - SUCCESS" + LINE_SEP +
                TextReport.LIGHT_SEP + LINE_SEP +
                "Description: -" + LINE_SEP +
                "Query      : "   + LINE_SEP +
                "Expected   : failure" + LINE_SEP +
                TextReport.SEPARATOR + LINE_SEP, out.toString());