Make Ssl tests opt-in
This commit is contained in:
parent
bc2fbe14e3
commit
34e8262dc8
11
.idea/codeStyles/Project.xml
Normal file
11
.idea/codeStyles/Project.xml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<codeStyleSettings language="JavaScript">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="INDENT_SIZE" value="2" />
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||||
|
<option name="TAB_SIZE" value="2" />
|
||||||
|
</indentOptions>
|
||||||
|
</codeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||||
|
</state>
|
||||||
|
</component>
|
|
@ -3,16 +3,18 @@ var GossipSeed = require('../src/gossipSeed');
|
||||||
|
|
||||||
var testBase = require('./common/base_test');
|
var testBase = require('./common/base_test');
|
||||||
|
|
||||||
|
var withSsl = !!process.env.NODE_ESC_WITH_SSL;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
'Connect To Endpoint Happy Path': function(test) {
|
'Connect To Endpoint Happy Path': function (test) {
|
||||||
test.expect(1);
|
test.expect(1);
|
||||||
var tcpEndpoint = {host: 'localhost', port: 1113};
|
var tcpEndpoint = {host: 'localhost', port: 1113};
|
||||||
var conn = client.EventStoreConnection.create(testBase.settings(), tcpEndpoint);
|
var conn = client.EventStoreConnection.create(testBase.settings(), tcpEndpoint);
|
||||||
conn.connect()
|
conn.connect()
|
||||||
.catch(function(err) {
|
.catch(function (err) {
|
||||||
test.done(err);
|
test.done(err);
|
||||||
});
|
});
|
||||||
conn.on('connected', function(endPoint){
|
conn.on('connected', function (endPoint) {
|
||||||
test.areEqual("connected endPoint", endPoint, tcpEndpoint);
|
test.areEqual("connected endPoint", endPoint, tcpEndpoint);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
@ -24,10 +26,10 @@ module.exports = {
|
||||||
test.done();
|
test.done();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'Connect To Endpoint That Doesn\'t Exist': function(test) {
|
'Connect To Endpoint That Doesn\'t Exist': function (test) {
|
||||||
test.expect(1);
|
test.expect(1);
|
||||||
var tcpEndpoint = {host: 'localhost', port: 11112};
|
var tcpEndpoint = {host: 'localhost', port: 11112};
|
||||||
var conn = client.EventStoreConnection.create(testBase.settings({maxReconnections:1}), tcpEndpoint);
|
var conn = client.EventStoreConnection.create(testBase.settings({maxReconnections: 1}), tcpEndpoint);
|
||||||
conn.connect()
|
conn.connect()
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
test.done(err);
|
test.done(err);
|
||||||
|
@ -39,12 +41,12 @@ module.exports = {
|
||||||
conn.on('error', function (err) {
|
conn.on('error', function (err) {
|
||||||
test.done(err);
|
test.done(err);
|
||||||
});
|
});
|
||||||
conn.on('closed', function(reason) {
|
conn.on('closed', function (reason) {
|
||||||
test.ok(reason.indexOf("Reconnection limit reached") === 0, "Wrong expected reason.");
|
test.ok(reason.indexOf("Reconnection limit reached") === 0, "Wrong expected reason.");
|
||||||
test.done();
|
test.done();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
'Create a connection with tcp://host:port string': function(test) {
|
'Create a connection with tcp://host:port string': function (test) {
|
||||||
var conn = client.createConnection({}, 'tcp://localhost:1113');
|
var conn = client.createConnection({}, 'tcp://localhost:1113');
|
||||||
conn.close();
|
conn.close();
|
||||||
test.done();
|
test.done();
|
||||||
|
@ -72,8 +74,11 @@ module.exports = {
|
||||||
if (err) return test.done(err);
|
if (err) return test.done(err);
|
||||||
test.done();
|
test.done();
|
||||||
}
|
}
|
||||||
}*/,
|
}*/
|
||||||
'Connect to secure tcp endpoint': function(test) {
|
};
|
||||||
|
|
||||||
|
if (withSsl) {
|
||||||
|
module.exports['Connect to secure tcp endpoint'] = function(test) {
|
||||||
var conn = client.createConnection({
|
var conn = client.createConnection({
|
||||||
useSslConnection: true,
|
useSslConnection: true,
|
||||||
targetHost: 'localhost',
|
targetHost: 'localhost',
|
||||||
|
@ -90,6 +95,6 @@ module.exports = {
|
||||||
test.done();
|
test.done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
testBase.init(module.exports, false);
|
testBase.init(module.exports, false);
|
Loading…
Reference in New Issue
Block a user