• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JUnit v Cactus?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone. I was hoping you could help clear up some confusion on my part.

Is Cactus an extension of JUnit? Or is it a different implementation of JUnit, with additional features? I'm having trouble deciding what framework to use.

Also, since I have your attention, can I use JMeter and JUnit together? Everything I find online seems to point back to the 'main' sites... which are confusing to me to beign with.

Thanks so much for your time and help!
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tabitha Scott:
Is Cactus an extension of JUnit? Or is it a different implementation of JUnit, with additional features?


Cactus is a "JUnit extension" meaning that the Cactus API uses and extends the JUnit API.

Originally posted by Tabitha Scott:
I'm having trouble deciding what framework to use.


Test what you can with JUnit. If you're developing a web or EJB application, you might end up with pieces of code that you can't test using JUnit because you need to run the code in a J2EE application server for it to work. That's where you take Cactus into use -- you deploy the code to the server and run your Cactus tests against that server instance.

Originally posted by Tabitha Scott:
Also, since I have your attention, can I use JMeter and JUnit together?


No, you can't. JMeter has its own way of scripting performance test scripts.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tabitha Scott:
Also, since I have your attention, can I use JMeter and JUnit together?


If you want to use JUnit tests to stress/load test your system than I suggest you take a look at The Grinder. Just like JMeter, The Grinder is an OSS load-testing tool. I have used it previously on a few projects and I actually prefer it to JMeter.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another JUnit extension for (rather limited) performance testing is Mike Clark's JUnitPerf.
 
Tabitha Scott
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First off, thank you Chris and Lasse for your responses. I appreciate your time.

After reading and re-reading your responses and my task at hand, I think I may be trying to force JUnit into a project that doesn't need it.

Right now, I have an application where the test case data is embedded in the code. I'm trying to move the test cases into a more felxible framework. I was thinking JUnit should be used. However, the more I think about it, these test cases need to provide data.

Doesn't JUnit just ensure that the code executes properly? The TestResult that one would get from running a JUnit test is either Pass or Fail, correct? So maybe I shouldn't be using JUnit at all?

Any other opinions would be greatly appreciated. I apoligize if my logic is difficult to follow. I'm still new to the world of unit testing.

Thanks again!
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tabitha Scott:
First off, thank you Chris and Lasse for your responses. I appreciate your time.

After reading and re-reading your responses and my task at hand, I think I may be trying to force JUnit into a project that doesn't need it.

Right now, I have an application where the test case data is embedded in the code. I'm trying to move the test cases into a more felxible framework. I was thinking JUnit should be used. However, the more I think about it, these test cases need to provide data.

Doesn't JUnit just ensure that the code executes properly? The TestResult that one would get from running a JUnit test is either Pass or Fail, correct? So maybe I shouldn't be using JUnit at all?

Any other opinions would be greatly appreciated. I apoligize if my logic is difficult to follow. I'm still new to the world of unit testing.

Thanks again!



May be i am wrong, but as far as i remember 'Mock Objects' concept can be used to enable multiple data to be used for your unit testing with the help of JUnit.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tabitha, could you describe what you want to test? Maybe we would then be in a better position to suggest how to do that.
 
Tabitha Scott
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure, I can explain more.

What I'm currently testing are a slew of possible entries in a request. I'm adding information into a request form, and then sending the form to be processed. Based on what information was in the request, the request takes different amounts of time to process.

The results are used to determine response time baselines, and to gauge hardware capacity under significant loads.

The test data (the many different possible entries in the request) are hard coded. This is what I'm trying to make more felxible, so I don't have specific examples and test cases hard coded in my functions.

This is the best explanation I can give. Again, thanks for your help!
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. Sounds like you're doing performance testing, not unit testing, so JMeter (or possibly JUnitPerf, or Grinder) is probably a good pick for the tooling.
 
Tabitha Scott
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds good! Thank you once again for you help. I appreciate your time!

I have previously looked into JUnitPerf, and think it will be inadequate for the amount of testing I have in mind. (From JUnitPerf: "JUnitPerf is not intended to be a full-fledged load testing or performance profiling tool..." )

However, I haven't heard of The Grinder before, so I'll take a look at that.

Again, thank you to everyone who has contributed!
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic