Package org.openbravo.test.modularity
Class TableNameTest
- java.lang.Object
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.test.modularity.TableNameTest
-
public class TableNameTest extends OBBaseTest
This test case checks that table names are correctly checked when inserting them into DB. It must be checkes the table name starts with the db prefix for the module and it is not possible to add tables with non-allowed names.- Author:
- alostale
-
-
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 TableNameTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testACreateModule()
Creates a test module to work with it in later testsvoid
testBCreateTable1()
Creates a table that is valid, it has a valid name according with the db prefix for the module it is assigned tovoid
testCCreateTable2()
It tries to insert a table with a non-valid name prefix, it is tested that DB raises an exception and thus the table is not inserted.void
testDCreateTable3()
Same test as testCreateTable2 but trying to insert the table in a package that for core module, it should not insert anythingvoid
testEChangePackage()
This test tryies to change the package for the table created in testCreateTable1 to a package in core, this should fail because the naming rules are not filledvoid
testFCleanUp()
Removes all created objects from database.-
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
-
-
-
-
Method Detail
-
testACreateModule
public void testACreateModule()
Creates a test module to work with it in later tests
-
testBCreateTable1
public void testBCreateTable1()
Creates a table that is valid, it has a valid name according with the db prefix for the module it is assigned to
-
testCCreateTable2
public void testCCreateTable2()
It tries to insert a table with a non-valid name prefix, it is tested that DB raises an exception and thus the table is not inserted.
-
testDCreateTable3
public void testDCreateTable3()
Same test as testCreateTable2 but trying to insert the table in a package that for core module, it should not insert anything
-
testEChangePackage
public void testEChangePackage()
This test tryies to change the package for the table created in testCreateTable1 to a package in core, this should fail because the naming rules are not filled
-
testFCleanUp
public void testFCleanUp()
Removes all created objects from database.
-
-