Don't run the archetype test during package phase, wait for install one
authorJaroslav Tulach <jaroslav.tulach@netbeans.org>
Tue, 21 Jan 2014 11:21:23 +0100
changeset 478d135f0263960
parent 477 460881c12fdd
child 480 929fe7cc911b
Don't run the archetype test during package phase, wait for install one
ko-archetype-test/pom.xml
ko-archetype-test/src/test/java/org/netbeans/html/archetype/test/ArchetypeVersionIT.java
ko-archetype-test/src/test/java/org/netbeans/html/archetype/test/ArchetypeVersionTest.java
ko-archetype-test/src/test/java/org/netbeans/html/archetype/test/VerifyArchetypeIT.java
ko-archetype-test/src/test/java/org/netbeans/html/archetype/test/VerifyArchetypeTest.java
     1.1 --- a/ko-archetype-test/pom.xml	Tue Jan 21 09:05:02 2014 +0100
     1.2 +++ b/ko-archetype-test/pom.xml	Tue Jan 21 11:21:23 2014 +0100
     1.3 @@ -15,6 +15,22 @@
     1.4      <properties>
     1.5          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     1.6      </properties>
     1.7 +    <build>
     1.8 +        <plugins>
     1.9 +            <plugin>
    1.10 +                <artifactId>maven-failsafe-plugin</artifactId>
    1.11 +                <version>2.16</version>
    1.12 +                <executions>
    1.13 +                    <execution>
    1.14 +                        <goals>
    1.15 +                            <goal>integration-test</goal>
    1.16 +                            <goal>verify</goal>
    1.17 +                        </goals>
    1.18 +                    </execution>
    1.19 +                </executions>
    1.20 +            </plugin>
    1.21 +        </plugins>
    1.22 +    </build>
    1.23      <dependencies>
    1.24          <dependency>
    1.25              <groupId>org.apidesign.html</groupId>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/ko-archetype-test/src/test/java/org/netbeans/html/archetype/test/ArchetypeVersionIT.java	Tue Jan 21 11:21:23 2014 +0100
     2.3 @@ -0,0 +1,128 @@
     2.4 +/**
     2.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     2.6 + *
     2.7 + * Copyright 2013-2013 Oracle and/or its affiliates. All rights reserved.
     2.8 + *
     2.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    2.10 + * Other names may be trademarks of their respective owners.
    2.11 + *
    2.12 + * The contents of this file are subject to the terms of either the GNU
    2.13 + * General Public License Version 2 only ("GPL") or the Common
    2.14 + * Development and Distribution License("CDDL") (collectively, the
    2.15 + * "License"). You may not use this file except in compliance with the
    2.16 + * License. You can obtain a copy of the License at
    2.17 + * http://www.netbeans.org/cddl-gplv2.html
    2.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    2.19 + * specific language governing permissions and limitations under the
    2.20 + * License.  When distributing the software, include this License Header
    2.21 + * Notice in each file and include the License file at
    2.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    2.23 + * particular file as subject to the "Classpath" exception as provided
    2.24 + * by Oracle in the GPL Version 2 section of the License file that
    2.25 + * accompanied this code. If applicable, add the following below the
    2.26 + * License Header, with the fields enclosed by brackets [] replaced by
    2.27 + * your own identifying information:
    2.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    2.29 + *
    2.30 + * Contributor(s):
    2.31 + *
    2.32 + * The Original Software is NetBeans. The Initial Developer of the Original
    2.33 + * Software is Oracle. Portions Copyright 2013-2013 Oracle. All Rights Reserved.
    2.34 + *
    2.35 + * If you wish your version of this file to be governed by only the CDDL
    2.36 + * or only the GPL Version 2, indicate your decision by adding
    2.37 + * "[Contributor] elects to include this software in this distribution
    2.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    2.39 + * single choice of license, a recipient has the option to distribute
    2.40 + * your version of this file under either the CDDL, the GPL Version 2 or
    2.41 + * to extend the choice of license to its licensees as provided above.
    2.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    2.43 + * Version 2 license, then the option applies only if the new code is
    2.44 + * made subject to such option by the copyright holder.
    2.45 + */
    2.46 +package org.netbeans.html.archetype.test;
    2.47 +
    2.48 +import java.io.IOException;
    2.49 +import java.net.URL;
    2.50 +import javax.xml.XMLConstants;
    2.51 +import javax.xml.parsers.DocumentBuilderFactory;
    2.52 +import javax.xml.parsers.ParserConfigurationException;
    2.53 +import javax.xml.xpath.XPathConstants;
    2.54 +import javax.xml.xpath.XPathExpression;
    2.55 +import javax.xml.xpath.XPathExpressionException;
    2.56 +import javax.xml.xpath.XPathFactory;
    2.57 +import javax.xml.xpath.XPathFactoryConfigurationException;
    2.58 +import org.testng.annotations.Test;
    2.59 +import static org.testng.Assert.*;
    2.60 +import org.testng.annotations.BeforeClass;
    2.61 +import org.w3c.dom.Document;
    2.62 +import org.w3c.dom.NodeList;
    2.63 +import org.xml.sax.SAXException;
    2.64 +
    2.65 +/**
    2.66 + *
    2.67 + * @author Jaroslav Tulach <jtulach@netbeans.org>
    2.68 + */
    2.69 +public class ArchetypeVersionIT {
    2.70 +    private String version;
    2.71 +    
    2.72 +    public ArchetypeVersionIT() {
    2.73 +    }
    2.74 +    
    2.75 +    @BeforeClass public void readCurrentVersion() throws Exception {
    2.76 +        version = findCurrentVersion();
    2.77 +        assertFalse(version.isEmpty(), "There should be some version string");
    2.78 +    }
    2.79 +    
    2.80 +
    2.81 +    @Test public void testComparePomDepsVersions() throws Exception {
    2.82 +        final ClassLoader l = ArchetypeVersionIT.class.getClassLoader();
    2.83 +        URL r = l.getResource("archetype-resources/pom.xml");
    2.84 +        assertNotNull(r, "Archetype pom found");
    2.85 +        
    2.86 +        final XPathFactory fact = XPathFactory.newInstance();
    2.87 +        XPathExpression xp2 = fact.newXPath().compile(
    2.88 +            "//properties/net.java.html.version/text()"
    2.89 +        );
    2.90 +        
    2.91 +        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream());
    2.92 +        String arch = (String) xp2.evaluate(dom, XPathConstants.STRING);
    2.93 +
    2.94 +        assertEquals(arch, version, "net.java.html.json dependency needs to be on latest version");
    2.95 +    }
    2.96 +    
    2.97 +    @Test public void testNbActions() throws Exception {
    2.98 +        final ClassLoader l = ArchetypeVersionIT.class.getClassLoader();
    2.99 +        URL r = l.getResource("archetype-resources/nbactions.xml");
   2.100 +        assertNotNull(r, "Archetype nb file found");
   2.101 +        
   2.102 +        final XPathFactory fact = XPathFactory.newInstance();
   2.103 +        XPathExpression xp2 = fact.newXPath().compile(
   2.104 +            "//goal/text()"
   2.105 +        );
   2.106 +        
   2.107 +        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream());
   2.108 +        NodeList goals = (NodeList) xp2.evaluate(dom, XPathConstants.NODESET);
   2.109 +        
   2.110 +        for (int i = 0; i < goals.getLength(); i++) {
   2.111 +            String s = goals.item(i).getTextContent();
   2.112 +            if (s.contains("netbeans")) {
   2.113 +                assertFalse(s.matches(".*netbeans.*[0-9].*"), "No numbers: " + s);
   2.114 +            }
   2.115 +        }
   2.116 +    }
   2.117 +
   2.118 +    static String findCurrentVersion() throws XPathExpressionException, IOException, ParserConfigurationException, SAXException, XPathFactoryConfigurationException {
   2.119 +        final ClassLoader l = ArchetypeVersionIT.class.getClassLoader();
   2.120 +        URL u = l.getResource("META-INF/maven/org.apidesign.html/knockout4j-archetype/pom.xml");
   2.121 +        assertNotNull(u, "Own pom found: " + System.getProperty("java.class.path"));
   2.122 +
   2.123 +        final XPathFactory fact = XPathFactory.newInstance();
   2.124 +        fact.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
   2.125 +
   2.126 +        XPathExpression xp = fact.newXPath().compile("project/version/text()");
   2.127 +        
   2.128 +        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(u.openStream());
   2.129 +        return xp.evaluate(dom);
   2.130 +    }
   2.131 +}
     3.1 --- a/ko-archetype-test/src/test/java/org/netbeans/html/archetype/test/ArchetypeVersionTest.java	Tue Jan 21 09:05:02 2014 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,128 +0,0 @@
     3.4 -/**
     3.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     3.6 - *
     3.7 - * Copyright 2013-2013 Oracle and/or its affiliates. All rights reserved.
     3.8 - *
     3.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    3.10 - * Other names may be trademarks of their respective owners.
    3.11 - *
    3.12 - * The contents of this file are subject to the terms of either the GNU
    3.13 - * General Public License Version 2 only ("GPL") or the Common
    3.14 - * Development and Distribution License("CDDL") (collectively, the
    3.15 - * "License"). You may not use this file except in compliance with the
    3.16 - * License. You can obtain a copy of the License at
    3.17 - * http://www.netbeans.org/cddl-gplv2.html
    3.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    3.19 - * specific language governing permissions and limitations under the
    3.20 - * License.  When distributing the software, include this License Header
    3.21 - * Notice in each file and include the License file at
    3.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    3.23 - * particular file as subject to the "Classpath" exception as provided
    3.24 - * by Oracle in the GPL Version 2 section of the License file that
    3.25 - * accompanied this code. If applicable, add the following below the
    3.26 - * License Header, with the fields enclosed by brackets [] replaced by
    3.27 - * your own identifying information:
    3.28 - * "Portions Copyrighted [year] [name of copyright owner]"
    3.29 - *
    3.30 - * Contributor(s):
    3.31 - *
    3.32 - * The Original Software is NetBeans. The Initial Developer of the Original
    3.33 - * Software is Oracle. Portions Copyright 2013-2013 Oracle. All Rights Reserved.
    3.34 - *
    3.35 - * If you wish your version of this file to be governed by only the CDDL
    3.36 - * or only the GPL Version 2, indicate your decision by adding
    3.37 - * "[Contributor] elects to include this software in this distribution
    3.38 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    3.39 - * single choice of license, a recipient has the option to distribute
    3.40 - * your version of this file under either the CDDL, the GPL Version 2 or
    3.41 - * to extend the choice of license to its licensees as provided above.
    3.42 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    3.43 - * Version 2 license, then the option applies only if the new code is
    3.44 - * made subject to such option by the copyright holder.
    3.45 - */
    3.46 -package org.netbeans.html.archetype.test;
    3.47 -
    3.48 -import java.io.IOException;
    3.49 -import java.net.URL;
    3.50 -import javax.xml.XMLConstants;
    3.51 -import javax.xml.parsers.DocumentBuilderFactory;
    3.52 -import javax.xml.parsers.ParserConfigurationException;
    3.53 -import javax.xml.xpath.XPathConstants;
    3.54 -import javax.xml.xpath.XPathExpression;
    3.55 -import javax.xml.xpath.XPathExpressionException;
    3.56 -import javax.xml.xpath.XPathFactory;
    3.57 -import javax.xml.xpath.XPathFactoryConfigurationException;
    3.58 -import org.testng.annotations.Test;
    3.59 -import static org.testng.Assert.*;
    3.60 -import org.testng.annotations.BeforeClass;
    3.61 -import org.w3c.dom.Document;
    3.62 -import org.w3c.dom.NodeList;
    3.63 -import org.xml.sax.SAXException;
    3.64 -
    3.65 -/**
    3.66 - *
    3.67 - * @author Jaroslav Tulach <jtulach@netbeans.org>
    3.68 - */
    3.69 -public class ArchetypeVersionTest {
    3.70 -    private String version;
    3.71 -    
    3.72 -    public ArchetypeVersionTest() {
    3.73 -    }
    3.74 -    
    3.75 -    @BeforeClass public void readCurrentVersion() throws Exception {
    3.76 -        version = findCurrentVersion();
    3.77 -        assertFalse(version.isEmpty(), "There should be some version string");
    3.78 -    }
    3.79 -    
    3.80 -
    3.81 -    @Test public void testComparePomDepsVersions() throws Exception {
    3.82 -        final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
    3.83 -        URL r = l.getResource("archetype-resources/pom.xml");
    3.84 -        assertNotNull(r, "Archetype pom found");
    3.85 -        
    3.86 -        final XPathFactory fact = XPathFactory.newInstance();
    3.87 -        XPathExpression xp2 = fact.newXPath().compile(
    3.88 -            "//properties/net.java.html.version/text()"
    3.89 -        );
    3.90 -        
    3.91 -        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream());
    3.92 -        String arch = (String) xp2.evaluate(dom, XPathConstants.STRING);
    3.93 -
    3.94 -        assertEquals(arch, version, "net.java.html.json dependency needs to be on latest version");
    3.95 -    }
    3.96 -    
    3.97 -    @Test public void testNbActions() throws Exception {
    3.98 -        final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
    3.99 -        URL r = l.getResource("archetype-resources/nbactions.xml");
   3.100 -        assertNotNull(r, "Archetype nb file found");
   3.101 -        
   3.102 -        final XPathFactory fact = XPathFactory.newInstance();
   3.103 -        XPathExpression xp2 = fact.newXPath().compile(
   3.104 -            "//goal/text()"
   3.105 -        );
   3.106 -        
   3.107 -        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream());
   3.108 -        NodeList goals = (NodeList) xp2.evaluate(dom, XPathConstants.NODESET);
   3.109 -        
   3.110 -        for (int i = 0; i < goals.getLength(); i++) {
   3.111 -            String s = goals.item(i).getTextContent();
   3.112 -            if (s.contains("netbeans")) {
   3.113 -                assertFalse(s.matches(".*netbeans.*[0-9].*"), "No numbers: " + s);
   3.114 -            }
   3.115 -        }
   3.116 -    }
   3.117 -
   3.118 -    static String findCurrentVersion() throws XPathExpressionException, IOException, ParserConfigurationException, SAXException, XPathFactoryConfigurationException {
   3.119 -        final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
   3.120 -        URL u = l.getResource("META-INF/maven/org.apidesign.html/knockout4j-archetype/pom.xml");
   3.121 -        assertNotNull(u, "Own pom found: " + System.getProperty("java.class.path"));
   3.122 -
   3.123 -        final XPathFactory fact = XPathFactory.newInstance();
   3.124 -        fact.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
   3.125 -
   3.126 -        XPathExpression xp = fact.newXPath().compile("project/version/text()");
   3.127 -        
   3.128 -        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(u.openStream());
   3.129 -        return xp.evaluate(dom);
   3.130 -    }
   3.131 -}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/ko-archetype-test/src/test/java/org/netbeans/html/archetype/test/VerifyArchetypeIT.java	Tue Jan 21 11:21:23 2014 +0100
     4.3 @@ -0,0 +1,99 @@
     4.4 +/**
     4.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4.6 + *
     4.7 + * Copyright 2013-2013 Oracle and/or its affiliates. All rights reserved.
     4.8 + *
     4.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    4.10 + * Other names may be trademarks of their respective owners.
    4.11 + *
    4.12 + * The contents of this file are subject to the terms of either the GNU
    4.13 + * General Public License Version 2 only ("GPL") or the Common
    4.14 + * Development and Distribution License("CDDL") (collectively, the
    4.15 + * "License"). You may not use this file except in compliance with the
    4.16 + * License. You can obtain a copy of the License at
    4.17 + * http://www.netbeans.org/cddl-gplv2.html
    4.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    4.19 + * specific language governing permissions and limitations under the
    4.20 + * License.  When distributing the software, include this License Header
    4.21 + * Notice in each file and include the License file at
    4.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    4.23 + * particular file as subject to the "Classpath" exception as provided
    4.24 + * by Oracle in the GPL Version 2 section of the License file that
    4.25 + * accompanied this code. If applicable, add the following below the
    4.26 + * License Header, with the fields enclosed by brackets [] replaced by
    4.27 + * your own identifying information:
    4.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    4.29 + *
    4.30 + * Contributor(s):
    4.31 + *
    4.32 + * The Original Software is NetBeans. The Initial Developer of the Original
    4.33 + * Software is Oracle. Portions Copyright 2013-2013 Oracle. All Rights Reserved.
    4.34 + *
    4.35 + * If you wish your version of this file to be governed by only the CDDL
    4.36 + * or only the GPL Version 2, indicate your decision by adding
    4.37 + * "[Contributor] elects to include this software in this distribution
    4.38 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    4.39 + * single choice of license, a recipient has the option to distribute
    4.40 + * your version of this file under either the CDDL, the GPL Version 2 or
    4.41 + * to extend the choice of license to its licensees as provided above.
    4.42 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    4.43 + * Version 2 license, then the option applies only if the new code is
    4.44 + * made subject to such option by the copyright holder.
    4.45 + */
    4.46 +package org.netbeans.html.archetype.test;
    4.47 +
    4.48 +import java.io.File;
    4.49 +import java.util.Properties;
    4.50 +import org.apache.maven.it.Verifier;
    4.51 +import org.testng.annotations.Test;
    4.52 +import static org.testng.Assert.*;
    4.53 +
    4.54 +/**
    4.55 + *
    4.56 + * @author Jaroslav Tulach <jtulach@netbeans.org>
    4.57 + */
    4.58 +public class VerifyArchetypeIT {
    4.59 +    @Test public void projectCompiles() throws Exception {
    4.60 +        final File dir = new File("target/tests/fxcompile/").getAbsoluteFile();
    4.61 +        generateFromArchetype(dir);
    4.62 +        
    4.63 +        File created = new File(dir, "o-a-test");
    4.64 +        assertTrue(created.isDirectory(), "Project created");
    4.65 +        assertTrue(new File(created, "pom.xml").isFile(), "Pom file is in there");
    4.66 +        
    4.67 +        Verifier v = new Verifier(created.getAbsolutePath());
    4.68 +        v.executeGoal("verify");
    4.69 +        
    4.70 +        v.verifyErrorFreeLog();
    4.71 +        
    4.72 +        for (String l : v.loadFile(v.getBasedir(), v.getLogFileName(), false)) {
    4.73 +            if (l.contains("j2js")) {
    4.74 +                fail("No pre-compilaton:\n" + l);
    4.75 +            }
    4.76 +        }
    4.77 +        
    4.78 +        v.verifyTextInLog("fxcompile/o-a-test/target/o-a-test-1.0-SNAPSHOT-html.java.net.zip");
    4.79 +    }
    4.80 +    
    4.81 +    private Verifier generateFromArchetype(final File dir, String... params) throws Exception {
    4.82 +        Verifier v = new Verifier(dir.getAbsolutePath());
    4.83 +        v.setAutoclean(false);
    4.84 +        v.setLogFileName("generate.log");
    4.85 +        v.deleteDirectory("");
    4.86 +        dir.mkdirs();
    4.87 +        Properties sysProp = v.getSystemProperties();
    4.88 +        sysProp.put("groupId", "org.someuser.test");
    4.89 +        sysProp.put("artifactId", "o-a-test");
    4.90 +        sysProp.put("package", "org.someuser.test.oat");
    4.91 +        sysProp.put("archetypeGroupId", "org.apidesign.html");
    4.92 +        sysProp.put("archetypeArtifactId", "knockout4j-archetype");
    4.93 +        sysProp.put("archetypeVersion", ArchetypeVersionIT.findCurrentVersion());
    4.94 +        
    4.95 +        for (String p : params) {
    4.96 +            v.addCliOption(p);
    4.97 +        }
    4.98 +        v.executeGoal("archetype:generate");
    4.99 +        v.verifyErrorFreeLog();
   4.100 +        return v;
   4.101 +    }
   4.102 +}
     5.1 --- a/ko-archetype-test/src/test/java/org/netbeans/html/archetype/test/VerifyArchetypeTest.java	Tue Jan 21 09:05:02 2014 +0100
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,99 +0,0 @@
     5.4 -/**
     5.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     5.6 - *
     5.7 - * Copyright 2013-2013 Oracle and/or its affiliates. All rights reserved.
     5.8 - *
     5.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    5.10 - * Other names may be trademarks of their respective owners.
    5.11 - *
    5.12 - * The contents of this file are subject to the terms of either the GNU
    5.13 - * General Public License Version 2 only ("GPL") or the Common
    5.14 - * Development and Distribution License("CDDL") (collectively, the
    5.15 - * "License"). You may not use this file except in compliance with the
    5.16 - * License. You can obtain a copy of the License at
    5.17 - * http://www.netbeans.org/cddl-gplv2.html
    5.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    5.19 - * specific language governing permissions and limitations under the
    5.20 - * License.  When distributing the software, include this License Header
    5.21 - * Notice in each file and include the License file at
    5.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    5.23 - * particular file as subject to the "Classpath" exception as provided
    5.24 - * by Oracle in the GPL Version 2 section of the License file that
    5.25 - * accompanied this code. If applicable, add the following below the
    5.26 - * License Header, with the fields enclosed by brackets [] replaced by
    5.27 - * your own identifying information:
    5.28 - * "Portions Copyrighted [year] [name of copyright owner]"
    5.29 - *
    5.30 - * Contributor(s):
    5.31 - *
    5.32 - * The Original Software is NetBeans. The Initial Developer of the Original
    5.33 - * Software is Oracle. Portions Copyright 2013-2013 Oracle. All Rights Reserved.
    5.34 - *
    5.35 - * If you wish your version of this file to be governed by only the CDDL
    5.36 - * or only the GPL Version 2, indicate your decision by adding
    5.37 - * "[Contributor] elects to include this software in this distribution
    5.38 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    5.39 - * single choice of license, a recipient has the option to distribute
    5.40 - * your version of this file under either the CDDL, the GPL Version 2 or
    5.41 - * to extend the choice of license to its licensees as provided above.
    5.42 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    5.43 - * Version 2 license, then the option applies only if the new code is
    5.44 - * made subject to such option by the copyright holder.
    5.45 - */
    5.46 -package org.netbeans.html.archetype.test;
    5.47 -
    5.48 -import java.io.File;
    5.49 -import java.util.Properties;
    5.50 -import org.apache.maven.it.Verifier;
    5.51 -import org.testng.annotations.Test;
    5.52 -import static org.testng.Assert.*;
    5.53 -
    5.54 -/**
    5.55 - *
    5.56 - * @author Jaroslav Tulach <jtulach@netbeans.org>
    5.57 - */
    5.58 -public class VerifyArchetypeTest {
    5.59 -    @Test public void projectCompiles() throws Exception {
    5.60 -        final File dir = new File("target/tests/fxcompile/").getAbsoluteFile();
    5.61 -        generateFromArchetype(dir);
    5.62 -        
    5.63 -        File created = new File(dir, "o-a-test");
    5.64 -        assertTrue(created.isDirectory(), "Project created");
    5.65 -        assertTrue(new File(created, "pom.xml").isFile(), "Pom file is in there");
    5.66 -        
    5.67 -        Verifier v = new Verifier(created.getAbsolutePath());
    5.68 -        v.executeGoal("verify");
    5.69 -        
    5.70 -        v.verifyErrorFreeLog();
    5.71 -        
    5.72 -        for (String l : v.loadFile(v.getBasedir(), v.getLogFileName(), false)) {
    5.73 -            if (l.contains("j2js")) {
    5.74 -                fail("No pre-compilaton:\n" + l);
    5.75 -            }
    5.76 -        }
    5.77 -        
    5.78 -        v.verifyTextInLog("fxcompile/o-a-test/target/o-a-test-1.0-SNAPSHOT-html.java.net.zip");
    5.79 -    }
    5.80 -    
    5.81 -    private Verifier generateFromArchetype(final File dir, String... params) throws Exception {
    5.82 -        Verifier v = new Verifier(dir.getAbsolutePath());
    5.83 -        v.setAutoclean(false);
    5.84 -        v.setLogFileName("generate.log");
    5.85 -        v.deleteDirectory("");
    5.86 -        dir.mkdirs();
    5.87 -        Properties sysProp = v.getSystemProperties();
    5.88 -        sysProp.put("groupId", "org.someuser.test");
    5.89 -        sysProp.put("artifactId", "o-a-test");
    5.90 -        sysProp.put("package", "org.someuser.test.oat");
    5.91 -        sysProp.put("archetypeGroupId", "org.apidesign.html");
    5.92 -        sysProp.put("archetypeArtifactId", "knockout4j-archetype");
    5.93 -        sysProp.put("archetypeVersion", ArchetypeVersionTest.findCurrentVersion());
    5.94 -        
    5.95 -        for (String p : params) {
    5.96 -            v.addCliOption(p);
    5.97 -        }
    5.98 -        v.executeGoal("archetype:generate");
    5.99 -        v.verifyErrorFreeLog();
   5.100 -        return v;
   5.101 -    }
   5.102 -}