congbobo184 commented on a change in pull request #11304:
URL: https://github.com/apache/pulsar/pull/11304#discussion_r685101508



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionBufferClientTest.java
##########
@@ -74,76 +65,44 @@
 import static org.testng.Assert.fail;
 
 @Test(groups = "broker")
-public class TransactionBufferClientTest extends TransactionMetaStoreTestBase {
+public class TransactionBufferClientTest extends TransactionTestBase {
 
     private static final Logger log = 
LoggerFactory.getLogger(TransactionBufferClientTest.class);
     private TransactionBufferClient tbClient;
     TopicName partitionedTopicName = TopicName.get("persistent", "public", 
"test", "tb-client");
     int partitions = 10;
-    BrokerService[] brokerServices;
     private static final String namespace = "public/test";
 
-    private EventLoopGroup eventLoopGroup;
-
     @Override
-    protected void afterSetup() throws Exception {
-        pulsarAdmins[0].clusters().createCluster("my-cluster", 
ClusterData.builder().serviceUrl(pulsarServices[0].getWebServiceAddress()).build());
-        pulsarAdmins[0].tenants().createTenant("public", new 
TenantInfoImpl(Sets.newHashSet(), Sets.newHashSet("my-cluster")));
-        pulsarAdmins[0].namespaces().createNamespace(namespace, 10);
-        
pulsarAdmins[0].topics().createPartitionedTopic(partitionedTopicName.getPartitionedTopicName(),
 partitions);
-        String subName = "test";
-        
pulsarAdmins[0].topics().createSubscription(partitionedTopicName.getPartitionedTopicName(),
 subName, MessageId.latest);
+    @BeforeClass(alwaysRun = true)
+    protected void setup() throws Exception {
+        setBrokerCount(3);
+        internalSetup();
+        String[] brokerServiceUrlArr = 
getPulsarServiceList().get(0).getBrokerServiceUrl().split(":");
+        String webServicePort = brokerServiceUrlArr[brokerServiceUrlArr.length 
-1];
+        admin.clusters().createCluster(CLUSTER_NAME, 
ClusterData.builder().serviceUrl("http://localhost:"; + webServicePort).build());
+
+        
admin.tenants().createTenant(NamespaceName.SYSTEM_NAMESPACE.getTenant(),
+                new TenantInfoImpl(Sets.newHashSet("appid1"), 
Sets.newHashSet(CLUSTER_NAME)));
+        
admin.namespaces().createNamespace(NamespaceName.SYSTEM_NAMESPACE.toString());
+        
admin.topics().createPartitionedTopic(TopicName.TRANSACTION_COORDINATOR_ASSIGN.toString(),
 16);

Review comment:
       that's good comment, we don't need to create tc topic in this test.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to