}
@SuppressWarnings("unchecked")
protected Build createBuild(Integer testPlanId, String buildName,
String buildNotes) throws TestLinkAPIException {
Build build = null;
Integer id = 0;
build = new Build(id, testPlanId, buildName, buildNotes);
try {
Map<String, Object> executionData = Util.getBuildMap(build);
Object response = this.executeXmlRpcCall(
TestLinkMethods.CREATE_BUILD.toString(), executionData);
Object[] responseArray = Util.castToArray(response);
Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];
id = Util.getInteger(responseMap,
TestLinkResponseParams.ID.toString());
build.setId(id);
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error creating build: "
+ xmlrpcex.getMessage(), xmlrpcex);
}