cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6981] Adding a missing test resource
Date Thu, 13 Oct 2016 16:03:34 GMT
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 <sberyozkin@gmail.com>
Authored: Thu Oct 13 17:03:18 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
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 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);
+    }
+}


Mime
View raw message