Package org.openbravo.test.system
Class ImportEntryBuilderTest
- java.lang.Object
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.base.weld.test.WeldBaseTest
-
- org.openbravo.test.system.ImportEntryBuilderTest
-
public class ImportEntryBuilderTest extends WeldBaseTest
Test the ImportEntryBuilder under various scenarios- Author:
- jarmendariz
-
-
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_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 ImportEntryBuilderTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
createImportEntries()
Create two sample import entries.void
customPropertiesCanBeInserted()
Any field can be filled using .setProperty method.static void
disposeImportEntries()
void
removeImportEntryWhenCreated()
void
whenCustomPropertyToInsertDoesNotExistImportEntryCreationFails()
Check that the builder throws an exception when attempting to set a non existing field in setPropertiesvoid
whenGivenIdExistsAsArchivedImportEntryBuilderThrowsException()
Before creating an ImportEntry, if ID is provided, builder will check whether this entry exists in ImportEntryArchive tablevoid
whenGivenIdExistsImportEntryBuilderThrowsException()
Before creating an ImportEntry, if ID is provided, builder will check whether this entry exists in ImportEntry tablevoid
whenNoIdIsProvidedANewEntryIsCreated()
Check that the new import entry returned contains the inserted datavoid
whenNoParametersAreSetImportEntryIsCreatedWithDefaultValues()
Test that default values are set to the ImportEntryvoid
whenParametersAreSetImportEntryIsCreatedUsingThoseValues()
Test that defined parameters are actually in the created object-
Methods inherited from class org.openbravo.base.weld.test.WeldBaseTest
createTestArchive, getWeldComponent, resetOBInterceptors, setUp
-
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, setUserContext, shouldMockServletContext, staticInitializeDalLayer, testDone
-
-
-
-
Method Detail
-
createImportEntries
public static void createImportEntries()
Create two sample import entries. One for ImportEntry table and the other for ImportEntryArchive Those entries will be removed in @AfterClass
-
whenNoIdIsProvidedANewEntryIsCreated
public void whenNoIdIsProvidedANewEntryIsCreated()
Check that the new import entry returned contains the inserted data
-
whenGivenIdExistsImportEntryBuilderThrowsException
public void whenGivenIdExistsImportEntryBuilderThrowsException()
Before creating an ImportEntry, if ID is provided, builder will check whether this entry exists in ImportEntry table
-
whenGivenIdExistsAsArchivedImportEntryBuilderThrowsException
public void whenGivenIdExistsAsArchivedImportEntryBuilderThrowsException()
Before creating an ImportEntry, if ID is provided, builder will check whether this entry exists in ImportEntryArchive table
-
customPropertiesCanBeInserted
public void customPropertiesCanBeInserted()
Any field can be filled using .setProperty method. Test that active field can be set using this method
-
whenCustomPropertyToInsertDoesNotExistImportEntryCreationFails
public void whenCustomPropertyToInsertDoesNotExistImportEntryCreationFails()
Check that the builder throws an exception when attempting to set a non existing field in setProperties
-
whenNoParametersAreSetImportEntryIsCreatedWithDefaultValues
public void whenNoParametersAreSetImportEntryIsCreatedWithDefaultValues()
Test that default values are set to the ImportEntry
-
whenParametersAreSetImportEntryIsCreatedUsingThoseValues
public void whenParametersAreSetImportEntryIsCreatedUsingThoseValues()
Test that defined parameters are actually in the created object
-
removeImportEntryWhenCreated
public void removeImportEntryWhenCreated()
-
disposeImportEntries
public static void disposeImportEntries()
-
-