The Apache Commons Codec could help you to generate the MD5 of a file with just one command. Download the lib @ Download Commons Codec. If you want to use Maven, include the following dependency in the pom.xml. Continue reading
Finally i could find some time to release this Maven H2O which i did when i was working in CECID in 2009-2010. It is under GNU General Public License (GPL v2). I fixed some dependencies problem and i found that the Maven repository has changed since i left CECID. It is now ready in GitHub.
Thanks Ronnie who gave me the chance to learn Maven and apply it on the H2O project. Also give thanks to other teammates – Philip, Steve, Patrick, Franz, Jumbo. I missed the time working with you guys in the CECID H2O team.
Apache Commons IO provides the StringUtils Class for checking empty string in Java.
Add the Apache Commons Lang in the pom.xml. Continue reading
I follow the Struts 2 tutorial and setup a simple Struts 2 application.
Create Struts 2 Web Application Using Maven To Manage Artifacts and To Build The Application
I used the struts2-core version 2.2.1 and also added a maven-jetty-plugin for running the web application. But when i run mvn jetty:run, the following error is found.
java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!
It is found that in struts2-core version 2.2.1, the Javassist dependency was excluded in OGNL. So i have to add this dependency in the pom.xml by myself.
So here comes to the project details. Continue reading
I have the following shell script to start the Jetty Server in my portable web application in Windows.
start java -DSTOP.PORT=8080 -DSTOP.KEY=stop_jetty -jar start.jar EXIT
Normally, the maven-jetty-plugin should be configured in the pom of your Maven webapp project/module. But the project i am working is a legacy Java project with many modules and the webapp module depends on others. so i cannot simply start it due to the build sequence.
What i am going to do is to add an new Maven module for integration test of the Maven webapp module and it would be build in the last module such that all other modules are ready.
If you want to know how to run Selenium in a Maven webapp project, you can refer to the following post.
Selenium – Integrate the Selenium Tests into Maven Build
If you are a Tapestry user, the pom.xml in the above article may not work as the webapp cannot be started in the Embedded Jetty (404 Not Found). I am not sure the reason behind but i find a work around to solve the problem. The tricky thing is in the Embedded Jetty configuration in the cargo2-maven-plugin.
In this article, i will show you how to integrate the Selenium tests into a Maven webapp project using the selenium-maven-plugin and cargo-maven2-plugin.
In this example, i used JUnit as the testing framework. There is no problem if you use TestNG to replace JUnit. This example is a simple Java webapp Maven project which only shows a simple html page (index.jsp). During the build, a Selenium Server is started with the webapp deployed in the Embedded Jetty. It then runs an Unit Test (Selenium Test) during the Maven integration-test life cycle. Here comes to the code.
Selenium is a suite of tool to automate web application testing. Unlike the unit testing in backend application, it is hard to test user interface in frontend application. Thanks Selenium, it makes frontend testing much easier and fun.
Selenium are 3 sets of tools.
- Selenium IDE – A Firefox plugin to record and convert user actions into different programming language (Selenium tests)
After creating all the entity beans in the backend project. it’s time to move on to the frontend stuff. First, we need to decide what Java frontend framework is used in our project. so i take the chance to learn Tapestry.
With Maven, we can make use of the Archetype as a project template to start our first Tapestry project. This post shows u how to make start your first Tapestry project in Eclipse with m2eclipse installed.