String queueUrl = getQueueUrl(1, USR.USER1);
Map<String, String> attributes = new HashMap<String, String>();
attributes.put("IsCompressed", "true");
cqs1.setQueueAttributes(new SetQueueAttributesRequest(queueUrl,attributes));
StringBuffer sb = new StringBuffer("");
String filename = "data/message.xml";
String message = "";
if (new File(filename).exists()) {
BufferedReader br = new BufferedReader(new FileReader(filename));
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
}
br.close();
message = sb.toString();
} else {
logger.info("using small test message");
message = text;
}
cqs1.sendMessage(new SendMessageRequest(queueUrl, message.toString()));
ReceiveMessageResult result = cqs1.receiveMessage(new ReceiveMessageRequest(queueUrl));
attributes.put("IsCompressed", "false");
cqs1.setQueueAttributes(new SetQueueAttributesRequest(queueUrl,attributes));
if (result != null && result.getMessages().size() == 1) {
assertTrue("wrong message content: " + result.getMessages().get(0).getBody(), message.equals(result.getMessages().get(0).getBody()));
logger.info("event=message_found queue=" + queueUrl + " message=" + message);
} else {