<commit_before>"use strict";

var t = require('chai').assert;
var s = require('./support');
var rayson = require('../');

describe('Rayson.AMQP', function () {
	this.timeout(10000);

	describe('server', function () {

		var server = null;

		after(function (done) {
			server.close(done);
		});

		it('should connect to ', function (done) {
			server = rayson.server(s.server.methods).amqp('amqp://localhost', '$RPC/service/123');
			server.ready(function () {
				delaycall(done);
			});
		});

	});

	describe('client', function () {

		it('should initiate client with 2 params', function (done) {
			var client = rayson.client.amqp('amqp://localhost', '$RPC/service/:service');
			t.ok(client.client);
			t.ok(client.options.topic);
			client.close(done);
		});

		it('should initiate client with 1 params', function (done) {
			var client = rayson.client.amqp({url: 'amqp://localhost', topic: '$RPC/service/:service'});
			t.ok(client.client);
			t.ok(client.options.topic);
			client.close(done);
		});

		it('should initiate amqp js client', function (done) {
			var amqpclient = require('amqper').connect('amqp://localhost');
			var client = rayson.client.amqp(amqpclient, {topic: '$RPC/service/:service'});
			t.equal(client.client, amqpclient);
			t.ok(client.options.topic);
			client.close(done);
		});
	});

	describe('integration', function () {
		this.timeout(5000);

		var url = 'amqp://localhost';

		var server, client;

		beforeEach(function (done) {
			server = rayson.server(s.server.methods).amqp(url, 'rpc/service/123');
			client = rayson.client.amqp(url, {topic: 'rpc/service/:service'});

			server.ready(function () {
				client.ready(done);
			})
		});

		afterEach(function (done) {
			server.close(function () {<commit_msg>remove integration timeout 5s settings<commit_after>"use strict";

var t = require('chai').assert;
var s = require('./support');
var rayson = require('../');

describe('Rayson.AMQP', function () {
	this.timeout(10000);

	describe('server', function () {

		var server = null;

		after(function (done) {
			server.close(done);
		});

		it('should connect to ', function (done) {
			server = rayson.server(s.server.methods).amqp('amqp://localhost', '$RPC/service/123');
			server.ready(function () {
				delaycall(done);
			});
		});

	});

	describe('client', function () {

		it('should initiate client with 2 params', function (done) {
			var client = rayson.client.amqp('amqp://localhost', '$RPC/service/:service');
			t.ok(client.client);
			t.ok(client.options.topic);
			client.close(done);
		});

		it('should initiate client with 1 params', function (done) {
			var client = rayson.client.amqp({url: 'amqp://localhost', topic: '$RPC/service/:service'});
			t.ok(client.client);
			t.ok(client.options.topic);
			client.close(done);
		});

		it('should initiate amqp js client', function (done) {
			var amqpclient = require('amqper').connect('amqp://localhost');
			var client = rayson.client.amqp(amqpclient, {topic: '$RPC/service/:service'});
			t.equal(client.client, amqpclient);
			t.ok(client.options.topic);
			client.close(done);
		});
	});

	describe('integration', function () {
		var url = 'amqp://localhost';

		var server, client;

		beforeEach(function (done) {
			server = rayson.server(s.server.methods).amqp(url, 'rpc/service/123');
			client = rayson.client.amqp(url, {topic: 'rpc/service/:service'});

			server.ready(function () {
				client.ready(done);
			})
		});

		afterEach(function (done) {
			server.close(function () {
{'fraction_non_alphanumeric': 0.19281232173416998, 'fraction_numerical': 0.008841985168282943, 'mean_word_length': 3.9674220963172804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2953104', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1147, 'n_words': 219}