harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3953) [drlvm][test] Inaccurate kernel test ClassTestDesiredAssertionStatus
Date Thu, 24 May 2007 06:18:16 GMT
[drlvm][test] Inaccurate kernel test ClassTestDesiredAssertionStatus
--------------------------------------------------------------------

                 Key: HARMONY-3953
                 URL: https://issues.apache.org/jira/browse/HARMONY-3953
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
            Reporter: Alexey Varlamov
            Priority: Trivial


The kernel test java.lang.ClassTestDesiredAssertionStatus fails if assertions are enabled
through command line.
Looking at the test code, it is plain wrong: the class cannot change assertion status after
initialization.

    public void test1() {
        ClassLoader scl = ClassLoader.getSystemClassLoader();
        scl.setDefaultAssertionStatus(true);
        scl.clearAssertionStatus();
        assertFalse(ClassTestDesiredAssertionStatus.class
            .desiredAssertionStatus());
    }

Suggested to re-write the test so that it uses custom classloader and non-resolved class.
See for example org.apache.harmony.test.TestResources.getLoader().

-- 
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