Package org.milyn.profile

Examples of org.milyn.profile.HttpAcceptHeaderProfile


import junit.framework.TestCase;

public class HttpAcceptHeaderProfileTest extends TestCase {

  public void testHttpAcceptHeaderProfile() {
    HttpAcceptHeaderProfile profile = new HttpAcceptHeaderProfile(
        "text/plain", new String[] { "q=0.9", "", " level=1 " });

    assertEquals("Invalid profile name.", "accept:text/plain", profile
        .getName());
    if (profile.getParamNumeric("q", 1.0) != 0.9) {
      fail("Invalid qvalue param value.");
    }
    if ((int) profile.getParamNumeric("level", 2.0) != 1) {
      fail("Invalid level param value.");
    }
    if (profile.getParamNumeric("xxx", 2.0) != 2.0) {
      fail("Invalid level param value.");
    }
  }
View Full Code Here

TOP

Related Classes of org.milyn.profile.HttpAcceptHeaderProfile

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.