[QFJ-837] Tests on jdk1.8 fail Created: 15/Apr/15  Updated: 25/Dec/15  Resolved: 25/Dec/15

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.6.0
Fix Version/s: None

Type: Bug Priority: Default
Reporter: Slawomir Pawlewicz Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: session
Environment:

jdk 1.8.0_40 Windows 7 x64


Issue Links:
Duplicate
duplicates QFJ-838 Tests on jdk 1.7 failed Closed

 Description   

I executed quickifix test on jdk 1.6. All went fine. On jdk 1.8 failed:

-------------------------------------------------------------------------------
Test set: quickfix.SessionTest
-------------------------------------------------------------------------------
Tests run: 47, Failures: 6, Errors: 0, Skipped: 0, Time elapsed: 1.514 sec <<< FAILURE! - in quickfix.SessionTest
testSequenceResetStackOverflow(quickfix.SessionTest) Time elapsed: 0.012 sec <<< FAILURE!
java.lang.AssertionError: expected:<51> but was:<50>
at org.junit.Assert.fail(Assert.java:93)
at org.junit.Assert.failNotEquals(Assert.java:647)
at org.junit.Assert.assertEquals(Assert.java:128)
at org.junit.Assert.assertEquals(Assert.java:472)
at org.junit.Assert.assertEquals(Assert.java:456)
at quickfix.SessionTest.testSequenceResetStackOverflow(SessionTest.java:1044)

testResendRequestMsgSeqNum(quickfix.SessionTest) Time elapsed: 0.011 sec <<< FAILURE!
java.lang.AssertionError: Session should be logged out since seqnum too low!
at org.junit.Assert.fail(Assert.java:93)
at org.junit.Assert.assertTrue(Assert.java:43)
at org.junit.Assert.assertFalse(Assert.java:68)
at quickfix.SessionTest.testResendRequestMsgSeqNum(SessionTest.java:1172)

testSimultaneousResendRequests(quickfix.SessionTest) Time elapsed: 0 sec <<< FAILURE!
java.lang.AssertionError: null
at org.junit.Assert.fail(Assert.java:92)
at org.junit.Assert.assertTrue(Assert.java:43)
at org.junit.Assert.assertTrue(Assert.java:54)
at quickfix.SessionTest.testSimultaneousResendRequests(SessionTest.java:1225)

testDontCatchErrorsFromCallback(quickfix.SessionTest) Time elapsed: 0.003 sec <<< FAILURE!
org.junit.ComparisonFailure: expected:<[java.lang.Error: TEST]> but was:<[No error thrown]>
at org.junit.Assert.assertEquals(Assert.java:125)
at org.junit.Assert.assertEquals(Assert.java:147)
at quickfix.SessionTest.testDontCatchErrorsFromCallback(SessionTest.java:1462)

testAcceptorRelogon(quickfix.SessionTest) Time elapsed: 0 sec <<< FAILURE!
java.lang.AssertionError: null
at org.junit.Assert.fail(Assert.java:92)
at org.junit.Assert.assertTrue(Assert.java:43)
at org.junit.Assert.assertFalse(Assert.java:68)
at org.junit.Assert.assertFalse(Assert.java:79)
at quickfix.SessionTest.testAcceptorRelogon(SessionTest.java:1632)

testStateFlagsAreResetOnLogout(quickfix.SessionTest) Time elapsed: 0.001 sec <<< FAILURE!
java.lang.AssertionError: null
at org.junit.Assert.fail(Assert.java:92)
at org.junit.Assert.assertTrue(Assert.java:43)
at org.junit.Assert.assertFalse(Assert.java:68)
at org.junit.Assert.assertFalse(Assert.java:79)
at quickfix.SessionTest.testStateFlagsAreResetOnLogout(SessionTest.java:1670)



 Comments   
Comment by Kenny Tanaka [ 14/Jul/15 ]

I had exactly the same error, and found a workaround. It seems to be the order of the test methods executed. This problem has already been mentioned in QFJ-826.
http://randomallsorts.blogspot.de/2012/12/junit-411-whats-new-test-execution-order.html

  1. In quickfix-core/pom.xml, change junit version from 4.10 to 4.11.
  2. Annotate two test classes, quickfix.SessionTest and quickfix.mina.SingleThreadedEventHandlingStrategyTest, with @FixMethodOrder(MethodSorters.NAME_ASCENDING).
  3. Rename every public test methons in the two classes above. Change method name from testXxx to something like test###_Xxx, with ### a sequencial number. E.g., test001_DisposalOfFileResources() and test047_LargeQueue20000.

Now the test went through for me.

Generated at Sat Nov 23 07:38:53 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.