Saturday, November 17, 2012

Basic TDD with Jersey Test Framework

Decided to do TDD on one of  my mobileTAO initiatives. I hope this may also help others who wish to learn TDD with Jersey test framework

1.Requirements

1. JDK 1.6
2. Eclipse Indigo
3. Jersey
4. Jersey Test Framework
5. Maven 3.0.4 (with m2eclipse plugin)

2. Create maven project

run
mvn archetype:generate -DgroupId=desired.group.id -DartifactId=desiredArtifactId -Darchetype.ArtifactId=maven-archetype-webapp -DinteractiveMode=false

run mvn eclipse:eclipse in order to support eclipse

 Import project to eclipse

3. Setting up Dependencies 

Add the jersey dependency to your pom.xml

4. Create the test 

We will now code our unit test. add the source code to src/test/java


5. Create rest service




Usefull Links
http://jersey.java.net/nonav/documentation/latest/getting-started.html
http://www.parleys.com/#st=5&id=2723&sl=0

3 comments:

Unknown said...

cool!!!

Bert Añasco said...

LOL

OMKAR said...

Can you give more info on how we do TDD with some ATDD framework like Cucumber