org.aludratest.hpalm.infrastructure
Class RestConnector
java.lang.Object
org.aludratest.hpalm.infrastructure.RestConnector
public class RestConnector
- extends Object
This class keeps the state of the connection for the examples. This class is a thus sharing state singleton. All examples get
the instance in their default constructors - (cookies, server url).
Some simple methods are implemented to get commonly used paths.
|
Method Summary |
String |
buildEntityCollectionUrl(String entityType)
|
String |
buildUrl(String path)
|
Map<String,String> |
getCookies()
|
String |
getCookieString()
|
Response |
httpDelete(String url,
Map<String,String> headers)
|
Response |
httpGet(String url,
String queryString,
Map<String,String> headers)
|
Response |
httpPost(String url,
byte[] data,
Map<String,String> headers)
|
Response |
httpPut(String url,
byte[] data,
Map<String,String> headers)
|
void |
setCookies(Map<String,String> cookies)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cookies
protected Map<String,String> cookies
serverUrl
protected String serverUrl
- This is the URL to the ALM application. For example: http://myhost:8080/qcbin. Make sure that there is no slash at the end.
domain
protected String domain
project
protected String project
RestConnector
public RestConnector(Map<String,String> cookies,
String serverUrl,
String domain,
String project)
buildEntityCollectionUrl
public String buildEntityCollectionUrl(String entityType)
buildUrl
public String buildUrl(String path)
- Parameters:
path - on the server to use
- Returns:
- a url on the server for the path parameter
getCookies
public Map<String,String> getCookies()
- Returns:
- the cookies
setCookies
public void setCookies(Map<String,String> cookies)
- Parameters:
cookies - the cookies to set
httpPut
public Response httpPut(String url,
byte[] data,
Map<String,String> headers)
throws IOException
- Throws:
IOException
httpPost
public Response httpPost(String url,
byte[] data,
Map<String,String> headers)
throws IOException
- Throws:
IOException
httpDelete
public Response httpDelete(String url,
Map<String,String> headers)
throws IOException
- Throws:
IOException
httpGet
public Response httpGet(String url,
String queryString,
Map<String,String> headers)
throws IOException
- Throws:
IOException
getCookieString
public String getCookieString()
Copyright © 2015 aludratest.org. All rights reserved.