Package org.openbravo.test.datasource
Class BaseDataSourceTestNoDal
- java.lang.Object
-
- org.openbravo.test.datasource.BaseDataSourceTestNoDal
-
- Direct Known Subclasses:
FKDropDownDatasource
,HQLDataSourceTest
,LogDatasourceTest
,ProductSelectorDataSourceTest
,SelectorFieldPropertySelectorDSTest
,SelectorPickListFieldsDataSourceTest
public class BaseDataSourceTestNoDal extends Object
Base for tests performing requests to a live Openbravo instance. It doesn't allow to work with DAL, in case it is neededBaseDataSourceTestDal
can be used instead. NOTE FOR DEVELOPERS:BaseDataSourceTestDal
class should be maintained in parallel to this one- Author:
- alostale
-
-
Constructor Summary
Constructors Constructor Description BaseDataSourceTestNoDal()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
changeProfile(String roleId, String langId, String orgId, String warehouseId)
Changes current session's profileprotected String
doRequest(String wsPart, String content, int expectedResponse, String method)
Performs a request to Openbravo returning its response and asserting the response code matches expectedResponse.protected String
doRequest(String wsPart, String content, int expectedResponse, String method, String contentType)
Performs a request to Openbravo returning its response and asserting the response code matches expectedResponse.protected String
doRequest(String wsPart, Map<String,String> params, int expectedResponse, String method)
Performs a request to Openbravo returning its response and asserting the response code matches expectedResponse.protected String
getLogin()
Returns the login used to login for the requests.protected String
getOpenbravoURL()
Obtains URL of Openbravo instance, by default taken from Openbravo.poperties context.url propertyprotected String
getPassword()
Returns the password used to login for the requests.protected String
getSessionCsrfToken()
-
-
-
Field Detail
-
LOGIN
protected static final String LOGIN
- See Also:
- Constant Field Values
-
PWD
protected static final String PWD
- See Also:
- Constant Field Values
-
POST_METHOD
protected static final String POST_METHOD
- See Also:
- Constant Field Values
-
-
Method Detail
-
doRequest
protected String doRequest(String wsPart, String content, int expectedResponse, String method) throws Exception
Performs a request to Openbravo returning its response and asserting the response code matches expectedResponse.- Throws:
Exception
-
doRequest
protected String doRequest(String wsPart, Map<String,String> params, int expectedResponse, String method) throws Exception
Performs a request to Openbravo returning its response and asserting the response code matches expectedResponse.- Throws:
Exception
-
doRequest
protected String doRequest(String wsPart, String content, int expectedResponse, String method, String contentType) throws Exception
Performs a request to Openbravo returning its response and asserting the response code matches expectedResponse.- Throws:
Exception
-
getOpenbravoURL
protected String getOpenbravoURL()
Obtains URL of Openbravo instance, by default taken from Openbravo.poperties context.url property
-
getLogin
protected String getLogin()
Returns the login used to login for the requests. The default value isLOGIN
- Returns:
- the login name used to login for the requests
-
getPassword
protected String getPassword()
Returns the password used to login for the requests. The default value isPWD
- Returns:
- the password used to login for the requests
-
getSessionCsrfToken
protected String getSessionCsrfToken()
-
-