Package org.apache.marmotta.commons.http

Examples of org.apache.marmotta.commons.http.ContentType.matches()


    @Test
    public void testMatchNormal1() throws Exception {
        ContentType type1 = new ContentType("application","json");
        ContentType type2 = new ContentType("application","json");

        Assert.assertTrue(type2.matches(type1));
        Assert.assertTrue(type1.matches(type2));
    }


    @Test
View Full Code Here


        ContentType type1 = new ContentType("application","json");
        ContentType type2 = new ContentType("application","*");

        Assert.assertTrue(type2.matchesWildcard(type1));
        Assert.assertFalse(type1.matches(type2));
        Assert.assertFalse(type2.matches(type1));
    }

    @Test
    public void testMatchNormal3() throws Exception {
        ContentType type1 = new ContentType("application","json");
View Full Code Here

    public void testMatchNormal3() throws Exception {
        ContentType type1 = new ContentType("application","json");
        ContentType type2 = new ContentType("*","*");

        Assert.assertTrue(type2.matchesWildcard(type1));
        Assert.assertFalse(type2.matches(type1));
        Assert.assertFalse(type1.matches(type2));
    }

    @Test
    public void testMatchQualifier1() throws Exception {
View Full Code Here

    @Test
    public void testMatchQualifier1() throws Exception {
        ContentType type1 = new ContentType("application","rdf+json");
        ContentType type2 = new ContentType("application","json");

        Assert.assertFalse(type2.matches(type1));
        Assert.assertTrue(type2.matchesSubtype(type1));
        Assert.assertFalse(type1.matchesSubtype(type2));
    }
    @Test
    public void testMatchQualifier2() throws Exception {
View Full Code Here

    @Test
    public void testMatchNormal1() throws Exception {
        ContentType type1 = new ContentType("application","json");
        ContentType type2 = new ContentType("application","json");

        Assert.assertTrue(type2.matches(type1));
        Assert.assertTrue(type1.matches(type2));
    }


    @Test
View Full Code Here

        ContentType type1 = new ContentType("application","json");
        ContentType type2 = new ContentType("application","*");

        Assert.assertTrue(type2.matchesWildcard(type1));
        Assert.assertFalse(type1.matches(type2));
        Assert.assertFalse(type2.matches(type1));
    }

    @Test
    public void testMatchNormal3() throws Exception {
        ContentType type1 = new ContentType("application","json");
View Full Code Here

    public void testMatchNormal3() throws Exception {
        ContentType type1 = new ContentType("application","json");
        ContentType type2 = new ContentType("*","*");

        Assert.assertTrue(type2.matchesWildcard(type1));
        Assert.assertFalse(type2.matches(type1));
        Assert.assertFalse(type1.matches(type2));
    }

    @Test
    public void testMatchQualifier1() throws Exception {
View Full Code Here

    @Test
    public void testMatchQualifier1() throws Exception {
        ContentType type1 = new ContentType("application","rdf+json");
        ContentType type2 = new ContentType("application","json");

        Assert.assertFalse(type2.matches(type1));
        Assert.assertTrue(type2.matchesSubtype(type1));
        Assert.assertFalse(type1.matchesSubtype(type2));
    }
    @Test
    public void testMatchQualifier2() throws Exception {
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.