diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java index 55939ff655f..842a634acaa 100644 --- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java +++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java @@ -360,7 +360,13 @@ public void testAddBookAsListOfStreams() throws Exception { @Test public void testAddBookMixedMultiValueMapParameter() throws Exception { String address = "http://localhost:" + PORT + "/bookstore/books/mixedmultivaluedmap"; - doAddBook("multipart/mixed", address, "attachmentFormMixed", 200); + + InputStream is = getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/attachmentFormMixed"); + if (System.getProperty("os.name").startsWith("Windows")) { + is = new NoCarriageReturnFileInputStream(is); + } + + doAddBook("multipart/mixed", address, is, 200); } @Test @@ -1124,4 +1130,25 @@ private String stripXmlInstructionIfNeeded(String str) { return str; } + /** + * Windows attachment handling + */ + private static class NoCarriageReturnFileInputStream extends InputStream { + private final InputStream is; + + NoCarriageReturnFileInputStream(InputStream is) { + this.is = is; + } + + @Override + public int read() throws IOException { + int c; + + do { + c = is.read(); + } while(c != -1 && c == 13); + + return c; + } + } }