Use special version for the launcher
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 15 May 2013 10:45:23 +0200
changeset 121082300c4f5c54
parent 1209 bf622f485775
child 1211 c4bcb9c2a973
Use special version for the launcher
ko-archetype-test/src/test/java/org/apidesign/html/archetype/test/ArchetypeVersionTest.java
ko-archetype/src/main/resources/archetype-resources/pom.xml
     1.1 --- a/ko-archetype-test/src/test/java/org/apidesign/html/archetype/test/ArchetypeVersionTest.java	Mon May 13 17:39:08 2013 +0200
     1.2 +++ b/ko-archetype-test/src/test/java/org/apidesign/html/archetype/test/ArchetypeVersionTest.java	Wed May 15 10:45:23 2013 +0200
     1.3 @@ -69,6 +69,39 @@
     1.4          assertEquals(arch, version, "net.java.html.json dependency needs to be on latest version");
     1.5      }
     1.6      
     1.7 +    @Test public void testCheckLauncher() throws Exception {
     1.8 +        final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
     1.9 +        URL r = l.getResource("archetype-resources/pom.xml");
    1.10 +        assertNotNull(r, "Archetype pom found");
    1.11 +        
    1.12 +        final XPathFactory fact = XPathFactory.newInstance();
    1.13 +        XPathExpression xp2 = fact.newXPath().compile(
    1.14 +            "//properties/bck2brwsr.launcher.version/text()"
    1.15 +        );
    1.16 +        
    1.17 +        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream());
    1.18 +        String arch = (String) xp2.evaluate(dom, XPathConstants.STRING);
    1.19 +
    1.20 +        
    1.21 +        assertTrue(arch.matches("[0-9\\.]+"), "launcher version seems valid: " + arch);
    1.22 +    }
    1.23 +    
    1.24 +    @Test public void testCheckBck2Brwsr() throws Exception {
    1.25 +        final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
    1.26 +        URL r = l.getResource("archetype-resources/pom.xml");
    1.27 +        assertNotNull(r, "Archetype pom found");
    1.28 +        
    1.29 +        final XPathFactory fact = XPathFactory.newInstance();
    1.30 +        XPathExpression xp2 = fact.newXPath().compile(
    1.31 +            "//properties/bck2brwsr.version/text()"
    1.32 +        );
    1.33 +        
    1.34 +        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream());
    1.35 +        String arch = (String) xp2.evaluate(dom, XPathConstants.STRING);
    1.36 +        
    1.37 +        assertTrue(arch.matches("[0-9\\.]+"), "bck2brwsr version seems valid: " + arch);
    1.38 +    }
    1.39 +    
    1.40      @Test public void testNbActions() throws Exception {
    1.41          final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
    1.42          URL r = l.getResource("archetype-resources/nbactions.xml");
     2.1 --- a/ko-archetype/src/main/resources/archetype-resources/pom.xml	Mon May 13 17:39:08 2013 +0200
     2.2 +++ b/ko-archetype/src/main/resources/archetype-resources/pom.xml	Wed May 15 10:45:23 2013 +0200
     2.3 @@ -40,6 +40,7 @@
     2.4      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     2.5      <net.java.html.version>${project.version}</net.java.html.version>
     2.6      <bck2brwsr.version>${bck2brwsr.version}</bck2brwsr.version>
     2.7 +    <bck2brwsr.launcher.version>${bck2brwsr.launcher.version}</bck2brwsr.launcher.version>
     2.8      <bck2brwsr.obfuscationlevel>MINIMAL</bck2brwsr.obfuscationlevel>
     2.9      <brwsr.startpage>\${package.replace('.','/')}/index.html</brwsr.startpage>
    2.10    </properties>
    2.11 @@ -181,7 +182,7 @@
    2.12                <dependency>
    2.13                    <groupId>org.apidesign.bck2brwsr</groupId>
    2.14                    <artifactId>launcher.fx</artifactId>
    2.15 -                  <version>\${bck2brwsr.version}</version>
    2.16 +                  <version>\${bck2brwsr.launcher.version}</version>
    2.17                    <scope>runtime</scope>
    2.18                </dependency>
    2.19            </dependencies>
    2.20 @@ -256,7 +257,7 @@
    2.21                <dependency>
    2.22                    <groupId>org.apidesign.bck2brwsr</groupId>
    2.23                    <artifactId>launcher.http</artifactId>
    2.24 -                  <version>\${bck2brwsr.version}</version>
    2.25 +                  <version>\${bck2brwsr.launcher.version}</version>
    2.26                    <scope>test</scope>
    2.27                </dependency>
    2.28            </dependencies>