// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/exception/ValidatorException.java
// public class ValidatorException extends RuntimeException {
//     private static final long serialVersionUID = 1L;
//     private final String _sanitizedContent;
// 
//     public ValidatorException(String sanitizedContent) {
//         _sanitizedContent = sanitizedContent;
//     }
// 
//     public ValidatorException(String sanitizedContent, String message) {
//         super(message);
//         _sanitizedContent = sanitizedContent;
//     }
// 
//     public String getSanitizedContent() {
//         return _sanitizedContent;
//     }
// }


import com.switchfly.inputvalidation.exception.ValidatorException;
import org.junit.Test;
import static org.junit.Assert.*;

        /**
         * We have disabled HTML output encoding to so that special characters, such as ê and ú, are not also encoded.
         * Unfortunately, without output encoding, many XSS attacks become *MUCH* more difficult to prevent.
         * If the following tests fail, then we may be vulnerable to XSS attacks.
         */
        assertValidationException("<", validationStrategy);
        assertValidationException(">", validationStrategy);
        assertValidationException("=", validationStrategy);
        assertValidationException("{", validationStrategy);
        assertValidationException("}", validationStrategy);
        assertValidationException("\"", validationStrategy);
        assertValidationException("(", validationStrategy);
        assertValidationException(")", validationStrategy);
        assertValidationException(";", validationStrategy);

        /**
         * HTML output encoding alone will not prevent HTML tag attribute attacks.  DO NOT allow these characters: ( ) = "
         */
        assertValidationException("1\" +onmouseover=alert(\"123123\") +", validationStrategy);
        assertValidationException("1\"+onmouseover=alert(\"123123\")+", validationStrategy);
        assertValidationException("1'+onmouseover=alert('123123')+", validationStrategy);
        assertValidationException("1'onmouseover=alert('123123')", validationStrategy);
        assertValidationException("1'onmouseover=alert(123123)", validationStrategy);
    }

    public static void assertValidationException(String html, ValidationStrategy<String> validationStrategy) {
        try {
            validationStrategy.validate(html);
            fail("content should not be valid.");
// Path: inputvalidation/src/main/java/com/switchfly/inputvalidation/exception/ValidatorException.java
// public class ValidatorException extends RuntimeException {
//     private static final long serialVersionUID = 1L;
//     private final String _sanitizedContent;
// 
//     public ValidatorException(String sanitizedContent) {
//         _sanitizedContent = sanitizedContent;
//     }
// 
//     public ValidatorException(String sanitizedContent, String message) {
//         super(message);
//         _sanitizedContent = sanitizedContent;
//     }
// 
//     public String getSanitizedContent() {
//         return _sanitizedContent;
//     }
// }


// Path: inputvalidation/src/test/java/com/switchfly/inputvalidation/AddressLineValidationStrategiesTest.java
import com.switchfly.inputvalidation.exception.ValidatorException;
import org.junit.Test;
import static org.junit.Assert.*;


        /**
         * We have disabled HTML output encoding to so that special characters, such as ê and ú, are not also encoded.
         * Unfortunately, without output encoding, many XSS attacks become *MUCH* more difficult to prevent.
         * If the following tests fail, then we may be vulnerable to XSS attacks.
         */
        assertValidationException("<", validationStrategy);
        assertValidationException(">", validationStrategy);
        assertValidationException("=", validationStrategy);
        assertValidationException("{", validationStrategy);
        assertValidationException("}", validationStrategy);
        assertValidationException("\"", validationStrategy);
        assertValidationException("(", validationStrategy);
        assertValidationException(")", validationStrategy);
        assertValidationException(";", validationStrategy);

        /**
         * HTML output encoding alone will not prevent HTML tag attribute attacks.  DO NOT allow these characters: ( ) = "
         */
        assertValidationException("1\" +onmouseover=alert(\"123123\") +", validationStrategy);
        assertValidationException("1\"+onmouseover=alert(\"123123\")+", validationStrategy);
        assertValidationException("1'+onmouseover=alert('123123')+", validationStrategy);
        assertValidationException("1'onmouseover=alert('123123')", validationStrategy);
        assertValidationException("1'onmouseover=alert(123123)", validationStrategy);
    }

    public static void assertValidationException(String html, ValidationStrategy<String> validationStrategy) {
        try {
            validationStrategy.validate(html);
            fail("content should not be valid.");
        } catch (ValidatorException e) {