// AssertEcho calls the "echo" endpoint with random data, and asserts
// that the returned data matches the arguments "echo" was called with.
AssertEcho calls the "echo" endpoint with random data, and asserts
that the returned data matches the arguments "echo" was called with.
// AssertEcho calls the " echo " endpoint with random data and asserts // that the returned data matches the arguments " echo " was called with .
func AssertEcho(tb testing.TB, src *tchannel.Channel, targetHostPort, targetService string) {
	ctx, cancel := tchannel.NewContext(Timeout(300 * time.Millisecond))
	defer cancel()
	args := &raw.Args{
		Arg2: RandBytes(1000),
		Arg3: RandBytes(1000),
	}
	arg2, arg3, _, err := raw.Call(ctx, src, targetHostPort, targetService, "echo", args.Arg2, args.Arg3)
	if !assert.NoError(tb, err, "Call from %v (%v) to %v (%v) failed", src.ServiceName(), src.PeerInfo().HostPort, targetService, targetHostPort) {
		return
	}
	assert.Equal(tb, args.Arg2, arg2, "Arg2 mismatch")
	assert.Equal(tb, args.Arg3, arg3, "Arg3 mismatch")
}
func AssertEcho ( tb testing . TB , src * tchannel . Channel , targetHostPort , targetService string ) { ctx , cancel := tchannel . NewContext ( Timeout ( 300 * time . Millisecond ) ) defer cancel ( ) args := & raw . Args { Arg2 : RandBytes ( 1000 ) , Arg3 : RandBytes ( 1000 ) , } arg2 , arg3 , _ , err := raw . Call ( ctx , src , targetHostPort , targetService , " " , args . Arg2 , args . Arg3 ) if ! assert . NoError ( tb , err , " " , src . ServiceName ( ) , src . PeerInfo ( ) . HostPort , targetService , targetHostPort ) { return } assert . Equal ( tb , args . Arg2 , arg2 , " " ) assert . Equal ( tb , args . Arg3 , arg3 , " " ) }
AssertEcho calls the "echo" endpoint with random data, and asserts
that the returned data matches the arguments "echo" was called with.
AssertEcho calls the " echo " endpoint with random data and asserts that the returned data matches the arguments " echo " was called with .