use of org.wso2.ballerinalang.compiler.semantics.model.iterable.Operation in project product-iots by wso2.
the class AndroidOperation method testUnLock.
@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android device un-lock " + "operation.")
public void testUnLock() throws MalformedURLException, AutomationFrameworkException {
HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.UNLOCK_ENDPOINT, Constants.AndroidOperations.UNLOCK_OPERATION_PAYLOAD);
Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}
use of org.wso2.ballerinalang.compiler.semantics.model.iterable.Operation in project product-iots by wso2.
the class AndroidOperation method testCamera.
@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());
}
use of org.wso2.ballerinalang.compiler.semantics.model.iterable.Operation in project product-iots by wso2.
the class AndroidOperation method testMute.
@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android mute operation.")
public void testMute() throws Exception {
HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.MUTE_ENDPOINT, Constants.AndroidOperations.MUTE_PAYLOAD);
Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}
use of org.wso2.ballerinalang.compiler.semantics.model.iterable.Operation in project carbon-apimgt by wso2.
the class WSDL11ProcessorImpl method getOperation.
/**
* Retrieves WSDL operation given the binding operation and http verb
*
* @param bindingOperation {@link BindingOperation} object
* @param verb HTTP verb
* @return WSDL operation for the given binding operation and http verb
*/
private WSDLOperation getOperation(BindingOperation bindingOperation, String verb) {
WSDLOperation wsdlOperation = null;
for (Object boExtElement : bindingOperation.getExtensibilityElements()) {
if (boExtElement instanceof HTTPOperation) {
HTTPOperation httpOperation = (HTTPOperation) boExtElement;
if (!StringUtils.isBlank(httpOperation.getLocationURI())) {
wsdlOperation = new WSDLOperation();
wsdlOperation.setVerb(verb);
wsdlOperation.setURI(APIMWSDLUtils.replaceParentheses(httpOperation.getLocationURI()));
if (log.isDebugEnabled()) {
log.debug("Found HTTP Binding operation; name: " + bindingOperation.getName() + " [" + wsdlOperation.getVerb() + " " + wsdlOperation.getURI() + "]");
}
if (APIMWSDLUtils.canContainBody(verb)) {
String boContentType = getContentType(bindingOperation.getBindingInput());
wsdlOperation.setContentType(boContentType != null ? boContentType : TEXT_XML_MEDIA_TYPE);
}
List<WSDLOperationParam> paramList = getParameters(bindingOperation, verb, wsdlOperation.getContentType());
wsdlOperation.setParameters(paramList);
}
}
}
return wsdlOperation;
}
use of org.wso2.ballerinalang.compiler.semantics.model.iterable.Operation in project carbon-apimgt by wso2.
the class DynamicHtmlGenTestCase method testFromOperation.
@Test
public void testFromOperation() throws Exception {
Operation operation = new Operation();
final String summary = "Sample operation summary";
final String description = "Sample operation description";
operation.setDescription(description);
operation.setSummary(summary);
DynamicHtmlGen htmlGen = new DynamicHtmlGen();
CodegenOperation modified = htmlGen.fromOperation("/apis", "GET", operation, null, null);
Assert.assertEquals(modified.summary, summary);
Assert.assertEquals(modified.notes, description);
}
Aggregations