This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

testing platforms insight - testng, spock, junit  RSS feed

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to decide between using testng (which I am familiar with) junit (which I used to know) and spock  which i know little about.
Based upon my research it appears that you use testng / junit for robust testing with Testng having a few features that Junit lacks (but they are coming closer to testng).
Spock utilizes Groovy for more graphical results, but based upon the architecture at that I'm seeing at my new job doesn't lend itself to Object orientation. Could someone summarize the plus and minus of each one? Oh yeah I'm also unfamiliar with groovy.

So, could someone with familiarity of both spock and at least one of the others tell me how  / when you would use each? What are the strengths and weaknesses of each? How hard / easy would it to build an architecture that can be shared among projects for each?

I'm leaning toward testng, but I like spocks gui reporting. I  know that with testng you can export test results to other applications or databases, i don't know that about spock or how to do it.
 
Sheriff
Posts: 21747
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check JUnit 4 or 5? Because it got a major overhaul with a lot more possibilities.
 
Karina Guenther
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Spoor wrote:Did you check JUnit 4 or 5? Because it got a major overhaul with a lot more possibilities.



That's what I read somewhere that it's closer to testng. I've not really studied it. Does the overhaul make it BETTER than TESTNG? If not then I should stick with what I know or go with Spock.
 
Sheriff
Posts: 13478
222
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure how Groovy/Spock is considered to be not Object-Oriented. Groovy is in fact more object-oriented. The only minus will be that you'll need to learn a somewhat new language/syntax with Spock and Groovy. It's also a JVM language so you can test Java code and you have access to all standard Java library classes.
 
Karina Guenther
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:I'm not sure how Groovy/Spock is considered to be not Object-Oriented. Groovy is in fact more object-oriented. The only minus will be that you'll need to learn a somewhat new language/syntax with Spock and Groovy. It's also a JVM language so you can test Java code and you have access to all standard Java library classes.



Blame my unfamiliarity with how they work and how I see them being used at my new job. Is there a good place to go for how they should work?
 
Junilu Lacar
Sheriff
Posts: 13478
222
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search for Spock Testing and Groovy Language?
 
Junilu Lacar
Sheriff
Posts: 13478
222
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a test I wrote for something that was asked in the beginner forum:


This is actually really cool. Also, I don't work with Groovy that much but it didn't take me that long to write this. The SudokuChecker class is written in Java.
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!