sijie commented on a change in pull request #2036: Add testcontainer based 
standalone test
URL: https://github.com/apache/incubator-pulsar/pull/2036#discussion_r198351887
 
 

 ##########
 File path: 
tests/integration-tc/src/test/java/org/apache/pulsar/tests/integration/PulsarSimpleTest.java
 ##########
 @@ -0,0 +1,48 @@
+package org.apache.pulsar.tests.integration;
+
+import org.apache.pulsar.client.api.Consumer;
+import org.apache.pulsar.client.api.Message;
+import org.apache.pulsar.client.api.Producer;
+import org.apache.pulsar.client.api.PulsarClient;
+import org.apache.pulsar.client.api.PulsarClientException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+public class PulsarSimpleTest {
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(PulsarSimpleTest.class);
+
+    private PulsarStandAloneCluster pulsarCluster;
+    private PulsarClient client;
+    private Producer producer;
+    private Consumer consumer;
+
+    @BeforeTest
+    public void setup(){
+        pulsarCluster = new 
PulsarStandAloneCluster(PulsarSimpleTest.class.getSimpleName());
+        pulsarCluster.start();
+    }
+
+    @Test
+    public void testTopicSendReceive() throws PulsarClientException {
+        client = 
PulsarClient.builder().serviceUrl(pulsarCluster.getPulsarUrl()).build();
+        consumer = 
client.newConsumer().topic("test").subscriptionName("subs").subscribe();
 
 Review comment:
   use a more specific name for topic name. something like 
"test-topic-send-receive".
   
   "test" is too generic, it is hard for debugging and people might be using 
"test" in other places, which can cause conflicts.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to