com.google.caja.reporting.SimpleMessageQueue

Here are the examples of the java api class com.google.caja.reporting.SimpleMessageQueue taken from open source projects.

1. Html5ElementStackTest#setUp()

Project: caja
Source File: Html5ElementStackTest.java
View license
@Override
public void setUp() throws Exception {
    super.setUp();
    DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
    DOMImplementation domImpl = registry.getDOMImplementation("XML 1.0 Traversal 2.0");
    String qname = "html";
    String systemId = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";
    String publicId = "-//W3C//DTD XHTML 1.0 Transitional//EN";
    DocumentType documentType = domImpl.createDocumentType(qname, publicId, systemId);
    Document doc = domImpl.createDocument(null, null, documentType);
    mq = new SimpleMessageQueue();
    stack = new Html5ElementStack(doc, false, mq);
    stack.open(false);
}

2. ConfigUtil#loadSkeleton()

Project: caja
Source File: ConfigUtil.java
View license
private WhiteListSkeleton loadSkeleton(Reader in) throws IOException, ParseException {
    if (in instanceof UriReader) {
        URI uri = ((UriReader) in).getUri();
        Pair<WhiteListSkeleton, List<Message>> p = cache.get(uri);
        if (p != null) {
            mq.getMessages().addAll(p.b);
            return p.a;
        }
    }
    MessageQueue origMq = mq;
    SimpleMessageQueue cacheMq = new SimpleMessageQueue();
    this.mq = cacheMq;
    try {
        WhiteListSkeleton skel = loadSkeleton(expectJSONObject(JSONValue.parse(in), "whitelist"));
        if (in instanceof UriReader) {
            cache.put(((UriReader) in).getUri(), Pair.pair(skel, cacheMq.getMessages()));
        }
        return skel;
    } finally {
        this.mq = origMq;
        origMq.getMessages().addAll(cacheMq.getMessages());
    }
}

3. HtmlSchemaTest#setUp()

Project: caja
Source File: HtmlSchemaTest.java
View license
@Override
public void setUp() throws Exception {
    mq = new SimpleMessageQueue();
    schema = HtmlSchema.getDefault(mq);
    assertTrue(mq.getMessages().isEmpty());
}