Package org.openbravo.test.xml
Class UniqueConstraintImportTest
- java.lang.Object
-
- org.openbravo.test.base.MockableBaseTest
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.test.xml.XMLBaseTest
-
- org.openbravo.test.xml.UniqueConstraintImportTest
-
public class UniqueConstraintImportTest extends XMLBaseTest
Test the influence of unique constraints when importing data. In case of a unique constraint objects with different id's and the same values for the unique key fields can be matched. So if the xml contains an object with id A and a value for a unique key field V1 and in the database there is an object with B which also has the value V1 for the unique key field. Then object A will overwrite object B in the database.- Author:
- mtaal
-
-
Field Summary
-
Fields inherited from class org.openbravo.test.base.OBBaseTest
DOLLAR, DOLLAR_ID, EURO, EURO_ID, QA_TEST_ADMIN_USER_ID, QA_TEST_CLIENT_ID, QA_TEST_ORG_ID, TEST_BP_CATEGORY_ID, TEST_CLIENT_ID, TEST_INVOICE_ID, TEST_LOCATION_ID, TEST_ORDER_ID, TEST_ORG_ID, TEST_ORG_TREE, TEST_PRODUCT_ID, TEST_ROLE_ID, TEST_US_ORG_ID, TEST_USER_ID, TEST_WAREHOUSE_ID, TEST2_USER_ID, userIds, watchFailures
-
-
Constructor Summary
Constructors Constructor Description UniqueConstraintImportTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testACreateCountryTrl()
Builds the testdata,CountryTrl
objects for a specificCountry
.void
testBCountryTrlImport()
ReadsCountryTrl
objects from the db and imports them again after changing the id.-
Methods inherited from class org.openbravo.test.xml.XMLBaseTest
cleanRefDataLoaded, compare, getFileContent, getList, getList, getXML, getXML, getXML
-
Methods inherited from class org.openbravo.test.base.OBBaseTest
addReadWriteAccess, classSetUp, commitTransaction, count, getConnectionProvider, getOneInstance, getRandomUser, getTestLogAppender, initializeDalLayer, initializeDisabledTestCases, initializeTestLogAppender, isErrorOccured, reportException, rollback, setLogStackTraces, setQAAdminContext, setSystemAdministratorContext, setTestAdminContext, setTestLogAppenderLevel, setTestUserContext, setUp, setUserContext, shouldMockServletContext, staticInitializeDalLayer, testDone
-
Methods inherited from class org.openbravo.test.base.MockableBaseTest
mockStatic
-
-
-
-
Method Detail
-
testACreateCountryTrl
public void testACreateCountryTrl()
Builds the testdata,CountryTrl
objects for a specificCountry
.
-
testBCountryTrlImport
public void testBCountryTrlImport()
ReadsCountryTrl
objects from the db and imports them again after changing the id. This should result in updates of existingCountryTrl
objeccts because they are found using the unique constraint of country and language. This method also cleans up the testdata.
-
-