From 19c1698a1c9d576637a80b20afa080db5e16addb Mon Sep 17 00:00:00 2001
From: davidely <davidely@localhost>
Date: Sun, 03 Sep 2006 14:40:08 +0000
Subject: [PATCH] Migrating to TestNG 5.1 from 4.7. Most of the required changes are to address annotations that were deprecated.
---
opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestAbsoluteSubtreeSpecification.java | 7
opends/ext/testng/CHANGES.txt | 416 ++++++++++++++++++++++++++++++++++++++++++++++
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Long.java | 4
opends/tests/unit-tests-testng/src/server/org/opends/server/core/SubtreeSpecificationTestCase.java | 9
opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestDN.java | 16
opends/ext/testng/src.zip | 0
opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEnvManager.java | 11
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Enumerated.java | 4
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Set.java | 4
opends/ext/testng/lib/testng-5.1-jdk15.jar | 0
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Integer.java | 4
opends/tests/unit-tests-testng/src/server/org/opends/server/DirectoryServerTestCase.java | 2
opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEntryContainer.java | 7
opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestEntry.java | 14
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Element.java | 4
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1OctetString.java | 4
opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestBackendImpl.java | 7
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Sequence.java | 4
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1ReaderAndWriter.java | 7
19 files changed, 470 insertions(+), 54 deletions(-)
diff --git a/opends/ext/testng/CHANGES.txt b/opends/ext/testng/CHANGES.txt
new file mode 100644
index 0000000..1c6b0f1
--- /dev/null
+++ b/opends/ext/testng/CHANGES.txt
@@ -0,0 +1,416 @@
+
+TODO
+ :Introduce ITestFactory, deprecate @Factory
+ :Introduce Annotation Transformers
+
+===========================================================================
+5.1
+
+Added: @Test(sequential = true)
+Fixed: TESTNG-102 (Incorrect ordering of @BeforeMethod calls when a dependency is specified)
+Fixed: TESTNG-101 (HTML output contains nested <P> tags and a missing <tr> tag)
+Added: support for specifying test-only classpath (http://forums.opensymphony.com/thread.jspa?messageID=78048&tstart=0)
+Fixed: TESTNG-93 (method selectors filtering @BeforeMethod)
+Fixed: TESTNG-81 (Assert.assertFalse() displays wrong expected, actual value)
+Fixed: TESTNG-59 (multiple method selectors usage results in no tests run)
+Fixed: TESTNG-56 (invocation of @Before/AfterClass methods in parallel/sequential scenarios)
+Fixed: TESTNG-40 (failures suite does not contain @Before/After Suite/Test methods)
+Fixed: TESTNG-37 (allow passing null parameter value from testng.xml)
+Fixed: TESTNG-7 (display classname when hovering method)
+
+
+Eclipse plug-in
+
+Added: run contextual test classes with parameters from suite definition files
+Added: TESTNG-100 (Show HTML reports after running tests)
+Added: TESTNG-97 (Double click top stack to raise comparison)
+Added: TESTNG-84 (plug-in UI for suite option should support absolute path)
+Added: TESTNG-20 (copy stack trace)
+
+Fixed: TESTNG-72 (display groups with non-array values)
+Fixed: TESTNG-64 (Eclipse plug-in applies added groups to all launch configurations)
+Fixed: TESTNG-28 (Cannot select groups from dependent eclipse projects)
+Fixed: TESTNG-25 (do not display fully qualified method name when running contextual test class)
+
+Improved behavior:
+ TESTNG-98 (temporary files have guaranteed fixed names)
+ TESTNG-95 (Assertion failed comparison trims trailing ">")
+ TESTNG-70 (TestNG prevents eclipse from opening an older CVS version of a java class)
+ display of test hierarchy information (TESTNG-29)
+
+===========================================================================
+
+5.0.1
+
+Eclipse plug-in
+
+Added: Output directory for the tests
+Added: Can now specify listener classes
+
+===========================================================================
+5.0.1
+
+Fixed: reports generated by SuiteHTMLReporter do not work with JDK1.4
+
+===========================================================================
+
+5.0
+
+Added: Ant task: support for JVM, workingDir, timeout
+Added: Stack traces can be interactively shown in the HTML reports
+Added: Link to testng.xml in the reports
+Added: New structure for reports, suites go in their individual directory
+Added: @Test(suiteName) and @Test(testName)
+Added: The stack traces in reports do not include TestNG frames (system property testng.exception)
+ (see: http://groups.google.com/group/testng-dev/browse_thread/thread/9f4d46ade10b0fda)
+Fixed: Exit with error when no methods are run
+ (see: http://groups.google.com/group/testng-dev/browse_thread/thread/3c26e8a5658f22ac)
+Added: List of methods in alphabetical order
+Fixed: Class-scoped annotations were not recognized when inherited
+Added: Deprecated @Configuration and introduced @BeforeSuite/Test/Class/TestMethod
+Added: Deprecated @ExpectedExceptions and moved it into @Test
+Added: expectedExceptions to @Test, deprecated @ExpectedExceptions
+Added: New annotations: @BeforeSuite, @BeforeTest, etc...
+Fixed: Was returning an exit code of 0 if a cyclic graph was detected
+Added: Interface org.testng.ITest so that tests can declare a name
+Fixed: The Text reporter was reporting the square of the actual number of methods
+Fixed: Bug reported by Eran about dependencies with an afterClass method
+Added: IHookCallBack now receives the ITestResult in its run() method
+Added: Name of suite for command line can be set with -Dtestng.suite.name=xxx
+Fixed: TestNGAntTask was hardcoding m_haltOnFSP to true
+Fixed: Passing a null parameter caused an NPE in the reports
+Added: "listener" to the ant task (and documentation)
+Added: if patch-testng-sourcedir.properties is found in the classpath
+ with a property "sourcedir" containing a ; separated list of
+ directories, this list will override -sourcedir.
+
+===========================================================================
+
+
+4.7
+
+Added: Maven 2 plug-in
+Fixed: Message formattings in TestNG assertion utility class
+Fixed: @Factory methods were counted as @Test as well
+ http://jira.opensymphony.com/browse/TESTNG-51
+Fixed: All DataProvider parameters were shown in the HTML report
+Fixed: Bug in testng-failed.xml generation
+Fixed: <packages> bug when using a jar file to load the test classes
+Added: alwaysRun for before @Configuration methods
+ http://jira.opensymphony.com/browse/TESTNG-35
+Fixed: groupless @Configurations were not invoked if a method depends on a group
+ http://jira.opensymphony.com/browse/TESTNG-45
+Added: beforeGroups/afterGroups to @Configuration
+
+Eclipse plugin:
+
+Added: last contextual launch is available in Eclipse launcher lists
+Fixed: 3.2M5 integration (removed dependency on non-existing class)
+Fixed: testng-failures.xml generation
+
+===========================================================================
+
+4.6
+
+Added: Documentation contains the new reports
+Added: TestNG.setUseDefaultListeners(boolean)
+Added: Descriptions now appear in TextReporter (verbose>=2) and the HTML reports
+Added: description attribute to @Test and @Configuration
+Added: combined Reporter output in the reports
+Added: methods not run in the reports
+Added: org.testng.IReporter
+Added: threadPoolSize to @Test
+Added: Reports now show relative timings (start at 0)
+Added: Reports now show different colors depending on the methods' classes
+Added: Reports now show all parameters used to invoke the test method
+Added: org.testng.Reporter
+Added: DataProviders can accept a Method as first parameter
+Fixed: Extraneous implicit inclusion of a method
+
+Eclipse plugin:
+
+Added: Run/Debug as TestNG test from the editor contextual menu
+Fixed: TESTNG-24: 'Run as testng test' does not appear of the Test annotation does not have a group
+Fixed: TESTNG-18: Eclipse plugin ignores Factory annotation
+Fixed: TESTNG-21: Show differences when double clicking assertion exceptions
+Added: UI allows setting orientation (even more space)
+ http://forums.opensymphony.com/thread.jspa?threadID=17225&messageID=33805#33805
+
+===========================================================================
+
+4.5
+
+Core:
+
+Fixed: Methods were not implicitly included, only groups
+Fixed: Bug with failed parent @Configuration don't skip child @Configuration/@Test invocations
+Fixed: Bug with overridding @Configuration methods (both parent and child were run)
+Fixed: Bug when overriding beforeClass methods in base class (cyclic graph)
+Added: Support for JAAS (see org.testng.IHookable)
+Fixed: Problem with nested classes inside <package name="foo.*"
+Fixed: If a group is not found, mark the method as a skip instead of aborting
+Fixed: testng-failed.xml was not respecting dependencies
+Fixed: class/include method in testng.xml didn't work on default package
+Fixed: DTD only allowed one <define>
+Fixed: ArrayIndexOutOfBoundsException for jMock
+Added: dependsOnMethods can contain methods from another class
+Fixed: JUnitConverter required -restore, not any more (option is now a no-op)
+Fixed: JUnit mode wasn't invoking setName() on test classes
+Added: Regular expressions for classes in <package>
+Added: Distributed TestNG
+Fixed: Command line parameters and testng.xml are now cumulative
+Fixed: Reports now work for multiple suites
+Fixed: Was ignoring abstract classes even if they have non-abstract instances
+Fixed: If setUp() failed, methods were not skipped
+Fixed: Was not clearly indicating when beforeSuite fails
+Added: @Configuration.inheritGroups
+Fixed: inconsistency between testng.xml and objects regarding method selectors
+
+Eclipse plug-in:
+
+New look for the progress view.
+
+===========================================================================
+
+4.4
+
+Core:
+
+Fixed: testng-failures.xml was not excluding methods from base classes
+Fixed: Bug in suites of suites for JUnit mode
+
+===========================================================================
+
+4.3
+
+Core:
+
+Fixed: testng-failures.xml was not excluding methods from base classes
+Fixed: Bug in suites of suites for JUnit mode
+Added: Excluded groups on command line and ant task
+Fixed: When including a group, implicitly include groups depended upon
+Fixed: When depending on several groups, wasn't skipped if one of them failed
+Fixed: Failures weren't reported accurately in the JUnitReports report
+Fixed: Wasn't throwing an exception if depending on a non-existing group
+
+===========================================================================
+
+4.2
+
+Core:
+
+Fixed: wasn't excluding methods in base classes
+Added: alwaysRun for tests (soft dependencies)
+Fixed: Class-level enabled=false were not honored
+Fixed: Bug with multiple dataproviders on same class
+Fixed: Bug with dataprovider defined in the parent class
+Fixed: Bug with dataprovider defined in a subclass
+Fixed: Bug with dataprovider defined in an abstract class
+Fixed: testng-failures generation was excluding the methods even if a failed test depended on it
+
+===========================================================================
+
+4.1
+
+Core:
+
+Added: @DataProviders can return Iterable<Object[]>
+Fixed: Superclass test methods were not called in the presence of a class @Test
+Added: Reporter class to log messages in the HTML reports
+
+===========================================================================
+
+4.0
+
+Core:
+
+Fixed: suite methods now invoked only once in a hierarchy
+Added: @DataProvider and @testng.data-provider
+Fixed: Interleave order now respected for before/afterClass methods
+Added: Can now invoke java -jar testng-2.6.jar <...>
+Added: Support for BeanShell
+Added: Method Selectors (IMethodSelector)
+Fixed: In the absence of dependencies, @Configuration methods respect inheritance
+Fixed: Bug in multithreaded dependencies on methods
+Fixed: dependsOnGroups wasn't working on regular expressions
+Fixed: Bug in <package> when directories contain spaces in their names
+Fixed: Introduced a JDK5 dependency in the JDK1.4 build (getEnclosingClass())
+Fixed: Output directory in ant task was not honored if it didn't exist
+Fixed: Problem with timeout according to
+ http://forums.opensymphony.com/thread.jspa?threadID=6707
+
+Eclipse plug-in:
+
+Fixed: Wasn't handling linked directories correctly
+Fixed: Bug in QuickFix implementation
+Added: Quick Fix for JUnit conversion (Annotations and JavaDoc)
+Fixed: Methods Run as TestNG test
+Added: Package level Run as TestNG test
+Fixed: Resources from the linked directories are using a wrong path when
+ passed to command line TestNG
+
+IDEA plug-in:
+
+Added: Support for JDK 1.4 (both projects and IDEA itself)
+Fixed: Classes that contained only configuration were ignored
+
+===========================================================================
+
+2.5
+
+Added: ITestListener.onTestStart(ITestResult)
+Added: Support for <packages>
+Added: Resource files for easier ant taskdefs
+Fixed: @Configuration methods were not invoked with individual test methods
+Fixed: Bug with ExpectedExceptions
+Fixed: Didn't support nested factory classes
+Fixed: NPE if -target is omitted with JDK 1.4
+Fixed: @Configuration failures in a class would cause other classes to fail
+Added: alwaysRun
+Fixed: beforeTestClass/afterTestClass were broken for a pathological case
+Added: @Configuration(alwaysRun)
+Added: JUnitConverter task
+Fixed: < and > characters in reports were not escaped
+
+Eclipse plug-in:
+
+Fixed: Class dialog wasn't showing @Factory classes
+
+IDEA plug-in:
+
+First release!
+
+Documentation:
+
+Added: Brand new look!!!
+Added: Section on testng.xml
+Fixed: Numbering of sections
+
+===========================================================================
+
+2.4
+Changed: New package: testng.org
+Fixed: Bug with @ExpectedException occuring the parallel mode
+Fixed: Bug with parameters and beforeTest
+Added: IInstanceInfo support
+Fixed: methods were not excluded when included by groups
+Fixed: testng-failures.xml is now including also the beforeSuite/afterSuite methods
+Fixed: generating the testng-failures.xml is now working as expected
+Fixed: Factories call all the tests even if some of them fail along the way
+Fixed: Better JUnit support (wasn't creating individual instances)
+Fixed: dependsOnGroups didn't work across different classes
+Added: command line (and Ant) -groups option
+Added: @Parameters (and made parameters attribute deprecated)
+Added: Parameters for constructors
+Fixed: Better interleaving of before/afterTestMethods
+Fixed: Ant task
+Fixed: TestNGException thrown when TestNG conditions are not fulfilled
+
+Documentation:
+- New assert classes
+- New ways to launch
+- JUnitConverter documentation
+- new beforeSuite/afterSuite
+
+===========================================================================
+
+2.3
+
+Fixed: Spaces are now legal in JavaDoc comments
+Added: documentation for @Factory
+Fixed: factories were called multiple times
+Added: beforeSuite and afterSuite
+Fixed: inheritance and scope now working properly for annotations
+Fixed: dependsOnMethods wasn't working for 1.4
+Added: Better stack traces
+Added: Better syntax for included/excluded methods
+Fixed: Better verbose support
+Fixed: Various fixes for the Eclipse plug-in
+Added: Can specify a class name on the command line
+Fixed: Default package bug in JUnitConverter
+Added: Regression tests for JUnitConverter
+Added: -quiet option to JUnitConverter
+
+===========================================================================
+
+2.2
+
+Fixed: Wasn't handling several testng.xml files correctly
+Fixed: Renamed -src to -sourcedir
+Fixed: Complains if no sourcedir is specified in 1.4
+Added: In 1.4, don't require annotations="javadoc"
+Fixed: If setUp fails, complain and mark test methods as skips
+Fixed: Dependent methods weren't working for 1.4
+
+===========================================================================
+
+2.1
+
+Added: Parser can accept an InputStream for testng.xml
+Fixed: expected-exceptions now fails if test passes
+Fixed: reports now use the suite name in HTML
+Added: invocationCount and successPercentage
+Added: dependsOnMethods
+Added: timeOut works in non-parallel mode
+
+===========================================================================
+
+2.0
+
+Added: port on JDK 1.4
+
+===========================================================================
+
+1.3
+
+Added: new view: classes (still experimental)
+Added: timeout on methods
+Added: thread-count
+Added: TestNG is now multithread, see "parallel" in <suite>
+
+===========================================================================
+
+1.2
+
+Added: JUnitConverter
+Fixed: Bug with afterClasses (test: AfterClassCalledAtTheEnd)
+
+===========================================================================
+
+1.1
+
+Added: new links for methods and groups in the HTML report
+Added: <methods>
+Added: <fileset> to <testng>
+
+===========================================================================
+
+1.0
+
+Fixed: Updated to the new DTD
+Fixed: Suite table of contents displays failures first
+Fixed: Bug in afterTestClass
+Added: Validating testng.xml
+Added: Scoped parameters
+Added: testng.xml
+Removed: Property quiet
+Changed: Verbose is now an integer
+Added: Dependent methods
+
+===========================================================================
+
+0.9
+
+Added: Groups of groups
+Added: Groups for Configuration methods
+Added: Parameters
+
+===========================================================================
+
+0.2
+
+Fixed: Merged TestMethod and TestClass into Test
+Added: HTML report
+Added: Regexps for groups
+Fixed: Inheritance of methods
+Fixed: ExpectedException is now called ExpectedExceptions
diff --git a/opends/ext/testng/lib/testng-4.7-jdk15.jar b/opends/ext/testng/lib/testng-5.1-jdk15.jar
similarity index 64%
rename from opends/ext/testng/lib/testng-4.7-jdk15.jar
rename to opends/ext/testng/lib/testng-5.1-jdk15.jar
index a1f9df6..e287861 100644
--- a/opends/ext/testng/lib/testng-4.7-jdk15.jar
+++ b/opends/ext/testng/lib/testng-5.1-jdk15.jar
Binary files differ
diff --git a/opends/ext/testng/src.zip b/opends/ext/testng/src.zip
index adfec28..93c32ed 100644
--- a/opends/ext/testng/src.zip
+++ b/opends/ext/testng/src.zip
Binary files differ
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/DirectoryServerTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/DirectoryServerTestCase.java
index 6eb22ee..dd8a53d 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/DirectoryServerTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/DirectoryServerTestCase.java
@@ -26,6 +26,8 @@
*/
package org.opends.server;
+import org.testng.annotations.Test;
+
import java.io.PrintStream;
/**
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestBackendImpl.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestBackendImpl.java
index 5af1f81..ccea5d5 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestBackendImpl.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestBackendImpl.java
@@ -40,8 +40,9 @@
import org.opends.server.util.Base64;
import org.opends.server.util.LDIFReader;
import org.opends.server.util.StaticUtils;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.AfterClass;
/**
* BackendImpl Tester.
@@ -68,7 +69,7 @@
* @throws Exception
* If the environment could not be set up.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() throws Exception {
InitialDirectoryServerFixture.FACTORY.setUp();
@@ -93,7 +94,7 @@
* @throws Exception
* If the environment could not be finalized.
*/
- @Configuration(afterTestClass = true)
+ @AfterClass
public void tearDown() throws Exception {
InitialDirectoryServerFixture.FACTORY.tearDown();
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEntryContainer.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEntryContainer.java
index 6c63f90..125723a 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEntryContainer.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEntryContainer.java
@@ -39,8 +39,9 @@
import org.opends.server.types.Entry;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.util.LDIFReader;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.AfterClass;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
@@ -128,7 +129,7 @@
* @throws Exception
* If the environment could not be set up.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() throws Exception {
// This test suite depends on having the schema available.
SchemaFixture.FACTORY.setUp();
@@ -166,7 +167,7 @@
* @throws Exception
* If the environment could not be finalized.
*/
- @Configuration(afterTestClass = true)
+ @AfterClass
public void tearDown() throws Exception {
SchemaFixture.FACTORY.tearDown();
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEnvManager.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEnvManager.java
index 05b9e23..73cd024 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEnvManager.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestEnvManager.java
@@ -30,9 +30,9 @@
import java.io.File;
-import org.testng.annotations.Configuration;
-import org.testng.annotations.ExpectedExceptions;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.AfterClass;
import org.opends.server.TestCaseUtils;
import com.sleepycat.je.Environment;
@@ -51,7 +51,7 @@
* @throws Exception
* If the environment could not be set up.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() throws Exception {
tempDir = TestCaseUtils.createTemporaryDirectory("jebtest");
homeDirName = tempDir.getAbsolutePath();
@@ -63,7 +63,7 @@
* @throws Exception
* If the environment could not be finalized.
*/
- @Configuration(afterTestClass = true)
+ @AfterClass
public void tearDown() throws Exception {
TestCaseUtils.deleteDirectory(tempDir);
}
@@ -98,8 +98,7 @@
* @throws Exception
* If the test failed unexpectedly.
*/
- @ExpectedExceptions(value = JebException.class)
- @Test()
+ @Test(expectedExceptions = JebException.class)
public void testInvalidHomeDir() throws Exception {
File tempFile = File.createTempFile("jebtest", "");
tempFile.deleteOnExit();
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/SubtreeSpecificationTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/SubtreeSpecificationTestCase.java
index 51fa27c..381675e 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/SubtreeSpecificationTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/SubtreeSpecificationTestCase.java
@@ -35,7 +35,8 @@
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.ObjectClass;
-import org.testng.annotations.Configuration;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.AfterClass;
/**
* An abstract base class for all subtree specification tests.
@@ -55,7 +56,7 @@
* @return The created entry.
*/
protected final Entry createEntry(DN entryDN,
- Set<ObjectClass> objectClasses) {
+ Set<ObjectClass> objectClasses) {
HashMap<ObjectClass, String> map = new HashMap<ObjectClass, String>();
for (ObjectClass oc : objectClasses) {
@@ -73,7 +74,7 @@
* @throws Exception
* If the environment could not be set up.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public final void setUp() throws Exception {
// This test suite depends on having the schema available.
SchemaFixture.FACTORY.setUp();
@@ -100,7 +101,7 @@
* @throws Exception
* If the environment could not be finalized.
*/
- @Configuration(afterTestClass = true)
+ @AfterClass
public final void tearDown() throws Exception {
SchemaFixture.FACTORY.tearDown();
}
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestAbsoluteSubtreeSpecification.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestAbsoluteSubtreeSpecification.java
index f94a80d..090d8ea 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestAbsoluteSubtreeSpecification.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestAbsoluteSubtreeSpecification.java
@@ -30,7 +30,6 @@
import org.opends.server.api.SubtreeSpecification;
import org.opends.server.types.DN;
-import org.testng.annotations.ExpectedExceptions;
import org.testng.annotations.Test;
/**
@@ -51,8 +50,7 @@
* @throws Exception
* If the test failed unexpectedly.
*/
- @Test
- @ExpectedExceptions(value = DirectoryException.class)
+ @Test(expectedExceptions = DirectoryException.class)
public void testValueOf1() throws Exception {
String input = "{}";
@@ -66,8 +64,7 @@
* @throws Exception
* If the test failed unexpectedly.
*/
- @Test
- @ExpectedExceptions(value = DirectoryException.class)
+ @Test(expectedExceptions = DirectoryException.class)
public void testValueOf2() throws Exception {
String input = " { } ";
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestDN.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestDN.java
index f5c9130..5e3942e 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestDN.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestDN.java
@@ -33,10 +33,10 @@
import org.opends.server.types.DN;
import org.opends.server.types.RDN;
import org.opends.server.types.AttributeValue;
-import org.testng.annotations.Configuration;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import org.testng.annotations.ExpectedExceptions;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.AfterClass;
import java.util.Arrays;
@@ -166,7 +166,7 @@
* @throws Exception
* If the environment could not be set up.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() throws Exception {
// This test suite depends on having the schema available.
SchemaFixture.FACTORY.setUp();
@@ -178,7 +178,7 @@
* @throws Exception
* If the environment could not be finalized.
*/
- @Configuration(afterTestClass = true)
+ @AfterClass
public void tearDown() throws Exception {
SchemaFixture.FACTORY.tearDown();
}
@@ -229,8 +229,8 @@
* @throws Exception
* If the test failed unexpectedly.
*/
- @Test(dataProvider = "illegalDNs")
- @ExpectedExceptions(value = { DirectoryException.class } )
+ @Test(dataProvider = "illegalDNs",
+ expectedExceptions = DirectoryException.class )
public void testIllegalStringDNs(String dn)
throws Exception
{
@@ -259,8 +259,8 @@
* @throws Exception
* If the test failed unexpectedly.
*/
- @Test(dataProvider = "illegalDNs")
- @ExpectedExceptions(value = { DirectoryException.class } )
+ @Test(dataProvider = "illegalDNs",
+ expectedExceptions = DirectoryException.class )
public void testIllegalOctetStringDNs(String dn)
throws Exception
{
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestEntry.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestEntry.java
index b93153d..a7f12d4 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestEntry.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestEntry.java
@@ -41,9 +41,9 @@
import org.opends.server.schema.IntegerSyntax;
import org.opends.server.schema.RFC3672SubtreeSpecificationSyntax;
import org.opends.server.types.*;
-import org.testng.annotations.Configuration;
-import org.testng.annotations.ExpectedExceptions;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.AfterClass;
/**
* This class defines a set of tests for the {@link Entry} class.
@@ -130,7 +130,7 @@
* @throws Exception
* If the environment could not be set up.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() throws Exception {
// This test suite depends on having the schema available.
SchemaFixture.FACTORY.setUp();
@@ -142,7 +142,7 @@
* @throws Exception
* If the environment could not be finalized.
*/
- @Configuration(afterTestClass = true)
+ @AfterClass
public void tearDown() throws Exception {
SchemaFixture.FACTORY.tearDown();
}
@@ -210,8 +210,7 @@
* @throws Exception
* If the test failed unexpectedly.
*/
- @Test
- @ExpectedExceptions(value = DirectoryException.class)
+ @Test(expectedExceptions = DirectoryException.class)
public void testGetAttributeValueBooleanBad() throws Exception {
AttributeType type = DirectoryServer.getAttributeType("inheritable");
@@ -255,8 +254,7 @@
* @throws Exception
* If the test failed unexpectedly.
*/
- @Test
- @ExpectedExceptions(value = DirectoryException.class)
+ @Test(expectedExceptions = DirectoryException.class)
public void testGetAttributeValueIntegerBad() throws Exception {
AttributeType type = DirectoryServer
.getAttributeType("supportedldapversion");
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Element.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Element.java
index 156df01..2d78c4d 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Element.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Element.java
@@ -34,8 +34,8 @@
import java.util.ArrayList;
import java.util.Arrays;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
/**
* This class defines a set of tests for the
@@ -75,7 +75,7 @@
/**
* Performs any necessary initialization for this test case.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() {
// Initialize the set of types. It will encapsulate the entire range
// of
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Enumerated.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Enumerated.java
index 4769254..2875907 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Enumerated.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Enumerated.java
@@ -32,8 +32,8 @@
import java.util.ArrayList;
import java.util.Arrays;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
/**
* This class defines a set of tests for the
@@ -49,7 +49,7 @@
/**
* Performs any necessary initialization for this test case.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() {
testIntegers = new ArrayList<Integer>();
testEncodedIntegers = new ArrayList<byte[]>();
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Integer.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Integer.java
index 9a3f068..a3872b3 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Integer.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Integer.java
@@ -32,8 +32,8 @@
import java.util.ArrayList;
import java.util.Arrays;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
/**
* This class defines a set of tests for the
@@ -49,7 +49,7 @@
/**
* Performs any necessary initialization for this test case.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() {
testIntegers = new ArrayList<Integer>();
testEncodedIntegers = new ArrayList<byte[]>();
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Long.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Long.java
index ac5e44b..ebae763 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Long.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Long.java
@@ -32,8 +32,8 @@
import java.util.ArrayList;
import java.util.Arrays;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
/**
* This class defines a set of tests for the
@@ -49,7 +49,7 @@
/**
* Performs any necessary initialization for this test case.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() {
testLongs = new ArrayList<Long>();
testEncodedLongs = new ArrayList<byte[]>();
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1OctetString.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1OctetString.java
index 66966db..e8fb993 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1OctetString.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1OctetString.java
@@ -33,8 +33,8 @@
import java.util.ArrayList;
import java.util.Arrays;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
/**
* This class defines a set of tests for the
@@ -53,7 +53,7 @@
/**
* Performs any necessary initialization for this test case.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() {
// Initialize the set of binary values. Don't make these too big
// since they
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1ReaderAndWriter.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1ReaderAndWriter.java
index 1e8df4e..eb3e3a6 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1ReaderAndWriter.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1ReaderAndWriter.java
@@ -36,8 +36,9 @@
import java.util.ArrayList;
import java.util.Arrays;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.AfterClass;
/**
* This class defines a set of tests for the
@@ -79,7 +80,7 @@
* @throws Exception
* If a problem occurs during initialization.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() throws Exception {
// Create the temporary file that we will write to and read from.
dataFile = File.createTempFile("TestASN1ReaderAndWriter-", ".data");
@@ -211,7 +212,7 @@
* @throws Exception
* If a problem occurs during cleanup.
*/
- @Configuration(afterTestClass = true)
+ @AfterClass
public void tearDown() throws Exception {
// Delete the temporary data file.
dataFile.delete();
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Sequence.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Sequence.java
index 4fbfa28..ed11a87 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Sequence.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Sequence.java
@@ -31,8 +31,8 @@
import java.util.ArrayList;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
/**
* This class defines a set of tests for the
@@ -51,7 +51,7 @@
/**
* Performs any necessary initialization for this test case.
*/
- @Configuration(beforeTestMethod = true)
+ @BeforeMethod
public void setUp() {
// Initialize the sets of ASN.1 elements that will be used in
// testing the
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Set.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Set.java
index ceb4dee..88c8f7b 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Set.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Set.java
@@ -31,8 +31,8 @@
import java.util.ArrayList;
-import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
+import org.testng.annotations.BeforeClass;
/**
* This class defines a set of tests for the
@@ -51,7 +51,7 @@
/**
* Performs any necessary initialization for this test case.
*/
- @Configuration(beforeTestClass = true)
+ @BeforeClass
public void setUp() {
// Initialize the sets of ASN.1 elements that will be used in
// testing the
--
Gitblit v1.10.0