// Path: spring-test-dbunit/src/main/java/com/github/springtestdbunit/annotation/DatabaseOperation.java
// public enum DatabaseOperation {
// 
// 	/**
// 	 * Updates the contents of existing database tables from the dataset.
// 	 */
// 	UPDATE,
// 
// 	/**
// 	 * Inserts new database tables and contents from the dataset.
// 	 */
// 	INSERT,
// 
// 	/**
// 	 * Refresh the contents of existing database tables. Rows from the dataset will insert or replace existing data. Any
// 	 * database rows that are not in the dataset remain unaffected.
// 	 */
// 	REFRESH,
// 
// 	/**
// 	 * Deletes database table rows that matches rows from the dataset.
// 	 */
// 	DELETE,
// 
// 	/**
// 	 * Deletes all rows from a database table when the table is specified in the dataset. Tables in the database but not
// 	 * in the dataset remain unaffected.
// 	 * @see #TRUNCATE_TABLE
// 	 */
// 	DELETE_ALL,
// 
// 	/**
// 	 * Deletes all rows from a database table when the table is specified in the dataset. Tables in the database but not
// 	 * in the dataset are unaffected. Identical to {@link #DELETE_ALL} expect this operation cannot be rolled back and
// 	 * is supported by less database vendors.
// 	 * @see #DELETE_ALL
// 	 */
// 	TRUNCATE_TABLE,
// 
// 	/**
// 	 * Deletes all rows from a database table when the tables is specified in the dataset and subsequently insert new
// 	 * contents. Equivalent to calling {@link #DELETE_ALL} followed by {@link #INSERT}.
// 	 */
// 	CLEAN_INSERT;
// 
// }
// 
// Path: spring-test-dbunit/src/test/java/com/github/springtestdbunit/entity/EntityAssert.java
// public class EntityAssert implements InitializingBean {
// 
// 	@PersistenceContext
// 	private EntityManager entityManager;
// 
// 	private CriteriaQuery<SampleEntity> criteriaQuery;
// 
// 	public void afterPropertiesSet() throws Exception {
// 		CriteriaBuilder cb = this.entityManager.getCriteriaBuilder();
// 		this.criteriaQuery = cb.createQuery(SampleEntity.class);
// 		Root<SampleEntity> from = this.criteriaQuery.from(SampleEntity.class);
// 		this.criteriaQuery.orderBy(cb.asc(from.get("value").as(String.class)));
// 	}
// 
// 	public void assertValues(String... values) {
// 		SortedSet<String> expected = new TreeSet<String>(Arrays.asList(values));
// 		SortedSet<String> actual = new TreeSet<String>();
// 		TypedQuery<SampleEntity> query = this.entityManager.createQuery(this.criteriaQuery);
// 		List<SampleEntity> results = query.getResultList();
// 		for (SampleEntity sampleEntity : results) {
// 			actual.add(sampleEntity.getValue());
// 			this.entityManager.detach(sampleEntity);
// 		}
// 		assertEquals(expected, actual);
// 	}
// 
// }
// 
// Path: spring-test-dbunit/src/test/java/com/github/springtestdbunit/testutils/AfterTearDownDbUnitTestExecutionListener.java
// public class AfterTearDownDbUnitTestExecutionListener extends TestExecutionListenerChain {
// 
// 	private static final Class<?> CHAIN[] = { TransactionalTestExecutionListener.class,
// 			CallAfterTestMethodExecutionListener.class, DbUnitTestExecutionListener.class };
// 
// 	@Override
// 	protected Class<?>[] getChain() {
// 		return CHAIN;
// 	}
// 
// }


