Package org.openbravo.test.dal
Class OBContextTest
- java.lang.Object
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.test.dal.OBContextTest
-
public class OBContextTest extends OBBaseTest
Tests theOBContext
class.- 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_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 OBContextTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
basicSerializationShouldWork()
void
clientVisibilityIsCorrectAfterDeserialization()
void
organizationVisibilityIsCorrectAfterDeserialization()
void
testLanguageInContext()
Tests if the language is set correctly in the OBContext.void
testMultiThreadedOBContext()
Tests if theOBContext.setAdminMode()
andOBContext.restorePreviousMode()
work correctly if the same OBContext is used by multiple threads.void
testReadableDeactivatedOrg()
Tests that inactive readable organizations are included in the list of readable organization by the role.void
testUnbalancedCallsToAdminMode()
Maintain and print stacktraces when calls to setAdminMode and restoreAdminMode are unbalanced To test this issue set the OBContext.ADMIN_TRACE_SIZE to a higher value than 0void
testWarehouseInContext()
Tests if the warehouse is set correctly in the OBContext.-
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
-
testWarehouseInContext
public void testWarehouseInContext()
Tests if the warehouse is set correctly in the OBContext.
-
testLanguageInContext
public void testLanguageInContext()
Tests if the language is set correctly in the OBContext.
-
testReadableDeactivatedOrg
public void testReadableDeactivatedOrg()
Tests that inactive readable organizations are included in the list of readable organization by the role.
-
testMultiThreadedOBContext
public void testMultiThreadedOBContext() throws Exception
Tests if theOBContext.setAdminMode()
andOBContext.restorePreviousMode()
work correctly if the same OBContext is used by multiple threads. This is possible in case of simultaneous ajax requests.- Throws:
Exception
-
testUnbalancedCallsToAdminMode
public void testUnbalancedCallsToAdminMode()
Maintain and print stacktraces when calls to setAdminMode and restoreAdminMode are unbalanced To test this issue set the OBContext.ADMIN_TRACE_SIZE to a higher value than 0
-
basicSerializationShouldWork
public void basicSerializationShouldWork() throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
clientVisibilityIsCorrectAfterDeserialization
public void clientVisibilityIsCorrectAfterDeserialization() throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
organizationVisibilityIsCorrectAfterDeserialization
public void organizationVisibilityIsCorrectAfterDeserialization() throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
-