From 5c9738983782929439e25a00b20722516fc947cd Mon Sep 17 00:00:00 2001
From: Fabio Pistolesi <fabio.pistolesi@forgerock.com>
Date: Tue, 10 Feb 2015 15:59:24 +0000
Subject: [PATCH] Tweak pluggable backend unit tests for maven. A test was missing an annotation and another a dependency on a previous test. Also, having both dependencies and expected exceptions in annotations on a chain of dependencies creates problems.
---
opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java b/opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
index c44ac5c..a806bb7 100644
--- a/opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
+++ b/opendj3-server-dev/tests/unit-tests-testng/src/server/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
@@ -521,7 +521,7 @@
"postalAddress: {cn}${street}${l}, {st} {postalCode}",
"description: This is the description for {cn}.",
""};
- // Add suffix and barnch entries
+ // Add suffix and branch entries
ldifNumberOfEntries += 2;
}
@@ -550,6 +550,7 @@
}
}
+ @Test
public void testAdd() throws Exception
{
addEntriesToBackend(topEntries);
@@ -743,16 +744,24 @@
assertTrue(backend.getEntry(oldEntry.getName()).hasValue(modifyAttribute, null, modifyValue));
}
- @Test(dependsOnMethods = { "testAdd", "testRenameEntry", "testHasSubordinates" })
+ @Test(dependsOnMethods = { "testAdd", "testRenameEntry", "testHasSubordinates", "testUtilityAPIs" })
public void testDeleteEntry() throws Exception
{
deleteEntry(dnToDel);
}
- @Test(dependsOnMethods = "testDeleteEntry", expectedExceptions = DirectoryException.class)
+ @Test(dependsOnMethods = "testDeleteEntry")
public void testDeleteAlreadyDeletedEntry() throws Exception
{
- deleteEntry(dnToDel);
+ try
+ {
+ deleteEntry(dnToDel);
+ fail("Should have generated a DirectoryException");
+ }
+ catch (DirectoryException de)
+ {
+ // Expected exception, do nothing, test succeeds.
+ }
}
private void deleteEntry(DN dn) throws Exception
--
Gitblit v1.10.0