Announcement Announcement Module
Collapse
No announcement yet.
JUnitPerf integration in Spring-JUnit classes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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>

    Comment

    Working...
    X