use of com.openmeap.protocol.WebServiceException in project OpenMEAP by OpenMEAP.
the class ApplicationManagementServlet method connectionOpenRequest.
/**
* Pulls parameters out of the request and passes them to the ApplicationManagementPortType bean pulled from the WebApplicationContext
*
* @param req
* @return
*/
public Result connectionOpenRequest(HttpServletRequest req) {
WebApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
ConnectionOpenRequest request = createConnectionOpenRequest(req);
Result result = new Result();
try {
ConnectionOpenResponse response = ((ApplicationManagementService) context.getBean("applicationManagementService")).connectionOpen(request);
result.setConnectionOpenResponse(response);
} catch (WebServiceException wse) {
Error err = new Error();
err.setCode(wse.getType().asErrorCode());
err.setMessage(wse.getMessage());
result.setError(err);
}
return result;
}
use of com.openmeap.protocol.WebServiceException in project OpenMEAP by OpenMEAP.
the class ApplicationManagementPortTypeImplTest method testConnectionOpen_verifyNoUpdateIfOnlyInitialVersion.
/**
* Verify that no update is set,
* if there are no deployments
* and the initial version is reported
*/
@Test
public void testConnectionOpen_verifyNoUpdateIfOnlyInitialVersion() throws Exception {
com.openmeap.model.dto.Application app = modelManager.getModelService().findByPrimaryKey(Application.class, 1L);
Iterator<Deployment> i = new ArrayList<Deployment>(app.getDeployments()).iterator();
while (i.hasNext()) {
Deployment d = i.next();
modelManager.delete(d, null);
}
app = modelManager.getModelService().findByPrimaryKey(Application.class, 1L);
Assert.assertTrue(app.getDeployments().size() == 0);
Assert.assertTrue(app.getVersions().size() == 2);
thrown = false;
try {
response = appMgmtSvc.connectionOpen(request);
} catch (WebServiceException wse) {
thrown = true;
}
Assert.assertTrue("If no deployments have been made, it should be ok, providing the initial version is reported by SLIC.", !thrown);
app = modelManager.addModify(app, null);
}
Aggregations