Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 8
java-version: 11

- name: Cache local Maven repository
uses: actions/cache@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 8
java-version: 11

- name: Cache local Maven repository
uses: actions/cache@v5
Expand Down
112 changes: 61 additions & 51 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,59 +92,25 @@
</repository>
</repositories>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>

<ldapbp.version>1.0</ldapbp.version>
<slf4j.version>1.7.32</slf4j.version>
<log4j.version>2.25.3</log4j.version>
<properties>
<slf4j.version>1.7.36</slf4j.version>
<jaxb.version>2.3.1</jaxb.version>

<targetJdk>11</targetJdk>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>ldapbp</artifactId>
<version>${ldapbp.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.glassfish.main.external</groupId>
<artifactId>ldapbp-repackaged</artifactId>
<version>5.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -153,10 +119,17 @@
<version>${jaxb.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.14.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<defaultGoal>clean test</defaultGoal>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -179,6 +152,31 @@
</executions>
</plugin>

<plugin>
<groupId>org.gaul</groupId>
<artifactId>modernizer-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<javaVersion>${targetJdk}</javaVersion>
<exclusions>
<exclusion>java/util/Enumeration</exclusion>
<exclusion>java/util/Hashtable."&lt;init&gt;":(IF)V</exclusion>
<exclusion>java/util/Hashtable."&lt;init&gt;":(I)V</exclusion>
<exclusion>java/util/Hashtable."&lt;init&gt;":()V</exclusion>
<exclusion>java/util/Hashtable."&lt;init&gt;":(Ljava/util/Map;)V</exclusion>
</exclusions>
</configuration>
<executions>
<execution>
<id>modernizer-check</id>
<phase>verify</phase>
<goals>
<goal>modernizer</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down Expand Up @@ -282,12 +280,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.5.3</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<encoding>utf-8</encoding>
<runOrder>alphabetical</runOrder>
<skipTests>false</skipTests>
<includes>
<include>**/unit/*Test.java</include>
</includes>
Expand All @@ -299,8 +296,16 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<source>${targetJdk}</source>
<target>${targetJdk}</target>
<useIncrementalCompilation>false</useIncrementalCompilation>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<compilerArgument>-Xlint:unchecked</compilerArgument>
<compilerArgs>
<arg>--add-exports</arg>
<arg>java.naming/com.sun.jndi.ldap=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -329,10 +334,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<encoding>utf-8</encoding>
<runOrder>alphabetical</runOrder>
<skipTests>false</skipTests>
<argLine>--add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED</argLine>
<includes>
<include>**/it/*Test.java</include>
</includes>
Expand Down Expand Up @@ -365,7 +367,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.3</version>
<version>3.12.0</version>
<configuration>
<doclint>none</doclint>
<release>${targetJdk}</release>
<additionalOptions>
<additionalOption>--legal-notices</additionalOption>
<additionalOption>none</additionalOption>
</additionalOptions>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
12 changes: 5 additions & 7 deletions src/test/java/net/tirasa/adsddl/it/AbstractTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@
*/
package net.tirasa.adsddl.it;

import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;

import java.io.IOException;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;

public abstract class AbstractTest extends net.tirasa.adsddl.unit.AbstractTest {

private static final long serialVersionUID = 1L;

protected static LdapContext ctx;

protected static String baseContext;
Expand All @@ -38,7 +36,7 @@ public abstract class AbstractTest extends net.tirasa.adsddl.unit.AbstractTest {

protected static Properties prop;

@BeforeClass
@BeforeAll
@SuppressWarnings("unchecked")
public static void setUpConnection() throws IOException {
prop = new Properties();
Expand Down Expand Up @@ -75,7 +73,7 @@ public static void setUpConnection() throws IOException {
searchFilter = prop.getProperty("searchFilter");
}

@AfterClass
@AfterAll
public static void close() throws NamingException {
ctx.close();
}
Expand Down
15 changes: 4 additions & 11 deletions src/test/java/net/tirasa/adsddl/it/DirSyncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package net.tirasa.adsddl.it;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.sun.jndi.ldap.ctl.DirSyncResponseControl;
import java.util.AbstractMap;
Expand All @@ -34,13 +34,10 @@
import javax.naming.ldap.Control;
import javax.naming.ldap.LdapContext;
import net.tirasa.adsddl.ntsd.controls.DirSyncControl;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class DirSyncTest extends AbstractTest {

private static final long serialVersionUID = 1L;

@Test
public void syncUser() throws Exception {
// -----------------------------------
Expand Down Expand Up @@ -170,9 +167,7 @@ private Map.Entry<SyncToken, Set<SearchResult>> search(
final Control[] rspCtls = ctx.getResponseControls();

if (rspCtls != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Response Controls: {}", rspCtls.length);
}
LOG.debug("Response Controls: {}", rspCtls.length);

for (Control rspCtl : rspCtls) {
if (rspCtl instanceof DirSyncResponseControl) {
Expand All @@ -181,9 +176,7 @@ private Map.Entry<SyncToken, Set<SearchResult>> search(
}
}

if (LOG.isDebugEnabled()) {
LOG.debug("Latest sync token set to {}", latestSyncToken);
}
LOG.debug("Latest sync token set to {}", latestSyncToken);
}
}
} catch (NamingException e) {
Expand Down
8 changes: 3 additions & 5 deletions src/test/java/net/tirasa/adsddl/it/RetrieveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package net.tirasa.adsddl.it;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import net.tirasa.adsddl.ntsd.controls.SDFlagsControl;
import javax.naming.NamingEnumeration;
Expand All @@ -26,12 +26,10 @@
import net.tirasa.adsddl.ntsd.SID;
import net.tirasa.adsddl.ntsd.utils.Hex;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class RetrieveTest extends AbstractTest {

private static final long serialVersionUID = 1L;

@Test
public void searchBySID() throws Exception {
final SearchControls controls = new SearchControls();
Expand Down
Loading