You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2021/04/26 21:42:52 UTC
[directory-server] 01/03: Migrated to Junit5
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git
commit 08ef62b6f825a818d9d4c22a808965f0e4fea0f8
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Mon Apr 5 06:00:13 2021 +0200
Migrated to Junit5
---
core-annotations/pom.xml | 5 +++++
core/pom.xml | 14 +++++++-------
.../directory/server/core/DefaultDirectoryServiceTest.java | 3 +--
.../server/core/security/CertificateUtilTest.java | 3 +--
.../server/core/security/TlsKeyGeneratorTest.java | 13 +++----------
5 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/core-annotations/pom.xml b/core-annotations/pom.xml
index c388df7..0ed3a5b 100644
--- a/core-annotations/pom.xml
+++ b/core-annotations/pom.xml
@@ -37,6 +37,11 @@
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
diff --git a/core/pom.xml b/core/pom.xml
index 393f52e..3e94f4a 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -39,12 +39,6 @@
<dependencies>
<dependency>
- <groupId>org.apache.directory.junit</groupId>
- <artifactId>junit-addons</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>${project.groupId}</groupId>
<artifactId>apacheds-i18n</artifactId>
</dependency>
@@ -153,7 +147,13 @@
<groupId>org.apache.directory.api</groupId>
<artifactId>api-util</artifactId>
</dependency>
-
+
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
diff --git a/core/src/test/java/org/apache/directory/server/core/DefaultDirectoryServiceTest.java b/core/src/test/java/org/apache/directory/server/core/DefaultDirectoryServiceTest.java
index 90c2731..4a3d2fc 100644
--- a/core/src/test/java/org/apache/directory/server/core/DefaultDirectoryServiceTest.java
+++ b/core/src/test/java/org/apache/directory/server/core/DefaultDirectoryServiceTest.java
@@ -26,12 +26,11 @@ import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
import org.apache.directory.server.core.api.interceptor.Interceptor;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class DefaultDirectoryServiceTest
{
-
@Test
public void testAddAfterExistingInterceptor() throws LdapException
{
diff --git a/core/src/test/java/org/apache/directory/server/core/security/CertificateUtilTest.java b/core/src/test/java/org/apache/directory/server/core/security/CertificateUtilTest.java
index 0a60df2..e71f09f 100644
--- a/core/src/test/java/org/apache/directory/server/core/security/CertificateUtilTest.java
+++ b/core/src/test/java/org/apache/directory/server/core/security/CertificateUtilTest.java
@@ -27,7 +27,7 @@ import java.security.cert.X509Certificate;
import javax.security.auth.x500.X500Principal;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Test for the CertificateUtil class.
@@ -37,7 +37,6 @@ import org.junit.Test;
@SuppressWarnings("restriction")
public class CertificateUtilTest
{
-
@Test
public void testSelfSignedCertificateCreation() throws IOException, GeneralSecurityException
{
diff --git a/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java b/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java
index 1398671..c56ba45 100644
--- a/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java
+++ b/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java
@@ -33,23 +33,16 @@ import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.ldap.schema.loader.LdifSchemaLoader;
import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
-
-
/**
* Test for the TlsKeyGenerator class.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-@RunWith(ConcurrentJunitRunner.class)
-@Concurrency()
public class TlsKeyGeneratorTest
{
private static final Logger LOG = LoggerFactory.getLogger( TlsKeyGeneratorTest.class );
@@ -60,7 +53,7 @@ public class TlsKeyGeneratorTest
/**
* Initialize the registries once for the whole test suite
*/
- @BeforeClass
+ @BeforeAll
public static void setup() throws Exception
{
/*