Skip to content

Commit 9263bab

Browse files
Updates to documentation
- clarify what is meant by "your `/Downloads` directory"; - correct references to `apiKey.json` because `CreateConnectionFactoryFromJSON` function will be looking for `applicationApiKey.json`
1 parent 1acbfb0 commit 9263bab

14 files changed

+50
-42
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ go build
186186
### Verify the installation by executing the tests
187187
This project includes a series of tests that validate the successful operation of the Golang JMS style client library.
188188

189-
The test cases use the `CreateConnectionFactoryFromDefaultJSONFiles` method to obtain details of a queue manager to connect to from two JSON files in your `/Downloads` directory;
189+
The test cases use the `CreateConnectionFactoryFromDefaultJSONFiles` method to obtain details of a queue manager to connect to from two JSON files in your `$HOME/Downloads` directory;
190190
- `connection_info.json` contains information like the hostname/port/channel
191191
- If you are using the MQ on Cloud service you can download a pre-populated file directly from the queue manager details page as [described here](https://cloud.ibm.com/docs/mqcloud?topic=mqcloud-mqoc_jms_tls#connection_info-json)
192-
- Otherwise you can insert details of your own queue manager into [this sample file](./config-samples/connection_info.json) and copy it to your `/Downloads` directory
192+
- Otherwise you can insert details of your own queue manager into [this sample file](./config-samples/connection_info.json) and copy it to your `$HOME/Downloads` directory
193193
- `applicationApiKey.json` contains the Application username and password that will be used to connect to your queue manager
194194
- If you are using the MQ on Cloud service you can download a pre-populated file directly from the Application Permissions tab in the service console as [described here](https://cloud.ibm.com/docs/mqcloud?topic=mqcloud-mqoc_jms_tls#apikey-json)
195-
- Otherwise you can insert details of your own queue manager into [this sample file](./config-samples/applicationApiKey.json) and copy it to your `/Downloads` directory
195+
- Otherwise you can insert details of your own queue manager into [this sample file](./config-samples/applicationApiKey.json) and copy it to your `$HOME/Downloads` directory
196196

197-
Once you have added the details of your queue manager and user credentials into the two JSON files and placed them in your `/Downloads` directory you are ready to run the test, which is done in the same way as any other Go tests.
197+
Once you have added the details of your queue manager and user credentials into the two JSON files and placed them in your `$HOME/Downloads` directory you are ready to run the test, which is done in the same way as any other Go tests.
198198

199199
Note that the tests require the queues `DEV.QUEUE.1` and `DEV.QUEUE.2` to be defined on your queue manager, be empty of messages and be accessible to the application username you are using. This will be the case by default for queue managers provisioned through the MQ on Cloud service, but may require manual configuration for queue managers you have created through other means.
200200
```bash

bytesmessage_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
*/
2323
func TestBytesMessageBody(t *testing.T) {
2424

25-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
25+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
2626
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
2727
assert.Nil(t, cfErr)
2828

@@ -53,7 +53,7 @@ func TestBytesMessageBody(t *testing.T) {
5353
*/
5454
func TestBytesMessageNilBody(t *testing.T) {
5555

56-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
56+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
5757
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
5858
assert.Nil(t, cfErr)
5959

@@ -99,7 +99,7 @@ func TestBytesMessageNilBody(t *testing.T) {
9999
*/
100100
func TestBytesMessageWithBody(t *testing.T) {
101101

102-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
102+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
103103
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
104104
assert.Nil(t, cfErr)
105105

@@ -148,7 +148,7 @@ func TestBytesMessageWithBody(t *testing.T) {
148148
*/
149149
func TestBytesMessageInitWithBytes(t *testing.T) {
150150

151-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
151+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
152152
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
153153
assert.Nil(t, cfErr)
154154

@@ -196,7 +196,7 @@ func TestBytesMessageInitWithBytes(t *testing.T) {
196196
*/
197197
func TestBytesMessageProducerSendBytes(t *testing.T) {
198198

199-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
199+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
200200
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
201201
assert.Nil(t, cfErr)
202202

@@ -241,7 +241,7 @@ func TestBytesMessageProducerSendBytes(t *testing.T) {
241241
*/
242242
func TestBytesMessageConsumerReceiveBytesBodyNoWait(t *testing.T) {
243243

244-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
244+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
245245
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
246246
assert.Nil(t, cfErr)
247247

@@ -284,7 +284,7 @@ func TestBytesMessageConsumerReceiveBytesBodyNoWait(t *testing.T) {
284284
*/
285285
func TestBytesMessageConsumerReceiveBytesBody(t *testing.T) {
286286

287-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
287+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
288288
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
289289
assert.Nil(t, cfErr)
290290

@@ -328,7 +328,7 @@ func TestBytesMessageConsumerReceiveBytesBody(t *testing.T) {
328328
*/
329329
func TestBytesMessageConsumerMixedMessageErrors(t *testing.T) {
330330

331-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
331+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
332332
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
333333
assert.Nil(t, cfErr)
334334

cascade_close_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
*/
2727
func TestCascadeClose(t *testing.T) {
2828

29-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
29+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
3030
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
3131
assert.Nil(t, cfErr)
3232

connectionfactory_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
package main
1111

1212
import (
13-
"github.com/ibm-messaging/mq-golang-jms20/mqjms"
14-
"github.com/stretchr/testify/assert"
1513
"log"
1614
"os"
1715
"testing"
16+
17+
"github.com/ibm-messaging/mq-golang-jms20/mqjms"
18+
"github.com/stretchr/testify/assert"
1819
)
1920

2021
/*
@@ -23,7 +24,7 @@ import (
2324
*/
2425
func TestLoadCFFromJSON(t *testing.T) {
2526

26-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
27+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
2728
cf, err := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
2829

2930
if err != nil {

deliverymode_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@ package main
1111

1212
import (
1313
"fmt"
14+
"testing"
15+
1416
"github.com/ibm-messaging/mq-golang-jms20/jms20subset"
1517
"github.com/ibm-messaging/mq-golang-jms20/mqjms"
1618
"github.com/stretchr/testify/assert"
17-
"testing"
1819
)
1920

2021
/*
2122
* Test the ability to send both Persistent and Non-Persistent messages.
2223
*/
2324
func TestDeliveryMode(t *testing.T) {
2425

25-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
26+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
2627
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
2728
assert.Nil(t, cfErr)
2829

getbycorrelid_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
*/
2525
func TestGetByCorrelID(t *testing.T) {
2626

27-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
27+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
2828
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
2929
assert.Nil(t, cfErr)
3030

@@ -96,7 +96,7 @@ func TestGetByCorrelID(t *testing.T) {
9696
*/
9797
func TestSelectorParsing(t *testing.T) {
9898

99-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
99+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
100100
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
101101
assert.Nil(t, cfErr)
102102

@@ -163,7 +163,7 @@ func TestSelectorParsing(t *testing.T) {
163163
*/
164164
func TestCorrelIDParsing(t *testing.T) {
165165

166-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
166+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
167167
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
168168
assert.Nil(t, cfErr)
169169

mqjms/FactoryFactory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
//
2424
// This method reads the following files;
2525
// - $HOME/Downloads/connection_info.json for host/port/channel information
26-
// - $HOME/Downloads/apiKey.json for username/password information
26+
// - $HOME/Downloads/applicationApiKey.json for username/password information
2727
//
2828
// If your queue manager is hosted on the IBM MQ on Cloud service then you can
2929
// download these two files directly from the IBM Cloud service console.
@@ -42,7 +42,7 @@ func CreateConnectionFactoryFromDefaultJSONFiles() (cf ConnectionFactoryImpl, er
4242
// the file as the two parameters. If empty string is provided then the default
4343
// location and name is assumed as follows;
4444
// - $HOME/Downloads/connection_info.json for host/port/channel information
45-
// - $HOME/Downloads/apiKey.json for username/password information
45+
// - $HOME/Downloads/applicationApiKey.json for username/password information
4646
//
4747
// If your queue manager is hosted on the IBM MQ on Cloud service then you can
4848
// download these two files directly from the IBM Cloud service console.

receivewithwait_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@
1010
package main
1111

1212
import (
13-
"github.com/ibm-messaging/mq-golang-jms20/mqjms"
14-
"github.com/stretchr/testify/assert"
1513
"testing"
1614
"time"
15+
16+
"github.com/ibm-messaging/mq-golang-jms20/mqjms"
17+
"github.com/stretchr/testify/assert"
1718
)
1819

1920
/*
2021
* Test the behaviour of the receive-with-wait methods.
2122
*/
2223
func TestReceiveWait(t *testing.T) {
2324

24-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
25+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
2526
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
2627
assert.Nil(t, cfErr)
2728

@@ -80,7 +81,7 @@ func TestReceiveWait(t *testing.T) {
8081

8182
func TestReceiveStringBodyWait(t *testing.T) {
8283

83-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
84+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
8485
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
8586
assert.Nil(t, cfErr)
8687

requestreply_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
*/
2424
func TestRequestReply(t *testing.T) {
2525

26-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
26+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
2727
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
2828
assert.Nil(t, cfErr)
2929

sample_errorhandling_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
package main
1111

1212
import (
13+
"testing"
14+
1315
"github.com/ibm-messaging/mq-golang-jms20/mqjms"
1416
"github.com/stretchr/testify/assert"
15-
"testing"
1617
)
1718

1819
/*
@@ -47,7 +48,7 @@ func TestFailToConnect(t *testing.T) {
4748
*/
4849
func TestFailToConnectToQueue(t *testing.T) {
4950

50-
// Loads CF parameters from connection_info.json and apiKey.json in the Downloads directory
51+
// Loads CF parameters from connection_info.json and applicationApiKey.json in the Downloads directory
5152
cf, cfErr := mqjms.CreateConnectionFactoryFromDefaultJSONFiles()
5253
assert.Nil(t, cfErr)
5354

0 commit comments

Comments
 (0)