// CSE 143, Winter 2009, Marty Stepp
// Homework 2: HTML Validator
//
// Instructor-provided code.
// This program is a very simple test for your HTML validator object.
// Please feel free to modify this file to create your own simple test cases.
import java.util.*;
/** Runs your HTML validator. */
public class SimpleTest {
public static void main(String[] args) {
// first test for short valid code
//
hellohow are you
Queue tags = new LinkedList();
tags.add(new HtmlTag("html", true)); //
tags.add(new HtmlTag("body", true)); //
tags.add(new HtmlTag("b", true)); //
tags.add(new HtmlTag("b", false)); //
tags.add(new HtmlTag("i", true)); //
tags.add(new HtmlTag("b", true)); //
tags.add(new HtmlTag("b", false)); //
tags.add(new HtmlTag("br")); //
tags.add(new HtmlTag("i", false)); //
tags.add(new HtmlTag("body", false)); //
tags.add(new HtmlTag("html", false)); //
HtmlValidator validator = new HtmlValidator(tags);
System.out.println("getTags: " + validator.getTags());
System.out.println("validate:");
validator.validate();
// second test for invalid code and setTags
tags = new LinkedList();
tags.add(new HtmlTag("html", true)); //
tags.add(new HtmlTag("body", true)); //
tags.add(new HtmlTag("b", true)); //
tags.add(new HtmlTag("body", false)); //
tags.add(new HtmlTag("b", false)); //
tags.add(new HtmlTag("html", false)); //
System.out.println();
System.out.println("setTags(" + tags + ")");
validator.setTags(tags);
System.out.println("getTags: " + validator.getTags());
System.out.println("validate:");
validator.validate();
}
}