Package org.openbravo.test.model
Class RuntimeModelTest
- java.lang.Object
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.test.model.RuntimeModelTest
-
public class RuntimeModelTest extends OBBaseTest
Tests the in-memory runtime model provided by theModelProvider
.
-
-
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 RuntimeModelTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
setUpRmt()
This before method is named setUpRmt() to avoid overwriting the super setUp method that is invoke automatically before this one.void
testColumnIdSet()
Tests that all non-one-to-many/not-one-to-one/not-composite id columns have a columnvoid
testDumpModel()
Iterates over the model and prints it to the log.void
testIdentifiers()
void
testIsParent()
Tests that parent references are only allowed for specific reference types.void
testIsParent2()
Tests that columns that hasColumn.isParent()
on true are not of a primitive type.void
testIsParent3()
Checks that a column that hasColumn.isParent()
on true has a table defined.void
testIsParent4()
Checks that a column that hasColumn.isParent()
finishes on _ID.void
testModelProvider()
Just checks that there is aModelProvider
and that it returns a model (a list ofEntity
objects).void
testModelProviderKeepsNoHelpAfterRemoveHelp()
Checks if a model removes correctly every help comment from every entity and property of its modelvoid
testModelProviderShouldBeInitializedWithoutHelpByDefault()
Checks if a ModelProvider is initialized without help in its model entities and propertiesvoid
testModelProviderShouldHaveHelpAfterAddHelpToModel()
Checks that a ModelProvider has help after addHelpToModelvoid
testOnePK()
Tests that each entity/table has only one PK.void
testPK()
Checks if there are tables without a PK in the model.void
testPrimitiveDomainTypeDefaultMethods()
void
testTableName()
Check the AD_Table.name for illegal characters.void
testUniqueColumnMapping()
Checks that all names of properties are unique within an Entity.void
testUniqueTableMapping()
Checks that entities have a unique name.-
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
-
setUpRmt
public static void setUpRmt() throws Exception
This before method is named setUpRmt() to avoid overwriting the super setUp method that is invoke automatically before this one.- Throws:
Exception
-
testDumpModel
public void testDumpModel()
Iterates over the model and prints it to the log.
-
testPK
public void testPK()
Checks if there are tables without a PK in the model.
-
testTableName
public void testTableName()
Check the AD_Table.name for illegal characters. Spaces in AD_TABLE.name should be handled better, currently the entity name contains a space resulting in errors in HQL
-
testModelProvider
public void testModelProvider()
Just checks that there is aModelProvider
and that it returns a model (a list ofEntity
objects).
-
testUniqueTableMapping
public void testUniqueTableMapping()
Checks that entities have a unique name.- See Also:
Entity.getName()
-
testUniqueColumnMapping
public void testUniqueColumnMapping()
Checks that all names of properties are unique within an Entity.- See Also:
Property.getName()
-
testOnePK
public void testOnePK()
Tests that each entity/table has only one PK.
-
testIdentifiers
public void testIdentifiers()
-
testColumnIdSet
public void testColumnIdSet()
Tests that all non-one-to-many/not-one-to-one/not-composite id columns have a column
-
testIsParent
public void testIsParent()
Tests that parent references are only allowed for specific reference types.- See Also:
Column.getReference()
,Reference
-
testIsParent2
public void testIsParent2()
Tests that columns that hasColumn.isParent()
on true are not of a primitive type.
-
testIsParent3
public void testIsParent3()
Checks that a column that hasColumn.isParent()
on true has a table defined.
-
testIsParent4
public void testIsParent4()
Checks that a column that hasColumn.isParent()
finishes on _ID.
-
testModelProviderShouldBeInitializedWithoutHelpByDefault
public void testModelProviderShouldBeInitializedWithoutHelpByDefault()
Checks if a ModelProvider is initialized without help in its model entities and properties
-
testModelProviderShouldHaveHelpAfterAddHelpToModel
public void testModelProviderShouldHaveHelpAfterAddHelpToModel()
Checks that a ModelProvider has help after addHelpToModel
-
testModelProviderKeepsNoHelpAfterRemoveHelp
public void testModelProviderKeepsNoHelpAfterRemoveHelp()
Checks if a model removes correctly every help comment from every entity and property of its model
-
testPrimitiveDomainTypeDefaultMethods
public void testPrimitiveDomainTypeDefaultMethods()
-
-