Examples of ValuedMediaType


Examples of org.apache.wink.common.internal.http.Accept.ValuedMediaType

* Unit test of accept header.
*/
public class AcceptHeaderTest extends TestCase {

    public void testValuedMediaType() {
        ValuedMediaType vmt = new ValuedMediaType(MediaType.APPLICATION_ATOM_XML_TYPE);
        assertEquals("media type", MediaType.APPLICATION_ATOM_XML_TYPE, vmt.getMediaType());
        assertEquals("q-value", 1.0, vmt.getQ());
        assertEquals("toString", MediaType.APPLICATION_ATOM_XML_TYPE.toString(), vmt.toString());
    }
View Full Code Here

Examples of org.apache.wink.common.internal.http.Accept.ValuedMediaType

        assertEquals("toString", MediaType.APPLICATION_ATOM_XML_TYPE.toString(), vmt.toString());
    }

    public void testValueMediaTypeNegative() {
        try {
            new ValuedMediaType(MediaType.WILDCARD_TYPE, 1.1);
            fail("Large");
        } catch (IllegalArgumentException ignore) {
        }
        try {
            new ValuedMediaType(MediaType.WILDCARD_TYPE, -.5);
            fail("Negative");
        } catch (IllegalArgumentException ignore) {
        }
    }
View Full Code Here

Examples of org.apache.wink.common.internal.http.Accept.ValuedMediaType

* Unit test of accept header.
*/
public class AcceptHeaderTest extends TestCase {

    public void testValuedMediaType() {
        ValuedMediaType vmt = new ValuedMediaType(MediaType.APPLICATION_ATOM_XML_TYPE);
        assertEquals("media type", MediaType.APPLICATION_ATOM_XML_TYPE, vmt.getMediaType());
        assertEquals("q-value", 1.0, vmt.getQ());
        assertEquals("toString", MediaType.APPLICATION_ATOM_XML_TYPE.toString(), vmt.toString());
    }
View Full Code Here

Examples of org.apache.wink.common.internal.http.Accept.ValuedMediaType

        assertEquals("toString", MediaType.APPLICATION_ATOM_XML_TYPE.toString(), vmt.toString());
    }

    public void testValueMediaTypeNegative() {
        try {
            new ValuedMediaType(MediaType.WILDCARD_TYPE, 1.1);
            fail("Large");
        } catch (IllegalArgumentException ignore) {
        }
        try {
            new ValuedMediaType(MediaType.WILDCARD_TYPE, -.5);
            fail("Negative");
        } catch (IllegalArgumentException ignore) {
        }
    }
View Full Code Here

Examples of org.apache.wink.common.internal.http.Accept.ValuedMediaType

* Unit test of accept header.
*/
public class AcceptHeaderTest extends TestCase {

    public void testValuedMediaType() {
        ValuedMediaType vmt = new ValuedMediaType(MediaType.APPLICATION_ATOM_XML_TYPE);
        assertEquals("media type", MediaType.APPLICATION_ATOM_XML_TYPE, vmt.getMediaType());
        assertEquals("q-value", 1.0, vmt.getQ());
        assertEquals("toString", MediaType.APPLICATION_ATOM_XML_TYPE.toString(), vmt.toString());
    }
View Full Code Here

Examples of org.apache.wink.common.internal.http.Accept.ValuedMediaType

        assertEquals("toString", MediaType.APPLICATION_ATOM_XML_TYPE.toString(), vmt.toString());
    }

    public void testValueMediaTypeNegative() {
        try {
            new ValuedMediaType(MediaType.WILDCARD_TYPE, 1.1);
            fail("Large");
        } catch (IllegalArgumentException ignore) {
        }
        try {
            new ValuedMediaType(MediaType.WILDCARD_TYPE, -.5);
            fail("Negative");
        } catch (IllegalArgumentException ignore) {
        }
    }
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.