# HG changeset patch # User Jaroslav Tulach # Date 1378751632 -7200 # Node ID 913732a84aa3bdca5b40a25fe177b825e392f62c # Parent c4f83529954d75a3c7e327f56fa78a29a9225890 Verify all placeholders are substituted when building final ZIP distribution diff -r c4f83529954d -r 913732a84aa3 ko/archetype-test/src/test/java/org/apidesign/bck2brwsr/ko/archetype/test/VerifyArchetypeTest.java --- a/ko/archetype-test/src/test/java/org/apidesign/bck2brwsr/ko/archetype/test/VerifyArchetypeTest.java Mon Sep 09 19:35:12 2013 +0200 +++ b/ko/archetype-test/src/test/java/org/apidesign/bck2brwsr/ko/archetype/test/VerifyArchetypeTest.java Mon Sep 09 20:33:52 2013 +0200 @@ -18,11 +18,15 @@ package org.apidesign.bck2brwsr.ko.archetype.test; import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.util.Properties; +import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import org.apache.maven.it.Verifier; import org.testng.annotations.Test; import static org.testng.Assert.*; +import org.testng.reporters.Files; /** * @@ -87,8 +91,18 @@ assertTrue(zip.isFile(), "Zip file with website was created"); ZipFile zf = new ZipFile(zip); - assertNotNull(zf.getEntry("public_html/index.html"), "index.html found"); + final ZipEntry index = zf.getEntry("public_html/index.html"); + assertNotNull(index, "index.html found"); + String txt = readText(zf.getInputStream(index)); + final int beg = txt.indexOf("${"); + if (beg >= 0) { + int end = txt.indexOf("}", beg); + if (end < beg) { + end = txt.length(); + } + fail("No substitutions in index.html. Found: " + txt.substring(beg, end)); + } } private Verifier generateFromArchetype(final File dir, String... params) throws Exception { @@ -112,4 +126,8 @@ v.verifyErrorFreeLog(); return v; } + + private static String readText(InputStream is) throws IOException { + return Files.readFile(is); + } } diff -r c4f83529954d -r 913732a84aa3 ko/archetype/src/main/resources/archetype-resources/src/main/assembly/bck2brwsr.xml --- a/ko/archetype/src/main/resources/archetype-resources/src/main/assembly/bck2brwsr.xml Mon Sep 09 19:35:12 2013 +0200 +++ b/ko/archetype/src/main/resources/archetype-resources/src/main/assembly/bck2brwsr.xml Mon Sep 09 20:33:52 2013 +0200 @@ -32,6 +32,7 @@ src/main/webapp/pages / + true diff -r c4f83529954d -r 913732a84aa3 ko/archetype/src/main/resources/archetype-resources/src/main/assembly/fxbrwsr.xml --- a/ko/archetype/src/main/resources/archetype-resources/src/main/assembly/fxbrwsr.xml Mon Sep 09 19:35:12 2013 +0200 +++ b/ko/archetype/src/main/resources/archetype-resources/src/main/assembly/fxbrwsr.xml Mon Sep 09 20:33:52 2013 +0200 @@ -27,6 +27,7 @@ pages/** + true \ No newline at end of file