diff options
author | gjoranv <gv@verizonmedia.com> | 2022-05-04 13:54:08 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-05-08 01:38:47 +0200 |
commit | 94088fe6442c1016e0202e63c800d21733dd7aee (patch) | |
tree | 43c89cb5b0908bcc6945e2e2ca0aa16d5751d056 /jdisc_core | |
parent | 260f7bef67c8132c23b4f7dd7c334f45ea25ceed (diff) |
Add simple integration test for ExportPackages
- Add plugin management for failsafe-plugin
Diffstat (limited to 'jdisc_core')
-rw-r--r-- | jdisc_core/pom.xml | 13 | ||||
-rw-r--r-- | jdisc_core/src/test/java/com/yahoo/jdisc/core/ExportPackagesIT.java | 42 |
2 files changed, 55 insertions, 0 deletions
diff --git a/jdisc_core/pom.xml b/jdisc_core/pom.xml index 19826c6de75..cf2502c73b8 100644 --- a/jdisc_core/pom.xml +++ b/jdisc_core/pom.xml @@ -285,6 +285,19 @@ </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>3.0.0-M6</version> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/core/ExportPackagesIT.java b/jdisc_core/src/test/java/com/yahoo/jdisc/core/ExportPackagesIT.java new file mode 100644 index 00000000000..395ddc889ae --- /dev/null +++ b/jdisc_core/src/test/java/com/yahoo/jdisc/core/ExportPackagesIT.java @@ -0,0 +1,42 @@ +package com.yahoo.jdisc.core; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.File; +import java.io.FileReader; +import java.util.Properties; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +/** + * Integration tests for {@link ExportPackages}. + * + * @author gjoranv + */ +public class ExportPackagesIT { + + @Rule + public TemporaryFolder tempFolder= new TemporaryFolder(); + + @Test + public void export_packages_are_added_from_dependency_jars() throws Exception { + File file = tempFolder.newFile(ExportPackages.PROPERTIES_FILE); + + ExportPackages.main(new String[] { file.getAbsolutePath(), "target/dependency/guice-no_aop.jar" }); + assertTrue(file.exists()); + Properties props = new Properties(); + String exportPackages; + try (FileReader reader = new FileReader(file)) { + props.load(reader); + exportPackages = props.getProperty(ExportPackages.EXPORT_PACKAGES); + } + assertNotNull(exportPackages); + + assertTrue(exportPackages.contains("com.google.inject")); + + } + +} |