@Test public void testContentSinkDefaultMimeType() throws IOException { String DEFAULT = "application/octet-stream"; ContentSink cs = contentItemFactory.createContentSink(null); assertNotNull(cs); assertNotNull(cs.getBlob()); assertNotNull(cs.getBlob().getMimeType()); //get MimeType MUST return the simple mime type assertEquals(DEFAULT, cs.getBlob().getMimeType()); assertNull(cs.getBlob().getParameter().get("charset")); }
@Test public void testContentSinkDefaultMimeType() throws IOException { String DEFAULT = "application/octet-stream"; ContentSink cs = contentItemFactory.createContentSink(null); assertNotNull(cs); assertNotNull(cs.getBlob()); assertNotNull(cs.getBlob().getMimeType()); //get MimeType MUST return the simple mime type assertEquals(DEFAULT, cs.getBlob().getMimeType()); assertNull(cs.getBlob().getParameter().get("charset")); }
ContentSink cs = contentItemFactory.createContentSink(mt+"; charset="+ISO8859_4.name()); assertNotNull(cs); assertNotNull(cs.getBlob()); OutputStream out = cs.getOutputStream(); assertNotNull(cs); assertNotNull(cs.getBlob().getMimeType()); assertEquals(mt, cs.getBlob().getMimeType()); String charsetParam = cs.getBlob().getParameter().get("charset"); assertNotNull("expected charset parameter is missing!",charsetParam); assertEquals(ISO8859_4.name(), charsetParam); cs.getBlob().getStream(), charsetParam); assertEquals(TEST_CONTENT, content);
ContentSink cs = contentItemFactory.createContentSink(mt+"; charset="+ISO8859_4.name()); assertNotNull(cs); assertNotNull(cs.getBlob()); OutputStream out = cs.getOutputStream(); assertNotNull(cs); assertNotNull(cs.getBlob().getMimeType()); assertEquals(mt, cs.getBlob().getMimeType()); String charsetParam = cs.getBlob().getParameter().get("charset"); assertNotNull("expected charset parameter is missing!",charsetParam); assertEquals(ISO8859_4.name(), charsetParam); cs.getBlob().getStream(), charsetParam); assertEquals(TEST_CONTENT, content);