Results 1 to 8 of 8

Thread: Load/Performance test and Spring

  1. #1
    Join Date
    Nov 2004
    Posts
    159

    Default Load/Performance test and Spring

    I'm sure many of you might have used some kind of load/performance tools in your project.

    Our team is evaluating these tools for our Spring/Hibernate based application which is NOT A WEB APPLICATION.

    We have short listed jMeter, Grinder and jUnitPerf. Each has it's own pros and cons.

    Could someone please share your experience? Which tool(s) did you use? I've the following requirements:

    1. command line interface so that i can automate these test as part of my nightly builds.

    2. Graphical output report

    3. JUnit support (Nice to have)

    4. Good statistics in the output report.

    5. To be able to simulate concurrent users.

    6. Stress test my application


    I would greatly appreciate any input on this.

    Thanks in advance!

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    I would probably go for Grinder. It's quite sophisticated, although can be a bit of a pain to set up. We used it successfully on a recent project.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3
    Join Date
    Aug 2004
    Location
    Germany, Magdeburg
    Posts
    279

    Default

    JMeter should meet any of your requirements except point 3 where I am not sure about.

    JMeter is widely used and well understood. But I am not into the topic to give you any advise. I am not the guy for performing the load testing here :-). Check out http://javaboutique.internet.com/tut...r/index-3.html maybe this helps you finding out.

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Grinder 3 can do JUnit, but it takes a little coding in Jython... I can post the required code if you like.

  5. #5
    Join Date
    Nov 2004
    Posts
    159

    Default

    Thanks Ben.

    If you could post the code, that would be great!

  6. #6
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Quote Originally Posted by spring04
    Thanks Ben.

    If you could post the code, that would be great!
    Code:
    #
    # Delegates to jWebUnit integration test
    # 
    #
    
    import string
    import random
    from net.grinder.script.Grinder import grinder
    from net.grinder.script import Test
    from net.grinder.statistics import TestStatistics
    from net.grinder.common import GrinderException
    from some.company.web.tests import SomeJWebUnitIntegrationTests
    from junit.framework import TestResult
    
    log = grinder.logger.output
    out = grinder.logger.TERMINAL
    
    class TestRunner:
        def __call__(self):
            grinder.statistics.delayReports = 1
            myTest = Test(1, "jWebUnit Integration Tests")
            jWebUnitTests = myTest.wrap(SomeJWebUnitIntegrationTests("test"))
            
            jWebUnitTests.setUp()
            jWebUnitTests.testServiceUserSession()
            jWebUnitTests.tearDown()

  7. #7
    Join Date
    Nov 2004
    Posts
    159

    Default

    Thanks Ben.

  8. #8
    Join Date
    Feb 2006
    Posts
    1

    Default Calling JUnit Test Cases from Grinder 3

    Hi,

    you also may find the following Jython code helpful for calling JUnit Test Cases from Grinder 3:

    Code:
    from net.grinder.script.Grinder import grinder
    from net.grinder.script import Test
    from junit.framework import TestSuite
    from junit.framework import TestResult
    
    from mypackage.test import MyJUnitTestCase
    
    class TestRunner:
        def __call__(self):
            # Turn off automatic reporting for the current worker thread. 
            # Having done this, the script can modify or set the statistics 
            # before they are sent to the log and the console. 
            grinder.statistics.delayReports = 1    
        
            # Creates a Test Suite.
            suite = TestSuite(MyJUnitTestCase().getClass());
    
            # Returns the tests as an enumeration.
            tests = suite.tests();
            
            # Iterate over the tests.
            testNumber = 0
            for test in tests:
                testNumber += 1
                testCase = Test(testNumber, test.getName()).wrap(suite)
                
                testResult = TestResult()
                testCase.runTest(test, testResult)
                
                if testResult.errorCount() > 0:
                    grinder.statistics.success = 0
                elif testResult.failureCount() > 0:
                    grinder.statistics.success = 0
    It automatically "registers" all testXXX methods within a TestCase as Tests and displays it in the Grinder console. If the testXXX method fails or an error occurs, this is also reported to the Grinder statistics.

    Wolfgang

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 1
    Last Post: Feb 15th, 2008, 04:36 AM
  3. Spring code remarks
    By Alarmnummer in forum Architecture
    Replies: 18
    Last Post: Apr 7th, 2005, 07:17 AM
  4. Spring: useful for J2EE. not so useful for J2SE?
    By Edward Kenworthy in forum Container
    Replies: 2
    Last Post: Nov 2nd, 2004, 08:46 AM
  5. Replies: 7
    Last Post: Oct 6th, 2004, 02:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •