Example usage for org.apache.commons.httpclient HttpStatus SC_CREATED

List of usage examples for org.apache.commons.httpclient HttpStatus SC_CREATED

Introduction

In this page you can find the example usage for org.apache.commons.httpclient HttpStatus SC_CREATED.

Prototype

int SC_CREATED

To view the source code for org.apache.commons.httpclient HttpStatus SC_CREATED.

Click Source Link

Document

<tt>201 Created</tt> (HTTP/1.0 - RFC 1945)

Usage

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android device camera "
        + "operation.")
public void testCamera() throws Exception {
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.CAMERA_OPERATION,
            Constants.AndroidOperations.CAMERA_OPERATION_PAYLOAD);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = {
        Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android get info operation")
public void testGetInfo() throws Exception {
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.DEVICE_INFO_ENDPOINT,
            Constants.AndroidOperations.DEVICE_INFO_PAYLOAD);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android logcat operation")
public void testLogcat() throws Exception {
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.DEVICE_LOGCAT_ENDPOINT,
            Constants.AndroidOperations.PAYLOAD_COMMON);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android enterprise-wipe "
        + "operation.")
public void testEnterpriseWipe() throws Exception {
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT
                    + Constants.AndroidOperations.ENTERPRISE_WIPE_ENDPOINT,
            Constants.AndroidOperations.ENTERPRISE_WIPE_PAYLOAD);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = {
        Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android wipe data operation.")
public void testWipeData() throws Exception {
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.WIPE_DATA_ENDPOINT,
            Constants.AndroidOperations.WIPE_DATA_PAYLOAD);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android get applications "
        + "operation.")
public void testGetApplications() throws Exception {
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT
                    + Constants.AndroidOperations.APPLICATION_LIST_ENDPOINT,
            Constants.AndroidOperations.PAYLOAD_COMMON);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = {
        Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android app install operation")
public void testInstallApplication() throws Exception {
    JsonObject installApplicationPayload = PayloadGenerator.getJsonPayload(
            Constants.AndroidOperations.OPERATION_PAYLOAD_FILE_NAME,
            Constants.AndroidOperations.INSTALL_APPS_OPERATION);
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.INSTALL_APPS_ENDPOINT,
            installApplicationPayload.toString());
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = {
        Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android app update operation")
public void testUpdateApplication()
        throws FileNotFoundException, MalformedURLException, AutomationFrameworkException {
    JsonObject installApplicationPayload = PayloadGenerator.getJsonPayload(
            Constants.AndroidOperations.OPERATION_PAYLOAD_FILE_NAME,
            Constants.AndroidOperations.INSTALL_APPS_OPERATION);
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.UPDATE_APPS_ENDPOINT,
            installApplicationPayload.toString());
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android app un-install "
        + "operation")
public void testUninstallApplication() throws MalformedURLException, AutomationFrameworkException {
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT
                    + Constants.AndroidOperations.UNINSTALL_APPS_ENDPOINT,
            Constants.AndroidOperations.UNINSTALL_APPS_PAYLOAD);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}

From source file:org.wso2.iot.integration.device.operation.AndroidOperation.java

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test black list application "
        + "operation")
public void testBlackListApplication()
        throws FileNotFoundException, MalformedURLException, AutomationFrameworkException {
    JsonObject blackListApplicationPayload = PayloadGenerator.getJsonPayload(
            Constants.AndroidOperations.OPERATION_PAYLOAD_FILE_NAME,
            Constants.AndroidOperations.BLACKLIST_OPERATION);
    HttpResponse response = client.post(
            Constants.AndroidOperations.OPERATION_ENDPOINT
                    + Constants.AndroidOperations.BLACKLIST_APPS_ENDPOINT,
            blackListApplicationPayload.toString());
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}