Hi Jesse, Yes in early Harmony development, we have an agreement that we will follow RI's behavior to make Harmony compatible to serve more application as possible - which includes exceptions etc (unless RI does break spec or is not logical). So I believe there are many testcases checking such exceptions. Jesse, I am not against this proposal, but I wonder if it will be a large mount of work to split them all (unless we found an automatic solution, e.g, searching the test source for try-catch).
2011/1/7 Jesse Wilson <jessewil...@google.com> > Harmony folks, > > Here on Android, we've been running Harmony's test suite on our devices. > The > extensive test suite includes many large test methods that exercise many > behaviors. For example, consider this test method from > StringBuffer2Test.java: > > public void test_insertI$CII() { // Test for method java.lang.StringBuffer > // java.lang.StringBuffer.insert(int, char [], int, int) char[] c = new > char[]{'n', 'o', 't', ' '}; testBuffer.insert(8, c, 0, 4); > assertEquals("This is not a test buffer", testBuffer.toString()); > StringBuffer buf1 = new StringBuffer("abcd"); try { buf1.insert(-1, > (char[]) > null, 0, 0); fail("Should throw StringIndexOutOfBoundsException"); } catch > (StringIndexOutOfBoundsException e) { //expected } try { > testBuffer.insert(testBuffer.length() - 1, c, -1, 1); } catch > (StringIndexOutOfBoundsException e) { //expected } } > This tests that the behavior of insert() is consistent with the spec. But > it > also tests which exception is thrown when multiple arguments are incorrect. > That behavior is not specified, but Harmony tests it to ensure that > implementation behaviors are consistent with those in the RI. > > I'd like to split this into two test methods. We Androids want to pass > every > test for behavior that's specified. But we're not as concerned with > implementation details like exception priority. Splitting it into two tests > makes it possible for us to manage the most important tests. > > For another example, InetAddressTest.test_getAllByNameLjava_lang_String() > covers null handling, security managers, and IPv4 vs. IPv6 addresses. For > this test I'd like to move the SecurityManager testing to a separate > method. > > I'm planning on starting into this work beginning on Monday the 9th. If > you'd rather I didn't, please let me know! > > Cheers, > Jesse from Android > -- Best Regards! Jimmy, Jing Lv