Results 1 to 2 of 2

Thread: JUnitPerf integration in Spring-JUnit classes

  1. #1
    Join Date
    Oct 2008
    Posts
    5

    Default JUnitPerf integration in Spring-JUnit classes

    Hi,

    I am using Spring 2.5 and Junit 4.4 version in my application.

    My JUnit classes are integrated with Spring using SpringJUnit4ClassRunner.class.

    I don’t ‘ve any reference to TestCase or Test Suite in my code. My classes are extending org.springframework.test.jpa.AbstractJpaTests. I am using @Test annotation to identify the methods to be executed while running the test.

    I am trying to implement JUnitPerf as a decorator to JUnit test cases. Usually JUnit classes are added to TestCase and passed as parameter to LoadTest or TimedTest constructors. Now, I don’t have JUnit classes extending TestCase. How do I implement the LoadTest and TimedTest for such junit classes?

    It would be great if you could send me some reference code.

    Skeleton of my code is given below:

    public class DocumentFacadeImplTest extends BaseJUnitTest
    {
    @Test
    public void testUpdateDocumentTemplate()
    {
    . . . .
    }

    @RunWith(SpringJUnit4ClassRunner.class)
    @TestExecutionListeners({DependencyInjectionTestEx ecutionListener.class})
    @ContextConfiguration(locations={"/config/common/applicationContext-common.xml})
    public abstract class BaseJUnitTest extends AbstractJpaTests {
    . . . . .
    }

    I would like to load test testUpdateDocumentTemplate() method of DocumentFacadeImplTest.class.

  2. #2

    Default

    Hi ArumugamD,
    Were you able to get JunitPerf working with Spring? I couldn't, so I wrote custom logic to get this working and it became a framework of it's own( unfortunately it still uses Junit3 ). This new framework allows annotated performance tests and Spring autowiring in the tests. The ReadMe is here - https://github.com/vandanagopal/juni...ster/README.md.
    It can also now be downloaded as a Maven dependency -
    <dependency>
    <groupId>com.github.vandanagopal</groupId>
    <artifactId>junit-load-perf</artifactId>
    <version>1.0</version>
    </dependency>

Tags for this Thread

Posting Permissions

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