• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ExpectedDataSet类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.unitils.dbunit.annotation.ExpectedDataSet的典型用法代码示例。如果您正苦于以下问题:Java ExpectedDataSet类的具体用法?Java ExpectedDataSet怎么用?Java ExpectedDataSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ExpectedDataSet类属于org.unitils.dbunit.annotation包,在下文中一共展示了ExpectedDataSet类的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: assertExpectedDataSet

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
public static void assertExpectedDataSet(final String... datasetFile) {
    TestContext testContext = Unitils.getInstance().getTestContext();
    ExpectedDataSet expectedDataSetAnnotation = new ExpectedDataSet() {

        @Override
        public Class<? extends Annotation> annotationType() {
            return ExpectedDataSet.class;
        }

        @Override
        public String[] value() {
            return datasetFile;
        }

        @Override
        public Class<? extends DataSetFactory> factory() {
            return null;
        }

        @Override
        public String databaseName() {
            return null;
        }
    };
    getDbUnitModule().assertExpectedDataSets(expectedDataSetAnnotation , testContext.getTestObject(), testContext.getTestMethod());
}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:27,
代码来源:DbUnitUnitils.java

示例2: getExpectedDataSet

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
/**
 * Returns the {@link MultiSchemaDataSet} that represents the state of a number of database tables after the given <code>Method</code>
 * has been executed.
 *
 * @param testMethod The test method, not null
 * @param testObject The test object, not null
 * @return The dataset, null if there is no data set
 */
public MultiSchemaDataSet getExpectedDataSet(ExpectedDataSet expectedDataSetAnnotation, Method testMethod, Object testObject) {


    databaseName = expectedDataSetAnnotation.databaseName();

    // Create configured factory for data sets
    DataSetFactory dataSetFactory = getDataSetFactory(ExpectedDataSet.class, testMethod, testObject.getClass());

    // Get the dataset file name
    String[] dataSetFileNames = expectedDataSetAnnotation.value();
    if (dataSetFileNames.length == 0) {
        // empty means use default file name
        dataSetFileNames = new String[]{
            createDataSetFileNamesHandler().getDefaultExpectedDataSetFileName(testMethod, testObject.getClass(), dataSetFactory.getDataSetFileExtension())
        };
    }

    return getDataSet(testMethod.getDeclaringClass(), dataSetFileNames, dataSetFactory);
}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:28,
代码来源:DbUnitModule.java

