harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-575) [classlib][tesing]Refactor ByteBuffer testcases in org.apache.harmony.tests.java.nio
Date Thu, 08 Jun 2006 03:02:29 GMT
[classlib][tesing]Refactor ByteBuffer testcases in org.apache.harmony.tests.java.nio 
-------------------------------------------------------------------------------------

         Key: HARMONY-575
         URL: http://issues.apache.org/jira/browse/HARMONY-575
     Project: Harmony
        Type: Improvement

  Components: Classlib  
    Reporter: Paulex Yang
    Priority: Minor


The current testcases for buffers are organized in some unusual way - test logic are written
in many static methods, and some instance method testXXX call them one by one. I guess the
purpose is to test buffers constructed in different ways(allocate, wrap, asXXXBuffer, duplicate,
slice, etc)

This desgin have some drawbacks :
1. If one assertion fails, the following ones will not be executed .
2. It is hard to determine the actual position where the failure happens .
3. The codes are difficult to understand or extend, if someone want to add one more test method,
he may need to add one static method, and add the method invocation to some instance testXXX
methods.

I propose to refactor them and to organize them to classes hierarchy, for example, an abstract
ByteBufferTest, and several subclass such as DirectByteBufferTest, HeapByteBufferTest, WrappedByteBufferTest,
etc.  I'll provide patch for ByteBuffer at first as a pilot, and if it is acceptted, I'll
raise JIRA and provide patch for other bufers(char, int, float, etc) one by one.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message