Blog Archives

Integration Testing with DB Unit

First checkout DB Unit: DbUnit is a JUnit extension targeted at database-driven projects that, among other things, puts your database into a known state between test runs. … DbUnit has the ability to export and import your database data

Tagged with: , , ,
Posted in Database, JUnit, Testing

Testing with SpringJUnit4ClassRunner

Testing with SpringJUnit4ClassRunner is breeze. First add annotations: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { “/appContext.xml” }) public class SimpleDaoTest{ … } Place resources on classpath: src/main/test/resources Add dependencies: <dependency>     <groupId>org.springframework</groupId>     <artifactId>spring-test</artifactId>     <version>${springframework.version}</version>     <scope>test</scope> </dependency> Annotate test class: @Autowired

Tagged with: , ,
Posted in JUnit, Spring, Testing

VisualVM with firewall

Helpfull article which explains how to get JVisualVM running on a Linux system with a firewall: The trick was to setup a Listener in Tomcat’s server.xml : <!– JMX  –>   <Listener className=”org.apache.catalina.mbeans.JmxRemoteLifecycleListener”     rmiRegistryPortPlatform=”8000″ rmiServerPortPlatform=”8001″ /> The rmiRegistryPortPlatform

Posted in Java, Performance, Testing

Load testing with Jmeter

Found these 2 useful articles that explain how to Load test a Spring WebFlow application with Jmeter: Article #1: – June 2007, still useful but unfortunately the images are no longer hosted 😦 Article #2: – 2010 Note:

Tagged with:
Posted in Performance, Spring, Spring WebFlow, Testing


1) Head over to 2) Install Selenium IDE (Firefox) 3) Download the Selenium Server & IE Driver Server 4) Download the Web Driver bindings for Java  <dependency>     <groupId>org.seleniumhq.selenium</groupId>     <artifactId>selenium-parent</artifactId>     <version>2.36.0</version> </dependency> References

Posted in Selenium, Testing

Unit Testing

Mockito is a mocking Framework <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>${mockito.version}</version> <scope>test</scope> </dependency> It allows us to easily mock objects: mock(MyService.class) //using mock static method or @Mock +  MockitoAnnotations.initMocks(this); We can specify the desired behavior of the mocks using Mockito’s fluent APIs:

Tagged with: , ,
Posted in JUnit, Mockito, Testing