示例3: testInsertRecommendation

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS)
@ExpectedDataSet(DATA_FILENAME_NO_TIME)
public void testInsertRecommendation() {
    RecommendationVO<Integer, Integer> recommendation = null;
    try {
        List<RecommendedItemVO<Integer, Integer>> recommendedItems = new ArrayList<RecommendedItemVO<Integer, Integer>>();
        recommendedItems.add(new RecommendedItemVO<Integer, Integer>(
                new ItemVO<Integer, Integer>(1, 33, 1), 0.89d, 1l, "x"));
        recommendedItems.add(new RecommendedItemVO<Integer, Integer>(
                new ItemVO<Integer, Integer>(1, 34, 1), 0.88d, 1l, "x"));
        recommendation = new RecommendationVO<Integer, Integer>(1, 3, 1, 1, 1,
                1, "a", "b", recommendedItems);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(recommendation.getId() == null);
    recommendationDAO.insertRecommendation(recommendation);

    assertThat(recommendation.getId(), is(greaterThan(4)));
    assertThat(recommendation.getRecommendedItems().get(0).getId(), is(greaterThan(8)));
    assertThat(recommendation.getRecommendedItems().get(1).getId(), is(greaterThan(9)));
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:24,
代码来源:RecommendationDAOTest.java

示例4: testInsertRecommendedItem

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS_RECOMMENDED_ITEM)
@ExpectedDataSet(DATA_FILENAME_ONE_LESS)
public void testInsertRecommendedItem() {
    RecommendedItemVO<Integer, Integer> recommendedItem = null;
    try {
        recommendedItem = new RecommendedItemVO<Integer, Integer>(
                new ItemVO<Integer, Integer>(1, 34, 1), 0.88d, 1l, "x");
        recommendedItem.setRecommendationId(5);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(recommendedItem.getId() == null);
    recommendedItemDAO.insertRecommendedItem(recommendedItem);

    assertThat(recommendedItem.getId(), is(greaterThan(9)));
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:18,
代码来源:RecommendedItemDAOTest.java

示例5: testInsertItemAssoc

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
    @DataSet(DATA_FILENAME_ONE_LESS)
    @ExpectedDataSet(DATA_FILENAME_NO_CHANGEDATE)
    public void testInsertItemAssoc() {
        ItemAssocVO<Integer,Integer> itemAssoc = null;
        try {
            itemAssoc = new ItemAssocVO<Integer,Integer>(1,
                    new ItemVO<Integer, Integer>(1, 2, 1), 1, 0.1d,
                    new ItemVO<Integer, Integer>(1, 7, 1), 2, "def", 1, true);
        } catch (Exception e) {
            fail("caught exception: " + e);
        }
        assertTrue(itemAssoc.getId() == null);
        itemAssocDAO.insertItemAssoc(itemAssoc);

//        assertThat(itemAssoc.getId(), is(not(1)));
//        assertThat(itemAssoc.getId(), is(not(2)));
//        assertThat(itemAssoc.getId(), is(not(3)));
//        assertThat(itemAssoc.getId(), is(not(4)));
//        assertThat(itemAssoc.getId(), is(not(5)));
    }
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:22,
代码来源:ItemAssocDAOTest.java

示例6: testInsertItemAssocActiveNull

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
    @DataSet(DATA_FILENAME_ONE_LESS)
    @ExpectedDataSet(DATA_FILENAME_NO_CHANGEDATE)
    public void testInsertItemAssocActiveNull() {
        ItemAssocVO<Integer,Integer> itemAssoc = null;

        try {
            itemAssoc = new ItemAssocVO<Integer,Integer>(1,
                    new ItemVO<Integer, Integer>(1, 2, 1), 1, 0.1d,
                    new ItemVO<Integer, Integer>(1, 7, 1), 2, "def", 1, null);
        } catch (Exception e) {
            fail("caught exception: " + e);
        }

        assertTrue(itemAssoc.getId() == null);
        itemAssocDAO.insertItemAssoc(itemAssoc);

//        assertThat(itemAssoc.getId(), is(not(1)));
//        assertThat(itemAssoc.getId(), is(not(2)));
//        assertThat(itemAssoc.getId(), is(not(3)));
//        assertThat(itemAssoc.getId(), is(not(4)));
//        assertThat(itemAssoc.getId(), is(not(5)));
    }
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:24,
代码来源:ItemAssocDAOTest.java

示例7: testUpdateItemAssocUsingPrimaryKey

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSet(DATA_FILENAME_UPDATED)
public void testUpdateItemAssocUsingPrimaryKey() {
    ItemAssocVO<Integer,Integer> itemAssoc = itemAssocDAO
            .loadItemAssocByPrimaryKey(1l);
    itemAssoc.setAssocValue(1.2d);
    itemAssocDAO.updateItemAssocUsingPrimaryKey(itemAssoc);

    itemAssoc = itemAssocDAO.loadItemAssocByPrimaryKey(2l);
    itemAssoc.setViewType(7);
    itemAssoc.setActive(false);
    itemAssocDAO.updateItemAssocUsingPrimaryKey(itemAssoc);

    itemAssoc = itemAssocDAO.loadItemAssocByPrimaryKey(3l);
    itemAssoc.setAssocValue(3.0d);
    itemAssoc.setActive(false);
    itemAssocDAO.updateItemAssocUsingPrimaryKey(itemAssoc);
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:19,
代码来源:ItemAssocDAOTest.java

示例8: testUpdateItemAssocUsingUniqueKey

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSet(DATA_FILENAME_UPDATED)
public void testUpdateItemAssocUsingUniqueKey() {
    ItemAssocVO<Integer,Integer> itemAssoc = itemAssocDAO
            .loadItemAssocByPrimaryKey(1l);
    itemAssoc.setAssocValue(1.2d);
    itemAssocDAO.updateItemAssocUsingUniqueKey(itemAssoc);

    itemAssoc = itemAssocDAO.loadItemAssocByPrimaryKey(2l);
    itemAssoc.setViewType(7);
    itemAssoc.setActive(false);
    itemAssocDAO.updateItemAssocUsingUniqueKey(itemAssoc);

    itemAssoc = itemAssocDAO.loadItemAssocByPrimaryKey(3l);
    itemAssoc.setAssocValue(3.0d);
    itemAssoc.setActive(false);
    itemAssocDAO.updateItemAssocUsingUniqueKey(itemAssoc);
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:19,
代码来源:ItemAssocDAOTest.java

示例9: testInsertAction

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS)
@ExpectedDataSet(DATA_FILENAME_NO_ACTIONTIME)
public void testInsertAction() {
    ActionVO<Integer, Integer> action = null;
    try {
        action = new ActionVO<>(2, 2, "abc5", "127.0.0.1",
                new ItemVO<>(2, 1, 1), 1, null, null);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(action.getId() == null);
    actionDAO.insertAction(action, false);

    assertThat(action.getId(), is(not(1l)));
    assertThat(action.getId(), is(not(2l)));
    assertThat(action.getId(), is(not(3l)));
    assertThat(action.getId(), is(not(4l)));
    assertThat(action.getId(), is(not(5l)));
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:21,
代码来源:ActionDAOTest.java

示例10: buy_withRequiredParameters_shouldCreateViewActionAndItem

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSet("/dbunit/web/rest/expected_buy_1.xml")
public void buy_withRequiredParameters_shouldCreateViewActionAndItem() {
    MultivaluedMap<String, String> params = new MultivaluedMapImpl();
    params.add("tenantid", TENANT_ID);
    params.add("apikey", API_KEY);
    params.add("sessionid", "TEST_SESSION");
    params.add("itemid", "TEST_A");
    params.add("itemdescription", "Test A");
    params.add("itemurl", "http://testtenant.com/test/test/a");

    JSONObject json = makeAPIRequest(params);

    assertThat(json, not(is(nullValue())));
    assertThat(json.getString("action"), is("buy"));
    assertThat(json.getString("tenantid"), is(TENANT_ID));
    assertThat(json.getString("sessionid"), is("TEST_SESSION"));
    assertThat(json.getJSONObject("item").getString("id"), is("TEST_A"));
    assertThat(json.getJSONObject("item").getString("itemType"), is("ITEM"));
    assertThat(json.getJSONObject("item").getString("description"), is("Test A"));
    assertThat(json.getJSONObject("item").getString("url"), is("http://testtenant.com/test/test/a"));
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:23,
代码来源:BuyTest.java

示例11: view_withRequiredParameters_shouldCreateViewActionAndItem

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSet("/dbunit/web/rest/expected_view_1.xml")
public void view_withRequiredParameters_shouldCreateViewActionAndItem() {
    MultivaluedMap<String, String> params = new MultivaluedMapImpl();
    params.add("tenantid", TENANT_ID);
    params.add("apikey", API_KEY);
    params.add("sessionid", "TEST_SESSION");
    params.add("itemid", "TEST_A");
    params.add("itemdescription", "Test A");
    params.add("itemurl", "http://testtenant.com/test/test/a");

    JSONObject json = makeAPIRequest(params);

    assertThat(json, not(is(nullValue())));
    assertThat(json.getString("action"), is("view"));
    assertThat(json.getString("tenantid"), is(TENANT_ID));
    assertThat(json.getString("sessionid"), is("TEST_SESSION"));
    assertThat(json.getJSONObject("item").getString("id"), is("TEST_A"));
    assertThat(json.getJSONObject("item").getString("itemType"), is("ITEM"));
    assertThat(json.getJSONObject("item").getString("description"), is("Test A"));
    assertThat(json.getJSONObject("item").getString("url"), is("http://testtenant.com/test/test/a"));
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:23,
代码来源:ViewTest.java

示例12: rate_withRequiredParameters_shouldCreateViewActionAndItem

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSet("/dbunit/web/rest/expected_rate_1.xml")
public void rate_withRequiredParameters_shouldCreateViewActionAndItem() {
    MultivaluedMap<String, String> params = new MultivaluedMapImpl();
    params.add("tenantid", TENANT_ID);
    params.add("apikey", API_KEY);
    params.add("sessionid", "TEST_SESSION");
    params.add("itemid", "TEST_A");
    params.add("itemdescription", "Test A");
    params.add("itemurl", "http://testtenant.com/test/test/a");
    params.add("ratingvalue", "5");

    JSONObject json = makeAPIRequest(params);

    assertThat(json, not(is(nullValue())));
    assertThat(json.getString("action"), is("rate"));
    assertThat(json.getString("tenantid"), is(TENANT_ID));
    assertThat(json.getString("sessionid"), is("TEST_SESSION"));
    assertThat(json.getString("ratingValue"), is("5"));
    assertThat(json.getJSONObject("item").getString("id"), is("TEST_A"));
    assertThat(json.getJSONObject("item").getString("itemType"), is("ITEM"));
    assertThat(json.getJSONObject("item").getString("description"), is("Test A"));
    assertThat(json.getJSONObject("item").getString("url"), is("http://testtenant.com/test/test/a"));
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:25,
代码来源:RateTest.java

示例13: testInsertRecommendation

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS)
@ExpectedDataSet(DATA_FILENAME_NO_TIME)
public void testInsertRecommendation() {
    RecommendationVO<Integer, Integer> recommendation = null;
    try {
        List<RecommendedItemVO<Integer, Integer>> recommendedItems = new ArrayList<RecommendedItemVO<Integer, Integer>>();
        recommendedItems.add(new RecommendedItemVO<Integer, Integer>(
                new ItemVO<Integer, Integer>(1, 33, 1), 0.89d, 1, "x"));
        recommendedItems.add(new RecommendedItemVO<Integer, Integer>(
                new ItemVO<Integer, Integer>(1, 34, 1), 0.88d, 1, "x"));
        recommendation = new RecommendationVO<Integer, Integer>(1, 3, 1, 1, 1,
                1, "a", "b", recommendedItems);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(recommendation.getId() == null);
    recommendationDAO.insertRecommendation(recommendation);

    assertThat(recommendation.getId(), is(greaterThan(4)));
    assertThat(recommendation.getRecommendedItems().get(0).getId(), is(greaterThan(8)));
    assertThat(recommendation.getRecommendedItems().get(1).getId(), is(greaterThan(9)));
}
 

开发者ID:customertimes,
项目名称:easyrec-PoC,
代码行数:24,
代码来源:RecommendationDAOTest.java

示例14: testInsertRecommendedItem

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS_RECOMMENDED_ITEM)
@ExpectedDataSet(DATA_FILENAME_ONE_LESS)
public void testInsertRecommendedItem() {
    RecommendedItemVO<Integer, Integer> recommendedItem = null;
    try {
        recommendedItem = new RecommendedItemVO<Integer, Integer>(
                new ItemVO<Integer, Integer>(1, 34, 1), 0.88d, 1, "x");
        recommendedItem.setRecommendationId(5);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(recommendedItem.getId() == null);
    recommendedItemDAO.insertRecommendedItem(recommendedItem);

    assertThat(recommendedItem.getId(), is(greaterThan(9)));
}
 

开发者ID:customertimes,
项目名称:easyrec-PoC,
代码行数:18,
代码来源:RecommendedItemDAOTest.java

示例15: testInsertItemAssoc

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS)
@ExpectedDataSet(DATA_FILENAME_NO_CHANGEDATE)
public void testInsertItemAssoc() {
    ItemAssocVO<Integer,Integer> itemAssoc = null;
    try {
        itemAssoc = new ItemAssocVO<Integer,Integer>(1,
                new ItemVO<Integer, Integer>(1, 2, 1), 1, 0.1d,
                new ItemVO<Integer, Integer>(1, 7, 1), 2, "def", 1, true);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(itemAssoc.getId() == null);
    itemAssocDAO.insertItemAssoc(itemAssoc);

    assertThat(itemAssoc.getId(), is(not(1)));
    assertThat(itemAssoc.getId(), is(not(2)));
    assertThat(itemAssoc.getId(), is(not(3)));
    assertThat(itemAssoc.getId(), is(not(4)));
    assertThat(itemAssoc.getId(), is(not(5)));
}
 

开发者ID:customertimes,
项目名称:easyrec-PoC,
代码行数:22,
代码来源:ItemAssocDAOTest.java

示例16: testInsertItemAssocActiveNull

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS)
@ExpectedDataSet(DATA_FILENAME_NO_CHANGEDATE)
public void testInsertItemAssocActiveNull() {
    ItemAssocVO<Integer,Integer> itemAssoc = null;

    try {
        itemAssoc = new ItemAssocVO<Integer,Integer>(1,
                new ItemVO<Integer, Integer>(1, 2, 1), 1, 0.1d,
                new ItemVO<Integer, Integer>(1, 7, 1), 2, "def", 1, null);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }

    assertTrue(itemAssoc.getId() == null);
    itemAssocDAO.insertItemAssoc(itemAssoc);

    assertThat(itemAssoc.getId(), is(not(1)));
    assertThat(itemAssoc.getId(), is(not(2)));
    assertThat(itemAssoc.getId(), is(not(3)));
    assertThat(itemAssoc.getId(), is(not(4)));
    assertThat(itemAssoc.getId(), is(not(5)));
}
 

开发者ID:customertimes,
项目名称:easyrec-PoC,
代码行数:24,
代码来源:ItemAssocDAOTest.java

示例17: testUpdateItemAssocUsingPrimaryKey

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSet(DATA_FILENAME_UPDATED)
public void testUpdateItemAssocUsingPrimaryKey() {
    ItemAssocVO<Integer,Integer> itemAssoc = itemAssocDAO
            .loadItemAssocByPrimaryKey(1);
    itemAssoc.setAssocValue(1.2d);
    itemAssocDAO.updateItemAssocUsingPrimaryKey(itemAssoc);

    itemAssoc = itemAssocDAO.loadItemAssocByPrimaryKey(2);
    itemAssoc.setViewType(7);
    itemAssoc.setActive(false);
    itemAssocDAO.updateItemAssocUsingPrimaryKey(itemAssoc);

    itemAssoc = itemAssocDAO.loadItemAssocByPrimaryKey(3);
    itemAssoc.setAssocValue(3.0d);
    itemAssoc.setActive(false);
    itemAssocDAO.updateItemAssocUsingPrimaryKey(itemAssoc);
}
 

开发者ID:customertimes,
项目名称:easyrec-PoC,
代码行数:19,
代码来源:ItemAssocDAOTest.java

示例18: testUpdateItemAssocUsingUniqueKey

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSet(DATA_FILENAME_UPDATED)
public void testUpdateItemAssocUsingUniqueKey() {
    ItemAssocVO<Integer,Integer> itemAssoc = itemAssocDAO
            .loadItemAssocByPrimaryKey(1);
    itemAssoc.setAssocValue(1.2d);
    itemAssocDAO.updateItemAssocUsingUniqueKey(itemAssoc);

    itemAssoc = itemAssocDAO.loadItemAssocByPrimaryKey(2);
    itemAssoc.setViewType(7);
    itemAssoc.setActive(false);
    itemAssocDAO.updateItemAssocUsingUniqueKey(itemAssoc);

    itemAssoc = itemAssocDAO.loadItemAssocByPrimaryKey(3);
    itemAssoc.setAssocValue(3.0d);
    itemAssoc.setActive(false);
    itemAssocDAO.updateItemAssocUsingUniqueKey(itemAssoc);
}
 

开发者ID:customertimes,
项目名称:easyrec-PoC,
代码行数:19,
代码来源:ItemAssocDAOTest.java

示例19: testInsertAction

点赞 3

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS)
@ExpectedDataSet(DATA_FILENAME_NO_ACTIONTIME)
public void testInsertAction() {
    ActionVO<Integer, Integer> action = null;
    try {
        action = new ActionVO<Integer, Integer>(2, 2, "abc5", "127.0.0.1",
                new ItemVO<Integer, Integer>(2, 1, 1), 1, null, null, null, null);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(action.getId() == null);
    actionDAO.insertAction(action, false);

    assertThat(action.getId(), is(not(1)));
    assertThat(action.getId(), is(not(2)));
    assertThat(action.getId(), is(not(3)));
    assertThat(action.getId(), is(not(4)));
    assertThat(action.getId(), is(not(5)));
}
 

开发者ID:customertimes,
项目名称:easyrec-PoC,
代码行数:21,
代码来源:ActionDAOTest.java

示例20: testPersist

点赞 2

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@DataSet("../datasets/NoPersons.xml")
@ExpectedDataSet("../datasets/SinglePerson-result.xml")
public void testPersist() {
	Session currentSession = sessionFactory.getCurrentSession();
    currentSession.persist(person);
}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:8,
代码来源:HibernateTest.java

示例21: testMultipleExpectedDataSetsOnMultipleDatabases

点赞 2

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSets({@ExpectedDataSet(databaseName=DATABASE1, value = "MultiDatabaseIntTest.testMultipleExpectedDataSetsOnMultipleDatabases_1.xml"), @ExpectedDataSet(databaseName=DATABASE2, value= "MultiDatabaseIntTest.testMultipleExpectedDataSetsOnMultipleDatabases_2.xml")})
public void testMultipleExpectedDataSetsOnMultipleDatabases() {
    SQLUnitils.executeUpdate("INSERT INTO person (personid, personname) values ('5', 'Andre');", dataSourceDatabase1);
    SQLUnitils.executeUpdate("INSERT INTO person (personid, personname) values ('6', 'Charles');", dataSourceDatabase1);
    SQLUnitils.executeUpdate("INSERT INTO person (personid, personname) values ('8', 'Luc');", dataSourceDatabase2);
    SQLUnitils.executeUpdate("INSERT INTO person (personid, personname) values ('9', 'Jean-Michel');", dataSourceDatabase2);


}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:11,
代码来源:MultiDatabaseIntTest.java

示例22: testLoadingResourceDatasetDefault

点赞 2

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
/** */
@DataSet
@Test
@Ignore
@ExpectedDataSet
public void testLoadingResourceDatasetDefault() {
    LOGGER.debug("STVE :" + DbUnitModule.class.getPackage().toString());
    Assert.assertTrue(true);
}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:10,
代码来源:ResourceLoadingMethodTest.java

示例23: testLoadingExpectedResourceMultipleDataFiles

点赞 2

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
/** */
@Test
@Ignore
@DataSet({
    "/org/unitils/testdata/exampleResourceData.xml", "/org/unitils/testdata/exampleResourceData.xml"
})
@ExpectedDataSet({
    "/org/unitils/testdata/exampleResourceData.xml", "/org/unitils/testdata/exampleResourceData.xml"
})
public void testLoadingExpectedResourceMultipleDataFiles() {
    Assert.assertTrue(true);
}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:13,
代码来源:ResourceLoadingMethodTest.java

示例24: testLoadingResource

点赞 2

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
/*** */
@Test
@ExpectedDataSet("/org/unitils/testdata/exampleResourceData.xml")
public void testLoadingResource() {
    //SqlAssert.assertCountSqlResult("select count(*) from dossier", 3L);
    //SqlAssert.assertMultipleRowSqlResult("select * from dossier", new String[]{"DS-1", "TestAppResourcesBlack"}, new String[]{"DS-2", "n"}, new String[]{"DS-3", "decker"});
    Assert.assertTrue(true);
}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:9,
代码来源:ResourceLoadingClassTest.java

示例25: init

点赞 2

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
/**
 * Initializes the DbUnitModule using the given Configuration
 *
 * @param configuration The config, not null
 */
@Override
@SuppressWarnings("unchecked")
public void init(Properties configuration) {
    this.configuration = configuration;
    defaultAnnotationPropertyValues = getAnnotationPropertyDefaults(DbUnitModule.class, configuration, DataSet.class, ExpectedDataSet.class);
}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:12,
代码来源:DbUnitModule.java

示例26: assertExpectedDataSets

点赞 2

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
public void assertExpectedDataSets(ExpectedDataSet expectedDataSetAnnotation, Object testObject, Method testMethod) {
    try {
        // get the expected dataset
        MultiSchemaDataSet multiSchemaExpectedDataSet = getExpectedDataSet(expectedDataSetAnnotation, testMethod, testObject);
        assertExpectedDataSets(multiSchemaExpectedDataSet, testObject);
    } finally {
        closeJdbcConnection();
    }
}
 

开发者ID:linux-china,
项目名称:unitils,
代码行数:10,
代码来源:DbUnitModule.java

示例27: perform_shouldCalculateRules

点赞 2

import org.unitils.dbunit.annotation.ExpectedDataSet; //导入依赖的package包/类
@Test
@ExpectedDataSet("/dbunit/plugins/arm/ARMGeneratorTest_expected.xml")
public void perform_shouldCalculateRules() {
    try {
        armGenerator.install(false);
        armGenerator.initialize();
        ARMConfiguration config = armGenerator.newConfiguration();
        config.setTenantId(1);
        armGenerator.setConfiguration(config);
        armGenerator.execute();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 

开发者ID:major2015,
项目名称:easyrec_major,
代码行数:15,
代码来源:ARMGeneratorTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)