Examples of XMLParticle


Examples of org.apache.vysper.xml.decoder.XMLParticle

    }
   
    public void testIllegalOpening() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<start <illegal start>> "));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("opening not allowed inside element");
        } catch (DecodingException e) {
            // test succeded
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

    }
   
    public void testIllegalOpeningAfterAttr() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<start attr='val' <illegal start>>"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("opening not allowed inside element");
        } catch (DecodingException e) {
            // test succeded
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

    }
   
    public void testLateOpeningElementName() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("< latename attr='val'>"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("opening xml element name to follow immediately after '<' ");
        } catch (DecodingException e) {
            // test succeded
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

    }
   
    public void testWrongClosingElementName() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<name attr='val'>"));
        particles.add(new XMLParticle("</nameother >"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("closing xml element name to follow immediately after '</'");
        } catch (DecodingException e) {
            // test succeded
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

    }
   
    public void testWrongClosingElementWhitespace() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<name attr='val'>"));
        particles.add(new XMLParticle("</ name >"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("closing xml element name to follow immediately after '</'");
        } catch (DecodingException e) {
            // test succeded
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

    }
   
    public void testWrongClosingElementWhitespace2() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        particles.add(new XMLParticle("<name attr='val'>"));
        particles.add(new XMLParticle("< /name >"));
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("closing xml element must start with '</'");
        } catch (DecodingException e) {
            // test succeded
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

    }

    public void testStartElementEmpty() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        XMLParticle particle = new XMLParticle("< />");
        try {
            String name = particle.getElementName();
            fail("closing xml element must not be empty (direct access)");
        } catch (DecodingException e) {
            // test succeded
        }
        particles.add(particle);
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

        }
    }

    public void testElementNameColon_Only() throws DecodingException {

        XMLParticle particle = new XMLParticle("<: />");
        try {
            String name = particle.getElementName();
            fail("illegal element name ':'");
        } catch (DecodingException e) {
            // test succeded
        }
    }
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

    }

    public void testElementNameColon_NoName() throws DecodingException {
        List<XMLParticle> particles = new ArrayList<XMLParticle>();

        XMLParticle particle = new XMLParticle("<namespace: />");
        particles.add(particle);
        try {
            xmlRawToFragmentConverter.convert(particles);
            fail("illegal element name");
        } catch (DecodingException e) {
View Full Code Here

Examples of org.apache.vysper.xml.decoder.XMLParticle

        }
    }

    public void testMoreEmptyElements() throws DecodingException {
        try {
            String name = new XMLParticle("<>").getElementName();
            fail("xml element name is mandatory");
        } catch (DecodingException e) {
            // test succeded
        }

        try {
            String name = new XMLParticle("< >").getElementName();
            fail("xml element name is mandatory");
        } catch (DecodingException e) {
            // test succeded
        }

        try {
            String name = new XMLParticle("< attr='k' >").getElementName();
            fail("xml element name is mandatory");
        } catch (DecodingException e) {
            // test succeded
        }

        try {
            String name = new XMLParticle("< attr='k' ></>").getElementName();
            fail("xml element name is mandatory");
        } catch (DecodingException e) {
            // test succeded
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.