From commits-return-5098-archive-asf-public=cust-asf.ponee.io@juneau.apache.org Sat Feb 10 19:51:19 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id CAE3018061A for ; Sat, 10 Feb 2018 19:51:19 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BAD23160C4D; Sat, 10 Feb 2018 18:51:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8B14F160C3D for ; Sat, 10 Feb 2018 19:51:18 +0100 (CET) Received: (qmail 87508 invoked by uid 500); 10 Feb 2018 18:51:17 -0000 Mailing-List: contact commits-help@juneau.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.apache.org Delivered-To: mailing list commits@juneau.apache.org Received: (qmail 87498 invoked by uid 99); 10 Feb 2018 18:51:17 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Feb 2018 18:51:17 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id B47D582483; Sat, 10 Feb 2018 18:51:16 +0000 (UTC) Date: Sat, 10 Feb 2018 18:51:16 +0000 To: "commits@juneau.apache.org" Subject: [juneau] branch master updated: "Accept: */*" should always match first serializer. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <151828867669.6276.7860628381332924477@gitbox.apache.org> From: jamesbognar@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: juneau X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 26efaa85b9c8f6491ad62a59b6d25e691b4f7b18 X-Git-Newrev: bf88ddee5c0e4535b2668b528553c29572397849 X-Git-Rev: bf88ddee5c0e4535b2668b528553c29572397849 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. jamesbognar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/juneau.git The following commit(s) were added to refs/heads/master by this push: new bf88dde "Accept: */*" should always match first serializer. bf88dde is described below commit bf88ddee5c0e4535b2668b528553c29572397849 Author: JamesBognar AuthorDate: Sat Feb 10 13:51:15 2018 -0500 "Accept: */*" should always match first serializer. --- .../java/org/apache/juneau/https/AcceptTest.java | 153 +++++++++++---------- .../java/org/apache/juneau/http/MediaType.java | 5 +- .../org/apache/juneau/json/JsonSerializer.java | 4 +- .../apache/juneau/yaml/proto/YamlSerializer.java | 2 +- ...omboTestcase.java => ContentComboTestBase.java} | 4 +- .../juneau/examples/rest/RootContentTest.java | 2 +- .../apache/juneau/microservice/ResourceJena.java | 2 + .../juneau/microservice/ResourceJenaGroup.java | 2 + 8 files changed, 89 insertions(+), 85 deletions(-) diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/https/AcceptTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/https/AcceptTest.java index d8fb3a7..14bd8b8 100644 --- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/https/AcceptTest.java +++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/https/AcceptTest.java @@ -33,128 +33,129 @@ public class AcceptTest { // label, accept-header, media-types, expected-index // Simple matches - { "SimpleMatch-1", "text/json", "['text/json']", 0 }, - { "SimpleMatch-2", "text/json", "['text/json','text/foo']", 0 }, - { "SimpleMatch-3", "text/json", "['text/foo','text/json']", 1 }, + { "SimpleMatch-1", "text/json", "['text/json']", 0, 0 }, + { "SimpleMatch-2", "text/json", "['text/json','text/foo']", 0, 0 }, + { "SimpleMatch-3", "text/json", "['text/foo','text/json']", 1, 1 }, // Simple no-matches - { "SimpleNoMatch-1", "text/jsonx", "['text/json']", -1 }, - { "SimpleNoMatch-2", "text/jso", "['text/json']", -1 }, - { "SimpleNoMatch-3", "text/json", "['application/json']", -1 }, - { "SimpleNoMatch-4", "text/json", "[]", -1 }, + { "SimpleNoMatch-1", "text/jsonx", "['text/json']", -1, -1 }, + { "SimpleNoMatch-2", "text/jso", "['text/json']", -1, -1 }, + { "SimpleNoMatch-3", "text/json", "['application/json']", -1, -1 }, + { "SimpleNoMatch-4", "text/json", "[]", -1, -1 }, // Meta-character matches - { "MetaMatch-1", "text/*", "['text/a','text/b+c','text/b+d+e']", 2 }, - { "MetaMatch-2", "text/b+*", "['text/a','text/b+c','text/b+d+e']", 2 }, - { "MetaMatch-3", "text/c+*", "['text/a','text/b+c','text/b+d+e']", 1 }, - { "MetaMatch-4", "text/b+d+e", "['text/a','text/b+c','text/b+d']", -1 }, - { "MetaMatch-5", "text/b+*", "['text/a','text/b+c','text/b+d+e']", 2 }, - { "MetaMatch-6", "text/d+e+*", "['text/a','text/b+c','text/b+d+e']", 2 }, + { "MetaMatch-1", "text/*", "['text/a','text/b+c','text/b+d+e']", 0, 2 }, + { "MetaMatch-2", "text/b+*", "['text/a','text/b+c','text/b+d+e']", 1, 2 }, + { "MetaMatch-3", "text/c+*", "['text/a','text/b+c','text/b+d+e']", 1, 1 }, + { "MetaMatch-4", "text/b+d+e", "['text/a','text/b+c','text/b+d']", -1, -1 }, + { "MetaMatch-5", "text/b+*", "['text/a','text/b+c','text/b+d+e']", 1, 2 }, + { "MetaMatch-6", "text/d+e+*", "['text/a','text/b+c','text/b+d+e']", 2, 2 }, - { "MetaMatch-7", "*/a", "['text/a','application/b']", 0 }, - { "MetaMatch-8", "*/*", "['text/a','text/b+c']", 1 }, - { "MetaMatch-9", "*/*", "['text/b+c','text/a']", 0 }, + { "MetaMatch-7", "*/a", "['text/a','application/b']", 0, 0 }, + { "MetaMatch-8", "*/*", "['text/a','text/b+c']", 0, 1 }, + { "MetaMatch-9", "*/*", "['text/b+c','text/a']", 0, 1 }, // Reverse meta-character matches - { "RevMetaMatch-1", "text/a", "['text/*']", 0 }, - { "RevMetaMatch-2", "text/a", "['*/a']", 0 }, - { "RevMetaMatch-3", "text/a", "['*/*']", 0 }, + { "RevMetaMatch-1", "text/a", "['text/*']", 0, 0 }, + { "RevMetaMatch-2", "text/a", "['*/a']", 0, 0 }, + { "RevMetaMatch-3", "text/a", "['*/*']", 0, 0 }, // Meta-character mixture matches - { "MixedMetaMatch-1", "text/*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 0 }, - { "MixedMetaMatch-2", "*/a", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 1 }, - { "MixedMetaMatch-3", "*/*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 0 }, - { "MixedMetaMatch-4", "text/a+*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 2 }, - { "MixedMetaMatch-5", "text/c+*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 3 }, - { "MixedMetaMatch-6", "text/d+*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 4 }, + { "MixedMetaMatch-1", "text/*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 0, 0 }, + { "MixedMetaMatch-2", "*/a", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 1, 1 }, + { "MixedMetaMatch-3", "*/*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 0, 0 }, + { "MixedMetaMatch-4", "text/a+*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 1, 2 }, + { "MixedMetaMatch-5", "text/c+*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 3, 3 }, + { "MixedMetaMatch-6", "text/d+*", "['text/*','text/a','text/a+b','text/b+c','text/d+*']", 4, 4 }, // Fuzzy matches - { "Fuzzy-1", "text/1+2", "['text/1+2']", 0 }, + { "Fuzzy-1", "text/1+2", "['text/1+2']", 0, 0 }, // Order of subtype parts shouldn't matter. - { "Fuzzy-2", "text/2+1", "['text/1+2']", 0 }, + { "Fuzzy-2", "text/2+1", "['text/1+2']", 0, 0 }, // Should match if Accept has 'extra' subtypes. // For example, "Accept: text/json+activity" should match against the "text/json" serializer. - { "Fuzzy-3", "text/json+foo", "['text/json+*']", 0 }, + { "Fuzzy-3", "text/json+foo", "['text/json+*']", 0, 0 }, // Shouldn't match because the accept media type must be at least a subset of the real media type // For example, "Accept: text/json" should not match against the "text/json+lax" serializer. - { "Fuzzy-4", "text/json", "['text/json+lax']", -1 }, + { "Fuzzy-4", "text/json", "['text/json+lax']", -1, -1 }, - { "Fuzzy-5", "text/1+2", "['text/1','text/1+3']", -1 }, + { "Fuzzy-5", "text/1+2", "['text/1','text/1+3']", -1, -1 }, // "text/1+2" should be a better match than just "text/1" - { "Fuzzy-6", "text/1+2", "['text/1','text/1+2','text/1+2+3']", 1 }, + { "Fuzzy-6", "text/1+2", "['text/1','text/1+2','text/1+2+3']", 1, 1 }, // Same as last, but mix up the order a bit. - { "Fuzzy-7", "text/1+2", "['text/1+2+3','text/1','text/1+2']", 2 }, + { "Fuzzy-7", "text/1+2", "['text/1+2+3','text/1','text/1+2']", 2, 2 }, // Same as last, but mix up the order of the subtypes as well. - { "Fuzzy-8", "text/1+2", "['text/3+2+1','text/1','text/2+1']", 2 }, - { "Fuzzy-9", "text/1+2+3+4", "['text/1+2','text/1+2+3']", -1 }, - { "Fuzzy-10", "text/1+2+3+4", "['text/1+2+3','text/1+2']", -1 }, - { "Fuzzy-11", "text/4+2+3+1", "['text/1+2+3','text/1+2']", -1 }, - { "Fuzzy-12", "text/4+2+3+1", "['text/1+2','text/1+2+3']", -1 }, + { "Fuzzy-8", "text/1+2", "['text/3+2+1','text/1','text/2+1']", 2, 2 }, + { "Fuzzy-9", "text/1+2+3+4", "['text/1+2','text/1+2+3']", -1, -1 }, + { "Fuzzy-10", "text/1+2+3+4", "['text/1+2+3','text/1+2']", -1, -1 }, + { "Fuzzy-11", "text/4+2+3+1", "['text/1+2+3','text/1+2']", -1, -1 }, + { "Fuzzy-12", "text/4+2+3+1", "['text/1+2','text/1+2+3']", -1, -1 }, // Q metrics - { "Q-1", "text/A;q=0.9,text/B;q=0.1", "['text/A','text/B']", 0 }, - { "Q-2", "text/A;q=0.9,text/B;q=0.1", "['text/B','text/A']", 1 }, - { "Q-3", "text/A+1;q=0.9,text/B;q=0.1", "['text/A','text/B']", 1 }, - { "Q-4", "text/A;q=0.9,text/B+1;q=0.1", "['text/A','text/B+1']", 0 }, - { "Q-5", "text/A;q=0.9,text/A+1;q=0.1", "['text/A+1','text/A']", 1 }, + { "Q-1", "text/A;q=0.9,text/B;q=0.1", "['text/A','text/B']", 0, 0 }, + { "Q-2", "text/A;q=0.9,text/B;q=0.1", "['text/B','text/A']", 1, 1 }, + { "Q-3", "text/A+1;q=0.9,text/B;q=0.1", "['text/A','text/B']", 1, 1 }, + { "Q-4", "text/A;q=0.9,text/B+1;q=0.1", "['text/A','text/B+1']", 0, 0 }, + { "Q-5", "text/A;q=0.9,text/A+1;q=0.1", "['text/A+1','text/A']", 1, 1 }, // Test q=0 - { "Q0-1", "text/A;q=0,text/B;q=0.1", "['text/A','text/B']", 1 }, - { "Q0-2", "text/A;q=0,text/B;q=0.1", "['text/A','text/A+1']", -1 }, + { "Q0-1", "text/A;q=0,text/B;q=0.1", "['text/A','text/B']", 1, 1 }, + { "Q0-2", "text/A;q=0,text/B;q=0.1", "['text/A','text/A+1']", -1, -1 }, // Test media types with parameters - { "Parms-1", "text/A", "['text/A;foo=bar','text/B']", 0 }, - { "Parms-2", "text/A;foo=bar", "['text/A','text/B']", 0 }, + { "Parms-1", "text/A", "['text/A;foo=bar','text/B']", 0, 0 }, + { "Parms-2", "text/A;foo=bar", "['text/A','text/B']", 0, 0 }, // Real-world JSON - { "Json-1a", "text/json", "['text/json','text/json+*','text/*','text/json+lax','text/json+lax+*','text/foo']", 0 }, - { "Json-1b", "text/json", "['text/json+*','text/*','text/json+lax','text/json+lax+*','text/foo','text/json']", 5 }, - { "Json-1c", "text/json", "['text/json+*','text/*','text/json+lax','text/json+lax+*','text/foo']", 0 }, - { "Json-1d", "text/json", "['text/*','text/json+lax','text/json+lax+*','text/foo']", 0 }, - { "Json-1e", "text/json", "['text/json+lax','text/json+lax+*','text/foo']", -1 }, + { "Json-1a", "text/json", "['text/json','text/json+*','text/*','text/json+lax','text/json+lax+*','text/foo']", 0, 0 }, + { "Json-1b", "text/json", "['text/json+*','text/*','text/json+lax','text/json+lax+*','text/foo','text/json']", 5, 5 }, + { "Json-1c", "text/json", "['text/json+*','text/*','text/json+lax','text/json+lax+*','text/foo']", 0, 0 }, + { "Json-1d", "text/json", "['text/*','text/json+lax','text/json+lax+*','text/foo']", 0, 0 }, + { "Json-1e", "text/json", "['text/json+lax','text/json+lax+*','text/foo']", -1, -1 }, - { "Json-2a", "text/json+lax", "['text/json+lax','text/json+lax+*','text/json+*','text/lax+*','text/*','text/json','text/lax']", 0 }, - { "Json-2b", "text/json+lax", "['text/json+lax+*','text/json+*','text/lax+*','text/*','text/json','text/lax']", 0 }, - { "Json-2c", "text/json+lax", "['text/json+*','text/lax+foo+*','text/*','text/json','text/lax']", 0 }, - { "Json-2d", "text/json+lax", "['text/lax+*','text/*','text/json','text/lax']", 0 }, - { "Json-2e", "text/json+lax", "['text/*','text/json','text/lax']", 0 }, - { "Json-2f", "text/json+lax", "['text/json','text/lax']", -1 }, + { "Json-2a", "text/json+lax", "['text/json+lax','text/json+lax+*','text/json+*','text/lax+*','text/*','text/json','text/lax']", 0, 0 }, + { "Json-2b", "text/json+lax", "['text/json+lax+*','text/json+*','text/lax+*','text/*','text/json','text/lax']", 0, 0 }, + { "Json-2c", "text/json+lax", "['text/json+*','text/lax+foo+*','text/*','text/json','text/lax']", 0, 0 }, + { "Json-2d", "text/json+lax", "['text/lax+*','text/*','text/json','text/lax']", 0, 0 }, + { "Json-2e", "text/json+lax", "['text/*','text/json','text/lax']", 0, 0 }, + { "Json-2f", "text/json+lax", "['text/json','text/lax']", -1, -1 }, - { "Json-3a", "text/json+activity", "['text/json+activity','text/activity+json','text/json+activity+*','text/json+*','text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0 }, - { "Json-3b", "text/json+activity", "['text/activity+json','text/json+activity+*','text/json+*','text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0 }, - { "Json-3c", "text/json+activity", "['text/json+activity+*','text/json+*','text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0 }, - { "Json-3d", "text/json+activity", "['text/json+*','text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0 }, - { "Json-3e", "text/json+activity", "['text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0 }, - { "Json-3f", "text/json+activity", "['text/json','text/json+lax','text/json+lax+*','text/foo']", -1 }, + { "Json-3a", "text/json+activity", "['text/json+activity','text/activity+json','text/json+activity+*','text/json+*','text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0, 0 }, + { "Json-3b", "text/json+activity", "['text/activity+json','text/json+activity+*','text/json+*','text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0, 0 }, + { "Json-3c", "text/json+activity", "['text/json+activity+*','text/json+*','text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0, 0 }, + { "Json-3d", "text/json+activity", "['text/json+*','text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0, 0 }, + { "Json-3e", "text/json+activity", "['text/*','text/json','text/json+lax','text/json+lax+*','text/foo']", 0, 0 }, + { "Json-3f", "text/json+activity", "['text/json','text/json+lax','text/json+lax+*','text/foo']", -1, -1 }, // Real-world XML - { "Xml-1a", "text/xml", "['text/xml','text/xml+*','text/xml+rdf','text/foo']", 0 }, - { "Xml-1b", "text/xml", "['text/xml+*','text/xml+rdf','text/foo']", 0 }, - { "Xml-1c", "text/xml", "['text/xml+rdf','text/foo']", -1 }, - { "Xml-1d", "text/xml", "['text/foo']", -1 }, + { "Xml-1a", "text/xml", "['text/xml','text/xml+*','text/xml+rdf','text/foo']", 0, 0 }, + { "Xml-1b", "text/xml", "['text/xml+*','text/xml+rdf','text/foo']", 0, 0 }, + { "Xml-1c", "text/xml", "['text/xml+rdf','text/foo']", -1, -1 }, + { "Xml-1d", "text/xml", "['text/foo']", -1, -1 }, - { "Xml-2a", "text/xml+id", "['text/xml+*','text/xml','text/xml+rdf']", 0 }, - { "Xml-2b", "text/xml+id", "['text/xml','text/xml+rdf']", -1 }, - { "Xml-2c", "text/xml+id", "['text/xml+rdf']", -1 }, + { "Xml-2a", "text/xml+id", "['text/xml+*','text/xml','text/xml+rdf']", 0, 0 }, + { "Xml-2b", "text/xml+id", "['text/xml','text/xml+rdf']", -1, -1 }, + { "Xml-2c", "text/xml+id", "['text/xml+rdf']", -1, -1 }, // Real-world RDF - { "Rdf-1a", "text/xml+rdf", "['text/xml+rdf','text/xml+*','text/xml']", 0 }, - { "Rdf-1b", "text/xml+rdf", "['text/xml+*','text/xml']", 0 }, - { "Rdf-1c", "text/xml+rdf", "['text/xml']", -1 }, + { "Rdf-1a", "text/xml+rdf", "['text/xml+rdf','text/xml+*','text/xml']", 0, 0 }, + { "Rdf-1b", "text/xml+rdf", "['text/xml+*','text/xml']", 0, 0 }, + { "Rdf-1c", "text/xml+rdf", "['text/xml']", -1, -1 }, }); } private String label, accept, mediaTypes; - private int expected; + private int expected, expectedReverse; - public AcceptTest(String label, String accept, String mediaTypes, int expected) { + public AcceptTest(String label, String accept, String mediaTypes, int expected, int expectedReverse) { this.label = label; this.accept = accept; this.mediaTypes = mediaTypes; this.expected = expected; + this.expectedReverse = expectedReverse; } @Test @@ -171,7 +172,7 @@ public class AcceptTest { MediaType[] mt = JsonParser.DEFAULT.parse(mediaTypes, MediaType[].class); Collections.reverse(Arrays.asList(mt)); int r = accept.findMatch(mt); - int expected2 = expected == -1 ? -1 : mt.length-expected-1; + int expected2 = expectedReverse == -1 ? -1 : mt.length-expectedReverse-1; TestUtils.assertEquals(expected2, r, "{0} failed", label); } } diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaType.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaType.java index bb2a2b5..f320d49 100644 --- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaType.java +++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaType.java @@ -263,7 +263,6 @@ public class MediaType implements Comparable { *
    *
  • 7,500 for an exact match (e.g. "json+foo"=="json+foo" or "json+foo"=="foo+json") *
  • 100 for every subtype entry match (e.g. "json"/"json+foo") - *
  • 10 for a subtype entry meta match (e.g. "*"/"json" or "json+*"/"json+foo") *
* * @@ -297,7 +296,7 @@ public class MediaType implements Comparable { else if (ArrayUtils.contains(st1, o.subTypes)) c += 100; else if (o.hasSubtypeMeta) - c += 10; + c += 0; else return 0; } @@ -307,7 +306,7 @@ public class MediaType implements Comparable { else if (ArrayUtils.contains(st2, subTypes)) c += 100; else if (hasSubtypeMeta) - c += 10; + c += 0; else if (! allowExtraSubTypes) return 0; else diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java index 0f2ab34..2490c62 100644 --- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java +++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializer.java @@ -306,7 +306,7 @@ public class JsonSerializer extends WriterSerializer { .set(SERIALIZER_quoteChar, '\'') .build(), "application/json", - "application/json+simple", "application/json+simple+*", "text/json+simple", "text/json+simple+*" + "application/json+simple", "text/json+simple" ); } } @@ -372,7 +372,7 @@ public class JsonSerializer extends WriterSerializer { * The property store containing all the settings for this object. */ public JsonSerializer(PropertyStore ps) { - this(ps, "application/json", "application/json", "application/json+*", "text/json", "text/json+*"); + this(ps, "application/json", "application/json", "text/json"); } /** diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java index e4206e6..ad5fadd 100644 --- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java +++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/yaml/proto/YamlSerializer.java @@ -265,7 +265,7 @@ public class YamlSerializer extends WriterSerializer { * The property store containing all the settings for this object. */ public YamlSerializer(PropertyStore ps) { - this(ps, "application/yaml", "application/yaml", "application/yaml+*", "text/yaml", "text/yaml+*"); + this(ps, "application/yaml", "application/yaml", "text/yaml"); } /** diff --git a/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestcase.java b/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestBase.java similarity index 97% rename from juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestcase.java rename to juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestBase.java index 19d1c62..62704dd 100644 --- a/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestcase.java +++ b/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/ContentComboTestBase.java @@ -31,7 +31,7 @@ import org.apache.juneau.urlencoding.*; import org.apache.juneau.xml.*; import org.junit.*; -public class ContentComboTestcase extends RestTestcase { +public class ContentComboTestBase extends RestTestcase { // Reusable RestClients keyed by label that live for the duration of a testcase class. private static Map clients = new LinkedHashMap<>(); @@ -89,7 +89,7 @@ public class ContentComboTestcase extends RestTestcase { private final ComboInput comboInput; - public ContentComboTestcase(ComboInput comboInput) { + public ContentComboTestBase(ComboInput comboInput) { this.comboInput = comboInput; } diff --git a/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/RootContentTest.java b/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/RootContentTest.java index 9afc211..c8dd710 100644 --- a/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/RootContentTest.java +++ b/juneau-examples/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/RootContentTest.java @@ -19,7 +19,7 @@ import org.junit.runner.*; import org.junit.runners.*; @RunWith(Parameterized.class) -public class RootContentTest extends ContentComboTestcase { +public class RootContentTest extends ContentComboTestBase { @Parameterized.Parameters public static Collection getParameters() { diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJena.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJena.java index 0a76948..4b99105 100755 --- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJena.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJena.java @@ -12,6 +12,7 @@ // *************************************************************************************************************************** package org.apache.juneau.microservice; +import org.apache.juneau.html.*; import org.apache.juneau.jena.*; import org.apache.juneau.rest.*; import org.apache.juneau.rest.annotation.*; @@ -30,6 +31,7 @@ import org.apache.juneau.rest.annotation.*; ), config="$S{juneau.configFile}", serializers={ + HtmlDocSerializer.class, // HTML must be listed first because Internet Explore does not include text/html in their Accept header. RdfSerializer.Xml.class, RdfSerializer.XmlAbbrev.class, RdfSerializer.Turtle.class, diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJenaGroup.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJenaGroup.java index d31ca0c..6b99e1e 100644 --- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJenaGroup.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJenaGroup.java @@ -14,6 +14,7 @@ package org.apache.juneau.microservice; import static org.apache.juneau.rest.annotation.HookEvent.*; +import org.apache.juneau.html.*; import org.apache.juneau.jena.*; import org.apache.juneau.microservice.vars.*; import org.apache.juneau.rest.*; @@ -54,6 +55,7 @@ import org.apache.juneau.rest.annotation.*; ), config="$S{juneau.configFile}", serializers={ + HtmlDocSerializer.class, // HTML must be listed first because Internet Explore does not include text/html in their Accept header. RdfSerializer.Xml.class, RdfSerializer.XmlAbbrev.class, RdfSerializer.Turtle.class, -- To stop receiving notification emails like this one, please contact jamesbognar@apache.org.