Repository: tomee Updated Branches: refs/heads/master 8ef3205b4 -> a684da5a0
Fix CXF-RS tests Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/a684da5a Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/a684da5a Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/a684da5a Branch: refs/heads/master Commit: a684da5a014651b2d928d317c6d1cef0c0a6fa35 Parents: 8ef3205 Author: Jonathan Gallimore <[email protected]> Authored: Mon Jul 24 15:40:50 2017 +0100 Committer: Jonathan Gallimore <[email protected]> Committed: Mon Jul 24 15:40:50 2017 +0100 ---------------------------------------------------------------------- .../server/cxf/rs/AppPropertiesPropagationTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/a684da5a/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/AppPropertiesPropagationTest.java ---------------------------------------------------------------------- diff --git a/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/AppPropertiesPropagationTest.java b/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/AppPropertiesPropagationTest.java index 3a345e2..7537b5c 100644 --- a/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/AppPropertiesPropagationTest.java +++ b/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/AppPropertiesPropagationTest.java @@ -83,6 +83,10 @@ public class AppPropertiesPropagationTest { public static class Registrator implements Feature { @Override public boolean configure(final FeatureContext context) { + if (!context.getConfiguration().getProperties().containsKey("AppPropertiesPropagationTest")) { + return false; + } + context.register(new Writer(context.getConfiguration().getProperty("AppPropertiesPropagationTest") .toString().getBytes(StandardCharsets.UTF_8))); return true; @@ -94,7 +98,7 @@ public class AppPropertiesPropagationTest { public static class Writer implements MessageBodyWriter<MyEndpoint> { private final byte[] value; - Writer(byte[] value) { + public Writer(byte[] value) { this.value = value; } @@ -115,7 +119,9 @@ public class AppPropertiesPropagationTest { final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException { - entityStream.write(value); + if (value != null) { + entityStream.write(value); + } } }
