[Git][java-team/jnr-netdb][upstream] New upstream version 1.2.0+dfsg
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sat Feb 1 12:39:22 GMT 2025
Andreas Tille pushed to branch upstream at Debian Java Maintainers / jnr-netdb
Commits:
24b0d70d by Andreas Tille at 2025-02-01T13:33:00+01:00
New upstream version 1.2.0+dfsg
- - - - -
5 changed files:
- + .github/workflows/ci.yml
- pom.xml
- src/test/java/jnr/netdb/FileProtocolDBTest.java
- src/test/java/jnr/netdb/NativeProtocolsDBTest.java
- src/test/java/jnr/netdb/ProtocolTest.java
Changes:
=====================================
.github/workflows/ci.yml
=====================================
@@ -0,0 +1,37 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Java CI with Maven
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ jdk8:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout at v2
+ - name: Set up JDK 8
+ uses: actions/setup-java at v1
+ with:
+ java-version: 8
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+ jdk11:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout at v2
+ - name: Set up JDK 11
+ uses: actions/setup-java at v1
+ with:
+ java-version: 11
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
=====================================
pom.xml
=====================================
@@ -9,7 +9,7 @@
<groupId>com.github.jnr</groupId>
<artifactId>jnr-netdb</artifactId>
<packaging>jar</packaging>
- <version>1.1.6</version>
+ <version>1.2.0</version>
<name>jnr-netdb</name>
<description>Lookup TCP and UDP services from java</description>
<url>http://github.com/jnr/jnr-netdb</url>
@@ -38,8 +38,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.compiler.source>1.5</maven.compiler.source>
- <maven.compiler.target>1.5</maven.compiler.target>
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
@@ -54,10 +54,53 @@
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-ffi</artifactId>
- <version>2.1.0</version>
+ <version>2.2.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Automatic-Module-Name>org.jnrproject.netdb</Automatic-Module-Name>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>java9</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <!-- Use -release compiler option rather than source/target if 9+ -->
+ <release>${maven.compiler.target}</release>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <activation>
+ <jdk>[9,)</jdk>
+ </activation>
+ </profile>
+ </profiles>
+
</project>
=====================================
src/test/java/jnr/netdb/FileProtocolDBTest.java
=====================================
@@ -34,17 +34,32 @@ public class FileProtocolDBTest {
@Test public void canLookupIpProtocolByName() {
ProtocolsDB db = FileProtocolsDB.getInstance();
- Protocol p = db.getProtocolByName("ip");
- assertNotNull("could not lookup ip protocol", p);
- assertEquals("incorrect proto number", 0, p.getProto());
- assertEquals("incorrect name", "ip", p.getName());
+ // we try ip first and then ipv4 due to jnr/jnr-netdb#4
+ Protocol p = Protocol.getProtocolByName("ip");
+ if (p != null) {
+ assertEquals("incorrect proto number", 0, p.getProto());
+ assertEquals("incorrect name", "ip", p.getName());
+ } else {
+ p = Protocol.getProtocolByName("ipv4");
+ assertNotNull("could not lookup ipv4 protocol", p);
+ assertEquals("incorrect proto number", 4, p.getProto());
+ assertEquals("incorrect name", "ipv4", p.getName());
+ }
}
@Test public void canLookupIpProtocolByNumber() {
ProtocolsDB db = FileProtocolsDB.getInstance();
- Protocol p = db.getProtocolByNumber(0);
- assertNotNull("could not lookup ip protocol", p);
- assertEquals("incorrect proto number", 0, p.getProto());
- assertEquals("incorrect name", "ip", p.getName());
+ // we try ip first and then ipv4 due to jnr/jnr-netdb#4
+ Protocol p = Protocol.getProtocolByName("ip");
+ if (p != null) {
+ p = Protocol.getProtocolByNumber(0);
+ assertEquals("incorrect proto number", 0, p.getProto());
+ assertEquals("incorrect name", "ip", p.getName());
+ } else {
+ p = Protocol.getProtocolByNumber(4);
+ assertNotNull("could not lookup ip protocol", p);
+ assertEquals("incorrect proto number", 4, p.getProto());
+ assertEquals("incorrect name", "ipv4", p.getName());
+ }
}
}
=====================================
src/test/java/jnr/netdb/NativeProtocolsDBTest.java
=====================================
@@ -34,18 +34,33 @@ public class NativeProtocolsDBTest {
@Test public void canLookupIpProtocolByName() {
ProtocolsDB db = NativeProtocolsDB.getInstance();
- Protocol p = db.getProtocolByName("ip");
- assertNotNull("could not lookup ip protocol", p);
- assertEquals("incorrect proto number", 0, p.getProto());
- assertEquals("incorrect name", "ip", p.getName());
+ // we try ip first and then ipv4 due to jnr/jnr-netdb#4
+ Protocol p = Protocol.getProtocolByName("ip");
+ if (p != null) {
+ assertEquals("incorrect proto number", 0, p.getProto());
+ assertEquals("incorrect name", "ip", p.getName());
+ } else {
+ p = Protocol.getProtocolByName("ipv4");
+ assertNotNull("could not lookup ipv4 protocol", p);
+ assertEquals("incorrect proto number", 4, p.getProto());
+ assertEquals("incorrect name", "ipv4", p.getName());
+ }
}
@Test public void canLookupIpProtocolByNumber() {
ProtocolsDB db = NativeProtocolsDB.getInstance();
- Protocol p = db.getProtocolByNumber(0);
- assertNotNull("could not lookup ip protocol", p);
- assertEquals("incorrect proto number", 0, p.getProto());
- assertEquals("incorrect name", "ip", p.getName());
+ // we try ip first and then ipv4 due to jnr/jnr-netdb#4
+ Protocol p = Protocol.getProtocolByName("ip");
+ if (p != null) {
+ p = Protocol.getProtocolByNumber(0);
+ assertEquals("incorrect proto number", 0, p.getProto());
+ assertEquals("incorrect name", "ip", p.getName());
+ } else {
+ p = Protocol.getProtocolByNumber(4);
+ assertNotNull("could not lookup ip protocol", p);
+ assertEquals("incorrect proto number", 4, p.getProto());
+ assertEquals("incorrect name", "ipv4", p.getName());
+ }
}
@Test public void canLookupTcpProtocolByName() {
=====================================
src/test/java/jnr/netdb/ProtocolTest.java
=====================================
@@ -33,10 +33,17 @@ public class ProtocolTest {
}
@Test public void canLookupIpProtocolByName() {
+ // we try ip first and then ipv4 due to jnr/jnr-netdb#4
Protocol p = Protocol.getProtocolByName("ip");
- assertNotNull("could not lookup ip protocol", p);
- assertEquals("incorrect proto number", 0, p.getProto());
- assertEquals("incorrect name", "ip", p.getName());
+ if (p != null) {
+ assertEquals("incorrect proto number", 0, p.getProto());
+ assertEquals("incorrect name", "ip", p.getName());
+ } else {
+ p = Protocol.getProtocolByName("ipv4");
+ assertNotNull("could not lookup ipv4 protocol", p);
+ assertEquals("incorrect proto number", 4, p.getProto());
+ assertEquals("incorrect name", "ipv4", p.getName());
+ }
}
@Test public void returnsNullOnUnknownProtocol() {
@@ -45,10 +52,18 @@ public class ProtocolTest {
}
@Test public void canLookupIpProtocolByNumber() {
- Protocol p = Protocol.getProtocolByNumber(0);
- assertNotNull("could not lookup ip protocol", p);
- assertEquals("incorrect proto number", 0, p.getProto());
- assertEquals("incorrect name", "ip", p.getName());
+ // we try ip first and then ipv4 due to jnr/jnr-netdb#4
+ Protocol p = Protocol.getProtocolByName("ip");
+ if (p != null) {
+ p = Protocol.getProtocolByNumber(0);
+ assertEquals("incorrect proto number", 0, p.getProto());
+ assertEquals("incorrect name", "ip", p.getName());
+ } else {
+ p = Protocol.getProtocolByNumber(4);
+ assertNotNull("could not lookup ip protocol", p);
+ assertEquals("incorrect proto number", 4, p.getProto());
+ assertEquals("incorrect name", "ipv4", p.getName());
+ }
}
@Test public void returnsNullOnInvalidNumber() {
View it on GitLab: https://salsa.debian.org/java-team/jnr-netdb/-/commit/24b0d70dc7f4266d6c916a8dd78efbadc766b2ee
--
View it on GitLab: https://salsa.debian.org/java-team/jnr-netdb/-/commit/24b0d70dc7f4266d6c916a8dd78efbadc766b2ee
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20250201/88b3b4e7/attachment.htm>
More information about the pkg-java-commits
mailing list