String remotePassword = config.getProperty("remote.password");
String keystorePath = config.getProperty("keystore.path");
String keystorePassword = config.getProperty("keystore.password");
XMPPServer server = createLocalServer(localServer, localUser, localPassword, keystorePath, keystorePassword);
Thread.sleep(2000);
System.out.println();
System.out.println();
System.out.println("Connecting local client");
System.out.println();
System.out.println();
LinkedBlockingQueue<Packet> localClientPackages = new LinkedBlockingQueue<Packet>();
LinkedBlockingQueue<Packet> remoteClientPackages = new LinkedBlockingQueue<Packet>();
XMPPConnection localClient = connectClient(localConnect, localUser.getFullQualifiedName(), localPassword, keystorePath, keystorePassword, localClientPackages);
// XMPPConnection localClient = null;
System.out.println();
System.out.println();
System.out.println("Connecting remote client");
System.out.println();
System.out.println();
// XMPPConnection remoteClient = connectClient(remoteServer, remoteUser, remotePassword, keystorePath, keystorePassword, remoteClientPackages);
XMPPConnection remoteClient = null;
Thread.sleep(3000);
System.out.println();
System.out.println();
System.out.println("Sending message from local to remote");
System.out.println();
System.out.println();
remoteClientPackages.clear();
Message msg = new Message(remoteUser);
msg.setBody("Hello world");
localClient.sendPacket(msg);
// Packet packet = remoteClientPackages.poll(15000, TimeUnit.MILLISECONDS);
// if(packet != null && packet instanceof Message) {
// System.out.println("!!!!!!" + ((Message)packet).getBody());
// } else {
// fail("Message not received by remote client");
// }
//
// Thread.sleep(3000);
//
// System.out.println();
// System.out.println();
// System.out.println("Sending message from remote to local");
// System.out.println();
// System.out.println();
//
// localClientPackages.clear();
// msg = new Message(localUser.getFullQualifiedName());
// msg.setBody("Hello world");
//
// remoteClient.sendPacket(msg);
//
// packet = localClientPackages.poll(15000, TimeUnit.MILLISECONDS);
// if(packet != null && packet instanceof Message) {
// System.out.println("!!!!!!" + ((Message)packet).getBody());
// } else {
// fail("Message not received by local client");
// }
Thread.sleep(15000);
System.out.println();
System.out.println();
System.out.println("Closing down");
System.out.println();
System.out.println();
remoteClient.disconnect();
localClient.disconnect();
Thread.sleep(5000);
server.stop();
}