Package org.apache.sling.rewriter

Examples of org.apache.sling.rewriter.Transformer.startElement()


        Transformer transformer = factory.createTransformer();
        transformer.setContentHandler(handler);

        AttributesImpl in = new AttributesImpl();
        in.addAttribute(null, "href", null, "CDATA", "/etc/clientlib/test.css");
        transformer.startElement(null, "link", null, in);

        verify(handler, only()).startElement(isNull(String.class), eq("link"), isNull(String.class),
                attributesCaptor.capture());
        Attributes out = attributesCaptor.getValue();
        assertEquals("/etc/clientlib/test.css", out.getValue(0));
View Full Code Here


        Transformer transformer = factory.createTransformer();
        transformer.setContentHandler(handler);

        AttributesImpl in = new AttributesImpl();
        in.addAttribute(null, "href", null, "CDATA", "/etc/clientlib/test.css");
        transformer.startElement(null, "link", null, in);

        verify(handler, only()).startElement(isNull(String.class), eq("link"), isNull(String.class),
                attributesCaptor.capture());
        Attributes out = attributesCaptor.getValue();
        assertEquals("//static.host.com/etc/clientlib/test.css", out.getValue(0));
View Full Code Here

        transformer.setContentHandler(handler);

        AttributesImpl in = new AttributesImpl();
        in.addAttribute(null, "href", null, "CDATA", "/etc/clientlib/test.css");
        in.addAttribute(null, "class", null, "CDATA", "something nostatic");
        transformer.startElement(null, "link", null, in);

        verify(handler, only()).startElement(isNull(String.class), eq("link"), isNull(String.class),
                attributesCaptor.capture());
        Attributes out = attributesCaptor.getValue();
        assertEquals("/etc/clientlib/test.css", out.getValue(0));
View Full Code Here

        Transformer transformer = factory.createTransformer();
        transformer.setContentHandler(handler);

        AttributesImpl in = new AttributesImpl();
        in.addAttribute(null, "href", null, "CDATA", "/content/clientlib/test.css");
        transformer.startElement(null, "link", null, in);

        verify(handler, only()).startElement(isNull(String.class), eq("link"), isNull(String.class),
                attributesCaptor.capture());
        Attributes out = attributesCaptor.getValue();
        assertEquals("/content/clientlib/test.css", out.getValue(0));
View Full Code Here

        Transformer transformer = factory.createTransformer();
        transformer.setContentHandler(handler);

        AttributesImpl in = new AttributesImpl();
        in.addAttribute(null, "href", null, "CDATA", "/etc/clientlib/testA.css");
        transformer.startElement(null, "link", null, in);

        verify(handler, only()).startElement(isNull(String.class), eq("link"), isNull(String.class),
                attributesCaptor.capture());
        Attributes out = attributesCaptor.getValue();
        assertEquals("//static2.host.com/etc/clientlib/testA.css", out.getValue(0));
View Full Code Here

        Transformer transformer = factory.createTransformer();
        transformer.setContentHandler(handler);

        AttributesImpl in = new AttributesImpl();
        in.addAttribute(null, "src", null, "CDATA", "/etc/clientlib/testABC.css");
        transformer.startElement(null, "link", null, in);

        verify(handler, only()).startElement(isNull(String.class), eq("link"), isNull(String.class),
                attributesCaptor.capture());
        Attributes out = attributesCaptor.getValue();
        assertEquals("/etc/clientlib/testABC.css", out.getValue(0));
View Full Code Here

        Transformer transformer = factory.createTransformer();
        transformer.setContentHandler(handler);

        AttributesImpl in = new AttributesImpl();
        in.addAttribute(null, "src", null, "CDATA", "/etc/clientlib/testABC.css");
        transformer.startElement(null, "iframe", null, in);

        verify(handler, only()).startElement(isNull(String.class), eq("iframe"), isNull(String.class),
                attributesCaptor.capture());
        Attributes out = attributesCaptor.getValue();
        assertEquals("/etc/clientlib/testABC.css", out.getValue(0));
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.