commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCS-114) Test failures under Java 7 caused by different order of tests
Date Mon, 07 Apr 2014 18:25:21 GMT

    [ https://issues.apache.org/jira/browse/JCS-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13962099#comment-13962099
] 

Sebb commented on JCS-114:
--------------------------

bq. In each case, the test class has 2 tests. 

This is not the case for the test LHMLRUMemoryCacheUnitTest which has multiple test methods.
In this case the problem occurs because the test cases don't use separate regions, so the
tests are not currently independent.

Fixed:

URL: http://svn.apache.org/r1585543
Log:
JCS-114 Test failures under Java 7 caused by different order of tests

Modified:
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/memory/lru/LHMLRUMemoryCacheUnitTest.java


> Test failures under Java 7 caused by different order of tests
> -------------------------------------------------------------
>
>                 Key: JCS-114
>                 URL: https://issues.apache.org/jira/browse/JCS-114
>             Project: Commons JCS
>          Issue Type: Bug
>            Reporter: Sebb
>
> ON Java 7 under WinXP I get several test failures. These do not occur with Java 6. The
failures are:
> {code}
>  org.apache.commons.jcs.access.SystemPropertyUnitTest#testSystemPropertyInValueDelimiter
AssertionFailedError
>  org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCachePoolAccessManagerUnitTest#testConfigurePoolAccessAttributes_Simple
ComparisonFailure
>  org.apache.commons.jcs.engine.memory.lru.LHMLRUMemoryCacheUnitTest#testGetStatsThroughHub
AssertionFailedError
>  org.apache.commons.jcs.engine.SystemPropertyUsageUnitTest#testSystemPropertyUsage_inactive
AssertionFailedError
>  org.apache.commons.jcs.engine.SystemPropertyUsageUnitTest#testSystemPropertyUsage AssertionFailedError
> {code}
> AFAICT these failures occur because Java 7 runs tests in a different order from Java
6.
> In each case, the test class has 2 tests.
> Either the Unit tests are wrong - e.g. the second test relies on something set up by
an earlier test, or the second test fails to clear up afterwards so causes a problem when
the test order is reversed.
> Otherwise there must be a problem in the code under test - e.g. the code caches a value
that it should not.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message