// Path: deltaspike-dbunit/src/main/java/com/github/deltaspikedbunit/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 match 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} except 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 table is specified in the dataset and subsequently insert new
// 	 * contents. Equivalent to calling {@link #DELETE_ALL} followed by {@link #INSERT}.
// 	 */
// 	CLEAN_INSERT
// 
// }
// 
// Path: deltaspike-dbunit-sample/src/main/java/com/github/deltaspikedbunit/sample/inventory/entity/InventoryCategory.java
// @Entity
// @Table(name = "inventory_category")
// public class InventoryCategory {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.AUTO)
//     private int id;
//     @Version
//     @Column(name = "version")
//     private int version;
//     @Column(name = "category_name", nullable = false, unique = true)
//     private String categoryName;
//     @Column(name = "category_description")
//     private String categoryDescription;
//     @OneToMany(cascade = CascadeType.ALL, mappedBy = "category")
//     private Set<InventoryItem> items = new HashSet<>();
// 
// 
//     public InventoryCategory() {
//     }
// 
//     public InventoryCategory(String categoryName, String categoryDescription) {
//         this.categoryName = categoryName;
//         this.categoryDescription = categoryDescription;
//     }
// 
// 
//     public String getCategoryName() {
//         return categoryName;
//     }
//     public void setCategoryName(String name) {
//         this.categoryName = name;
//     }
// 
//     public String getCategoryDescription() {
//         return categoryDescription;
//     }
//     public void setCategoryDescription(String description) {
//         this.categoryDescription = description;
//     }
// 
//     int getVersion() {
//         return version;
//     }
//     void setVersion(int version) {
//         this.version = version;
//     }
// 
//     public int getId() {
//         return id;
//     }
//     void setId(int id) {
//         this.id = id;
//     }
// 
//     public Set<InventoryItem> getItems() {
//         return items;
//     }
//     void setItems(Set<InventoryItem> items) {
//         this.items = items;
//     }
// 
//     public void addItem(InventoryItem item) {
//         if (item != null) {
//             this.items.add(item);
//             item.setCategory(this);
//         }
//     }
// 
//     public void addItems(InventoryItem... items) {
//         if (items != null) {
//             for (InventoryItem ii : items) {
//                 addItem(ii);
//             }
//         }
//     }
// 
// }
// 
// Path: deltaspike-dbunit-sample/src/main/java/com/github/deltaspikedbunit/sample/inventory/repository/InventoryCategoryRepository.java
// @Repository
// public abstract class InventoryCategoryRepository extends AbstractEntityRepository<InventoryCategory, Integer> {
// 
//     @Query(value = "select ic from InventoryCategory ic where ic.categoryName = :categoryName", 
// 	   singleResult = SingleResultType.OPTIONAL)
//     public abstract InventoryCategory findByName(@QueryParam("categoryName") String categoryName);
// 
// }


import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import com.github.deltaspikedbunit.annotation.DatabaseOperation;
import com.github.deltaspikedbunit.annotation.DatabaseTearDown;
import com.github.deltaspikedbunit.deltaspike.DatabaseNoRollbackTest;
import com.github.deltaspikedbunit.sample.inventory.entity.InventoryCategory;
import com.github.deltaspikedbunit.sample.inventory.repository.InventoryCategoryRepository;
import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.inject.Inject;
import java.util.List;
/*
 * Copyright 2002-2015 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.deltaspikedbunit.teardown;





@RunWith(CdiTestRunner.class)
@DatabaseNoRollbackTest
@DatabaseTearDown(value = "../refresh-db.xml", type = DatabaseOperation.REFRESH)
public class RefreshTearDownOnClassTest {

    @Inject
    private InventoryCategoryRepository inventoryRepository;

// Path: deltaspike-dbunit/src/main/java/com/github/deltaspikedbunit/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 match 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} except 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 table is specified in the dataset and subsequently insert new
// 	 * contents. Equivalent to calling {@link #DELETE_ALL} followed by {@link #INSERT}.
// 	 */
// 	CLEAN_INSERT
// 
// }
// 
// Path: deltaspike-dbunit-sample/src/main/java/com/github/deltaspikedbunit/sample/inventory/entity/InventoryCategory.java
// @Entity
// @Table(name = "inventory_category")
// public class InventoryCategory {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.AUTO)
//     private int id;
//     @Version
//     @Column(name = "version")
//     private int version;
//     @Column(name = "category_name", nullable = false, unique = true)
//     private String categoryName;
//     @Column(name = "category_description")
//     private String categoryDescription;
//     @OneToMany(cascade = CascadeType.ALL, mappedBy = "category")
//     private Set<InventoryItem> items = new HashSet<>();
// 
// 
//     public InventoryCategory() {
//     }
// 
//     public InventoryCategory(String categoryName, String categoryDescription) {
//         this.categoryName = categoryName;
//         this.categoryDescription = categoryDescription;
//     }
// 
// 
//     public String getCategoryName() {
//         return categoryName;
//     }
//     public void setCategoryName(String name) {
//         this.categoryName = name;
//     }
// 
//     public String getCategoryDescription() {
//         return categoryDescription;
//     }
//     public void setCategoryDescription(String description) {
//         this.categoryDescription = description;
//     }
// 
//     int getVersion() {
//         return version;
//     }
//     void setVersion(int version) {
//         this.version = version;
//     }
// 
//     public int getId() {
//         return id;
//     }
//     void setId(int id) {
//         this.id = id;
//     }
// 
//     public Set<InventoryItem> getItems() {
//         return items;
//     }
//     void setItems(Set<InventoryItem> items) {
//         this.items = items;
//     }
// 
//     public void addItem(InventoryItem item) {
//         if (item != null) {
//             this.items.add(item);
//             item.setCategory(this);
//         }
//     }
// 
//     public void addItems(InventoryItem... items) {
//         if (items != null) {
//             for (InventoryItem ii : items) {
//                 addItem(ii);
//             }
//         }
//     }
// 
// }
// 
// Path: deltaspike-dbunit-sample/src/main/java/com/github/deltaspikedbunit/sample/inventory/repository/InventoryCategoryRepository.java
// @Repository
// public abstract class InventoryCategoryRepository extends AbstractEntityRepository<InventoryCategory, Integer> {
// 
//     @Query(value = "select ic from InventoryCategory ic where ic.categoryName = :categoryName", 
// 	   singleResult = SingleResultType.OPTIONAL)
//     public abstract InventoryCategory findByName(@QueryParam("categoryName") String categoryName);
// 
// }


// Path: deltaspike-dbunit/src/test/java/com/github/deltaspikedbunit/teardown/RefreshTearDownOnClassTest.java
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import com.github.deltaspikedbunit.annotation.DatabaseOperation;
import com.github.deltaspikedbunit.annotation.DatabaseTearDown;
import com.github.deltaspikedbunit.deltaspike.DatabaseNoRollbackTest;
import com.github.deltaspikedbunit.sample.inventory.entity.InventoryCategory;
import com.github.deltaspikedbunit.sample.inventory.repository.InventoryCategoryRepository;
import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.inject.Inject;
import java.util.List;

/*
 * Copyright 2002-2015 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.deltaspikedbunit.teardown;





@RunWith(CdiTestRunner.class)
@DatabaseNoRollbackTest
@DatabaseTearDown(value = "../refresh-db.xml", type = DatabaseOperation.REFRESH)
public class RefreshTearDownOnClassTest {

    @Inject
    private InventoryCategoryRepository inventoryRepository;

    @Test