assertEquals(topic, new String(msg.getPayload()));
msg.ack();
connection.unsubscribe(new String[] { topic });
}
connection.disconnect();
// test wildcard patterns with above topics
String[] wildcards = { "#", "+", "+/#", "/+", "+/", "+/+", "+/+/", "+/+/+" };
for (String wildcard : wildcards) {
final Pattern pattern = Pattern.compile(wildcard.replaceAll("/?#", "(/?.*)*").replaceAll("\\+", "[^/]*"));