Examples of InputStreamWrapper


Examples of net.jcores.jre.utils.internal.wrapper.InputStreamWrapper

            // We CAN NOT close the parent stream right away, because then we would
            // invalidate
            // the returned stream. Instead we have to wait until the returned stream is
            // closed as
            // well.
            return new InputStreamWrapper(inputStream) {
                @Override
                public void close() throws IOException {
                    super.close();
                    inputStream.close();
                }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

     * by the implementation.
     *
     * @throws RepositoryException
     */
    public void testInputStream() throws RepositoryException {
        InputStreamWrapper in = new InputStreamWrapper(new ByteArrayInputStream(binaryValue));
        valueFactory.createValue(in);
        assertTrue("ValueFactory.createValue(InputStream) is expected to close the passed input stream", in.isClosed());

        in = new InputStreamWrapper(new ByteArrayInputStream(binaryValue));
        Binary bin = valueFactory.createBinary(in);
        assertTrue("ValueFactory.createBinary(InputStream) is expected to close the passed input stream", in.isClosed());
        bin.dispose();
    }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

     * obey the stream handling contract.
     */
    public void testStreamHandling() throws RepositoryException, IOException {
        exportRepository(SAVEBINARY, RECURSE);

        InputStreamWrapper in = new InputStreamWrapper(new FileInputStream(file));
        session.importXML(treeComparator.targetFolder, in,
                ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        assertTrue("Session.importXML(..., InputStream, ...) is expected to close the passed input stream", in.isClosed());
        session.refresh(false);

        in = new InputStreamWrapper(new FileInputStream(file));
        workspace.importXML(treeComparator.targetFolder, in,
                ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        assertTrue("Workspace.importXML(..., InputStream, ...) is expected to close the passed input stream", in.isClosed());
    }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

     * obey the stream handling contract.
     */
    public void testStreamHandling() throws RepositoryException, IOException {
        exportRepository(SAVEBINARY, RECURSE);

        InputStreamWrapper in = new InputStreamWrapper(new FileInputStream(file));
        session.importXML(treeComparator.targetFolder, in,
                ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        assertTrue("Session.importXML(..., InputStream, ...) is expected to close the passed input stream", in.isClosed());
        session.refresh(false);

        in = new InputStreamWrapper(new FileInputStream(file));
        workspace.importXML(treeComparator.targetFolder, in,
                ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        assertTrue("Workspace.importXML(..., InputStream, ...) is expected to close the passed input stream", in.isClosed());
    }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

     * by the implementation.
     *
     * @throws RepositoryException
     */
    public void testInputStream() throws RepositoryException {
        InputStreamWrapper in = new InputStreamWrapper(new ByteArrayInputStream(binaryValue));
        valueFactory.createValue(in);
        assertTrue("ValueFactory.createValue(InputStream) is expected to close the passed input stream", in.isClosed());

        in = new InputStreamWrapper(new ByteArrayInputStream(binaryValue));
        Binary bin = valueFactory.createBinary(in);
        assertTrue("ValueFactory.createBinary(InputStream) is expected to close the passed input stream", in.isClosed());
        bin.dispose();
    }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

    /**
     * Tests whether the passed input stream is closed.
     * @throws Exception
     */
    public void testInputStreamClosed() throws Exception {
        InputStreamWrapper in = new InputStreamWrapper(new ByteArrayInputStream(bytes1));
        testNode.setProperty(propertyName1, in);
        assertTrue("Node.setProperty(..., InputStream) is expected to close the passed input stream", in.isClosed());
    }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

    /**
     * Tests whether <code>Property.setValue(InputStream)</code> obeys the
     * stream handling contract.
     */
    public void testInputStreamClosed() throws RepositoryException, IOException {
        InputStreamWrapper in = new InputStreamWrapper(new ByteArrayInputStream(data));
        property1.setValue(in);
        assertTrue("Property.setValue(InputStream) is expected to close the passed input stream", in.isClosed());
    }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

    /**
     * Tests whether <code>Property.setValue(InputStream)</code> obeys the
     * stream handling contract.
     */
    public void testInputStreamClosed() throws RepositoryException, IOException {
        InputStreamWrapper in = new InputStreamWrapper(new ByteArrayInputStream(data));
        property1.setValue(in);
        assertTrue("Property.setValue(InputStream) is expected to close the passed input stream", in.isClosed());
    }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

     * obey the stream handling contract.
     */
    public void testStreamHandling() throws RepositoryException, IOException {
        exportRepository(SAVEBINARY, RECURSE);

        InputStreamWrapper in = new InputStreamWrapper(new FileInputStream(file));
        session.importXML(treeComparator.targetFolder, in,
                ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        assertTrue("Session.importXML(..., InputStream, ...) is expected to close the passed input stream", in.isClosed());
        session.refresh(false);

        in = new InputStreamWrapper(new FileInputStream(file));
        workspace.importXML(treeComparator.targetFolder, in,
                ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
        assertTrue("Workspace.importXML(..., InputStream, ...) is expected to close the passed input stream", in.isClosed());
    }
View Full Code Here

Examples of org.apache.jackrabbit.test.api.util.InputStreamWrapper

    /**
     * Tests whether the passed input stream is closed.
     * @throws Exception
     */
    public void testInputStreamClosed() throws Exception {
        InputStreamWrapper in = new InputStreamWrapper(new ByteArrayInputStream(bytes1));
        testNode.setProperty(propertyName1, in);
        assertTrue("Node.setProperty(..., InputStream) is expected to close the passed input stream", in.isClosed());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.