Skip to content

Commit 7b2f5fb

Browse files
Merge pull request #12847 from rabbitmq/add-missing-nodejs-module
Fix issues in amqp10
2 parents c4d9a84 + 1d8b28d commit 7b2f5fb

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

.github/workflows/test-authnz.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ on:
2020
- .github/workflows/test-authnz.yaml
2121
pull_request:
2222
paths:
23+
- 'selenium/**'
2324
- 'deps/rabbit/**'
2425
- 'deps/rabbitmq_auth_/**'
2526
- 'deps/rabbitmq_mqtt/**'
26-
- 'deps/rabbitmq_management/selenium/full-suite-authnz-messaging'
27-
- 'deps/rabbitmq_management/selenium/suites/authnz-messaging/**'
28-
- 'deps/rabbitmq_management/selenium/test/authnz-msg-protocols/**'
2927
- .github/workflows/test-authnz.yaml
3028
concurrency:
3129
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

selenium/test/amqp.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var container = require('rhea') // https://github.com/amqp/rhea
22
var fs = require('fs');
33
var path = require('path');
4+
var connectionOptions = getConnectionOptions()
45

56
function getAmqpConnectionOptions() {
67
return {
@@ -19,16 +20,18 @@ function getAmqpsConnectionOptions() {
1920
options['enable_sasl_external'] = true
2021
}
2122
options['transport'] = 'tls'
22-
let certsLocation = getEnv("RABBITMQ_CERTS");
23+
let certsLocation = process.env.RABBITMQ_CERTS
2324
options['key'] = fs.readFileSync(path.resolve(certsLocation,'client_rabbitmq_key.pem'))
2425
options['cert'] = fs.readFileSync(path.resolve(certsLocation,'client_rabbitmq_certificate.pem'))
2526
options['ca'] = fs.readFileSync(path.resolve(certsLocation,'ca_rabbitmq_certificate.pem'))
27+
return options
2628
}
2729
function getConnectionOptions() {
28-
switch(process.env.RABBITMQ_AMQP_SCHEME || 'amqp'){
29-
case 'amqp':
30+
let scheme = process.env.RABBITMQ_AMQP_SCHEME || 'amqp'
31+
switch(scheme){
32+
case "amqp":
3033
return getAmqpConnectionOptions()
31-
case 'amqps':
34+
case "amqps":
3235
return getAmqpsConnectionOptions()
3336
}
3437
}
@@ -40,14 +43,14 @@ module.exports = {
4043
resolve()
4144
})
4245
})
43-
let connection = container.connect(getConnectionOptions())
46+
let connection = container.connect(connectionOptions)
4447
let receiver = connection.open_receiver({
45-
source: 'examples',
48+
source: 'my-queue',
4649
target: 'receiver-target',
4750
name: 'receiver-link'
4851
})
4952
let sender = connection.open_sender({
50-
target: 'examples',
53+
target: 'my-queue',
5154
source: 'sender-source',
5255
name: 'sender-link'
5356
})

selenium/test/connections/amqp10/sessions-for-monitoring-user.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ describe('Given an amqp10 connection opened, listed and clicked on it', function
5858
let sessions = await connectionPage.getSessions()
5959
assert.equal(1, sessions.sessions.length)
6060
let session = connectionPage.getSessionInfo(sessions.sessions, 0)
61-
//console.log("session: " + JSON.stringify(session))
6261
assert.equal(0, session.channelNumber)
6362
assert.equal(1, session.nextIncomingId)
6463
assert.equal(0, session.outgoingUnsettledDeliveries)
@@ -70,20 +69,18 @@ describe('Given an amqp10 connection opened, listed and clicked on it', function
7069
assert.equal(1, sessions.outgoing_links.length)
7170

7271
let incomingLink = connectionPage.getIncomingLinkInfo(sessions.incoming_links, 0)
73-
//console.log("incomingLink: " + JSON.stringify(incomingLink))
7472
assert.equal(1, incomingLink.handle)
7573
assert.equal("sender-link", incomingLink.name)
76-
assert.equal("examples", incomingLink.targetAddress)
74+
assert.equal("my-queue", incomingLink.targetAddress)
7775
assert.equal("mixed", incomingLink.sndSettleMode)
7876
assert.equal("0", incomingLink.unconfirmedMessages)
7977
assert.equal(1, incomingLink.deliveryCount)
8078

8179
let outgoingLink = connectionPage.getOutgoingLinkInfo(sessions.outgoing_links, 0)
82-
//console.log("outgoingLink: " + JSON.stringify(outgoingLink))
8380
assert.equal(0, outgoingLink.handle)
8481
assert.equal("receiver-link", outgoingLink.name)
85-
assert.equal("examples", outgoingLink.sourceAddress)
86-
assert.equal("examples", outgoingLink.queueName)
82+
assert.equal("my-queue", outgoingLink.sourceAddress)
83+
assert.equal("my-queue", outgoingLink.queueName)
8784

8885
assert.equal(false, outgoingLink.sendSettled)
8986
assert.equal("unlimited", outgoingLink.maxMessageSize)

0 commit comments

Comments
 (0)