Package org.jboss.resteasy.core.request

Examples of org.jboss.resteasy.core.request.VariantQuality


{

   @Test
   public void defaultQuality()
   {
      VariantQuality q = new VariantQuality();
      assertEquals(new BigDecimal("1.00000"), q.getOverallQuality());
      q.setMediaTypeQualityValue(null);
      q.setCharacterSetQualityValue(null);
      q.setEncodingQualityValue(null);
      q.setLanguageQualityValue(null);
      assertEquals(new BigDecimal("1.00000"), q.getOverallQuality());
   }
View Full Code Here



   @Test
   public void qualitySetters()
   {
      VariantQuality q = new VariantQuality();
      q.setMediaTypeQualityValue(QualityValue.valueOf("0.1"));
      assertEquals(new BigDecimal("0.10000"), q.getOverallQuality());
      q.setCharacterSetQualityValue(QualityValue.valueOf("0.2"));
      assertEquals(new BigDecimal("0.02000"), q.getOverallQuality());
      q.setEncodingQualityValue(QualityValue.valueOf("0.4"));
      assertEquals(new BigDecimal("0.00800"), q.getOverallQuality());
      q.setLanguageQualityValue(QualityValue.valueOf("0.8"));
      assertEquals(new BigDecimal("0.00640"), q.getOverallQuality());
   }
View Full Code Here


   @Test
   public void round5()
   {
      VariantQuality q = new VariantQuality();
      q.setMediaTypeQualityValue(QualityValue.valueOf("0.004"));
      q.setEncodingQualityValue(QualityValue.valueOf("0.008"));
      assertEquals(new BigDecimal("0.00003"), q.getOverallQuality());
   }
View Full Code Here

{

   @Test
   public void defaultQuality()
   {
      VariantQuality q = new VariantQuality();
      assertEquals(new BigDecimal("1.00000"), q.getOverallQuality());
      q.setMediaTypeQualityValue(null);
      q.setCharacterSetQualityValue(null);
      q.setEncodingQualityValue(null);
      q.setLanguageQualityValue(null);
      assertEquals(new BigDecimal("1.00000"), q.getOverallQuality());
   }
View Full Code Here


   @Test
   public void qualitySetters()
   {
      VariantQuality q = new VariantQuality();
      q.setMediaTypeQualityValue(QualityValue.valueOf("0.1"));
      assertEquals(new BigDecimal("0.10000"), q.getOverallQuality());
      q.setCharacterSetQualityValue(QualityValue.valueOf("0.2"));
      assertEquals(new BigDecimal("0.02000"), q.getOverallQuality());
      q.setEncodingQualityValue(QualityValue.valueOf("0.4"));
      assertEquals(new BigDecimal("0.00800"), q.getOverallQuality());
      q.setLanguageQualityValue(QualityValue.valueOf("0.8"));
      assertEquals(new BigDecimal("0.00640"), q.getOverallQuality());
   }
View Full Code Here


   @Test
   public void round5()
   {
      VariantQuality q = new VariantQuality();
      q.setMediaTypeQualityValue(QualityValue.valueOf("0.004"));
      q.setEncodingQualityValue(QualityValue.valueOf("0.008"));
      assertEquals(new BigDecimal("0.00003"), q.getOverallQuality());
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.core.request.VariantQuality

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.