# HG changeset patch # User Jaroslav Tulach # Date 1368607523 -7200 # Node ID 82300c4f5c5428e35cf3ed2c27201442888cc9a0 # Parent bf622f4857759a784a8d4ecba0e5e5b5c13cfa9d Use special version for the launcher diff -r bf622f485775 -r 82300c4f5c54 ko-archetype-test/src/test/java/org/apidesign/html/archetype/test/ArchetypeVersionTest.java --- a/ko-archetype-test/src/test/java/org/apidesign/html/archetype/test/ArchetypeVersionTest.java Mon May 13 17:39:08 2013 +0200 +++ b/ko-archetype-test/src/test/java/org/apidesign/html/archetype/test/ArchetypeVersionTest.java Wed May 15 10:45:23 2013 +0200 @@ -69,6 +69,39 @@ assertEquals(arch, version, "net.java.html.json dependency needs to be on latest version"); } + @Test public void testCheckLauncher() throws Exception { + final ClassLoader l = ArchetypeVersionTest.class.getClassLoader(); + URL r = l.getResource("archetype-resources/pom.xml"); + assertNotNull(r, "Archetype pom found"); + + final XPathFactory fact = XPathFactory.newInstance(); + XPathExpression xp2 = fact.newXPath().compile( + "//properties/bck2brwsr.launcher.version/text()" + ); + + Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream()); + String arch = (String) xp2.evaluate(dom, XPathConstants.STRING); + + + assertTrue(arch.matches("[0-9\\.]+"), "launcher version seems valid: " + arch); + } + + @Test public void testCheckBck2Brwsr() throws Exception { + final ClassLoader l = ArchetypeVersionTest.class.getClassLoader(); + URL r = l.getResource("archetype-resources/pom.xml"); + assertNotNull(r, "Archetype pom found"); + + final XPathFactory fact = XPathFactory.newInstance(); + XPathExpression xp2 = fact.newXPath().compile( + "//properties/bck2brwsr.version/text()" + ); + + Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream()); + String arch = (String) xp2.evaluate(dom, XPathConstants.STRING); + + assertTrue(arch.matches("[0-9\\.]+"), "bck2brwsr version seems valid: " + arch); + } + @Test public void testNbActions() throws Exception { final ClassLoader l = ArchetypeVersionTest.class.getClassLoader(); URL r = l.getResource("archetype-resources/nbactions.xml"); diff -r bf622f485775 -r 82300c4f5c54 ko-archetype/src/main/resources/archetype-resources/pom.xml --- a/ko-archetype/src/main/resources/archetype-resources/pom.xml Mon May 13 17:39:08 2013 +0200 +++ b/ko-archetype/src/main/resources/archetype-resources/pom.xml Wed May 15 10:45:23 2013 +0200 @@ -40,6 +40,7 @@ UTF-8 ${project.version} ${bck2brwsr.version} + ${bck2brwsr.launcher.version} MINIMAL \${package.replace('.','/')}/index.html @@ -181,7 +182,7 @@ org.apidesign.bck2brwsr launcher.fx - \${bck2brwsr.version} + \${bck2brwsr.launcher.version} runtime @@ -256,7 +257,7 @@ org.apidesign.bck2brwsr launcher.http - \${bck2brwsr.version} + \${bck2brwsr.launcher.version} test