Skip to content

Commit

Permalink
Add loadFromPOM magic test
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dzianishchyts committed Nov 22, 2024
1 parent 26da613 commit f5e7075
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class KernelMagicIT extends ContainerizedKernelCase {
class KernelMagicIT extends ContainerizedKernelCase {

@Test
void jars() throws Exception {
Expand Down Expand Up @@ -68,4 +68,18 @@ void load() throws Exception {
assertThat(snippetResult.getStderr(), not(containsString("|")));
assertThat(snippetResult.getStdout(), containsString("pong!"));
}

@Test
void loadFromPOM() throws Exception {
String pom = CONTAINER_RESOURCES + "/test-pom.xml";
String snippet = String.join("\n",
"%loadFromPOM " + pom,
"import jakarta.annotation.Nullable;",
"Nullable.class.getName()"
);
Container.ExecResult snippetResult = executeInKernel(snippet);

assertThat(snippetResult.getStderr(), not(containsString("|")));
assertThat(snippetResult.getStdout(), containsString("jakarta.annotation.Nullable"));
}
}
15 changes: 15 additions & 0 deletions jjava/src/test/resources/test-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.dflib.jjava</groupId>
<artifactId>jjava-test</artifactId>
<version>1.0</version>

<dependencies>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
</project>

0 comments on commit f5e7075

Please sign in to comment.