You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by ch...@apache.org on 2023/05/23 02:43:36 UTC

[eventmesh-go] 07/26: Removed invalid code.[producer_test.go] #3775

This is an automated email from the ASF dual-hosted git repository.

chenguangsheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/eventmesh-go.git

commit 2a03de85b817acd249b4cd4bb644ca4a018d991f
Author: Piyush <11...@users.noreply.github.com>
AuthorDate: Thu Apr 20 18:28:21 2023 +0530

    Removed invalid code.[producer_test.go] #3775
---
 .../standalone/standalone_connector_test.go        | 49 +---------------------
 1 file changed, 1 insertion(+), 48 deletions(-)

diff --git a/plugin/connector/standalone/standalone_connector_test.go b/plugin/connector/standalone/standalone_connector_test.go
index c6f70b2..0f48a90 100644
--- a/plugin/connector/standalone/standalone_connector_test.go
+++ b/plugin/connector/standalone/standalone_connector_test.go
@@ -147,54 +147,7 @@ func TestConsumer_ManualAck(t *testing.T) {
 
 // TODO update later
 func TestConsumer_UpdateOffset(t *testing.T) {
-	//sum := atomic.NewInt64(0)
-	//ch := make(chan struct{})
-	//listener := connector.EventListener{
-	//	Consume: func(event *ce.Event, commitFunc connector.CommitFunc) error {
-	//		var data map[string]interface{}
-	//		event.DataAs(&data)
-	//		sum.Add(int64(data["val"].(float64)))
-	//		commitFunc(connector.CommitMessage)
-	//		ch <- struct{}{}
-	//		return nil
-	//	},
-	//}
-	//
-	//factory := &Factory{}
-	//err := factory.Setup(pluginName, &plugin.YamlNodeDecoder{
-	//	Node: &yaml.Node{},
-	//})
-	//assert.NoError(t, err)
-	//consumer, _ := factory.GetConsumer()
-	//consumer.Start()
-	//defer consumer.Shutdown()
-	//consumer.RegisterEventListener(&listener)
-	//event := getTestEvent()
-	//event.SetExtension("offset", "49")
-	//consumer.Subscribe(topicName)
-	//consumer.UpdateOffset(context.Background(), []*ce.Event{event})
-	//
-	//producer, _ := factory.GetProducer()
-	//producer.Start()
-	//defer producer.Shutdown()
-	//for i := 1; i <= 50; i++ {
-	//	err := producer.Publish(context.Background(), getTestEventOfData(map[string]interface{}{
-	//		"val": i,
-	//	}), getEmptyPublishCallback())
-	//
-	//	if err != nil {
-	//		t.Fail()
-	//		return
-	//	}
-	//}
-	//
-	//timer := time.NewTimer(3 * time.Second)
-	//select {
-	//case <-timer.C:
-	//	t.Fail()
-	//case <-ch:
-	//	assert.Equal(t, int64(50), sum.Load())
-	//}
+	
 }
 
 func getTestEvent(topicName string) *ce.Event {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org