<< Previous | Home

Why did I move my blog

Some people might be wondering why I moved my blog? Well, the tricky part about blogging, JUG visits or presentations is making sure people understand what and what is not official.

Since joining Oracle as an employee sometimes people have a tendency to think that I am an official spokesperson and/or a fulltime evangelist. Far from it, I am an engineer tasked with the responsbility of maintaining and furthering Mojarra and Ozark. Both very rewarding to work on. When I do blog, visit JUGs or do presentations I do it to meet all of you. Will I be the perfect presenter? Far from it! After all my job is being an engineer!

Do I welcome feedback? Sure, leave a comment here, or email me directly. Note giving feedback Indirectly will always be ignored.

So to make it 100% clear my blog is my own and presents my personal view points.

Enjoy!

 

And we have moved

And we have moved!

Testing with a specific JSF version on Glassfish using HtmlUnit and Maven

In the previous article we described how to do testing with multiple containers. But since joining the Glassfish team I have wondered how can I test applications against different versions of JSF on Glassfish?

As it turns out it is actually quite straightforward. This blog entry shows you how to do it. It will allow you to test using a 2.1.2 version and up. All by using properties passed in on the command line.

Download the attachment at the end of the article and follow along. We are going the use the maven-dependency-plugin to copy the javax.faces.jar into the Glassfish installation we are using for testing.

  <plugin>                 
    <groupid>org.apache.maven.plugins</groupid>
    <artifactid>maven-dependency-plugin</artifactid>
    <version>2.4</version>
    <executions>
      <execution>
        <id>copy</id>                        
        <phase>package</phase>
        <goals>
          <goal>copy</goal>
        </goals>
        <configuration>
          <artifactitems>
            <artifactitem>
              <groupid>${jsf.groupId}</groupid>
      <artifactid>${jsf.artifactId</artifactId>
              <version>${jsf.version}</version>
              <type>jar</type>
              <overwrite>true</overwrite>                                    
              <outputdirectory>${integration.container.installDir}/glassfish-${glassfish.version}/glassfish3/glassfish/modules</outputdirectory>
              <destfilename>javax.faces.jar</destfilename>
            </artificatitem>
          </artificatitems>
          <overwritereleases>true</overwritereleases>
          <overwritesnapshots>true</overwritesnapshots>
        </configuration>
      </execution>
     <executions>
   </plugin>

The above mentioned plugin copies the javax.faces.jar file into the Glassfish modules directory during the package phase. This is well before the integration phase so we are sure we have the JSF runtime we want to use.

By using -Djsf.version=2.1.6 on the commandline you would test against Mojarra version 2.1.6. Note that the POM file also requires you to pass in the Glassfish version you are using. This is a little quirk in how Cargo installs the container. So a complete command line could look very similar to the one below.

  mvn -Dintegration.skip=false -Dintegration.container.skip=false 
  -Dintegration.container.downloadUrl=http://dlc.sun.com.edgesuite.net/glassfish/3.1.2/promoted/glassfish-3.1.2-b15.zip
  -Dintegration.container.installDir=/tmp/cargo/install/glassfish3.1.2
  -Dintegration.container.runtimeDir=/tmp/cargo/runtime/glassfish3.1.2
  -Dintegration.container.type=existing -Dglassfish.version=3.1.2-b15
  -Djsf.version=2.1.6 clean verify

I hope you liked this article! Let me know what you think, or if you have any suggestions about other content, or if you just want to drop me a note, feel free to do so :)