blob: f008a87585cbc9776116b0a032c5f738b181595e [file] [log] [blame]
murgatroid997d1a19a2015-01-20 15:59:43 -08001/*
2 *
Craig Tiller06059952015-02-18 08:34:56 -08003 * Copyright 2015, Google Inc.
murgatroid997d1a19a2015-01-20 15:59:43 -08004 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following disclaimer
14 * in the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
murgatroid99dca966d2015-02-19 14:37:18 -080034'use strict';
35
murgatroid997d1a19a2015-01-20 15:59:43 -080036var interop_server = require('../interop/interop_server.js');
37var interop_client = require('../interop/interop_client.js');
38
murgatroid997d1a19a2015-01-20 15:59:43 -080039var server;
40
41var port;
42
Julien Boeuf597a4f22015-02-23 15:57:14 -080043var name_override = 'foo.test.google.fr';
murgatroid99b6ab1b42015-01-21 10:30:36 -080044
murgatroid997d1a19a2015-01-20 15:59:43 -080045describe('Interop tests', function() {
46 before(function(done) {
murgatroid99f034e502015-01-21 12:12:39 -080047 var server_obj = interop_server.getServer(0, true);
48 server = server_obj.server;
murgatroid99366e64d2015-07-15 17:01:49 -070049 server.start();
murgatroid99f034e502015-01-21 12:12:39 -080050 port = 'localhost:' + server_obj.port;
51 done();
murgatroid997d1a19a2015-01-20 15:59:43 -080052 });
murgatroid9951cab622015-01-26 10:45:49 -080053 after(function() {
murgatroid99cb951f62015-08-18 17:38:11 -070054 server.forceShutdown();
murgatroid9951cab622015-01-26 10:45:49 -080055 });
murgatroid9997d61302015-01-20 18:06:43 -080056 // This depends on not using a binary stream
murgatroid99ec895642015-01-21 13:43:39 -080057 it('should pass empty_unary', function(done) {
murgatroid995b41d4f2015-02-18 10:21:57 -080058 interop_client.runTest(port, name_override, 'empty_unary', true, true,
59 done);
murgatroid997d1a19a2015-01-20 15:59:43 -080060 });
murgatroid99e16e3332015-01-23 11:08:45 -080061 // This fails due to an unknown bug
murgatroid9910ac96c2015-02-12 13:28:25 -080062 it('should pass large_unary', function(done) {
murgatroid995b41d4f2015-02-18 10:21:57 -080063 interop_client.runTest(port, name_override, 'large_unary', true, true,
64 done);
murgatroid997d1a19a2015-01-20 15:59:43 -080065 });
66 it('should pass client_streaming', function(done) {
murgatroid995b41d4f2015-02-18 10:21:57 -080067 interop_client.runTest(port, name_override, 'client_streaming', true, true,
68 done);
murgatroid997d1a19a2015-01-20 15:59:43 -080069 });
70 it('should pass server_streaming', function(done) {
murgatroid995b41d4f2015-02-18 10:21:57 -080071 interop_client.runTest(port, name_override, 'server_streaming', true, true,
72 done);
murgatroid997d1a19a2015-01-20 15:59:43 -080073 });
murgatroid996fe015e2015-10-12 13:18:06 -070074 it('should pass ping_pong', function(done) {
murgatroid995b41d4f2015-02-18 10:21:57 -080075 interop_client.runTest(port, name_override, 'ping_pong', true, true, done);
murgatroid997d1a19a2015-01-20 15:59:43 -080076 });
murgatroid99c92499d2015-01-23 14:52:01 -080077 it('should pass empty_stream', function(done) {
murgatroid995b41d4f2015-02-18 10:21:57 -080078 interop_client.runTest(port, name_override, 'empty_stream', true, true,
79 done);
murgatroid997d1a19a2015-01-20 15:59:43 -080080 });
murgatroid99bca2f952015-01-29 14:32:56 -080081 it('should pass cancel_after_begin', function(done) {
82 interop_client.runTest(port, name_override, 'cancel_after_begin', true,
murgatroid995b41d4f2015-02-18 10:21:57 -080083 true, done);
murgatroid99bca2f952015-01-29 14:32:56 -080084 });
85 it('should pass cancel_after_first_response', function(done) {
86 interop_client.runTest(port, name_override, 'cancel_after_first_response',
murgatroid995b41d4f2015-02-18 10:21:57 -080087 true, true, done);
murgatroid99bca2f952015-01-29 14:32:56 -080088 });
murgatroid999ceac712015-05-14 15:23:16 -070089 it('should pass timeout_on_sleeping_server', function(done) {
90 interop_client.runTest(port, name_override, 'timeout_on_sleeping_server',
91 true, true, done);
92 });
murgatroid99e634f9a2015-08-27 10:02:00 -070093 it('should pass custom_metadata', function(done) {
murgatroid991eb113c2015-08-27 09:26:33 -070094 interop_client.runTest(port, name_override, 'custom_metadata',
95 true, true, done);
96 });
murgatroid99b8ceb7c2015-10-08 11:07:16 -070097 it('should pass status_code_and_message', function(done) {
98 interop_client.runTest(port, name_override, 'status_code_and_message',
99 true, true, done);
100 });
101 it('should pass unimplemented_method', function(done) {
102 interop_client.runTest(port, name_override, 'unimplemented_method',
103 true, true, done);
104 });
murgatroid997d1a19a2015-01-20 15:59:43 -0800105});