Package org.openbravo.test.datasource
Class DataSourceSecurity
- java.lang.Object
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.test.datasource.BaseDataSourceTestDal
-
- org.openbravo.test.datasource.DataSourceSecurity
-
public class DataSourceSecurity extends BaseDataSourceTestDal
Test cases to ensure that mechanism of security DataSource access is working properly.- Author:
- inigo.sanchez
-
-
Field Summary
-
Fields inherited from class org.openbravo.test.datasource.BaseDataSourceTestDal
LOGIN, POST_METHOD, PWD
-
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 DataSourceSecurity(org.openbravo.test.datasource.DataSourceSecurity.RoleType role, org.openbravo.test.datasource.DataSourceSecurity.DataSource dataSource, int expectedResponseStatus)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
cleanUp()
Deletes dummy testing role and productstatic void
createNoAccessRoleAndGenericProduct()
Creates dummy role without any access for testing purposesvoid
fetchShouldBeAllowedOnlyIfRoleIsGranted()
Tests datasource allows or denies fetch action based on role accessstatic Collection<Object[]>
parameters()
-
Methods inherited from class org.openbravo.test.datasource.BaseDataSourceTestDal
authenticate, changeProfile, doRequest, doRequest, doRequest, getLogin, getOpenbravoURL, getPassword, getSessionCsrfToken, logout
-
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
-
parameters
public static Collection<Object[]> parameters()
-
createNoAccessRoleAndGenericProduct
public static void createNoAccessRoleAndGenericProduct()
Creates dummy role without any access for testing purposes
-
fetchShouldBeAllowedOnlyIfRoleIsGranted
public void fetchShouldBeAllowedOnlyIfRoleIsGranted() throws Exception
Tests datasource allows or denies fetch action based on role access- Throws:
Exception
-
cleanUp
public static void cleanUp()
Deletes dummy testing role and product
-
-