modules/fxpackager/src/test/java/com/oracle/tools/packager/mac/MacAppStoreBundlerTest.java
Print this page
*** 47,56 ****
--- 47,58 ----
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
+ import java.util.regex.Matcher;
+ import java.util.regex.Pattern;
import static com.oracle.tools.packager.StandardBundlerParam.*;
import static com.oracle.tools.packager.mac.MacAppBundler.*;
import static com.oracle.tools.packager.mac.MacAppStoreBundler.*;
import static org.junit.Assert.*;
*** 182,194 ****
--- 184,215 ----
boolean valid = bundler.validate(bundleParams);
assertTrue(valid);
File result = bundler.execute(bundleParams, new File(workDir, "smoke"));
System.err.println("Bundle at - " + result);
+
+ checkFiles(result);
+ }
+
+ private void checkFiles(File result) throws IOException {
assertNotNull(result);
assertTrue(result.exists());
assertTrue(result.length() > MIN_SIZE);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintStream printStream = new PrintStream(baos, true);
+ IOUtils.exec(
+ new ProcessBuilder("pkgutil", "--payload-files", result.getCanonicalPath()),
+ false, false, printStream);
+
+ String output = baos.toString();
+
+ Pattern jreInfoPListPattern = Pattern.compile("/PlugIns/[^/]+/Contents/Info\\.plist");
+ Matcher matcher = jreInfoPListPattern.matcher(output);
+ assertTrue("Insure that info.plist is packed in for embedded jre", matcher.find());
+
+ assertFalse("Insure JFX Media isn't packed in", output.contains("/libjfxmedia.dylib"));
}
@Test
public void configureEverything() throws Exception {
AbstractBundler bundler = new MacAppStoreBundler();
*** 249,258 ****
// only run the bundle with full tests
Assume.assumeTrue(Boolean.parseBoolean(System.getProperty("FULL_TEST")));
File result = bundler.execute(bundleParams, new File(workDir, "everything"));
System.err.println("Bundle at - " + result);
! assertNotNull(result);
! assertTrue(result.exists());
! assertTrue(result.length() > MIN_SIZE);
}
}
--- 270,278 ----
// only run the bundle with full tests
Assume.assumeTrue(Boolean.parseBoolean(System.getProperty("FULL_TEST")));
File result = bundler.execute(bundleParams, new File(workDir, "everything"));
System.err.println("Bundle at - " + result);
!
! checkFiles(result);
}
}