Package org.apache.wink.common.internal

Examples of org.apache.wink.common.internal.PathSegmentImpl


        assertFalse(segment1.equals(segment2));
    }

    public void testBadInput() {
        try {
            new PathSegmentImpl(null);
            fail("expected NuulPointerException");
        } catch (NullPointerException e) {
        }

        try {
            new PathSegmentImpl(null, (String)null);
            fail("expected NuulPointerException");
        } catch (NullPointerException e) {
        }

        try {
            new PathSegmentImpl(null, (MultivaluedMap<String, String>)null);
            fail("expected NuulPointerException");
        } catch (NullPointerException e) {
        }
    }
View Full Code Here


        } catch (NullPointerException e) {
        }
    }

    public void testDecode() {
        PathSegmentImpl segment = new PathSegmentImpl("a%20b;m%201=a%201;m%202=a%202;m3=3");
        PathSegmentImpl expected = new PathSegmentImpl("a b;m 1=a 1;m 2=a 2;m3=3");
        assertEquals(expected, PathSegmentImpl.decode(segment));
    }
View Full Code Here

            .appendQueryParamsToPath(uri, null, true));
    }

    public void testParsePath() {
        LinkedList<PathSegment> segments = new LinkedList<PathSegment>();
        segments.add(new PathSegmentImpl(""));
        assertEquals(segments, UriHelper.parsePath(""));

        segments.clear();
        segments.add(new PathSegmentImpl("a"));
        segments.add(new PathSegmentImpl("b;m=1"));
        segments.add(new PathSegmentImpl("c"));
        assertEquals(segments, UriHelper.parsePath("a/b;m=1/c"));
        segments.add(new PathSegmentImpl(""));
        assertEquals(segments, UriHelper.parsePath("a/b;m=1/c/"));
        segments.addFirst(new PathSegmentImpl(""));
        assertEquals(segments, UriHelper.parsePath("/a/b;m=1/c/"));
    }
View Full Code Here

        @GET
        @Path("PathSegmentSimple")
        @Produces
        public void getPathSegment(@PathParam("p") PathSegment p) {
            PathSegment segment = new PathSegmentImpl("a b;m1=1");
            assertEquals(segment, p);
        }
View Full Code Here

        @GET
        @Path("PathSegmentEncoded")
        @Produces
        public void getPathSegmentEncoded(@Encoded @PathParam("p") PathSegment p) {
            assertEquals(new PathSegmentImpl("a%20b;m1=1"), p);
        }
View Full Code Here

        @GET
        @Path("PathSegmentDefault")
        @Produces
        public void getPathSegmentDefault(@DefaultValue("d;m=1") @PathParam("k") PathSegment p) {
            assertEquals(new PathSegmentImpl("d;m=1"), p);
        }
View Full Code Here

        @GET
        @Path("PathSegmentLast/{p1:.*}")
        @Produces
        public void getPathSegmentLast(@PathParam("p1") PathSegment p) {
            PathSegment segment = new PathSegmentImpl("c");
            assertEquals(segment, p);
        }
View Full Code Here

        @GET
        @Path("PathSegmentMultiSimple/{p1:.*/.*}/end")
        @Produces
        public void getPathSegmentMultiSimple(@PathParam("p1") PathSegment p) {
            PathSegment segment = new PathSegmentImpl("c d");
            assertEquals(segment, p);
        }
View Full Code Here

        @GET
        @Path("PathSegmentMultiEncoded/{p1:.*/.*}/end")
        @Produces
        public void getPathSegmentMultiEncoded(@Encoded @PathParam("p1") PathSegment p) {
            PathSegment segment = new PathSegmentImpl("c%20d");
            assertEquals(segment, p);
        }
View Full Code Here

        @GET
        @Path("PathSegmentSimpleList/{p1:.*}")
        @Produces
        public void getPathSegmentList(@PathParam("p1") List<PathSegment> p) {
            PathSegment segment1 = new PathSegmentImpl("a b;m1=1");
            PathSegment segment2 = new PathSegmentImpl("c d;m2=2");
            assertEquals(2, p.size());
            assertEquals(segment1, p.get(0));
            assertEquals(segment2, p.get(1));
        }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.PathSegmentImpl

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.