mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
21.42.2015 7a4d8d56edd72e1de5268f96476ffa48e9c440d4
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)
1 files modified
5 ■■■■■ changed files
opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/DefaultIndexTest.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/DefaultIndexTest.java
@@ -51,18 +51,17 @@
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));