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)
| | |
| | | import org.opends.server.backends.pluggable.spi.TreeName; |
| | | import org.opends.server.backends.pluggable.spi.UpdateFunction; |
| | | import org.opends.server.backends.pluggable.spi.WriteableTransaction; |
| | | import org.testng.annotations.BeforeTest; |
| | | import org.testng.annotations.BeforeMethod; |
| | | import org.testng.annotations.Test; |
| | | |
| | | @SuppressWarnings("javadoc") |
| | | @Test(groups = { "precommit", "pluggablebackend" }, sequential = true) |
| | | public class DefaultIndexTest extends DirectoryServerTestCase |
| | | { |
| | | |
| | | private DefaultIndex index; |
| | | private WriteableTransaction txn; |
| | | |
| | | @BeforeTest |
| | | @BeforeMethod |
| | | public void setUp() { |
| | | txn = new DummyWriteableTransaction(); |
| | | index = newIndex("test", 5, EnumSet.of(TRUSTED, COMPACTED)); |