Java Virtal Machine.net

[ News ] rss

February 01, 2011

Mark Wielaard: New GPG key. Finally created a new GPG key using gnupg. The old one was a DSA/1024 bits one and 8 years old. The new one is a RSA/2048 bits one. I will use the new one in the future to sign any release tarballs I might create. pub 2048R/57816A6A 2011-01-29 Key f...

More »

February 01, 2011

Andrew Hughes: [SECURITY] IcedTea6 1.7.8, 1.8.5, 1.9.5 Released!. We are pleased to announce a new set of security releases, IcedTea6 1.7.8, IcedTea6 1.8.5 and IcedTea6 1.9.5. This update contains the following security updates: The IcedTea project provides a harness to build the source code from OpenJDK6 u...

More »

March/2024
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
242526272829 30
31      

[ Archives News
for 'Java Technology' ]

home > news > java technology > testing jdk 1.4 production code using java 5 tests in maven

Testing JDK 1.4 production code using Java 5 tests in Maven

Java 5 marks a huge step forward in the realm of automated testing. JUnit 4, for example, introduces many powerful new features based on annotations, such as flexible test names and parameterized testing. TestNG has had very cool annotation-based features since its first release. And Selenium 2.0/WebDriver also has some great new features based on annotations that make it much easier to create Page Objects. However there are still those of us who, usually for reasons beyond our control, need to deploy to a Java 1.4-based environment. So are you stuck with prehistoric unit testing tools and prehistoric testing practices? The answer is no - even deploying to an archaic JVM, you can still use these new features for your tests. Curious? Read on! In fact, it's not too difficult, once you know how. The first thing you need to do is to configure the compiler options for each phase, to ensure that your application source code is compiled for Java 1.4, and your test code for Java 1.5. This isn't too hard: you can do it by configuring the maven-compiler-plugin as shown here: ... org.apache.maven.plugins maven-compiler-plugin 2.3.1 java-1.4-compile compile compile 1.4 1.4 java-1.5-compile process-test-sources testCompile ...


Date: August, 02 2010
Url: http://www.java.net/blog/johnsmart/archive/2010/08/02/testing-jdk-14-production-code-using-java-5-test-maven


Others News

©2002-2019Java-Virtual-Machine.net free icons | top free website builder | bootstrap navbar | bootstrap buttons | free bootstrap template