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

alexstocks pushed a commit to branch 0.4.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu.git


The following commit(s) were added to refs/heads/0.4.0 by this push:
     new 7529e25  delete zk and unuse code
     new 544d101  Merge pull request #290 from ztelur/0.4.0
7529e25 is described below

commit 7529e25ea731251ead8948fe6395e4561de06043
Author: randy <[email protected]>
AuthorDate: Sat Oct 30 20:49:33 2021 +0800

    delete zk and unuse code
---
 .gitignore                                         |   1 -
 .../registry/zookeeper/interface_listener_test.go  |  18 ---
 .../registry/zookeeper/service_listener_test.go    |  18 ---
 .../contrib/fatjar/zookeeper-3.4.9-fatjar.jar      | Bin 8673355 -> 0 bytes
 .../remoting/zookeeper/client_test.go              | 166 ---------------------
 .../contrib/fatjar/zookeeper-3.4.9-fatjar.jar      | Bin 8673355 -> 0 bytes
 6 files changed, 203 deletions(-)

diff --git a/.gitignore b/.gitignore
index b590313..8b4d6ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,6 @@ samples/dubbogo/simple/server/app/app
 /logs
 /.idea
 /.vscode
-pkg/registry/zookeeper-4unittest/contrib/fatjar
 
 
 .DS_Store
diff --git 
a/pkg/adapter/dubboregistry/registry/zookeeper/interface_listener_test.go 
b/pkg/adapter/dubboregistry/registry/zookeeper/interface_listener_test.go
deleted file mode 100644
index e386d95..0000000
--- a/pkg/adapter/dubboregistry/registry/zookeeper/interface_listener_test.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package zookeeper
diff --git 
a/pkg/adapter/dubboregistry/registry/zookeeper/service_listener_test.go 
b/pkg/adapter/dubboregistry/registry/zookeeper/service_listener_test.go
deleted file mode 100644
index e386d95..0000000
--- a/pkg/adapter/dubboregistry/registry/zookeeper/service_listener_test.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package zookeeper
diff --git 
a/pkg/adapter/dubboregistry/registry/zookeeper/zookeeper-4unittest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar
 
b/pkg/adapter/dubboregistry/registry/zookeeper/zookeeper-4unittest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar
deleted file mode 100644
index 839531b..0000000
Binary files 
a/pkg/adapter/dubboregistry/registry/zookeeper/zookeeper-4unittest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar
 and /dev/null differ
