You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ga...@apache.org on 2008/12/09 20:59:06 UTC
svn commit: r724854 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src:
main/java/org/apache/axiom/attachments/utils/
test/java/org/apache/axiom/attachments/
test/java/org/apache/axiom/attachments/utils/
Author: gawor
Date: Tue Dec 9 11:59:05 2008
New Revision: 724854
URL: http://svn.apache.org/viewvc?rev=724854&view=rev
Log:
return proper values from BAAInputStream.read() (WSCOMMONS-320)
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java (with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/BAAInputStream.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/BAAInputStream.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/BAAInputStream.java?rev=724854&r1=724853&r2=724854&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/BAAInputStream.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/BAAInputStream.java Tue Dec 9 11:59:05 2008
@@ -59,7 +59,7 @@
if (read < 0) {
return -1;
} else {
- return read_byte[0];
+ return read_byte[0] & 0xFF;
}
}
Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java?rev=724854&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java Tue Dec 9 11:59:05 2008
@@ -0,0 +1,42 @@
+/*
+ * 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.axiom.attachments.utils;
+
+import java.io.ByteArrayInputStream;
+import java.util.ArrayList;
+
+public final class BAAInputStreamTestCase extends junit.framework.TestCase {
+
+ public void testRead() throws Exception {
+ byte [] data = new byte [] { 5, 10, -10, -5, 0 };
+ ArrayList list = new ArrayList();
+ list.add(data);
+ BAAInputStream in = new BAAInputStream(list, 5);
+ ByteArrayInputStream expected = new ByteArrayInputStream(data);
+
+ assertEquals(expected.read(), in.read());
+ assertEquals(expected.read(), in.read());
+ assertEquals(expected.read(), in.read());
+ assertEquals(expected.read(), in.read());
+ assertEquals(expected.read(), in.read());
+ assertEquals(expected.read(), in.read());
+ }
+
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain