Verify nbactions.xml have the right version. Update everything to 0.5-SNAPSHOT.
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 08 Mar 2013 00:42:02 +0100
changeset 8231e9d34a337f2
parent 822 76064c9092a5
child 824 97fdbed30f8b
Verify nbactions.xml have the right version. Update everything to 0.5-SNAPSHOT.
rt/mojo/src/main/resources/archetype-resources/nbactions.xml
rt/mojo/src/main/resources/archetype-resources/pom.xml
rt/mojo/src/test/java/org/apidesign/bck2brwsr/mojo/ArchetypeVersionTest.java
     1.1 --- a/rt/mojo/src/main/resources/archetype-resources/nbactions.xml	Fri Mar 08 00:41:04 2013 +0100
     1.2 +++ b/rt/mojo/src/main/resources/archetype-resources/nbactions.xml	Fri Mar 08 00:42:02 2013 +0100
     1.3 @@ -4,7 +4,7 @@
     1.4          <actionName>run</actionName>
     1.5          <goals>
     1.6              <goal>process-classes</goal>
     1.7 -            <goal>org.apidesign.bck2brwsr:mojo:0.3-SNAPSHOT:brwsr</goal>
     1.8 +            <goal>org.apidesign.bck2brwsr:mojo:0.5-SNAPSHOT:brwsr</goal>
     1.9          </goals>
    1.10      </action>
    1.11  </actions>
     2.1 --- a/rt/mojo/src/main/resources/archetype-resources/pom.xml	Fri Mar 08 00:41:04 2013 +0100
     2.2 +++ b/rt/mojo/src/main/resources/archetype-resources/pom.xml	Fri Mar 08 00:42:02 2013 +0100
     2.3 @@ -14,7 +14,7 @@
     2.4        <repository>
     2.5            <id>java.net</id>
     2.6            <name>Java.net</name>
     2.7 -          <url>https://maven.java.net/content/repositories/snapshots/</url>
     2.8 +          <url>https://maven.java.net/content/repositories/releases/</url>
     2.9            <snapshots>
    2.10                <enabled>true</enabled>
    2.11            </snapshots>
    2.12 @@ -28,8 +28,8 @@
    2.13    <pluginRepositories>
    2.14        <pluginRepository>
    2.15            <id>java.net</id>
    2.16 -          <name>Local Maven repository of releases</name>
    2.17 -          <url>https://maven.java.net/content/repositories/snapshots/</url>
    2.18 +          <name>Java.net</name>
    2.19 +          <url>https://maven.java.net/content/repositories/releases/</url>
    2.20            <snapshots>
    2.21                <enabled>true</enabled>
    2.22            </snapshots>
    2.23 @@ -44,7 +44,7 @@
    2.24              <plugin>
    2.25                  <groupId>org.apidesign.bck2brwsr</groupId>
    2.26                  <artifactId>mojo</artifactId>
    2.27 -                <version>0.4-SNAPSHOT</version>
    2.28 +                <version>0.5-SNAPSHOT</version>
    2.29                  <executions>
    2.30                      <execution>
    2.31                          <goals>
    2.32 @@ -103,13 +103,13 @@
    2.33      <dependency>
    2.34        <groupId>org.apidesign.bck2brwsr</groupId>
    2.35        <artifactId>emul</artifactId>
    2.36 -      <version>0.4-SNAPSHOT</version>
    2.37 +      <version>0.5-SNAPSHOT</version>
    2.38        <classifier>rt</classifier>
    2.39      </dependency>
    2.40      <dependency>
    2.41        <groupId>org.apidesign.bck2brwsr</groupId>
    2.42        <artifactId>javaquery.api</artifactId>
    2.43 -      <version>0.4-SNAPSHOT</version>
    2.44 +      <version>0.5-SNAPSHOT</version>
    2.45      </dependency>
    2.46      <dependency>
    2.47        <groupId>org.testng</groupId>
    2.48 @@ -122,13 +122,13 @@
    2.49        <artifactId>vm4brwsr</artifactId>
    2.50        <classifier>js</classifier>
    2.51        <type>zip</type>
    2.52 -      <version>0.4-SNAPSHOT</version>
    2.53 +      <version>0.5-SNAPSHOT</version>
    2.54        <scope>provided</scope>
    2.55      </dependency>
    2.56      <dependency>
    2.57        <groupId>org.apidesign.bck2brwsr</groupId>
    2.58        <artifactId>vmtest</artifactId>
    2.59 -      <version>0.4-SNAPSHOT</version>
    2.60 +      <version>0.5-SNAPSHOT</version>
    2.61        <scope>test</scope>
    2.62      </dependency>
    2.63    </dependencies>
     3.1 --- a/rt/mojo/src/test/java/org/apidesign/bck2brwsr/mojo/ArchetypeVersionTest.java	Fri Mar 08 00:41:04 2013 +0100
     3.2 +++ b/rt/mojo/src/test/java/org/apidesign/bck2brwsr/mojo/ArchetypeVersionTest.java	Fri Mar 08 00:42:02 2013 +0100
     3.3 @@ -26,6 +26,7 @@
     3.4  import org.testng.annotations.Test;
     3.5  import org.xml.sax.InputSource;
     3.6  import static org.testng.Assert.*;
     3.7 +import org.testng.annotations.BeforeClass;
     3.8  import org.w3c.dom.Document;
     3.9  import org.w3c.dom.NodeList;
    3.10  
    3.11 @@ -34,26 +35,32 @@
    3.12   * @author Jaroslav Tulach <jtulach@netbeans.org>
    3.13   */
    3.14  public class ArchetypeVersionTest {
    3.15 +    private String version;
    3.16      
    3.17      public ArchetypeVersionTest() {
    3.18      }
    3.19 -
    3.20 -    @Test public void testCompareOwnAndArchtetypeVersion() throws Exception {
    3.21 +    
    3.22 +    @BeforeClass public void readCurrentVersion() throws Exception {
    3.23          final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
    3.24          URL u = l.getResource("META-INF/maven/org.apidesign.bck2brwsr/mojo/plugin-help.xml");
    3.25          assertNotNull(u, "Own pom found");
    3.26 -        
    3.27 +
    3.28          final XPathFactory fact = XPathFactory.newInstance();
    3.29          fact.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
    3.30 -        
    3.31 +
    3.32          XPathExpression xp = fact.newXPath().compile("plugin/version/text()");
    3.33 -        String version = xp.evaluate(new InputSource(u.openStream()));
    3.34 -        
    3.35 +        version = xp.evaluate(new InputSource(u.openStream()));
    3.36 +
    3.37          assertFalse(version.isEmpty(), "There should be some version string");
    3.38 -        
    3.39 +    }
    3.40 +    
    3.41 +
    3.42 +    @Test public void testComparePomDepsVersions() throws Exception {
    3.43 +        final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
    3.44          URL r = l.getResource("archetype-resources/pom.xml");
    3.45          assertNotNull(r, "Archetype pom found");
    3.46          
    3.47 +        final XPathFactory fact = XPathFactory.newInstance();
    3.48          XPathExpression xp2 = fact.newXPath().compile(
    3.49              "//version[../groupId/text() = 'org.apidesign.bck2brwsr']/text()"
    3.50          );
    3.51 @@ -69,4 +76,27 @@
    3.52              assertEquals(arch.item(i).getTextContent(), version, i + "th dependency needs to be on latest version of bck2brwsr");
    3.53          }
    3.54      }
    3.55 +    
    3.56 +    @Test public void testNbActions() throws Exception {
    3.57 +        final ClassLoader l = ArchetypeVersionTest.class.getClassLoader();
    3.58 +        URL r = l.getResource("archetype-resources/nbactions.xml");
    3.59 +        assertNotNull(r, "Archetype nb file found");
    3.60 +        
    3.61 +        final XPathFactory fact = XPathFactory.newInstance();
    3.62 +        XPathExpression xp2 = fact.newXPath().compile(
    3.63 +            "//goal/text()"
    3.64 +        );
    3.65 +        
    3.66 +        Document dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(r.openStream());
    3.67 +        NodeList goals = (NodeList) xp2.evaluate(dom, XPathConstants.NODESET);
    3.68 +        
    3.69 +        for (int i = 0; i < goals.getLength(); i++) {
    3.70 +            String s = goals.item(i).getTextContent();
    3.71 +            if (s.contains("bck2brwsr")) {
    3.72 +                String[] arr = s.split(":");
    3.73 +                assertEquals(arr.length, 4, "Three :");
    3.74 +                assertEquals(arr[2], version, "Proper version is used");
    3.75 +            }
    3.76 +        }
    3.77 +    }
    3.78  }