Skip to content

Commit

Permalink
Revert useless changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattisonchao committed Nov 13, 2023
1 parent 8e28602 commit f5ecd44
Showing 1 changed file with 0 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,56 +194,6 @@ public void testDurableSubscribe() throws Exception {
}
}

@Test(timeOut = 20000)
public void testRead() throws Exception {
Properties properties = new Properties();
properties.setProperty("serviceUrl", brokerUrl.toString());
properties.setProperty("useTls", "false");

final String topicName = getTopicWithRandomSuffix("reader");
admin.topics().createNonPartitionedTopic(topicName);

int numberOfMessages = 10;
@Cleanup("shutdownNow")
ExecutorService executor = Executors.newSingleThreadExecutor();
CompletableFuture<Void> future = new CompletableFuture<>();
executor.execute(() -> {
try {
PulsarClientTool pulsarClientToolReader = new PulsarClientTool(properties);
String[] args = {"read", "-m", "latest", "-n", Integer.toString(numberOfMessages), "--hex", "-r", "30",
topicName};
assertEquals(pulsarClientToolReader.run(args), 0);
future.complete(null);
} catch (Throwable t) {
future.completeExceptionally(t);
}
});

// Make sure subscription has been created
retryStrategically((test) -> {
try {
return admin.topics().getSubscriptions(topicName).size() == 1;
} catch (Exception e) {
return false;
}
}, 10, 500);

assertEquals(admin.topics().getSubscriptions(topicName).size(), 1);
assertTrue(admin.topics().getSubscriptions(topicName).get(0).startsWith("reader-"));
PulsarClientTool pulsarClientToolProducer = new PulsarClientTool(properties);

String[] args = {"produce", "--messages", "Have a nice day", "-n", Integer.toString(numberOfMessages), "-r",
"20", "-p", "key1=value1", "-p", "key2=value2", "-k", "partition_key", topicName};
assertEquals(pulsarClientToolProducer.run(args), 0);
assertFalse(future.isCompletedExceptionally());
future.get();

Awaitility.await()
.ignoreExceptions()
.atMost(Duration.ofMillis(20000))
.until(()->admin.topics().getSubscriptions(topicName).size() == 0);
}

@Test(timeOut = 20000)
public void testEncryption() throws Exception {
Properties properties = new Properties();
Expand Down

0 comments on commit f5ecd44

Please sign in to comment.