it.openutils.testing.junit.AbstractDbUnitJunitSpringContextTests Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openutils-testing-junit Show documentation
Show all versions of openutils-testing-junit Show documentation
Framework that helps to simplify unit testing coding with JUnit
/*
* Copyright Openmind http://www.openmindonline.it
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package it.openutils.testing.junit;
import it.openutils.testing.DbUnitTestContext;
import org.junit.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
/**
* @author fgiust
* @version $Id: AbstractDbUnitJunitSpringContextTests.java 925 2008-11-10 15:26:41Z fgiust $
*/
public class AbstractDbUnitJunitSpringContextTests extends AbstractJUnit4SpringContextTests
{
/**
* Slf4j logger that can be reused in subclasses.
*/
protected Logger log = LoggerFactory.getLogger(getClass());
/**
* DBUnit text context.
*/
protected DbUnitTestContext dbUnitTestContext;
/**
* Setup the Database before running the test method.
* @throws Exception Any exception.
*/
@Before
public void setUpDbUnit() throws Exception
{
dbUnitTestContext = new DbUnitTestContext(this, applicationContext);
dbUnitTestContext.setUpDbUnit();
}
}