ko-archetype-test/src/test/java/org/apidesign/html/archetype/test/ArchetypeVersionTest.java
changeset 1210 82300c4f5c54
parent 1202 5f04bdbc6ee1
     1.1 --- a/ko-archetype-test/src/test/java/org/apidesign/html/archetype/test/ArchetypeVersionTest.java	Mon May 13 14:25:37 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");