I have googled a lot and there are several options,
Arquillian
JUnitEE
Cactus
Does anyone have experience with one of these (or other frameworks)? Do they depend on JUnit only or does TestNG work as well? Please give me your suggestions. Thanks.
I haven't had direct experience with any of them, but after some reading, it seems that Arquillian is the newest one, it has an experienced company backing it, and it has a lot of hype surrounding it. Criteria that I have enumerated don't necessarily say Arquillian is quality wise the best out there, since that would be a pretty subjective argument. I'd say it's worth checking out.
JUnitEE's last release was about 6 years ago, and from what I've read, Cactus is a bit complicated and "heavyweight". If I were to use one of Java EE unit testing frameworks you've listed, I'd try Arquillian first.
Related
Ive heard bits and pieces about Seam and Weld in Java 7, and am trying to figure out how they relate to Spring. Any pointers to good references appreciated.
Spring might some day become obsolete for new projects. Still, in the last X years almost every Java EE project was done with atleast a bit of Spring technology (in my experience), so there is a lot of software out there running Spring ( I am currently on a project which uses Spring 2 ) and that isn't going to change in the near future. Corporation don't change a running system just because the new Y technology is out. (As all the COBOL software laying around painfully demonstrates)
So to directly awnser your question, I believe that Spring knowledge will remain a must for many years to come.
No. As others have said Spring is more than DI and is established.
The reality is there are three entities competing (and in some cases working together) for more users/developers.
VMware aka Springsource
Redhat aka JBoss, Seam and Weld
Oracle aka Glassfish
I would like to believe that each one of these companies doesn't have an agenda but the reality is they do and they want you to use their technology. You'll often see developers (employees) of each project vehemently trash the other project. Avoid this and make your own opinion by trying each.
Spring is much more than dependency injection, although DI is at its core and many people receive no more of it.
I worked with both Seam and Spring and found a surprising number of things possible in one, but not the other. They do not cover entirely the same area. Where they do, they are both viable alternatives. Spring is actively maintained. I cannot see it die anytime soon. That was the answer to your question heading.
To address the body of your question: Sorry. I’d be interested in a succinct but in-depth comparison as well.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Although I have programmed with Java for roughly 3 years + now (not day-to-day but at least I understand the fundamentals), haven't really come into the field of Unit Testing...
My work is now more Testing / Problem Analysis oriented, so I reckon a good Java Unit Testing Framework will be quite helpful to this role.
Obviously there is no formal rule of which framework to go with in my Team. So just wondering, as a beginner, which framework is a good one to get started quickly?
Junit?
TestNG?
or something else?
Edit: it seems JUnit has more printed books as references compared to TestNG on Amazon. But I don't know their popularity / trend in Java Industry as for now.
I'm the creator of TestNG and author of the "Next Generation Testing" book, so here are a few (obviously biased) thoughts.
For functional (or end to end / integration / system, whatever term you prefer) testing, TestNG offers a few features that JUnit doesn't have and that users have found very useful:
Groups. Once you have compiled your tests, you can just ask TestNG to run all the "front-end" tests, or "fast", "slow", "database", etc...
Support for multithreaded testing. This has two different meanings:
1) You can tell TestNG to run all your tests concurrently in thread pools that you define (one line change in an XML file). This is very configurable so that tests that are not multithreaded can still be run in single threads.
2) You can tell TestNG to invoke your test methods n times from p threads. This gives you a good idea of how thread safe the code you are testing is.
Test dependencies and deterministic ordering. This is very useful for integration testing where it's very common to see test methods that need prior test methods to succeed before they can even run. TestNG is very popular in the Selenium community for this specific reason ("don't bother testing this page of my web site if the login test failed").
Another immediate advantage of test dependencies is that TestNG can tell you "1 method failed, 99 methods skipped", which is a much more accurate result than "100 methods failed".
TestNG has many, many more features and I'm happy to answer questions here or on our mailing-list (http://groups.google.com/group/testng-users ).
I would learn TestNG with Unitils. Covered all my needs all the time. Add XMLUnit and DBUnit and you should be settled for a long time.
To be perfectly honest I JUnit is way more popular than TestNG, at least here where I work and live. I know this might be a strange argument, but if I were you I'd scan through some job adds and see which framework does the industry in your area/country favour (for example I'm going for JUnit because of that, I mean sure I could learn TestNG, it might turn out to be better, but what good would it do to me if all the employers require JUnit knowledge?).
Although it may seem to be a petty criterion, all things being equals, it looks like job trends heavily favour JUnit.
http://www.indeed.com/jobtrends?q=TestNG%2C+JUnit&l=
Both do their jobs equally well, so there is no right or wrong. You can use both in combination with numerous frameworks to help support your development.
If you need to work for a client, you can learn the one that you are expected to use. If not, the best idea is to try them both out and find out what works best for you.
I've used both and found that for unit testing only jUnit works very well, but in terms of System testing I would recommend TestNG. TestNG offers a few extra features (like parametric testing) and is highly flexible. For example, in jUnit one test failing in a suite usually means you have to re-run your entire suite, but in TestNG you can simply rerun the test that failed. Heres a really good article outlining both (its a bit biased towards TestNG though)
http://www.ibm.com/developerworks/java/library/j-cq08296/index.html
JUnit is very well supported in many IDE's including Eclipse, and JUnit 4 with annotations is quite nice to work with.
Unless you have specific needs then go for tool support, i.e. jUnit.
TestNG with Unitils is really great. It covers almost all the requirements. Unitils support lot of assertion utils, Spring, Hibernate, mocking frameworks, dbutils etc.
To me, it is just a matter of taste. I've personnaly used jUnit daily for more than 5 years now and I'm very happy with it, especially with the last version and its #Rule feature that prevents my team from writting the same code over and over.
It integrates well with all the tools I use daily : IDE, build, continuous intégration...
Junit is famous and best unit test tools, I think you and me both know Junit is so important so that Java developer changes their coding pattern as junit contribution, You can learn some Junit as basic unit test technology as well as learn testng as second unit test technology.
The following link maybe be useful for you!
http://www.javarmi.com/2010/08/junit-4-tutorial-and-example-get-starting/
Junit is the best place to start. Junit 4.x has many rich features like annotations etc as well its get good support from popular frameworks like Spring.
I would go for JUnit.
Using Getting back up to speed on Java after 8-10 years as a starting point...
Along with updating myself with the core JDK6 features, would knowing the different components of JBoss be enough of a refresher?
Though I have about six+ years of Java development experience, it's been about five years since I've done professional Java coding.
I used to do a fair bit of work with WebLogic, but as noted earlier it's been five years...
The best "refresher" I've always found when working with a technology I haven't used in a while is to actually try to do some sort of project with it. Reading is great, but actually building something useful is even better.
I'd start by doing the following:
Download a recent version of JBoss from here.
Study the documentation, found here, chapter 12 has a lot of good info for actual application development.
Try building a simple web application using servlets, JSP's and session beans.
As far as whether "knowing the different components of JBoss be enough of a refresher to make you marketable", that depends on who's hiring. If they are looking for someone who already knows these technologies well and can hit the ground running, then probably not. But if you can find a company that judges you based on your attitude/aptitude and willingness to learn, then you may have a shot.
It's always better to have experience, but if someone is driven to learn then they'll almost always overtake the experienced person who does nothing to keep learning and keep their skills sharp. The hard part is finding a company that hires on that basis, because sadly, it's often not the case.
Good luck!
Greetings, everyone. I consider myself to be an intermediate developer, but, to be candid, probably closer to novice than expert. In any case, I have more experience with C# and the .NET platform, but my current job has me working almost exclusively with Java. This in itself is sort of a problem, but I'm dealing with it fine and I'm not really in a position to change my role at the moment.
On the side, I am starting to work on a highly interactive, database-driven web project. I'm doing it because I feel that it's a great idea and I know that the experience of doing something like this from scratch will help me immensely.
I initially wanted to go with ASP.NET MVC and I am still leaning that direction. I'm not even sure why, but I love the community behind it and, in my opinion, Visual Studio is the best IDE around. However, doing that would be counter-productive to my current job. That brought me to Grails. Even though I realize that Groovy is not Java, it seems to be similar enough (not to mention that it runs on the JVM) that the skills I learn should still help me at my current job. The more I looked into Grails, the more I loved it, especially after having to deal with what I consider to be an extremely complex J2EE environment at work.
But with the good I found the bad. I can't help but notice that there are a lot of developers who are irritated with the amount of bugs in Grails. Being that I am starting a new project and I am fairly inexperienced, do I even want to consider Grails? Is it a liability? And what's the consensus about its longevity? I would really hate to get too involved if there is a good chance of it fading into obscurity within the next few years. And even if the bugs and longevity issues aren't a huge deal, how would you compare the ease of development of Grails with that of ASP.NET MVC? I realize this last part is highly subjective. But for the sake of comparison, let's say that someone with virtually no technical background were in the same position. Would you recommend they take a look at ASP.NET MVC or Grails?
Thanks so much. If anything needs clarified or reworded, please let me know. I sincerely hope I'm not opening a can of worms...
I am the author of this question and I can give you some shares on my own experience.
As it is stated in the question, I had no real preferences and I was opened to any technology/platform that could fulfill my requirements. After many tries of different technologies (at leats few days with PHP, Rails, ASP and Grails) and some answers from StackOverflow, I ended up with the same dilemma as yours : Grails or ASP.NET MVC ?
And I chose Grails. Why? Because of GORM. Almost only because of GORM. This is fantastic to deal only with your domain classes and have your DB schema automatically generated/updated. Of course, it has its limits but this is so powerful for querying and maintening your DB. You do not write SQL anymore and it is very easy to learn.
Now here is my 2-cents comparison of the 2 technologies:
GRAILS STRENGTHS
GORM (see above)
Complete Web Stack Framework : you can generate a website in minutes and everything is already configured
A lot to learn : You have Spring MVC, Hibernate, Sitemesh, Java, JEE, Groovy...Once you have mastered Grails you can add an additional page into your resume
Java world. Whatever you need, if it already exist in Java, you can use it.
Groovy : I really like this programming language. It takes time to get familiar but once done, you will love it.
GRAILS WEAKNESSES
Memory usage. Grails/groovy is greedy for memory and it might cost more than ASP for Web Hosting
Grails bugs : there are some and when you start a new project on a new technology, you assume that most of the problems come from you...until you find out (after 1 or 2 days) that it is a Grails bug. So my advice is to proceed by steps : test as soon as possible and don't try to twist the framework. It is rough on the edge so go after what is generally recommended. However, after 2 months, I do not encounter big problems anymore.
Debugging : due to the multiple layers of frameworks, errors are generally hidden inside tons of exception lines. Also, the only decent IDE debugger is IntelliJ but this is not as easy to debug as .NET under VS
ASP.NET MVC STRENGTHS
The community : it's HUGE ! First it is supported by Microsoft and secondly 30% of the websites out there are built in ASP.NET. You can find any snippets of code, any widgets, any AJAX components, any CMS...Grails community is very active but can you rival against millions ?
Visual Studio : I definitely agree with you : there is no better IDE. IntelliJ is very good for Grails but having using both, I prefered VS
ASP.NET MVC WEAKNESSES
The youthness of ASP.NET : this is a young framework. Built on a stable technology but young enough (less than 2 years) to have also some bugs/some bad practices. Indeed, the next version of ASP.NET MVC is strongly awaited by the community.
Microsoft : even if ASP.NET MVC is open-source, you are totally dependent on their decisions (and prices).
The Bottom Line
If you project has tight deadline and if it is crucial for you to succeed, then go for ASP (according to your background). Otherwise, give a try to Grails..don't worry, you will also succeed but it will take more time. I am also deeply convinced that Grails has just started its long journey and it has a great future (see google trends)
Update by Dmitriy: If your refer to Google Trends you have to compare the 2 of them Groovy Grails and ASP.NET MVC.
Good luck
This is something that's been pretty much asked before here...
http://74.125.155.132/search?q=cache:BpGj8RtSUIsJ:stackoverflow.com/questions/1283935/what-technology-asp-php-joomla-rails-grails-for-a-website-from-scratch+Which+technology+to+choose+%28ASP.net+or+Grails%29&cd=1&hl=en&ct=clnk&gl=us&client=firefox-a
Good Luck though!
I'm using JBoss Seam Framework, but it's seems to me isn't very popular among java developers.
I want to know how many java programmers here are using it, and in what kind of projects.
Is as good as django, or RoR?
In our JBoss Seam in Action presentation at the Javapolis conference last year, my colleague and I said that 'Seam is the next Struts'. This needed some explanation, which I later wrote-up as Seam is the new Struts. Needless to say, we like Seam.
One indication of Seam's popularity is the level of traffic on the Seam Users Forum.
I have used JBoss Seam now for about a year and like it very much over Spring. Unfortunately, I don't use this at work, more for side projects and personal projects. For me, it saves me a lot of time developing new projects for clients. And, one big reason I use it primarily is, the tight integration with each layer and I never get any lazy load errors that I used to get with Spring (even after the filter and other hacks).
An equivalent Spring application would have much more boilerplate code within it to get stuff working. Spring does not integrate each layer very well, it more or less is a wrapper for a lot of different things, but doesn't glue itself together very well.
The other nice thing I like with Seam is they practice what they preach. Take a look at their website. Take a guess what it is running, hmm, a live example of their code. Seam Wiki, Seam Forums, etc. If you truly believe in your code, stand behind it. I would be happy to have their pager 24x7x365, I bet it rarely goes off.
While you write a lot less code, the learning curve is about twice as steep. The further I get in, the more I understand how to write good code. I would like to see more comments, but as far as coding style, it is well written.
On the negative side, just as any product you try to market, Seam was years after Spring had already become popular so Spring is by far still more popular. Search on Indeed and Seam only has a few hits. If you look on Spring, there are roughly 40k registered users, while Seam has about 7k.
Depends on what is important to you, as a Java developer/engineer/programmer, you should be able to work with both technologies and chances are, you will most likely encounter a Spring application before a Seam one. Learn both and how to leverage both. If you use both properly and know the nuances and quirks of each, development becomes much easier whether you're using Spring or Seam.
I don't agree with the statement, "Seam is the next Struts". Struts was a view technology whereas Seam integrates all layers. I will agree that it is a new concept like Struts and will bring the same impact to the Java community that Struts did. I don't think we'll see that until Java EE 6 and CDI become more popular, and of course Seam 3 is released.
Walter
Seam is fixed JSF based on annotations. No more crappy XML. I used it at work.
Hope this helps a little, but at my college our web applications course just got revamped. So now we are going the jsp, servlet, hibernate route with the second part of the course on mostly JBoss Seam. So who knows, it probably just needs time to grow in the community.
It really works for us....JSF+EJB3.0 with the help of seam framework is really fantastic.But i have a question...why this is not becoming more popular for developing large scale application.I have seen that many are using other frameworks for developing large scale j2ee application.It seems to me that seam really helps the developers to build a j2ee application...but still ...why this but coming in?
I like Seam, have been using it for the past year professionally.
However, the question concerns its popularity. I can see the following indications that it is not very popular (at least in comparison to plain JSF or Spring):
Its forum is very inactive (at least at this point, they are working hard on Seam 3). http://seamframework.org/Community/SeamCommunityForumSlightlyInactive
You can also take a look at its comparison with Spring in Google insights for search: http://www.google.com/insights/search/?hl=en-US#cat=732&q=seam%2Cspring&cmpt=q
I only know one other company here in Athens where they use it, and I know a handful of companies that use plain JSF, Struts or Spring (of course, Athens is not representative for all the world).
I would say that seam is a rather popular framework, it has great documentation, a great and helpful community and a forum with many many questions and problems answered.
It should be popular among developers who use jsf beacuse it works great with jsf, but not only that... it fixes jsf in many ways (s:convertEntity tag, and unified component model are my favourite examples).
We have been using Seam for a while in huge projects.
Easy to kick-off a new project, reverse engineering is very handy.
I have used JBoss Seam on two commercial projects for two different clients. Yet JBoss Seam is still a new approach to developing JSF Web Applications. One measure is the results from a Indeed Job Search.
Indeed Job Search
When Java was introduced in the 90s as oak the community did not embrace it because it was too powerful for its time and was appreciated later on and is now running the show. Seam will get popular soon. if not it can be rebranded just as oak to java.
I have been using Seam from Seam 1.2 since 2007 in mid-size and large projects, sometimes in small projects no more than 200 users. My main concern is the productivity. Although my team has already gained obvious productivity from Spring since 2005, for some tricky clients developers have to code javascripts which is time consuming and error-prone. Seam was really helpful in this scenario because at that time most developers in my team had no experience with JSF. Happy to see Seam being more popular.
Seam has been discontinued in 2012. However, Apache DeltaSpike is the modern version of Seam, and this project is actively maintained, and it even won the 2014 Duke's Choice Award.