diff --git a/pkg/adapter/dubboregistry/remoting/zookeeper/client_test.go 
b/pkg/adapter/dubboregistry/remoting/zookeeper/client_test.go
deleted file mode 100644
index e55270a..0000000
--- a/pkg/adapter/dubboregistry/remoting/zookeeper/client_test.go
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package zookeeper
-
-import (
-       "fmt"
-       "testing"
-       "time"
-)
-import (
-       "github.com/dubbogo/go-zookeeper/zk"
-       "github.com/pkg/errors"
-       "github.com/stretchr/testify/assert"
-)
-import (
-       "github.com/apache/dubbo-go-pixiu/pkg/logger"
-)
-
-func verifyEventStateOrder(t *testing.T, c <-chan zk.Event, expectedStates 
[]zk.State, source string) {
-       for _, state := range expectedStates {
-               for {
-                       event, ok := <-c
-                       if !ok {
-                               t.Fatalf("unexpected channel close for %s", 
source)
-                       }
-                       logger.Debug(event)
-                       if event.Type != zk.EventSession {
-                               continue
-                       }
-                       assert.Equal(t, event.State, state)
-                       break
-               }
-       }
-}
-
-// NewMockZooKeeperClient returns a mock client instance
-func NewMockZooKeeperClient(name string, timeout time.Duration, opts 
...Option) (*zk.TestCluster, *ZooKeeperClient, <-chan zk.Event, error) {
-       var (
-               err   error
-               event <-chan zk.Event
-               z     *ZooKeeperClient
-               ts    *zk.TestCluster
-       )
-
-       z = &ZooKeeperClient{
-               name:          name,
-               ZkAddrs:       []string{},
-               Timeout:       timeout,
-               exit:          make(chan struct{}),
-               eventRegistry: make(map[string][]*chan struct{}),
-       }
-
-       options := &Options{}
-       for _, opt := range opts {
-               opt(options)
-       }
-
-       // connect to zookeeper
-       if options.ts != nil {
-               ts = options.ts
-       } else {
-               ts, err = zk.StartTestCluster(1, nil, nil)
-               if err != nil {
-                       return nil, nil, nil, errors.WithMessagef(err, 
"zk.Connect")
-               }
-       }
-
-       z.conn, event, err = ts.ConnectWithOptions(timeout)
-       if err != nil {
-               return nil, nil, nil, errors.WithMessagef(err, "zk.Connect")
-       }
-
-       return ts, z, event, nil
-}
-
-func TestNewZooKeeperClient(t *testing.T) {
-       tc, err := zk.StartTestCluster(1, nil, nil)
-       if err != nil {
-               t.Fatal(err)
-       }
-       defer func(tc *zk.TestCluster) {
-               err := tc.Stop()
-               if err != nil {
-                       t.Errorf("failed to stop cluster, %s", err.Error())
-               }
-       }(tc)
-
-       hosts := make([]string, len(tc.Servers))
-       for i, srv := range tc.Servers {
-               hosts[i] = fmt.Sprintf("127.0.0.1:%d", srv.Port)
-       }
-       zkClient, eventChan, err := NewZooKeeperClient("testZK", hosts, 
30*time.Second)
-       if err != nil {
-               t.Fatalf("Connect returned error: %+v", err)
-       }
-
-       states := []zk.State{zk.StateConnecting, zk.StateConnected, 
zk.StateHasSession}
-       verifyEventStateOrder(t, eventChan, states, "event channel")
-
-       zkClient.getConn().Close()
-       verifyEventStateOrder(t, eventChan, []zk.State{zk.StateDisconnected}, 
"event channel")
-}
-
-func TestGetChildren(t *testing.T) {
-       tc, err := zk.StartTestCluster(1, nil, nil)
-       if err != nil {
-               t.Fatal(err)
-       }
-       defer func(tc *zk.TestCluster) {
-               err := tc.Stop()
-               if err != nil {
-                       t.Errorf("failed to stop cluster, %s", err.Error())
-               }
-       }(tc)
-
-       conn, _, _ := tc.ConnectAll()
-       _, err = conn.Create("/test", nil, 0, zk.WorldACL(zk.PermAll))
-       assert.NoError(t, err)
-       _, err = conn.Create("/test/testchild1", nil, 0, 
zk.WorldACL(zk.PermAll))
-       assert.NoError(t, err)
-       _, err = conn.Create("/test/testchild2", nil, 0, 
zk.WorldACL(zk.PermAll))
-       assert.NoError(t, err)
-
-       hosts := make([]string, len(tc.Servers))
-       for i, srv := range tc.Servers {
-               hosts[i] = fmt.Sprintf("127.0.0.1:%d", srv.Port)
-       }
-       zkClient, eventChan, err := NewZooKeeperClient("testZK", hosts, 
30*time.Second)
-       assert.Nil(t, err)
-wait:
-       for {
-               e := <-eventChan
-               switch e.State {
-               case zk.StateDisconnected:
-                       break wait
-               case zk.StateConnected:
-                       children, err := zkClient.GetChildren("/test")
-                       assert.Nil(t, err)
-                       assert.Equal(t, children[1], "testchild1")
-                       assert.Equal(t, children[0], "testchild2")
-
-                       children, err = zkClient.GetChildren("/vacancy")
-                       assert.EqualError(t, err, "path{/vacancy} does not 
exist: node does not exist")
-                       assert.Nil(t, children)
-                       children, err = zkClient.GetChildren("/test/testchild1")
-                       assert.EqualError(t, err, "has none children")
-                       assert.Empty(t, children)
-                       zkClient.conn.Close()
-               }
-       }
-}
diff --git 
a/pkg/adapter/dubboregistry/remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar
 
b/pkg/adapter/dubboregistry/remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar
deleted file mode 100644
index 839531b..0000000
Binary files 
a/pkg/adapter/dubboregistry/remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar
 and /dev/null differ

Reply via email to