Package org.openbravo.service.json.test
Class JsonRestTest
- java.lang.Object
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.service.json.test.JsonRestTest
-
- Direct Known Subclasses:
JsonReadRestTest
,JsonUpdateRestTest
public class JsonRestTest extends OBBaseTest
Base class for Json test Rest http requests. To test theJsonRestServlet
. This test class requires a running Openbravo instance on http://localhost:8080/openbravo.- 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 JsonRestTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
convertToString(InputStream is)
protected HttpURLConnection
createConnection(String wsPart, String method)
protected org.codehaus.jettison.json.JSONObject
doContentRequest(String wsPart, String content, int expectedResponse, String expectedContent, String method)
protected org.codehaus.jettison.json.JSONObject
doRequest(String wsPart, String testContent, String method, int responseCode)
protected String
getOpenbravoURL()
Returns the url of the Openbravo instance.-
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
-
doRequest
protected org.codehaus.jettison.json.JSONObject doRequest(String wsPart, String testContent, String method, int responseCode)
-
createConnection
protected HttpURLConnection createConnection(String wsPart, String method) throws Exception
- Throws:
Exception
-
doContentRequest
protected org.codehaus.jettison.json.JSONObject doContentRequest(String wsPart, String content, int expectedResponse, String expectedContent, String method)
-
getOpenbravoURL
protected String getOpenbravoURL()
Returns the url of the Openbravo instance. The default value is:OB_URL
- Returns:
- the url of the Openbravo instance.
-
convertToString
protected String convertToString(InputStream is)
-
-