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
19 changes: 19 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
</Bundle-SymbolicName>
<Bundle-Name>OpenHFT :: ${project.artifactId}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Automatic-Module-Name>net.openhft.hashing</Automatic-Module-Name>
<Export-Package>
net.openhft.hashing.*;-noimport:=true,
!java.*,
Expand All @@ -289,6 +290,24 @@
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.5</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<packaged.jar>${project.build.directory}/${project.build.finalName}.jar</packaged.jar>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
37 changes: 37 additions & 0 deletions src/test/java/net/openhft/hashing/AutomaticModuleNameIT.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright 2013-2025 chronicle.software; SPDX-License-Identifier: Apache-2.0
*/
package net.openhft.hashing;

import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

public class AutomaticModuleNameIT {

private static final String EXPECTED_MODULE_NAME = "net.openhft.hashing";

@Test
public void packagedJarDeclaresAutomaticModuleName() throws IOException {
final String packagedJarPath = System.getProperty("packaged.jar");
assertNotNull("packaged.jar system property", packagedJarPath);

final File packagedJar = new File(packagedJarPath);
assertTrue("Packaged JAR does not exist: " + packagedJar, packagedJar.isFile());

try (JarFile jarFile = new JarFile(packagedJar)) {
final Manifest manifest = jarFile.getManifest();
assertNotNull("Packaged JAR has no manifest: " + packagedJar, manifest);
final Attributes attributes = manifest.getMainAttributes();
assertEquals(EXPECTED_MODULE_NAME, attributes.getValue("Automatic-Module-Name"));
}
}
}
Loading