Skip to content

Commit

Permalink
fix: include the missing classes in JDK index (#161)
Browse files Browse the repository at this point in the history
* tests: include the missing classes in JDK index

* fix: use internal name of Java class
  • Loading branch information
algomaster99 authored Mar 5, 2024
1 parent de4f5eb commit aea493f
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.Map;
import java.util.Set;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnJre;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.io.TempDir;

class JdkIndexerTest {
Expand All @@ -31,6 +33,23 @@ void jdkIndexShouldBeDeterministic_irrespectiveOfTheJDK(@TempDir Path tempDir) t
assertThat(contentFirst).isEqualTo(contentSecond);
}

@EnabledOnJre(JRE.JAVA_21)
@Test
void jdkIndexShouldHave__jdk_internal_foreign_MemorySessionImpl__and__java_lang_foreign_MemorySegment$Scope(
@TempDir Path tempDir) {
// arrange
Path indexFile = tempDir.resolve("jdk.json");

// act
String[] args = {"jdk", "-o", indexFile.toString()};
Index.main(args);

// assert
Map<String, Set<ClassFileAttributes>> referenceProvenance = ParsingHelper.deserializeFingerprints(indexFile);
assertThat(referenceProvenance)
.containsKeys("jdk/internal/foreign/MemorySessionImpl", "java/lang/foreign/MemorySegment$Scope");
}

@Test
void useMD5asAlgorithm(@TempDir Path tempDir) {
// arrange
Expand Down

0 comments on commit aea493f

Please sign in to comment.