Re-enabled commented tests
This commit is contained in:
@@ -37,164 +37,164 @@ public class ServerIntegrationTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// @Test
|
@Test
|
||||||
// public void testSubscribe() throws IOException, InterruptedException {
|
public void testSubscribe() throws IOException, InterruptedException {
|
||||||
//// startServer();
|
// startServer();
|
||||||
// Client client = new Client("localhost", Server.PORT);
|
Client client = new Client("localhost", Server.PORT);
|
||||||
//// Client client = new Client("test.mosquitto.org", 1883);
|
// Client client = new Client("test.mosquitto.org", 1883);
|
||||||
// client.connect();
|
client.connect();
|
||||||
//
|
|
||||||
//
|
|
||||||
// client.subscribe("/topic", new IPublishCallback() {
|
client.subscribe("/topic", new IPublishCallback() {
|
||||||
//
|
|
||||||
// public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
// received = true;
|
received = true;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
//
|
|
||||||
// client.publish("/topic", "Test my payload".getBytes());
|
client.publish("/topic", "Test my payload".getBytes());
|
||||||
//
|
|
||||||
// client.close();
|
client.close();
|
||||||
// client.shutdown();
|
client.shutdown();
|
||||||
//
|
|
||||||
// assertTrue(received);
|
assertTrue(received);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//
|
|
||||||
// @Test
|
@Test
|
||||||
// public void testCleanSession_maintainClientSubscriptions() {
|
public void testCleanSession_maintainClientSubscriptions() {
|
||||||
// Client client = new Client("localhost", Server.PORT/*, "CLID_123"*/);
|
Client client = new Client("localhost", Server.PORT/*, "CLID_123"*/);
|
||||||
// client.connect(false); //without session cleanup
|
client.connect(false); //without session cleanup
|
||||||
//
|
|
||||||
// client.subscribe("/topic", new IPublishCallback() {
|
client.subscribe("/topic", new IPublishCallback() {
|
||||||
//
|
|
||||||
// public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
// received = true;
|
received = true;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// client.close();
|
client.close();
|
||||||
//
|
|
||||||
// //Exercise that the client maintain the subscriptions
|
//Exercise that the client maintain the subscriptions
|
||||||
// client.connect(false);
|
client.connect(false);
|
||||||
// client.publish("/topic", "Test my payload".getBytes());
|
client.publish("/topic", "Test my payload".getBytes());
|
||||||
// client.close();
|
client.close();
|
||||||
//
|
|
||||||
// //Verify
|
//Verify
|
||||||
// assertTrue(received);
|
assertTrue(received);
|
||||||
//
|
|
||||||
// //TearDown
|
//TearDown
|
||||||
// client.shutdown();
|
client.shutdown();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Test
|
@Test
|
||||||
// public void testCleanSession_maintainClientSubscriptions_againstClientDestruction() {
|
public void testCleanSession_maintainClientSubscriptions_againstClientDestruction() {
|
||||||
// Client client = new Client("localhost", Server.PORT, "CLID_123");
|
Client client = new Client("localhost", Server.PORT, "CLID_123");
|
||||||
// client.connect(false); //without session cleanup
|
client.connect(false); //without session cleanup
|
||||||
//
|
|
||||||
// client.subscribe("/topic", new IPublishCallback() {
|
client.subscribe("/topic", new IPublishCallback() {
|
||||||
//
|
|
||||||
// public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
// received = true;
|
received = true;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// client.close();
|
client.close();
|
||||||
// client.shutdown();
|
client.shutdown();
|
||||||
//
|
|
||||||
// //Exercise that the client maintain the subscriptions
|
//Exercise that the client maintain the subscriptions
|
||||||
// client = new Client("localhost", Server.PORT, "CLID_123");
|
client = new Client("localhost", Server.PORT, "CLID_123");
|
||||||
// client.register("/topic", new IPublishCallback() {
|
client.register("/topic", new IPublishCallback() {
|
||||||
//
|
|
||||||
// public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
// received = true;
|
received = true;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// client.connect(false);
|
client.connect(false);
|
||||||
// client.publish("/topic", "Test my payload".getBytes());
|
client.publish("/topic", "Test my payload".getBytes());
|
||||||
// client.close();
|
client.close();
|
||||||
//
|
|
||||||
// //Verify
|
//Verify
|
||||||
// assertTrue(received);
|
assertTrue(received);
|
||||||
//
|
|
||||||
// //TearDown
|
//TearDown
|
||||||
// client.shutdown();
|
client.shutdown();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * Check that after a client has connected with clean session false, subscribed
|
* Check that after a client has connected with clean session false, subscribed
|
||||||
// * to some topic and exited, if it reconnect with clean session true, the server
|
* to some topic and exited, if it reconnect with clean session true, the server
|
||||||
// * correctly cleanup every previous subscription
|
* correctly cleanup every previous subscription
|
||||||
// */
|
*/
|
||||||
// @Test
|
@Test
|
||||||
// public void testCleanSession_correctlyClientSubscriptions() {
|
public void testCleanSession_correctlyClientSubscriptions() {
|
||||||
// Client client = new Client("localhost", Server.PORT, "CLID_123");
|
Client client = new Client("localhost", Server.PORT, "CLID_123");
|
||||||
// client.connect(false); //without session cleanup
|
client.connect(false); //without session cleanup
|
||||||
//
|
|
||||||
// client.subscribe("/topic", new IPublishCallback() {
|
client.subscribe("/topic", new IPublishCallback() {
|
||||||
//
|
|
||||||
// public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
// received = true;
|
received = true;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// client.close();
|
client.close();
|
||||||
// client.shutdown();
|
client.shutdown();
|
||||||
//
|
|
||||||
// //Exercise that the client maintain the subscriptions
|
//Exercise that the client maintain the subscriptions
|
||||||
// client = new Client("localhost", Server.PORT, "CLID_123");
|
client = new Client("localhost", Server.PORT, "CLID_123");
|
||||||
// client.register("/topic", new IPublishCallback() {
|
client.register("/topic", new IPublishCallback() {
|
||||||
//
|
|
||||||
// public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
// received = true;
|
received = true;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// client.connect(true);
|
client.connect(true);
|
||||||
// client.publish("/topic", "Test my payload".getBytes());
|
client.publish("/topic", "Test my payload".getBytes());
|
||||||
// client.close();
|
client.close();
|
||||||
//
|
|
||||||
// //Verify
|
//Verify
|
||||||
// assertFalse(received);
|
assertFalse(received);
|
||||||
//
|
|
||||||
// //TearDown
|
//TearDown
|
||||||
// client.shutdown();
|
client.shutdown();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
//
|
|
||||||
// @Test
|
@Test
|
||||||
// public void testCleanSession_maintainClientSubscriptions_withServerRestart() throws IOException {
|
public void testCleanSession_maintainClientSubscriptions_withServerRestart() throws IOException {
|
||||||
// Client client = new Client("localhost", Server.PORT, "CLID_123");
|
Client client = new Client("localhost", Server.PORT, "CLID_123");
|
||||||
// client.connect(false); //without session cleanup
|
client.connect(false); //without session cleanup
|
||||||
//
|
|
||||||
// client.subscribe("/topic", new IPublishCallback() {
|
client.subscribe("/topic", new IPublishCallback() {
|
||||||
//
|
|
||||||
// public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
// received = true;
|
received = true;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// client.close();
|
client.close();
|
||||||
// client.shutdown();
|
client.shutdown();
|
||||||
// server.stopServer();
|
server.stopServer();
|
||||||
//
|
|
||||||
// server.startServer();
|
server.startServer();
|
||||||
//
|
|
||||||
// //Exercise that the client maintain the subscriptions
|
//Exercise that the client maintain the subscriptions
|
||||||
// client = new Client("localhost", Server.PORT, "CLID_123");
|
client = new Client("localhost", Server.PORT, "CLID_123");
|
||||||
// client.register("/topic", new IPublishCallback() {
|
client.register("/topic", new IPublishCallback() {
|
||||||
//
|
|
||||||
// public void published(String topic, byte[] message) {
|
public void published(String topic, byte[] message) {
|
||||||
// received = true;
|
received = true;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// client.connect(false);
|
client.connect(false);
|
||||||
// client.publish("/topic", "Test my payload".getBytes());
|
client.publish("/topic", "Test my payload".getBytes());
|
||||||
// client.close();
|
client.close();
|
||||||
//
|
|
||||||
// //Verify
|
//Verify
|
||||||
// assertTrue(received);
|
assertTrue(received);
|
||||||
//
|
|
||||||
// //TearDown
|
//TearDown
|
||||||
// client.shutdown();
|
client.shutdown();
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user