gorealis v2 refactor (#5)
* Changing default timeout for start maintenance. * Upgrading dependencies to gorealis v2 and thrift 0.12.0 * Refactored to update to gorealis v2.
This commit is contained in:
parent
ad4dd9606e
commit
6ab5c9334d
1335 changed files with 137431 additions and 61530 deletions
2
vendor/git.apache.org/thrift.git/test/hs/Makefile.am
generated
vendored
2
vendor/git.apache.org/thrift.git/test/hs/Makefile.am
generated
vendored
|
@ -17,8 +17,6 @@
|
|||
# under the License.
|
||||
#
|
||||
|
||||
THRIFT = $(top_builddir)/compiler/cpp/thrift
|
||||
|
||||
stubs: $(THRIFT) ../ConstantsDemo.thrift ../DebugProtoTest.thrift ../ThriftTest.thrift ../Include.thrift
|
||||
$(THRIFT) --gen hs ../ConstantsDemo.thrift
|
||||
$(THRIFT) --gen hs ../DebugProtoTest.thrift
|
||||
|
|
6
vendor/git.apache.org/thrift.git/test/hs/TestClient.hs
generated
vendored
6
vendor/git.apache.org/thrift.git/test/hs/TestClient.hs
generated
vendored
|
@ -46,6 +46,7 @@ import Thrift.Transport.HttpClient
|
|||
import Thrift.Protocol
|
||||
import Thrift.Protocol.Binary
|
||||
import Thrift.Protocol.Compact
|
||||
import Thrift.Protocol.Header
|
||||
import Thrift.Protocol.JSON
|
||||
|
||||
data Options = Options
|
||||
|
@ -85,12 +86,14 @@ getTransport t host port = do return (NoTransport $ "Unsupported transport: " ++
|
|||
data ProtocolType = Binary
|
||||
| Compact
|
||||
| JSON
|
||||
| Header
|
||||
deriving (Show, Eq)
|
||||
|
||||
getProtocol :: String -> ProtocolType
|
||||
getProtocol "binary" = Binary
|
||||
getProtocol "compact" = Compact
|
||||
getProtocol "json" = JSON
|
||||
getProtocol "header" = Header
|
||||
getProtocol p = error $ "Unsupported Protocol: " ++ p
|
||||
|
||||
defaultOptions :: Options
|
||||
|
@ -104,7 +107,7 @@ defaultOptions = Options
|
|||
, testLoops = 1
|
||||
}
|
||||
|
||||
runClient :: (Protocol p, Transport t) => p t -> IO ()
|
||||
runClient :: Protocol p => p -> IO ()
|
||||
runClient p = do
|
||||
let prot = (p,p)
|
||||
putStrLn "Starting Tests"
|
||||
|
@ -266,6 +269,7 @@ main = do
|
|||
Binary -> runClient $ BinaryProtocol t
|
||||
Compact -> runClient $ CompactProtocol t
|
||||
JSON -> runClient $ JSONProtocol t
|
||||
Header -> createHeaderProtocol t t >>= runClient
|
||||
runTest loops p t = do
|
||||
let client = makeClient p t
|
||||
replicateM_ loops client
|
||||
|
|
15
vendor/git.apache.org/thrift.git/test/hs/TestServer.hs
generated
vendored
15
vendor/git.apache.org/thrift.git/test/hs/TestServer.hs
generated
vendored
|
@ -48,6 +48,7 @@ import Thrift.Transport.Framed
|
|||
import Thrift.Transport.Handle
|
||||
import Thrift.Protocol.Binary
|
||||
import Thrift.Protocol.Compact
|
||||
import Thrift.Protocol.Header
|
||||
import Thrift.Protocol.JSON
|
||||
|
||||
data Options = Options
|
||||
|
@ -90,11 +91,13 @@ getTransport t = NoTransport $ "Unsupported transport: " ++ t
|
|||
data ProtocolType = Binary
|
||||
| Compact
|
||||
| JSON
|
||||
| Header
|
||||
|
||||
getProtocol :: String -> ProtocolType
|
||||
getProtocol "binary" = Binary
|
||||
getProtocol "compact" = Compact
|
||||
getProtocol "json" = JSON
|
||||
getProtocol "header" = Header
|
||||
getProtocol p = error $"Unsupported Protocol: " ++ p
|
||||
|
||||
defaultOptions :: Options
|
||||
|
@ -261,13 +264,19 @@ main = do
|
|||
t <- f socket
|
||||
return (p t, p t)
|
||||
|
||||
headerAcceptor f socket = do
|
||||
t <- f socket
|
||||
p <- createHeaderProtocol1 t
|
||||
return (p, p)
|
||||
|
||||
doRunServer p f = do
|
||||
runThreadedServer (acceptor p f) TestHandler ThriftTest.process . PortNumber . fromIntegral
|
||||
|
||||
runServer p f port = case p of
|
||||
Binary -> do doRunServer BinaryProtocol f port
|
||||
Compact -> do doRunServer CompactProtocol f port
|
||||
JSON -> do doRunServer JSONProtocol f port
|
||||
Binary -> doRunServer BinaryProtocol f port
|
||||
Compact -> doRunServer CompactProtocol f port
|
||||
JSON -> doRunServer JSONProtocol f port
|
||||
Header -> runThreadedServer (headerAcceptor f) TestHandler ThriftTest.process (PortNumber $ fromIntegral port)
|
||||
|
||||
parseFlags :: [String] -> Options -> Maybe Options
|
||||
parseFlags (flag : flags) opts = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue