Test code cleanup
NamingConflictTest.java
Extracted fields to simplify code in test methods.
Extracted methods setUpLocal(), tearDown(), addMsg(), modDnMsg(), replayMsg(), createAndAddEntry(), createParentEntry(), createChildEntry().
ModifyConflictTest.java:
Made the code a bit more readable.
AttrHistoricalSingle.java:
Extracted methods replaceOrDelete(), add(), replace(), delete() and deleteWithoutDeleteTime() to increase code expressiveness.
AssuredReplicationPluginTest.java:
Used ReplicationTestCase.waitForSpecificMsg() and waitForSpecificMsgs() to ignore unrelated messages.
ReplicationTestCase.java:
Added methods:
- waitForSpecificMsgs(Session session, Class<?>... msgTypes)
- waitForSpecificMsgs(ReplicationBroker broker, Class<?>... msgTypes)
Changed
<T extends ReplicationMsg> T waitForSpecificMsg(Session session, ReplicationBroker broker, Class<T> msgType)
to
ReplicationMsg waitForSpecificMsgs(Session session, ReplicationBroker broker, Class<?>... msgTypes)
HistoricalAttributeValueTestCase.java:
Added test values.
Fix random test failure.
Tests methods were not properly isolated. The sequence testUpdateDeletedIDs() followed by testUpdateAddedIDs() caused the following failure:
17:42:32 T E S T F A I L U R E ! ! !
17:42:32
17:42:32 Failed Test: org.opends.server.backends.pluggable.DefaultIndexTest#testUpdateAddedIDs
17:42:32 Failure Cause: java.lang.AssertionError:
17:42:32 Expecting:
17:42:32 <[]>
17:42:32 to contain:
17:42:32 <[1, 2, 3, 4]>
17:42:32 but could not find:
17:42:32 <[1, 2, 3, 4]>
17:42:32
17:42:32 org.opends.server.backends.pluggable.Utils.assertIdsEquals(Utils.java:39)
17:42:32 org.opends.server.backends.pluggable.Utils.assertIdsEquals(Utils.java:51)
17:42:32 org.opends.server.backends.pluggable.DefaultIndexTest.testUpdateAddedIDs(DefaultIndexTest.java:76)
DefaultIndexTest.java:
In setUp(), use @BeforeMethod annotation (rather than @BeforeTest)
Revision
12768
by JnRouvignac:
AssuredReplicationPluginTest.java: Used ReplicationTestCase.waitForSpecificMsg() and waitForSpecificMsgs() to ignore unrelated messages.
Revision
12764
by JnRouvignac:
Fix random test failure. Tests methods were not properly isolated. The sequence testUpdateDeletedIDs() followed by testUpdateAddedIDs() caused the following failure: 17:42:32 T E S T F A I L U R E ! ! ! 17:42:32 17:42:32 Failed Test: org.opends.server.backends.pluggable.DefaultIndexTest#testUpdateAddedIDs 17:42:32 Failure Cause: java.lang.AssertionError: 17:42:32 Expecting: 17:42:32 <[]> 17:42:32 to contain: 17:42:32 <[1, 2, 3, 4]> 17:42:32 but could not find: 17:42:32 <[1, 2, 3, 4]> 17:42:32 17:42:32 org.opends.server.backends.pluggable.Utils.assertIdsEquals(Utils.java:39) 17:42:32 org.opends.server.backends.pluggable.Utils.assertIdsEquals(Utils.java:51) 17:42:32 org.opends.server.backends.pluggable.DefaultIndexTest.testUpdateAddedIDs(DefaultIndexTest.java:76)
DefaultIndexTest.java: In setUp(), use @BeforeMethod annotation (rather than @BeforeTest)