cxf git commit: [CXF-6981] Adding a missing test resource
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 158121633 -> 5a132146b [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/5a132146 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5a132146 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5a132146 Branch: refs/heads/3.0.x-fixes Commit: 5a132146bfa0b4555021a688463d383bbe197982 Parents: 1581216 Author: Sergey Beryozkin Authored: Thu Oct 13 17:03:18 2016 +0100 Committer: Sergey Beryozkin Committed: Thu Oct 13 17:05:06 2016 +0100 -- .../cxf/io/CacheAndWriteOutputStreamTest.java | 41 1 file changed, 41 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/5a132146/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 000..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); +} +}
cxf git commit: [CXF-6981] Adding a missing test resource
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 Authored: Thu Oct 13 17:03:18 2016 +0100 Committer: Sergey Beryozkin 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 000..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); +} +}
cxf git commit: [CXF-6981] Adding a missing test resource
Repository: cxf Updated Branches: refs/heads/master e7895d6a7 -> f060b8742 [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/f060b874 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f060b874 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f060b874 Branch: refs/heads/master Commit: f060b8742e2bea22c0abf218a43f62bc91b91143 Parents: e7895d6 Author: Sergey Beryozkin Authored: Thu Oct 13 17:03:18 2016 +0100 Committer: Sergey Beryozkin Committed: Thu Oct 13 17:03:18 2016 +0100 -- .../cxf/io/CacheAndWriteOutputStreamTest.java | 41 1 file changed, 41 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/f060b874/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 000..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); +} +}