Project Summary

  Analyzed 2 days ago based on code collected 2 days ago.

Latest Version: 0.9.2-m2

A collection of very simple utilities with the goal of making writing tests easier with less code.

FunctionalTestRunner - JUnit ExtensionAdded in 0.9.2-m1, read about it on the Carbon Five blog: http://blog.carbonfive.com/2009/10/testing/c5-test-support-new-addition-functionaltestrunner

Spring 2.5+ Test ExtensionsDataSetTestExecutionListenerLoads DBUnit test fixtures before test methods flagged with the @DataSet annotation. Participates in an active transactions if available or in auto-commit mode if one is not.

@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
public class TripRepositoryImplTest extends AbstractTransactionalDataSetTestCase
{
@Autowired TripRepository repository;

@Test
@DataSet
public void forIdShouldFindTrip() throws Exception
{
Trip trip = repository.forId(2);
assertThat(trip, not(nullValue()));
}
}The high-level execution path for this example looks like:

Inject dependencies (DependencyInjectionTestExecutionListener) Start transaction (TransactionalTestExecutionListener) Load dbunit data set from TripRepositoryImplTest.xml (DataSetTestExecutionListener) using the setup operation (default is CLEAN_INSERT) Execute test Optionally cleanup dbunit data using the tear down operation (default is NONE) Rollback transaction (TransactionalTestExecutionListener) Here’s the trimmed down log output for this test:

INFO: Began transaction (1): transaction manager; rollback [true] (TransactionalTestExecutionListener.java:259)
INFO: Loading dataset from location 'classpath:/eg/domain/TripRepositoryImplTest.xml' using operation 'CLEAN_INSERT'. (DataSetTestExecutionListener.java:152)
INFO: Tearing down dataset using operation 'NONE', leaving database connection open. (DataSetTestExecutionListener.java:67)
INFO: Rolled back transaction after test execution for test context (TransactionalTestExecutionListener.java:279)See http://blog.carbonfive.com/2008/07/testing/database-testing-with-spring-25-and-dbunit for additional details.

HibernateOpenSessionTestExecutionListenerOpens a Hibernate Session for the duration of a test method so that you can fetch lazy associations and collections. Useful for integration testing.

Data FixturesDBUnitFixture - Load a DBUnit dataset easily. SQLFixture - Load a SQL script easily. EasyMock ExtensionsArgumentAssertion - Make assertions on parameters passed to a mock.

Share

In a Nutshell, c5-test-support...

Languages

Java
84%
XML
15%
SQL
1%
 
 

Lines of Code

 

Activity

30 Day Summary Apr 22 2013 — May 22 2013

12 Month Summary May 22 2012 — May 22 2013

Community

Ratings

Be the first to rate this project
 
Click to add your rating
 
Review this Project!
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.