| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| package org.apache.jackrabbit.oak.http; |
| |
| import static junit.framework.Assert.assertEquals; |
| |
| import org.junit.Test; |
| |
| public class AcceptHeaderTest { |
| |
| // @Test |
| // public void testRfcExample1() { |
| // AcceptHeader accept = new AcceptHeader( |
| // "text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c"); |
| // |
| // assertEquals("text/plain", accept.resolve("text/plain")); |
| // assertEquals("text/html", accept.resolve("text/html")); |
| // assertEquals("text/x-dvi", accept.resolve("text/x-dvi")); |
| // assertEquals("text/x-c", accept.resolve("text/x-c")); |
| // |
| // assertEquals( |
| // "application/octet-stream", |
| // accept.resolve("application/octet-stream")); |
| // assertEquals( |
| // "application/octet-stream", |
| // accept.resolve("application/pdf")); |
| // |
| // assertEquals("text/html", accept.resolve("text/plain", "text/html")); |
| // assertEquals("text/x-c", accept.resolve("text/x-dvi", "text/x-c")); |
| // assertEquals("text/x-dvi", accept.resolve("text/x-dvi", "text/plain")); |
| // |
| // assertEquals("text/html", accept.resolve("text/html", "text/x-c")); |
| // assertEquals("text/x-c", accept.resolve("text/x-c", "text/html")); |
| // } |
| |
| } |