Skip to content

Commit

Permalink
Fix jshint error. (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleung authored and herom committed Jan 2, 2017
1 parent 8e37285 commit daa4fb0
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions test/server-options-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ describe('SOAP Server with Options', function() {
});
});
});


it('should escapeXML in response body', function(done) {
var responseData = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"><soap:Body><xsd1:TradePrice xmlns:xsd1="http://example.com/stockquote.xsd">&lt;S:Envelope xmlns:S=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&lt;S:Body&gt;&lt;ns3:UpdateProfileResponse xmlns:ns3=&quot;http://www.bigdatacollect.or/Name/Types&quot; xmlns=&quot;http://www.bigdatacollect.or/Common/Types&quot;&gt;&lt;ns3:Result resultStatusFlag=&quot;SUCCESS&quot;&gt;&lt;IDs&gt;&lt;UniqueID source=&quot;TESTSOURCE&quot;&gt;100&lt;/UniqueID&gt;&lt;/IDs&gt;&lt;/ns3:Result&gt;&lt;/ns3:UpdateProfileResponse&gt;&lt;/S:Body&gt;&lt;/S:Envelope&gt;</xsd1:TradePrice></soap:Body></soap:Envelope>';
test.server.listen(15099, null, null, function() {
Expand All @@ -173,7 +173,7 @@ describe('SOAP Server with Options', function() {
if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') {
test.baseUrl = 'http://127.0.0.1:' + test.server.address().port;
}

soap.createClient(test.baseUrl + '/stockquote?wsdl', function(err, client) {
assert.ok(!err);
client.GetLastTradePrice({ tickerSymbol: 'xml response' }, function(err, response, body) {
Expand All @@ -184,7 +184,7 @@ describe('SOAP Server with Options', function() {
});
});
});

it('should not escapeXML response in body', function(done) {
var responseData = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"><soap:Body><xsd1:TradePrice xmlns:xsd1="http://example.com/stockquote.xsd"><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns3:UpdateProfileResponse xmlns:ns3="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Common/Types"><ns3:Result resultStatusFlag="SUCCESS"><IDs><UniqueID source="TESTSOURCE">100</UniqueID></IDs></ns3:Result></ns3:UpdateProfileResponse></S:Body></S:Envelope></xsd1:TradePrice></soap:Body></soap:Envelope>';
test.server.listen(15099, null, null, function() {
Expand All @@ -202,7 +202,7 @@ describe('SOAP Server with Options', function() {
if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') {
test.baseUrl = 'http://127.0.0.1:' + test.server.address().port;
}

soap.createClient(test.baseUrl + '/stockquote?wsdl', function(err, client) {
assert.ok(!err);
client.GetLastTradePrice({ tickerSymbol: 'xml response' }, function(err, response, body) {
Expand Down Expand Up @@ -230,24 +230,24 @@ describe('SOAP Server with Options', function() {
if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') {
test.baseUrl = 'http://127.0.0.1:' + test.server.address().port;
}

request.post({
url: test.baseUrl + '/stockquote?wsdl',
body : '<soapenv:Envelope' +
' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"' +
' xmlns:soap="http://service.applicationsnet.com/soap/">' +
' <soapenv:Header/>' +
' <soapenv:Body>' +
' <soap:WrongTag/>' +
' </soapenv:Body>' +
'</soapenv:Envelope>',
headers: {'Content-Type': 'text/xml'}
}, function(err, res, body) {
assert.ok(!err);
assert.equal(res.statusCode, 500);
assert.ok(body.indexOf('\n at') !== -1);
done();
}
url: test.baseUrl + '/stockquote?wsdl',
body : '<soapenv:Envelope' +
' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"' +
' xmlns:soap="http://service.applicationsnet.com/soap/">' +
' <soapenv:Header/>' +
' <soapenv:Body>' +
' <soap:WrongTag/>' +
' </soapenv:Body>' +
'</soapenv:Envelope>',
headers: {'Content-Type': 'text/xml'}
}, function(err, res, body) {
assert.ok(!err);
assert.equal(res.statusCode, 500);
assert.ok(body.indexOf('\n at') !== -1);
done();
}
);
});
});
Expand All @@ -260,7 +260,7 @@ describe('SOAP Server with Options', function() {
xml: test.wsdl,
uri: __dirname + '/wsdl/strict/',
escapeXML: false,
suppressStack: true
suppressStack: true
}, test.service, test.wsdl);
test.baseUrl = 'http://' + test.server.address().address + ":" + test.server.address().port;

Expand All @@ -269,24 +269,24 @@ describe('SOAP Server with Options', function() {
if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') {
test.baseUrl = 'http://127.0.0.1:' + test.server.address().port;
}

request.post({
url: test.baseUrl + '/stockquote?wsdl',
body : '<soapenv:Envelope' +
' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"' +
' xmlns:soap="http://service.applicationsnet.com/soap/">' +
' <soapenv:Header/>' +
' <soapenv:Body>' +
' <soap:WrongTag/>' +
' </soapenv:Body>' +
'</soapenv:Envelope>',
headers: {'Content-Type': 'text/xml'}
}, function(err, res, body) {
assert.ok(!err);
assert.equal(res.statusCode, 500);
assert.equal(body.indexOf('\n at'), -1);
done();
}
url: test.baseUrl + '/stockquote?wsdl',
body : '<soapenv:Envelope' +
' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"' +
' xmlns:soap="http://service.applicationsnet.com/soap/">' +
' <soapenv:Header/>' +
' <soapenv:Body>' +
' <soap:WrongTag/>' +
' </soapenv:Body>' +
'</soapenv:Envelope>',
headers: {'Content-Type': 'text/xml'}
}, function(err, res, body) {
assert.ok(!err);
assert.equal(res.statusCode, 500);
assert.equal(body.indexOf('\n at'), -1);
done();
}
);
});
});
Expand Down

0 comments on commit daa4fb0

Please # to comment.