Package com.volantis.xml.sax.recorder.impl.attributes

Examples of com.volantis.xml.sax.recorder.impl.attributes.AttributesWindow


        int offset2 = builder.getOffset();
        builder.addAttributes(attributes);
        int offset3 = builder.getOffset();

        AttributesContainer container = builder.buildContainer();
        AttributesWindow window = container.createWindow();

        int index;

        // First search for attributes in the first set of attributes.
        window.move(offset1, offset2 - offset1);
        index = window.getIndex("", "abc");
        assertEquals("Index incorrect for attribute", 0, index);
        index = window.getIndex("abc");
        assertEquals("Index incorrect for attribute", 0, index);

        index = window.getIndex("", "xyz");
        assertEquals("Index incorrect for attribute", 1, index);
        index = window.getIndex("xyz");
        assertEquals("Index incorrect for attribute", 1, index);

        index = window.getIndex("", "qrs");
        assertEquals("Index incorrect for missing attribute", -1, index);
        index = window.getIndex("qrs");
        assertEquals("Index incorrect for missing attribute", -1, index);

        // Now move the window and try again.
        window.move(offset2, offset3 - offset2);

        index = window.getIndex("", "abc");
        assertEquals("Index incorrect for attribute", 0, index);
        index = window.getIndex("abc");
        assertEquals("Index incorrect for attribute", 0, index);

        index = window.getIndex("", "xyz");
        assertEquals("Index incorrect for attribute", 1, index);
        index = window.getIndex("xyz");
        assertEquals("Index incorrect for attribute", 1, index);

        index = window.getIndex("", "qrs");
        assertEquals("Index incorrect for missing attribute", -1, index);
        index = window.getIndex("qrs");
        assertEquals("Index incorrect for missing attribute", -1, index);
    }
View Full Code Here

TOP

Related Classes of com.volantis.xml.sax.recorder.impl.attributes.AttributesWindow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.