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 ve...@apache.org on 2009/04/04 12:21:42 UTC
svn commit: r761887 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom:
attachments/impl/ attachments/utils/ om/impl/
Author: veithen
Date: Sat Apr 4 10:21:42 2009
New Revision: 761887
URL: http://svn.apache.org/viewvc?rev=761887&view=rev
Log:
Some cleanup in the axiom-api unit tests.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTest.java (contents, props changed)
- copied, changed from r761883, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMNamespaceImplTest.java (contents, props changed)
- copied, changed from r761883, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/NamespaceImplTestCase.java
Removed:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/NamespaceImplTestCase.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/impl/BufferUtilsTest.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/impl/BufferUtilsTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/impl/BufferUtilsTest.java?rev=761887&r1=761886&r2=761887&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/impl/BufferUtilsTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/impl/BufferUtilsTest.java Sat Apr 4 10:21:42 2009
@@ -61,12 +61,9 @@
try {
OutputStream fos = new FileOutputStream(file, true);
for (int i = 0; i < 20; i++) {
- long start = System.currentTimeMillis();
InputStream bais = new ByteArrayInputStream(bytes);
BufferUtils.inputStream2OutputStream(bais, fos);
fos.flush();
- long end = System.currentTimeMillis();
-
}
fos.close();
FileInputStream fis = new FileInputStream(file);
@@ -103,38 +100,27 @@
}
}
- public void testObjectBackedDataHandlerExceedLimit(){
+ public void testObjectBackedDataHandlerExceedLimit() throws Exception {
String str = "This is a test String";
- try{
- DataHandler dh = new DataHandler(str, "text/plain");
- int unsupported= BufferUtils.doesDataHandlerExceedLimit(dh, 0);
- assertEquals(-1, unsupported);
- int doesExceed = BufferUtils.doesDataHandlerExceedLimit(dh, 10);
- assertEquals(1, doesExceed);
- int doesNotExceed = BufferUtils.doesDataHandlerExceedLimit(dh, 100);
- assertEquals(0, doesNotExceed);
- }catch(Exception e){
- e.printStackTrace();
- fail();
- }
-
+ DataHandler dh = new DataHandler(str, "text/plain");
+ int unsupported= BufferUtils.doesDataHandlerExceedLimit(dh, 0);
+ assertEquals(-1, unsupported);
+ int doesExceed = BufferUtils.doesDataHandlerExceedLimit(dh, 10);
+ assertEquals(1, doesExceed);
+ int doesNotExceed = BufferUtils.doesDataHandlerExceedLimit(dh, 100);
+ assertEquals(0, doesNotExceed);
}
- public void testByteArrayDataSourceBackedDataHandlerExceedLimit(){
+
+ public void testByteArrayDataSourceBackedDataHandlerExceedLimit() throws Exception {
String str = "This is a test String";
byte[] b = str.getBytes();
ByteArrayDataSource bads = new ByteArrayDataSource(b, "text/plain");
- try{
- DataHandler dh = new DataHandler(bads);
- int unsupported= BufferUtils.doesDataHandlerExceedLimit(dh, 0);
- assertEquals(-1, unsupported);
- int doesExceed = BufferUtils.doesDataHandlerExceedLimit(dh, 10);
- assertEquals(1, doesExceed);
- int doesNotExceed = BufferUtils.doesDataHandlerExceedLimit(dh, 100);
- assertEquals(0, doesNotExceed);
- }catch(Exception e){
- e.printStackTrace();
- fail();
- }
-
+ DataHandler dh = new DataHandler(bads);
+ int unsupported= BufferUtils.doesDataHandlerExceedLimit(dh, 0);
+ assertEquals(-1, unsupported);
+ int doesExceed = BufferUtils.doesDataHandlerExceedLimit(dh, 10);
+ assertEquals(1, doesExceed);
+ int doesNotExceed = BufferUtils.doesDataHandlerExceedLimit(dh, 100);
+ assertEquals(0, doesNotExceed);
}
}
Copied: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTest.java (from r761883, 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/BAAInputStreamTest.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTest.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java&r1=761883&r2=761887&rev=761887&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTestCase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTest.java Sat Apr 4 10:21:42 2009
@@ -22,7 +22,9 @@
import java.io.ByteArrayInputStream;
import java.util.ArrayList;
-public final class BAAInputStreamTestCase extends junit.framework.TestCase {
+import junit.framework.TestCase;
+
+public final class BAAInputStreamTest extends TestCase {
public void testRead() throws Exception {
byte [] data = new byte [] { 5, 10, -10, -5, 0 };
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTest.java
------------------------------------------------------------------------------
svn:mergeinfo =
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/utils/BAAInputStreamTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMNamespaceImplTest.java (from r761883, webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/NamespaceImplTestCase.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMNamespaceImplTest.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMNamespaceImplTest.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/NamespaceImplTestCase.java&r1=761883&r2=761887&rev=761887&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/NamespaceImplTestCase.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMNamespaceImplTest.java Sat Apr 4 10:21:42 2009
@@ -19,14 +19,14 @@
package org.apache.axiom.om.impl;
-public final class NamespaceImplTestCase extends junit.framework.TestCase {
+public final class OMNamespaceImplTest extends junit.framework.TestCase {
public void testEqualsHashCodeContract() {
assertEquals(
- new org.apache.axiom.om.impl.OMNamespaceImpl("anyURI", "prefix"),
- new org.apache.axiom.om.impl.OMNamespaceImpl("anyURI", "prefix"));
+ new OMNamespaceImpl("anyURI", "prefix"),
+ new OMNamespaceImpl("anyURI", "prefix"));
assertEquals(
- new org.apache.axiom.om.impl.OMNamespaceImpl("anyURI", "prefix").hashCode(),
- new org.apache.axiom.om.impl.OMNamespaceImpl("anyURI", "prefix").hashCode());
+ new OMNamespaceImpl("anyURI", "prefix").hashCode(),
+ new OMNamespaceImpl("anyURI", "prefix").hashCode());
}
}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMNamespaceImplTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMNamespaceImplTest.java
------------------------------------------------------------------------------
svn:mergeinfo =