Package org.glassfish.jersey.internal.util

Examples of org.glassfish.jersey.internal.util.SimpleNamespaceResolver


            }
            final DocumentBuilder b = bf.newDocumentBuilder();
            final Document d = b.parse(tmpFile);
            printSource(new DOMSource(d));
            final XPath xp = XPathFactory.newInstance().newXPath();
            xp.setNamespaceContext(new SimpleNamespaceResolver("wadl", "http://wadl.dev.java.net/2009/02"));
            // check base URI
            String val = (String) xp.evaluate("/wadl:application/wadl:resources/@base", d, XPathConstants.STRING);
            assertEquals(val, getBaseUri().toString());
            // check total number of resources is 4
            val = (String) xp.evaluate("count(//wadl:resource)", d, XPathConstants.STRING);
View Full Code Here


            }
            DocumentBuilder b = bf.newDocumentBuilder();
            Document d = b.parse(tmpFile);
            printSource(new DOMSource(d));
            final XPath xp = XPathFactory.newInstance().newXPath();
            xp.setNamespaceContext(new SimpleNamespaceResolver("wadl", "http://wadl.dev.java.net/2009/02"));

            // check base URI
            String val = (String) xp.evaluate("/wadl:application/wadl:resources/@base", d, XPathConstants.STRING);
            assertEquals(val, getBaseUri().toString());
            // check total number of resources is 3 (no ExtraResource details included)
View Full Code Here

            }
            final DocumentBuilder b = bf.newDocumentBuilder();
            final Document d = b.parse(tmpFile);
            printSource(new DOMSource(d));
            final XPath xp = XPathFactory.newInstance().newXPath();
            xp.setNamespaceContext(new SimpleNamespaceResolver("wadl", "http://wadl.dev.java.net/2009/02"));
            // check base URI
            String val = (String) xp.evaluate("/wadl:application/wadl:resources/@base", d, XPathConstants.STRING);
            assertEquals(val, getBaseUri().toString());
            // check total number of resources is 1 (no ExtraResource details included)
            val = (String) xp.evaluate("count(//wadl:resource)", d, XPathConstants.STRING);
View Full Code Here

            }
            final DocumentBuilder b = bf.newDocumentBuilder();
            final Document d = b.parse(tmpFile);
            printSource(new DOMSource(d));
            final XPath xp = XPathFactory.newInstance().newXPath();
            xp.setNamespaceContext(new SimpleNamespaceResolver("wadl", "http://wadl.dev.java.net/2009/02"));
            String val = (String) xp.evaluate("/wadl:application/wadl:resources/@base", d, XPathConstants.STRING);
            assertEquals(val, getBaseUri().toString());
            // check total number of resources is 1
            val = (String) xp.evaluate("count(//wadl:resource)", d, XPathConstants.STRING);
            assertEquals("1", val);
View Full Code Here

            ((ByteArrayInputStream) containerResponse.getEntity()).reset();

            final Document d = b.parse((InputStream) containerResponse.getEntity());
            printSource(new DOMSource(d));
            final XPath xp = XPathFactory.newInstance().newXPath();
            xp.setNamespaceContext(new SimpleNamespaceResolver("wadl", "http://wadl.dev.java.net/2009/02"));
            // check base URI
            final String val = (String) xp.evaluate("/wadl:application/wadl:resources/@base", d, XPathConstants.STRING);
            assertEquals(val, MyWadlGeneratorConfig.MyWadlGenerator.CUSTOM_RESOURCES_BASE_URI);
        }
View Full Code Here

            }
            final DocumentBuilder b = bf.newDocumentBuilder();
            final Document d = b.parse((InputStream) containerResponse.getEntity());
            printSource(new DOMSource(d));
            final XPath xp = XPathFactory.newInstance().newXPath();
            xp.setNamespaceContext(new SimpleNamespaceResolver("wadl", "http://wadl.dev.java.net/2009/02"));

            final NodeList responseElements = (NodeList) xp.evaluate(
                    "/wadl:application/wadl:resources[@path!='application.wadl']//wadl:method/wadl:response", d,
                    XPathConstants.NODESET);
View Full Code Here

        final DocumentBuilder b = bf.newDocumentBuilder();
        final Document d = b.parse(tmpFile);

        final XPath xp = XPathFactory.newInstance().newXPath();
        xp.setNamespaceContext(new SimpleNamespaceResolver("wadl", "http://wadl.dev.java.net/2009/02"));
        String val = (String) xp.evaluate(
                "//wadl:resource[@path='part']/wadl:method[@name='POST']/wadl:request/wadl:representation/@mediaType",
                d, XPathConstants.STRING);

        assertEquals("multipart/form-data", val);
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.internal.util.SimpleNamespaceResolver

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.