harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6608) [classlib][archive]Unit tests to improve the coverage of archive module
Date Tue, 10 Aug 2010 14:57:15 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896900#action_12896900
] 

Mark Hindess commented on HARMONY-6608:
---------------------------------------

Also, tests like:

+    /**
+     * @tests java.util.jar.JarException#JarException(java.lang.String)
+     */
+    public void test_ConstructorLjava_lang_String1() throws Exception {
+        try {
+            throw new JarException("Jar Exception");
+        } catch (JarException e) {
+            assertEquals("Jar Exception", e.getMessage());
+        }
+    }    
+    
+    /**
+     * @tests java.util.jar.JarException#JarException()
+     */
+    public void test_Constructor_void() throws Exception {
+        try {
+            throw new JarException();
+        } catch (JarException e) {
+            // Correct
+        }
+    }

should probably just be written:

+    /**
+     * @tests java.util.jar.JarException#JarException(java.lang.String)
+     */
+    public void test_ConstructorLjava_lang_String1() throws Exception {
+            assertEquals("Jar Exception", new JarException("Jar Exception").getMessage());
+    }    
+    
+    /**
+     * @tests java.util.jar.JarException#JarException()
+     */
+    public void test_Constructor_void() throws Exception {
+            new JarException();
+    }

since try/catch is already exercised sufficiently by other tests.  Having said that, I'd question
the value of these tests since the implementations of the tested constructors are only calls
to super(...).  If I was working on improving test coverage then I suspect these would be
very low on my list of priorities since they seem rather unlikely to fail.


> [classlib][archive]Unit tests to improve the coverage of archive module
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-6608
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6608
>             Project: Harmony
>          Issue Type: Test
>          Components: Classlib
>         Environment: Linux and Windows
>            Reporter: Mohanraj Loganathan
>             Fix For: 6.0M3
>
>         Attachments: 001_HARMONY-6608.patch, 002_HARMONY-6608.patch
>
>
> Added units-tests which increases the test-coverage of archive module.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message