import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.transaction.annotation.Transactional;
import com.github.springtestdbunit.annotation.DatabaseOperation;
import com.github.springtestdbunit.annotation.DatabaseTearDown;
import com.github.springtestdbunit.entity.EntityAssert;
import com.github.springtestdbunit.testutils.AfterTearDownDbUnitTestExecutionListener;
/*
 * Copyright 2002-2016 the original author or authors
 *
 * 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 com.github.springtestdbunit.teardown;



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/META-INF/dbunit-context.xml")
@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class,
		AfterTearDownDbUnitTestExecutionListener.class })
@DatabaseTearDown(type = DatabaseOperation.CLEAN_INSERT, value = { "/META-INF/db/insert.xml",
		"/META-INF/db/insert2.xml" })
@Transactional
public class MultipleInsertTearDownOnClassTest {

	@Autowired
	private EntityAssert entityAssert;

// Path: spring-test-dbunit/src/main/java/com/github/springtestdbunit/annotation/DatabaseOperation.java
// public enum DatabaseOperation {
// 
// 	/**
// 	 * Updates the contents of existing database tables from the dataset.
// 	 */
// 	UPDATE,
// 
// 	/**
// 	 * Inserts new database tables and contents from the dataset.
// 	 */
// 	INSERT,
// 
// 	/**
// 	 * Refresh the contents of existing database tables. Rows from the dataset will insert or replace existing data. Any
// 	 * database rows that are not in the dataset remain unaffected.
// 	 */
// 	REFRESH,
// 
// 	/**
// 	 * Deletes database table rows that matches rows from the dataset.
// 	 */
// 	DELETE,
// 
// 	/**
// 	 * Deletes all rows from a database table when the table is specified in the dataset. Tables in the database but not
// 	 * in the dataset remain unaffected.
// 	 * @see #TRUNCATE_TABLE
// 	 */
// 	DELETE_ALL,
// 
// 	/**
// 	 * Deletes all rows from a database table when the table is specified in the dataset. Tables in the database but not
// 	 * in the dataset are unaffected. Identical to {@link #DELETE_ALL} expect this operation cannot be rolled back and
// 	 * is supported by less database vendors.
// 	 * @see #DELETE_ALL
// 	 */
// 	TRUNCATE_TABLE,
// 
// 	/**
// 	 * Deletes all rows from a database table when the tables is specified in the dataset and subsequently insert new
// 	 * contents. Equivalent to calling {@link #DELETE_ALL} followed by {@link #INSERT}.
// 	 */
// 	CLEAN_INSERT;
// 
// }
// 
// Path: spring-test-dbunit/src/test/java/com/github/springtestdbunit/entity/EntityAssert.java
// public class EntityAssert implements InitializingBean {
// 
// 	@PersistenceContext
// 	private EntityManager entityManager;
// 
// 	private CriteriaQuery<SampleEntity> criteriaQuery;
// 
// 	public void afterPropertiesSet() throws Exception {
// 		CriteriaBuilder cb = this.entityManager.getCriteriaBuilder();
// 		this.criteriaQuery = cb.createQuery(SampleEntity.class);
// 		Root<SampleEntity> from = this.criteriaQuery.from(SampleEntity.class);
// 		this.criteriaQuery.orderBy(cb.asc(from.get("value").as(String.class)));
// 	}
// 
// 	public void assertValues(String... values) {
// 		SortedSet<String> expected = new TreeSet<String>(Arrays.asList(values));
// 		SortedSet<String> actual = new TreeSet<String>();
// 		TypedQuery<SampleEntity> query = this.entityManager.createQuery(this.criteriaQuery);
// 		List<SampleEntity> results = query.getResultList();
// 		for (SampleEntity sampleEntity : results) {
// 			actual.add(sampleEntity.getValue());
// 			this.entityManager.detach(sampleEntity);
// 		}
// 		assertEquals(expected, actual);
// 	}
// 
// }
// 
// Path: spring-test-dbunit/src/test/java/com/github/springtestdbunit/testutils/AfterTearDownDbUnitTestExecutionListener.java
// public class AfterTearDownDbUnitTestExecutionListener extends TestExecutionListenerChain {
// 
// 	private static final Class<?> CHAIN[] = { TransactionalTestExecutionListener.class,
// 			CallAfterTestMethodExecutionListener.class, DbUnitTestExecutionListener.class };
// 
// 	@Override
// 	protected Class<?>[] getChain() {
// 		return CHAIN;
// 	}
// 
// }


// Path: spring-test-dbunit/src/test/java/com/github/springtestdbunit/teardown/MultipleInsertTearDownOnClassTest.java
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
import org.springframework.transaction.annotation.Transactional;
import com.github.springtestdbunit.annotation.DatabaseOperation;
import com.github.springtestdbunit.annotation.DatabaseTearDown;
import com.github.springtestdbunit.entity.EntityAssert;
import com.github.springtestdbunit.testutils.AfterTearDownDbUnitTestExecutionListener;

/*
 * Copyright 2002-2016 the original author or authors
 *
 * 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 com.github.springtestdbunit.teardown;



@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/META-INF/dbunit-context.xml")
@TestExecutionListeners({ DependencyInjectionTestExecutionListener.class,
		AfterTearDownDbUnitTestExecutionListener.class })
@DatabaseTearDown(type = DatabaseOperation.CLEAN_INSERT, value = { "/META-INF/db/insert.xml",
		"/META-INF/db/insert2.xml" })
@Transactional
public class MultipleInsertTearDownOnClassTest {

	@Autowired
	private EntityAssert entityAssert;

	@Test