[jboss-jira] [JBoss JIRA] (AS7-5498) infinispan.DistributedCacheManagerTest unit tests fail with openjdk7

Joe Wertz (JIRA) jira-events at lists.jboss.org
Wed Sep 12 05:09:32 EDT 2012


    [ https://issues.jboss.org/browse/AS7-5498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717802#comment-12717802 ] 

Joe Wertz commented on AS7-5498:
--------------------------------

Was getting a similar issue.



{noformat}
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.jboss.as.clustering.web.infinispan.FineSessionAttributeStorageTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.236 sec
Running org.jboss.as.clustering.web.infinispan.CoarseSessionAttributeStorageTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running org.jboss.as.clustering.web.infinispan.SimpleExternalizerTestCase
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
Running org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest
Tests run: 22, Failures: 2, Errors: 1, Skipped: 0, Time elapsed: 0.385 sec <<< FAILURE!
Running org.jboss.as.clustering.web.infinispan.SessionAttributeStorageFactoryTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.jboss.as.clustering.web.infinispan.SessionMapEntryTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec

Results :

Failed tests:   getSessionDataNoOwner(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): expected same:<Mock for IncomingDistributableSessionData, hashCode: 1125454900> was not:<null>
  getMissingSessionDataNoOwner(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): expected same:<Mock for IncomingDistributableSessionData, hashCode: 431404444> was not:<null>

Tests in error: 
  storeSessionData(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): (..)

Tests run: 33, Failures: 2, Errors: 1, Skipped: 0

{noformat}

Adding ", same(Flag.FORCE_SYNCHRONOUS)" as a third method parameter to lines 180, 223, and 283 fixed the problem.

Current: 

{noformat}
180        when(this.invoker.invoke(same(this.cache), capturedOperation.capture())).thenReturn(null);

223        when(this.invoker.invoke(same(this.cache), capturedOperation.capture())).thenReturn(data);

283        when(this.invoker.invoke(same(this.cache), capturedOperation.capture())).thenReturn(expected);
{noformat}

Fixed: 

{noformat}
180        when(this.invoker.invoke(same(this.cache), capturedOperation.capture(), same(Flag.FORCE_SYNCHRONOUS))).thenReturn(null);

223        when(this.invoker.invoke(same(this.cache), capturedOperation.capture(), same(Flag.FORCE_SYNCHRONOUS))).thenReturn(data);

283        when(this.invoker.invoke(same(this.cache), capturedOperation.capture(), same(Flag.FORCE_SYNCHRONOUS))).thenReturn(expected);
{noformat}

The invoker in the Test file never gets called without the 3rd parameter. 

When it's added to the manager in the @Before method, it's actually put *inside* a child-class invoker, so it never gets called directly. Only thru that child class, which always seems to add a 3rd parameter to the call. The wrapper child-class invoker gets called with the currently defined 2-parameter invoker.invoke(...) call, but not the invoker from the Test class.
                
> infinispan.DistributedCacheManagerTest unit tests fail with openjdk7
> --------------------------------------------------------------------
>
>                 Key: AS7-5498
>                 URL: https://issues.jboss.org/browse/AS7-5498
>             Project: Application Server 7
>          Issue Type: Bug
>         Environment: affected master
>            Reporter: Radoslav Husar
>            Assignee: Radoslav Husar
>             Fix For: 7.2.0.Alpha1
>
>
> Noticed by alexey
> [rhusar at rhusar jboss-as]$ java -version
> java version "1.7.0_06-icedtea"
> OpenJDK Runtime Environment (fedora-2.3.1.fc17.2-x86_64)
> OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
> {noformat}
> [INFO] 
> [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ jboss-as-clustering-web-infinispan ---
> [debug] execute contextualize
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory /home/rhusar/git/jboss-as/clustering/web-infinispan/src/test/resources
> [INFO] 
> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ jboss-as-clustering-web-infinispan ---
> [INFO] Compiling 6 source files to /home/rhusar/git/jboss-as/clustering/web-infinispan/target/test-classes
> [INFO] 
> [INFO] --- maven-surefire-plugin:2.11:test (default-test) @ jboss-as-clustering-web-infinispan ---
> [INFO] Surefire report directory: /home/rhusar/git/jboss-as/clustering/web-infinispan/target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running org.jboss.as.clustering.web.infinispan.FineSessionAttributeStorageTest
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.334 sec
> Running org.jboss.as.clustering.web.infinispan.CoarseSessionAttributeStorageTest
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec
> Running org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest
> Tests run: 22, Failures: 2, Errors: 6, Skipped: 0, Time elapsed: 0.42 sec <<< FAILURE!
> Running org.jboss.as.clustering.web.infinispan.SimpleExternalizerTestCase
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec
> Running org.jboss.as.clustering.web.infinispan.SessionAttributeStorageFactoryTest
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
> Running org.jboss.as.clustering.web.infinispan.SessionMapEntryTest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
> Results :
> Failed tests:   getSessionDataNoOwner(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): expected same:<Mock for IncomingDistributableSessionData, hashCode: 1688182366> was not:<null>
>   getMissingSessionDataNoOwner(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): expected same:<Mock for IncomingDistributableSessionData, hashCode: 981356300> was not:<null>
> Tests in error: 
>   removeSession(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): (..)
>   removeSessionLocal(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): (..)
>   removeSessionLocalNoOwner(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): (..)
>   evictSession(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): (..)
>   evictSessionNoOwner(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest): (..)
>   getSessionIds(org.jboss.as.clustering.web.infinispan.DistributedCacheManagerTest)
> Tests run: 33, Failures: 2, Errors: 6, Skipped: 0
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list