You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by he...@apache.org on 2014/04/30 16:21:17 UTC

git commit: THRIFT-2132 Go: Support for Multiplexing Services on any Transport, Protocol and Server Patch: Aleksey Pesternikov

Repository: thrift
Updated Branches:
  refs/heads/master 3290336e3 -> 2bc4b130d


THRIFT-2132 Go: Support for Multiplexing Services on any Transport, Protocol and Server
Patch: Aleksey Pesternikov

typo

This closes #112

----
commit f362570683f57ad9ee78cedc437babb697c6a8d1
Author: Aleksey Pesternikov <ap...@alekseys-mbp.att.net>
Date:   2014-04-30T12:49:11Z

    THRIFT-2132 broken tests

----


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/2bc4b130
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/2bc4b130
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/2bc4b130

Branch: refs/heads/master
Commit: 2bc4b130dead8fdd664be332e16b2b7eb3e809d7
Parents: 3290336
Author: henrique <he...@apache.org>
Authored: Wed Apr 30 16:19:35 2014 +0200
Committer: henrique <he...@apache.org>
Committed: Wed Apr 30 16:19:35 2014 +0200

----------------------------------------------------------------------
 lib/go/test/tests/multiplexed_protocol_test.go | 26 ++++++++-------------
 1 file changed, 10 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/2bc4b130/lib/go/test/tests/multiplexed_protocol_test.go
----------------------------------------------------------------------
diff --git a/lib/go/test/tests/multiplexed_protocol_test.go b/lib/go/test/tests/multiplexed_protocol_test.go
index ee14ee8..5b8a328 100644
--- a/lib/go/test/tests/multiplexed_protocol_test.go
+++ b/lib/go/test/tests/multiplexed_protocol_test.go
@@ -20,11 +20,10 @@
 package tests
 
 import (
-	"MuliplexedProtocolTest"
+	"MultiplexedProtocolTest"
 	"net"
 	"testing"
 	"thrift"
-	"time"
 )
 
 func FindAvailableTCPServerPort() net.Addr {
@@ -48,11 +47,6 @@ func (s *SecondImpl) ReturnTwo() (r int64, err error) {
 	return 2, nil
 }
 
-const TIMEOUT = time.Second
-
-var addr net.Addr
-var server *thrift.TSimpleServer
-
 var processor = thrift.NewTMultiplexedProcessor()
 
 func TestInitTwoServers(t *testing.T) {
@@ -67,37 +61,37 @@ func TestInitTwoServers(t *testing.T) {
 	}
 	server = thrift.NewTSimpleServer4(processor, serverTransport, transportFactory, protocolFactory)
 
-	firstProcessor := MuliplexedProtocolTest.NewFirstProcessor(&FirstImpl{})
+	firstProcessor := MultiplexedProtocolTest.NewFirstProcessor(&FirstImpl{})
 	processor.RegisterProcessor("FirstService", firstProcessor)
 
-	secondProcessor := MuliplexedProtocolTest.NewSecondProcessor(&SecondImpl{})
+	secondProcessor := MultiplexedProtocolTest.NewSecondProcessor(&SecondImpl{})
 	processor.RegisterProcessor("SecondService", secondProcessor)
 
 	go server.Serve()
 }
 
-var firstClient *MuliplexedProtocolTest.FirstClient
+var firstClient *MultiplexedProtocolTest.FirstClient
 
 func TestInitClient1(t *testing.T) {
 	socket := thrift.NewTSocketFromAddrTimeout(addr, TIMEOUT)
 	transport := thrift.NewTFramedTransport(socket)
 	var protocol thrift.TProtocol = thrift.NewTBinaryProtocolTransport(transport)
 	protocol = thrift.NewTMultiplexedProtocol(protocol, "FirstService")
-	firstClient = MuliplexedProtocolTest.NewFirstClientProtocol(transport, protocol, protocol)
+	firstClient = MultiplexedProtocolTest.NewFirstClientProtocol(transport, protocol, protocol)
 	err := transport.Open()
 	if err != nil {
 		t.Fatal("Unable to open client socket", err)
 	}
 }
 
-var secondClient *MuliplexedProtocolTest.SecondClient
+var secondClient *MultiplexedProtocolTest.SecondClient
 
 func TestInitClient2(t *testing.T) {
 	socket := thrift.NewTSocketFromAddrTimeout(addr, TIMEOUT)
 	transport := thrift.NewTFramedTransport(socket)
 	var protocol thrift.TProtocol = thrift.NewTBinaryProtocolTransport(transport)
 	protocol = thrift.NewTMultiplexedProtocol(protocol, "SecondService")
-	secondClient = MuliplexedProtocolTest.NewSecondClientProtocol(transport, protocol, protocol)
+	secondClient = MultiplexedProtocolTest.NewSecondClientProtocol(transport, protocol, protocol)
 	err := transport.Open()
 	if err != nil {
 		t.Fatal("Unable to open client socket", err)
@@ -105,11 +99,11 @@ func TestInitClient2(t *testing.T) {
 }
 
 //create client without service prefix
-func createLegacyClient(t *testing.T) *MuliplexedProtocolTest.SecondClient {
+func createLegacyClient(t *testing.T) *MultiplexedProtocolTest.SecondClient {
 	socket := thrift.NewTSocketFromAddrTimeout(addr, TIMEOUT)
 	transport := thrift.NewTFramedTransport(socket)
 	var protocol thrift.TProtocol = thrift.NewTBinaryProtocolTransport(transport)
-	legacyClient := MuliplexedProtocolTest.NewSecondClientProtocol(transport, protocol, protocol)
+	legacyClient := MultiplexedProtocolTest.NewSecondClientProtocol(transport, protocol, protocol)
 	err := transport.Open()
 	if err != nil {
 		t.Fatal("Unable to open client socket", err)
@@ -145,7 +139,7 @@ func TestCallLegacy(t *testing.T) {
 		t.Fatal("Expecting error")
 	}
 	//register default processor and call again
-	processor.RegisterDefault(MuliplexedProtocolTest.NewSecondProcessor(&SecondImpl{}))
+	processor.RegisterDefault(MultiplexedProtocolTest.NewSecondProcessor(&SecondImpl{}))
 	legacyClient = createLegacyClient(t)
 	ret, err = legacyClient.ReturnTwo()
 	if err != nil {