Repository: cxf Updated Branches: refs/heads/3.1.x-fixes c99d22610 -> 75d35efc8
[CXF-6981] Adding a missing test resource Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/75d35efc Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/75d35efc Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/75d35efc Branch: refs/heads/3.1.x-fixes Commit: 75d35efc8d18eefc8901f12b39be9dd9fb886398 Parents: c99d226 Author: Sergey Beryozkin <sberyoz...@gmail.com> Authored: Thu Oct 13 17:03:18 2016 +0100 Committer: Sergey Beryozkin <sberyoz...@gmail.com> Committed: Thu Oct 13 17:04:24 2016 +0100 ---------------------------------------------------------------------- .../cxf/io/CacheAndWriteOutputStreamTest.java | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/75d35efc/core/src/test/java/org/apache/cxf/io/CacheAndWriteOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/cxf/io/CacheAndWriteOutputStreamTest.java b/core/src/test/java/org/apache/cxf/io/CacheAndWriteOutputStreamTest.java new file mode 100644 index 0000000..6b95eb3 --- /dev/null +++ b/core/src/test/java/org/apache/cxf/io/CacheAndWriteOutputStreamTest.java @@ -0,0 +1,41 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.io; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +public class CacheAndWriteOutputStreamTest extends CachedOutputStreamTest { + + ByteArrayOutputStream baos = new ByteArrayOutputStream() { + boolean isClosed; + @Override + public void close() throws IOException { + if (isClosed) { + throw new IOException("stream already closed"); + } + isClosed = true; + } + }; + + @Override + protected Object createCache() { + return new CacheAndWriteOutputStream(baos); + } +}