From 19d870e2cf0f25889ce4836029a1ed2824d2e935 Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Wed, 2 Jul 2025 09:59:53 +0530 Subject: [PATCH 01/13] Switched to LoggingHelper.init() to clean up duplicate logging code --- JMS/com/ibm/mq/samples/jms/JmsGet.java | 20 +++-------------- JMS/com/ibm/mq/samples/jms/JmsPub.java | 22 ++++--------------- JMS/com/ibm/mq/samples/jms/JmsPut.java | 20 +++-------------- JMS/com/ibm/mq/samples/jms/JmsRequest.java | 20 +++-------------- JMS/com/ibm/mq/samples/jms/JmsResponse.java | 20 +++-------------- JMS/com/ibm/mq/samples/jms/JmsSub.java | 20 +++-------------- JMS/com/ibm/mq/samples/jms/LoggingHelper.java | 22 +++++++++++++------ 7 files changed, 34 insertions(+), 110 deletions(-) diff --git a/JMS/com/ibm/mq/samples/jms/JmsGet.java b/JMS/com/ibm/mq/samples/jms/JmsGet.java index 6140cd8e..ca467b0b 100644 --- a/JMS/com/ibm/mq/samples/jms/JmsGet.java +++ b/JMS/com/ibm/mq/samples/jms/JmsGet.java @@ -1,5 +1,5 @@ /* -* (c) Copyright IBM Corporation 2019, 2024 +* (c) Copyright IBM Corporation 2019, 2025 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ import com.ibm.mq.samples.jms.SampleEnvSetter; import com.ibm.mq.samples.jms.JwtHelper; +import com.ibm.mq.samples.jms.LoggingHelper; public class JmsGet { @@ -77,7 +78,7 @@ public class JmsGet { public static void main(String[] args) { logger.info("Get application is starting"); - initialiseLogging(); + LoggingHelper.init(logger); SampleEnvSetter env = new SampleEnvSetter(); int limit = env.getCount(); @@ -256,21 +257,6 @@ private static void recordFailure(Exception ex) { return; } - private static void initialiseLogging() { - Logger defaultLogger = Logger.getLogger(""); - Handler[] handlers = defaultLogger.getHandlers(); - if (handlers != null && handlers.length > 0) { - defaultLogger.removeHandler(handlers[0]); - } - - Handler consoleHandler = new ConsoleHandler(); - consoleHandler.setLevel(LOGLEVEL); - logger.addHandler(consoleHandler); - - logger.setLevel(LOGLEVEL); - logger.finest("Logging initialised"); - } - private static void waitAWhile(int duration) { try { Thread.sleep(duration); diff --git a/JMS/com/ibm/mq/samples/jms/JmsPub.java b/JMS/com/ibm/mq/samples/jms/JmsPub.java index 3b31e947..ed0e6ffa 100644 --- a/JMS/com/ibm/mq/samples/jms/JmsPub.java +++ b/JMS/com/ibm/mq/samples/jms/JmsPub.java @@ -1,5 +1,5 @@ /* -* (c) Copyright IBM Corporation 2019, 2024 +* (c) Copyright IBM Corporation 2019, 2025 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ import com.ibm.mq.samples.jms.SampleEnvSetter; import com.ibm.mq.samples.jms.JwtHelper; +import com.ibm.mq.samples.jms.LoggingHelper; public class JmsPub { private static final String DEFAULT_APP_NAME = "Dev Experience JmsPub"; @@ -73,7 +74,7 @@ public class JmsPub { private static String accessToken = null; public static void main(String[] args) { - initialiseLogging(); + LoggingHelper.init(logger); SampleEnvSetter env = new SampleEnvSetter(); jh = new JwtHelper(env); if (jh.isJwtEnabled()) { @@ -109,7 +110,7 @@ public static void main(String[] args) { logger.info("Publishing messages.\n"); try { - publisher.send(destination, "this is a message"); + publisher.send(destination, "this is a message " + i); logger.info("message was sent"); Thread.sleep(2000); } catch (JMSRuntimeException jmsex) { @@ -218,21 +219,6 @@ private static void recordFailure(Exception ex) { return; } - private static void initialiseLogging() { - Logger defaultLogger = Logger.getLogger(""); - Handler[] handlers = defaultLogger.getHandlers(); - if (handlers != null && handlers.length > 0) { - defaultLogger.removeHandler(handlers[0]); - } - - Handler consoleHandler = new ConsoleHandler(); - consoleHandler.setLevel(LOGLEVEL); - logger.addHandler(consoleHandler); - - logger.setLevel(LOGLEVEL); - logger.finest("Logging initialised"); - } - private static void setUserCredentials(JmsConnectionFactory cf) { try { if (accessToken != null) { diff --git a/JMS/com/ibm/mq/samples/jms/JmsPut.java b/JMS/com/ibm/mq/samples/jms/JmsPut.java index 36447c63..ab5f793b 100644 --- a/JMS/com/ibm/mq/samples/jms/JmsPut.java +++ b/JMS/com/ibm/mq/samples/jms/JmsPut.java @@ -1,5 +1,5 @@ /* -* (c) Copyright IBM Corporation 2019, 2024 +* (c) Copyright IBM Corporation 2019, 2025 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ import com.ibm.mq.samples.jms.SampleEnvSetter; import com.ibm.mq.samples.jms.JwtHelper; +import com.ibm.mq.samples.jms.LoggingHelper; public class JmsPut { @@ -73,7 +74,7 @@ public class JmsPut { private static String accessToken = null; public static void main(String[] args) { - initialiseLogging(); + LoggingHelper.init(logger); SampleEnvSetter env = new SampleEnvSetter(); jh = new JwtHelper(env); if (jh.isJwtEnabled()) { @@ -206,21 +207,6 @@ private static void recordFailure(Exception ex) { return; } - private static void initialiseLogging() { - Logger defaultLogger = Logger.getLogger(""); - Handler[] handlers = defaultLogger.getHandlers(); - if (handlers != null && handlers.length > 0) { - defaultLogger.removeHandler(handlers[0]); - } - - Handler consoleHandler = new ConsoleHandler(); - consoleHandler.setLevel(LOGLEVEL); - logger.addHandler(consoleHandler); - - logger.setLevel(LOGLEVEL); - logger.finest("Logging initialised"); - } - private static void setUserCredentials(JmsConnectionFactory cf) { try { if (accessToken != null) { diff --git a/JMS/com/ibm/mq/samples/jms/JmsRequest.java b/JMS/com/ibm/mq/samples/jms/JmsRequest.java index f49a03e1..7bdbf06c 100644 --- a/JMS/com/ibm/mq/samples/jms/JmsRequest.java +++ b/JMS/com/ibm/mq/samples/jms/JmsRequest.java @@ -1,5 +1,5 @@ /* -* (c) Copyright IBM Corporation 2019, 2024 +* (c) Copyright IBM Corporation 2019, 2025 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,6 +58,7 @@ import com.ibm.mq.samples.jms.SampleEnvSetter; import com.ibm.mq.samples.jms.JwtHelper; +import com.ibm.mq.samples.jms.LoggingHelper; public class JmsRequest { @@ -91,7 +92,7 @@ public class JmsRequest { public static void main(String[] args) { - initialiseLogging(); + LoggingHelper.init(logger); SampleEnvSetter env = new SampleEnvSetter(); jh = new JwtHelper(env); if (jh.isJwtEnabled()) { @@ -328,21 +329,6 @@ private static void recordFailure(Exception ex) { return; } - private static void initialiseLogging() { - Logger defaultLogger = Logger.getLogger(""); - Handler[] handlers = defaultLogger.getHandlers(); - if (handlers != null && handlers.length > 0) { - defaultLogger.removeHandler(handlers[0]); - } - - Handler consoleHandler = new ConsoleHandler(); - consoleHandler.setLevel(LOGLEVEL); - logger.addHandler(consoleHandler); - - logger.setLevel(LOGLEVEL); - logger.finest("Logging initialised"); - } - private static void setUserCredentials(JmsConnectionFactory cf) { try { if (accessToken != null) { diff --git a/JMS/com/ibm/mq/samples/jms/JmsResponse.java b/JMS/com/ibm/mq/samples/jms/JmsResponse.java index c5092b20..11640c59 100644 --- a/JMS/com/ibm/mq/samples/jms/JmsResponse.java +++ b/JMS/com/ibm/mq/samples/jms/JmsResponse.java @@ -1,5 +1,5 @@ /* -* (c) Copyright IBM Corporation 2019, 2024 +* (c) Copyright IBM Corporation 2019, 2025 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,6 +62,7 @@ import com.ibm.mq.samples.jms.SampleEnvSetter; import com.ibm.mq.samples.jms.JwtHelper; +import com.ibm.mq.samples.jms.LoggingHelper; public class JmsResponse { private static final String DEFAULT_APP_NAME = "Dev Experience JmsResponse"; @@ -87,7 +88,7 @@ public class JmsResponse { private static Long HOUR = 60 * 60 * SECOND; public static void main(String[] args) { - initialiseLogging(); + LoggingHelper.init(logger); SampleEnvSetter env = new SampleEnvSetter(); jh = new JwtHelper(env); if (jh.isJwtEnabled()) { @@ -409,21 +410,6 @@ private static void recordFailure(Exception ex) { return; } - private static void initialiseLogging() { - Logger defaultLogger = Logger.getLogger(""); - Handler[] handlers = defaultLogger.getHandlers(); - if (handlers != null && handlers.length > 0) { - defaultLogger.removeHandler(handlers[0]); - } - - Handler consoleHandler = new ConsoleHandler(); - consoleHandler.setLevel(LOGLEVEL); - logger.addHandler(consoleHandler); - - logger.setLevel(LOGLEVEL); - logger.finest("Logging initialised"); - } - private static void setUserCredentials(JmsConnectionFactory cf) { try { if (accessToken != null) { diff --git a/JMS/com/ibm/mq/samples/jms/JmsSub.java b/JMS/com/ibm/mq/samples/jms/JmsSub.java index 5334caa5..bf88a39c 100644 --- a/JMS/com/ibm/mq/samples/jms/JmsSub.java +++ b/JMS/com/ibm/mq/samples/jms/JmsSub.java @@ -1,5 +1,5 @@ /* -* (c) Copyright IBM Corporation 2019, 2024 +* (c) Copyright IBM Corporation 2019, 2025 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ import com.ibm.mq.samples.jms.SampleEnvSetter; import com.ibm.mq.samples.jms.JwtHelper; +import com.ibm.mq.samples.jms.LoggingHelper; public class JmsSub { private static final String DEFAULT_APP_NAME = "Dev Experience JmsSub"; @@ -69,7 +70,7 @@ public class JmsSub { private static String accessToken = null; public static void main(String[] args) { - initialiseLogging(); + LoggingHelper.init(logger); SampleEnvSetter env = new SampleEnvSetter(); jh = new JwtHelper(env); if (jh.isJwtEnabled()) { @@ -209,21 +210,6 @@ private static void recordFailure(Exception ex) { return; } - private static void initialiseLogging() { - Logger defaultLogger = Logger.getLogger(""); - Handler[] handlers = defaultLogger.getHandlers(); - if (handlers != null && handlers.length > 0) { - defaultLogger.removeHandler(handlers[0]); - } - - Handler consoleHandler = new ConsoleHandler(); - consoleHandler.setLevel(LOGLEVEL); - logger.addHandler(consoleHandler); - - logger.setLevel(LOGLEVEL); - logger.finest("Logging initialised"); - } - private static void setUserCredentials(JmsConnectionFactory cf) { try { if (accessToken != null) { diff --git a/JMS/com/ibm/mq/samples/jms/LoggingHelper.java b/JMS/com/ibm/mq/samples/jms/LoggingHelper.java index 2855ec1f..9de0a016 100644 --- a/JMS/com/ibm/mq/samples/jms/LoggingHelper.java +++ b/JMS/com/ibm/mq/samples/jms/LoggingHelper.java @@ -1,5 +1,5 @@ /* -* (c) Copyright IBM Corporation 2019 +* (c) Copyright IBM Corporation 2019, 2025 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,28 @@ import java.util.logging.*; public class LoggingHelper { + private static boolean isLoggingInitialized = false; private static final Level LOGLEVEL = Level.ALL; public static void init(Logger logger) { - Logger defaultLogger = Logger.getLogger(""); - Handler[] handlers = defaultLogger.getHandlers(); - if (handlers != null && handlers.length > 0) { - defaultLogger.removeHandler(handlers[0]); + if (isLoggingInitialized) + return; + + logger.setUseParentHandlers(false); // avoid duplicate logs + + for (Handler handler : logger.getHandlers()) { + if (handler instanceof ConsoleHandler) { + logger.removeHandler(handler); + } } - Handler consoleHandler = new ConsoleHandler(); + ConsoleHandler consoleHandler = new ConsoleHandler(); consoleHandler.setLevel(LOGLEVEL); logger.addHandler(consoleHandler); logger.setLevel(LOGLEVEL); - logger.finest("Logging initialised"); + logger.finest("Logging initialized"); + + isLoggingInitialized = true; } } \ No newline at end of file From eaeb973ac74361655196b505ff6f4308d3f5235a Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Wed, 2 Jul 2025 10:00:23 +0530 Subject: [PATCH 02/13] updated the thread sleep time --- JMS/src/test/java/com/ibm/mq/samples/jms/JmsPubSubTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JMS/src/test/java/com/ibm/mq/samples/jms/JmsPubSubTest.java b/JMS/src/test/java/com/ibm/mq/samples/jms/JmsPubSubTest.java index 110b2f40..6eccf6db 100644 --- a/JMS/src/test/java/com/ibm/mq/samples/jms/JmsPubSubTest.java +++ b/JMS/src/test/java/com/ibm/mq/samples/jms/JmsPubSubTest.java @@ -1,5 +1,5 @@ /* -* (c) Copyright IBM Corporation 2024 +* (c) Copyright IBM Corporation 2024, 2025 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ public void testJmsPubSub(){ subThread.start(); //Wait for subscription to take place before publishing try { - Thread.sleep(2000); + Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } From 76b675ab9d9a6695bf6e70f0c7ac4acb15baef35 Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Wed, 2 Jul 2025 10:02:33 +0530 Subject: [PATCH 03/13] updated the init method --- JMS/com/ibm/mq/samples/jms/LoggingHelper.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/JMS/com/ibm/mq/samples/jms/LoggingHelper.java b/JMS/com/ibm/mq/samples/jms/LoggingHelper.java index 9de0a016..741c5e95 100644 --- a/JMS/com/ibm/mq/samples/jms/LoggingHelper.java +++ b/JMS/com/ibm/mq/samples/jms/LoggingHelper.java @@ -25,22 +25,19 @@ public class LoggingHelper { public static void init(Logger logger) { if (isLoggingInitialized) return; - - logger.setUseParentHandlers(false); // avoid duplicate logs + // avoid duplicate logs + logger.setUseParentHandlers(false); for (Handler handler : logger.getHandlers()) { if (handler instanceof ConsoleHandler) { logger.removeHandler(handler); } } - ConsoleHandler consoleHandler = new ConsoleHandler(); consoleHandler.setLevel(LOGLEVEL); logger.addHandler(consoleHandler); - logger.setLevel(LOGLEVEL); logger.finest("Logging initialized"); - isLoggingInitialized = true; } } \ No newline at end of file From bd03ba2c6b7889d124bc6559c5c948e0d767314f Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Thu, 3 Jul 2025 14:51:46 +0530 Subject: [PATCH 04/13] Added afterall to restore the custom path and added clearproperty to clean up the system setproperty --- .../ibm/mq/samples/jms/SampleEnvSetterTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/JMS/src/test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java b/JMS/src/test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java index deec6ccb..1ff7ae2e 100644 --- a/JMS/src/test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java +++ b/JMS/src/test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java @@ -19,6 +19,7 @@ import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.AfterAll; public class SampleEnvSetterTest { @@ -30,6 +31,16 @@ public static void setUp(){ envSetter = new SampleEnvSetter(); } + @AfterAll + public static void tearDown() { + // Restore the original value so other tests are unaffected + if (originalEnvFile != null) { + System.setProperty(SampleEnvSetter.ENV_FILE, originalEnvFile); + } else { + System.clearProperty(SampleEnvSetter.ENV_FILE); + } + } + @Test public void testGetEnvValueWithoutEnv() { @@ -51,6 +62,7 @@ public void testGetEnvValueWithEnv() { // Test for non-existing key but existing Environment variable String value = envSetter.getEnvValue("APP_USER", 1); assertEquals("testUser", value); + System.clearProperty("APP_USER"); } @Test @@ -84,6 +96,7 @@ public void testGEBVWithEnv(){ //Test for Non existing but existing env key Boolean value = envSetter.getEnvBooleanValue("BINDINGS", 0); assertTrue(value); + System.clearProperty("BINDINGS"); } @Test @@ -102,6 +115,7 @@ public void testGetCheckCCDT(){ value = envSetter.getCheckForCCDT(); //Test for getCheckForCCDT with MQCCDTURL set to incorrect ccdt file location assertNull(value); + System.clearProperty("MQCCDTURL"); } @Test From f9357b70755735bfc78b3a690d3f40649eb1bcad Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Thu, 3 Jul 2025 15:02:07 +0530 Subject: [PATCH 05/13] added the variable --- .../test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/JMS/src/test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java b/JMS/src/test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java index 1ff7ae2e..993cf083 100644 --- a/JMS/src/test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java +++ b/JMS/src/test/java/com/ibm/mq/samples/jms/SampleEnvSetterTest.java @@ -23,6 +23,7 @@ public class SampleEnvSetterTest { + private static String originalEnvFile; private static SampleEnvSetter envSetter; @BeforeAll From 3a31a32a1c23642e09288c853cc8c1cb8f7523aa Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Thu, 3 Jul 2025 17:27:47 +0530 Subject: [PATCH 06/13] added .yml files --- .github/workflows/test-JMS.yml | 81 ++++++++++++++++++++++++++++++ .github/workflows/test-Node.yml | 88 +++++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 .github/workflows/test-JMS.yml create mode 100644 .github/workflows/test-Node.yml diff --git a/.github/workflows/test-JMS.yml b/.github/workflows/test-JMS.yml new file mode 100644 index 00000000..8df3d3ce --- /dev/null +++ b/.github/workflows/test-JMS.yml @@ -0,0 +1,81 @@ +name: Run JMS Tests + +on: + pull-request: + branches: + - master + paths: + - 'JMS/**' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Podman + run: | + sudo apt-get update + sudo apt-get install -y podman + + - name: Pull IBM MQ image + run: podman pull icr.io/ibm-messaging/mq:latest + + - name: Run IBM MQ container (QM1) + run: | + podman run \ + --env LICENSE=accept \ + --env MQ_QMGR_NAME=QM1 \ + --env MQ_APP_USER=app \ + --env MQ_APP_PASSWORD=passw0rd \ + --env MQ_ADMIN_USER=admin \ + --env MQ_ADMIN_PASSWORD=passw0rd \ + --volume qm1data:/mnt/mqm \ + --publish 1414:1414 \ + --publish 9443:9443 \ + --detach \ + --name QM1 \ + icr.io/ibm-messaging/mq:latest + + - name: Wait for QMGR to be running + run: | + for i in {1..12}; do + STATUS=$(podman exec QM1 bash -c "dspmq -nm QM1" | grep -o 'STATUS([^)]*)' | cut -d'(' -f2 | cut -d')' -f1) + echo "QMGR state: $STATUS" + if [ "$STATUS" = "RUNNING" ]; then + echo "QM1 is running" + break + fi + echo "Waiting for QMGR to start..." + sleep 5 + done + + - name: Create env.json + working-directory: JMS + run: | + cat << EOF > env.json + { + "MQ_ENDPOINTS": [{ + "HOST": "127.0.0.1", + "PORT": "1414", + "CHANNEL": "DEV.APP.SVRCONN", + "QMGR": "QM1", + "APP_USER": "app", + "APP_PASSWORD": "passw0rd", + "QUEUE_NAME": "DEV.QUEUE.1", + "BACKOUT_QUEUE": "DEV.QUEUE.2", + "MODEL_QUEUE_NAME": "DEV.APP.MODEL.QUEUE", + "DYNAMIC_QUEUE_PREFIX": "APP.REPLIES.*", + "TOPIC_NAME": "dev/" + }] + } + EOF + echo "env.json path: $(pwd)" + cat env.json + + - name: Run the JMS tests + working-directory: JMS + run: | + mvn -Dmaven.test.skip=false -DEnvFile="/home/runner/work/mq-dev-patterns/mq-dev-patterns/JMS/env.json" test \ No newline at end of file diff --git a/.github/workflows/test-Node.yml b/.github/workflows/test-Node.yml new file mode 100644 index 00000000..1c8f532b --- /dev/null +++ b/.github/workflows/test-Node.yml @@ -0,0 +1,88 @@ +name: Run Node.js Tests + +on: + pull-request: + branches: + - master + paths: + - 'Node.js/**' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Podman + run: | + sudo apt-get update + sudo apt-get install -y podman + + - name: Pull IBM MQ image + run: podman pull icr.io/ibm-messaging/mq:latest + + - name: Run IBM MQ container (QM1) + run: | + podman run \ + --env LICENSE=accept \ + --env MQ_QMGR_NAME=QM1 \ + --env MQ_APP_USER=app \ + --env MQ_APP_PASSWORD=passw0rd \ + --env MQ_ADMIN_USER=admin \ + --env MQ_ADMIN_PASSWORD=passw0rd \ + --volume qm1data:/mnt/mqm \ + --publish 1414:1414 \ + --publish 9443:9443 \ + --detach \ + --name QM1 \ + icr.io/ibm-messaging/mq:latest + + - name: Wait for QMGR to be running + run: | + for i in {1..12}; do + STATUS=$(podman exec QM1 bash -c "dspmq -nm QM1" | grep -o 'STATUS([^)]*)' | cut -d'(' -f2 | cut -d')' -f1) + echo "QMGR state: $STATUS" + if [ "$STATUS" = "RUNNING" ]; then + echo "QM1 is running" + break + fi + echo "Waiting for QMGR to start..." + sleep 5 + done + + - name: Create env.json + working-directory: Node.js + run: | + cat << EOF > env.json + { + "MQ_ENDPOINTS": [{ + "HOST": "127.0.0.1", + "PORT": "1414", + "CHANNEL": "DEV.APP.SVRCONN", + "QMGR": "QM1", + "APP_USER": "app", + "APP_PASSWORD": "passw0rd", + "QUEUE_NAME": "DEV.QUEUE.1", + "BACKOUT_QUEUE": "DEV.QUEUE.2", + "MODEL_QUEUE_NAME": "DEV.APP.MODEL.QUEUE", + "DYNAMIC_QUEUE_PREFIX": "APP.REPLIES.*", + "TOPIC_NAME": "dev/" + }] + } + EOF + echo "PWD: $(pwd)" + cat env.json + + - name: Install dependencies + working-directory: Node.js + run: | + npm install + npm install --global mocha + + - name: Run Node.js tests + working-directory: Node.js + env: + EnvFile: "/home/runner/work/mq-dev-patterns/mq-dev-patterns/Node.js/env.json" + run: mocha \ No newline at end of file From f51afc47d8da0247ad9fe9632e377019e40dddc0 Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Thu, 3 Jul 2025 17:35:46 +0530 Subject: [PATCH 07/13] trigger update --- .github/workflows/test-JMS.yml | 2 +- .github/workflows/test-Node.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-JMS.yml b/.github/workflows/test-JMS.yml index 8df3d3ce..d751a7d8 100644 --- a/.github/workflows/test-JMS.yml +++ b/.github/workflows/test-JMS.yml @@ -1,7 +1,7 @@ name: Run JMS Tests on: - pull-request: + pull_request: branches: - master paths: diff --git a/.github/workflows/test-Node.yml b/.github/workflows/test-Node.yml index 1c8f532b..56ff5d94 100644 --- a/.github/workflows/test-Node.yml +++ b/.github/workflows/test-Node.yml @@ -1,7 +1,7 @@ name: Run Node.js Tests on: - pull-request: + pull_request: branches: - master paths: From f9e04ff1ceee20aee6778da657d1b452a3bbc755 Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Fri, 4 Jul 2025 13:20:33 +0530 Subject: [PATCH 08/13] added the .yml files --- .github/workflows/test-JMS.yml | 2 +- .github/workflows/test-JMSSecrets.yml | 48 ++++++++++++++++++++++ .github/workflows/test-Node.yml | 2 +- .github/workflows/test-NodeSecrets.yml | 56 ++++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-JMSSecrets.yml create mode 100644 .github/workflows/test-NodeSecrets.yml diff --git a/.github/workflows/test-JMS.yml b/.github/workflows/test-JMS.yml index d751a7d8..a9213634 100644 --- a/.github/workflows/test-JMS.yml +++ b/.github/workflows/test-JMS.yml @@ -78,4 +78,4 @@ jobs: - name: Run the JMS tests working-directory: JMS run: | - mvn -Dmaven.test.skip=false -DEnvFile="/home/runner/work/mq-dev-patterns/mq-dev-patterns/JMS/env.json" test \ No newline at end of file + mvn -Dmaven.test.skip=false test -DEnvFile="$(pwd)/env.json" \ No newline at end of file diff --git a/.github/workflows/test-JMSSecrets.yml b/.github/workflows/test-JMSSecrets.yml new file mode 100644 index 00000000..f14a5d4f --- /dev/null +++ b/.github/workflows/test-JMSSecrets.yml @@ -0,0 +1,48 @@ +name: Run JMS Tests using git actions secrets + +on: + push: + branches: + - anitha-unittest-automation + paths: + - 'JMS/**' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Create env.json from secrets + working-directory: JMS + run: | + cat << EOF > env.json + { + "MQ_ENDPOINTS": [{ + "HOST": "${{ secrets.HOST }}", + "PORT": "${{ secrets.PORT }}", + "CHANNEL": "CLOUD.APP.SVRCONN", + "QMGR": "QMHE", + "APP_USER": "${{ secrets.APP_USER }}", + "APP_PASSWORD": "${{ secrets.APP_PASSWORD }}", + "QUEUE_NAME": "DEV.QUEUE.1", + "BACKOUT_QUEUE": "DEV.QUEUE.2", + "MODEL_QUEUE_NAME": "CLOUD.APP.MODEL.QUEUE", + "DYNAMIC_QUEUE_PREFIX": "APP.REPLIES.*", + "TOPIC_NAME": "dev/", + "CIPHER": "TLS_AES_256_GCM_SHA384", + "CIPHER_SUITE": "TLS_AES_256_GCM_SHA384", + "KEY_REPOSITORY": "" + }] + } + EOF + + echo "env.json path: $(pwd)/env.json" + cat env.json + + - name: Run the tests + working-directory: JMS + run: | + mvn -Dmaven.test.skip=false test -DEnvFile="$(pwd)/env.json" diff --git a/.github/workflows/test-Node.yml b/.github/workflows/test-Node.yml index 56ff5d94..b1847969 100644 --- a/.github/workflows/test-Node.yml +++ b/.github/workflows/test-Node.yml @@ -72,7 +72,7 @@ jobs: }] } EOF - echo "PWD: $(pwd)" + echo "env.json path: $(pwd)/env.json" cat env.json - name: Install dependencies diff --git a/.github/workflows/test-NodeSecrets.yml b/.github/workflows/test-NodeSecrets.yml new file mode 100644 index 00000000..8bf82f4c --- /dev/null +++ b/.github/workflows/test-NodeSecrets.yml @@ -0,0 +1,56 @@ +name: Run Node tests using git actions secrets + +on: + push: + branches: + - anitha-unittest-automation + paths: + - 'Node.js/**' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Create env.json from secrets + working-directory: Node.js + run: | + cat << EOF > env.json + { + "MQ_ENDPOINTS": [{ + "HOST": "${{ secrets.HOST }}", + "PORT": "${{ secrets.PORT }}", + "CHANNEL": "CLOUD.APP.SVRCONN", + "QMGR": "QMHE", + "APP_USER": "${{ secrets.APP_USER }}", + "APP_PASSWORD": "${{ secrets.APP_PASSWORD }}", + "QUEUE_NAME": "DEV.QUEUE.1", + "BACKOUT_QUEUE": "DEV.QUEUE.2", + "MODEL_QUEUE_NAME": "CLOUD.APP.MODEL.QUEUE", + "DYNAMIC_QUEUE_PREFIX": "APP.REPLIES.*", + "TOPIC_NAME": "dev/", + "CIPHER": "TLS_AES_256_GCM_SHA384", + "CIPHER_SUITE": "TLS_AES_256_GCM_SHA384", + "KEY_REPOSITORY": "./keys/clientkey" + }] + } + EOF + + echo "env.json path: $(pwd)/env.json" + cat env.json + + - name: Install dependencies + working-directory: Node.js + run: | + npm install + npm install --global mocha + + - name: Run Node.js tests + working-directory: Node.js + env: + EnvFile: "/home/runner/work/mq-dev-patterns/mq-dev-patterns/Node.js/env.json" + run: mocha + From 882f7ac1f977aeb883eeaee5923f515b69e2ec4d Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Fri, 4 Jul 2025 14:27:06 +0530 Subject: [PATCH 09/13] added .yml files and keys --- .github/workflows/test-JMS.yml | 3 ++- .github/workflows/test-JMSSecrets.yml | 6 +++--- .github/workflows/test-Node.yml | 2 +- .github/workflows/test-NodeSecrets.yml | 6 +++--- Node.js/keys/clientkey.kdb | Bin 0 -> 5982 bytes Node.js/keys/clientkey.sth | Bin 0 -> 193 bytes 6 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 Node.js/keys/clientkey.kdb create mode 100644 Node.js/keys/clientkey.sth diff --git a/.github/workflows/test-JMS.yml b/.github/workflows/test-JMS.yml index a9213634..c194155c 100644 --- a/.github/workflows/test-JMS.yml +++ b/.github/workflows/test-JMS.yml @@ -78,4 +78,5 @@ jobs: - name: Run the JMS tests working-directory: JMS run: | - mvn -Dmaven.test.skip=false test -DEnvFile="$(pwd)/env.json" \ No newline at end of file + mvn -Dmaven.test.skip=false test -DEnvFile="$(pwd)/env.json" + \ No newline at end of file diff --git a/.github/workflows/test-JMSSecrets.yml b/.github/workflows/test-JMSSecrets.yml index f14a5d4f..9689eb9d 100644 --- a/.github/workflows/test-JMSSecrets.yml +++ b/.github/workflows/test-JMSSecrets.yml @@ -1,9 +1,9 @@ name: Run JMS Tests using git actions secrets on: - push: + pull_request: branches: - - anitha-unittest-automation + - master paths: - 'JMS/**' @@ -45,4 +45,4 @@ jobs: - name: Run the tests working-directory: JMS run: | - mvn -Dmaven.test.skip=false test -DEnvFile="$(pwd)/env.json" + mvn -Dmaven.test.skip=false test -DEnvFile="$(pwd)/env.json" \ No newline at end of file diff --git a/.github/workflows/test-Node.yml b/.github/workflows/test-Node.yml index b1847969..28b430a3 100644 --- a/.github/workflows/test-Node.yml +++ b/.github/workflows/test-Node.yml @@ -1,4 +1,4 @@ -name: Run Node.js Tests +name: Run Node Tests on: pull_request: diff --git a/.github/workflows/test-NodeSecrets.yml b/.github/workflows/test-NodeSecrets.yml index 8bf82f4c..f34e3838 100644 --- a/.github/workflows/test-NodeSecrets.yml +++ b/.github/workflows/test-NodeSecrets.yml @@ -1,9 +1,9 @@ name: Run Node tests using git actions secrets on: - push: + pull_request: branches: - - anitha-unittest-automation + - master paths: - 'Node.js/**' @@ -53,4 +53,4 @@ jobs: env: EnvFile: "/home/runner/work/mq-dev-patterns/mq-dev-patterns/Node.js/env.json" run: mocha - + \ No newline at end of file diff --git a/Node.js/keys/clientkey.kdb b/Node.js/keys/clientkey.kdb new file mode 100644 index 0000000000000000000000000000000000000000..f885e0436c3f5c124aaa67a8ebe8e53f2f119c78 GIT binary patch literal 5982 zcmV-k7oq4df)`o>0Ru3C7a9f$Duzgg_YDCD0ic2x3j~4}2QY#c12BRX{{{&vhDe6@ z4FLxRpn?|gFoG8B0s#Opf)?cl2`Yw2hW8Bt2LUi71_~;MNQUX+HL3yW6l0s;g8fPxmV$=k4r7H|y0R(s)anwFx86J3#Pg=r0bCo;d_y3W;D zjWx7$^B%S34fNCaLy(ZQR_O&G++TUw3_N@)#d!yD-bW(LxRtBk1!LX8=~CI(3F=2j zn};x)1&r~EOu8G-_gPOl6Uo&h#9(q|0vS^K;KWH9)3;XMPKuz)Q#Ys_U??>O}6fRtdxx zOvT85u0)?icvk1z%(-DnpBfX9RJOl#0{j4oT(zOFL)FbHR(G8@0n+>~l@*rp2hQIu z%o;9#tM>a^kGy19#Qr$hYRZjP9~QrIImz*fsEX^`ktl|N7r%Rs zP*0gOPbWxDMLtzWnZzEAJZ9t}bm^pBJyoa}c6~8I{+vh=WHBLa6mL9P92*B{+;+Gs zusjXw7E=cp7tsDlzjpZZ?AXI-aRI75xXs+fKx*6C<}J^L&j!3 z$nrbOrCU$T`Z3#9D5L+Z3>>a3C$@2UO8Lh&Q_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1SZ?c5<^v zwtagkg_qP*$-fNbn30^&_Zz;LRfRByDpH5|`z6U8Sq8-Zu2VF@vL(NYP_g}rB+B=# zi`eT&LHq(q})q3G Date: Fri, 4 Jul 2025 14:44:16 +0530 Subject: [PATCH 10/13] removed the secretsyml files and the keys --- .github/workflows/test-JMSSecrets.yml | 48 --------------------- .github/workflows/test-NodeSecrets.yml | 56 ------------------------- Node.js/keys/clientkey.kdb | Bin 5982 -> 0 bytes Node.js/keys/clientkey.sth | Bin 193 -> 0 bytes 4 files changed, 104 deletions(-) delete mode 100644 .github/workflows/test-JMSSecrets.yml delete mode 100644 .github/workflows/test-NodeSecrets.yml delete mode 100644 Node.js/keys/clientkey.kdb delete mode 100644 Node.js/keys/clientkey.sth diff --git a/.github/workflows/test-JMSSecrets.yml b/.github/workflows/test-JMSSecrets.yml deleted file mode 100644 index 9689eb9d..00000000 --- a/.github/workflows/test-JMSSecrets.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Run JMS Tests using git actions secrets - -on: - pull_request: - branches: - - master - paths: - - 'JMS/**' - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Create env.json from secrets - working-directory: JMS - run: | - cat << EOF > env.json - { - "MQ_ENDPOINTS": [{ - "HOST": "${{ secrets.HOST }}", - "PORT": "${{ secrets.PORT }}", - "CHANNEL": "CLOUD.APP.SVRCONN", - "QMGR": "QMHE", - "APP_USER": "${{ secrets.APP_USER }}", - "APP_PASSWORD": "${{ secrets.APP_PASSWORD }}", - "QUEUE_NAME": "DEV.QUEUE.1", - "BACKOUT_QUEUE": "DEV.QUEUE.2", - "MODEL_QUEUE_NAME": "CLOUD.APP.MODEL.QUEUE", - "DYNAMIC_QUEUE_PREFIX": "APP.REPLIES.*", - "TOPIC_NAME": "dev/", - "CIPHER": "TLS_AES_256_GCM_SHA384", - "CIPHER_SUITE": "TLS_AES_256_GCM_SHA384", - "KEY_REPOSITORY": "" - }] - } - EOF - - echo "env.json path: $(pwd)/env.json" - cat env.json - - - name: Run the tests - working-directory: JMS - run: | - mvn -Dmaven.test.skip=false test -DEnvFile="$(pwd)/env.json" \ No newline at end of file diff --git a/.github/workflows/test-NodeSecrets.yml b/.github/workflows/test-NodeSecrets.yml deleted file mode 100644 index f34e3838..00000000 --- a/.github/workflows/test-NodeSecrets.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Run Node tests using git actions secrets - -on: - pull_request: - branches: - - master - paths: - - 'Node.js/**' - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Create env.json from secrets - working-directory: Node.js - run: | - cat << EOF > env.json - { - "MQ_ENDPOINTS": [{ - "HOST": "${{ secrets.HOST }}", - "PORT": "${{ secrets.PORT }}", - "CHANNEL": "CLOUD.APP.SVRCONN", - "QMGR": "QMHE", - "APP_USER": "${{ secrets.APP_USER }}", - "APP_PASSWORD": "${{ secrets.APP_PASSWORD }}", - "QUEUE_NAME": "DEV.QUEUE.1", - "BACKOUT_QUEUE": "DEV.QUEUE.2", - "MODEL_QUEUE_NAME": "CLOUD.APP.MODEL.QUEUE", - "DYNAMIC_QUEUE_PREFIX": "APP.REPLIES.*", - "TOPIC_NAME": "dev/", - "CIPHER": "TLS_AES_256_GCM_SHA384", - "CIPHER_SUITE": "TLS_AES_256_GCM_SHA384", - "KEY_REPOSITORY": "./keys/clientkey" - }] - } - EOF - - echo "env.json path: $(pwd)/env.json" - cat env.json - - - name: Install dependencies - working-directory: Node.js - run: | - npm install - npm install --global mocha - - - name: Run Node.js tests - working-directory: Node.js - env: - EnvFile: "/home/runner/work/mq-dev-patterns/mq-dev-patterns/Node.js/env.json" - run: mocha - \ No newline at end of file diff --git a/Node.js/keys/clientkey.kdb b/Node.js/keys/clientkey.kdb deleted file mode 100644 index f885e0436c3f5c124aaa67a8ebe8e53f2f119c78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5982 zcmV-k7oq4df)`o>0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kIVgouHmS1jzr+d+CW^S z!;o167q4$q!;$qlYuG-1-Te49`VIag=Ml2ztc0#$5WKZ{* z!l*_&OY0(`d$ZfiTDTgSHyx(^5@@(?$T?-Y_WT3#341L1+3YLzoto~?aYLKXZ@@iq zP)QMCDvhzLc}^+9R}U4?m`e7%y~fPdTsRJ8*mU<~YWyd?lI-;QIoHNed@FR(ceO0c z6EMIk3_8U7r!`*AoHKVK6Ta63ay|EG*y8aoemtCfpf{Ljh)9USw3J^HE1rfa!6dL`D0v<$Gso)_SUR( z@$0YRTlz5~B26CQ*OWi?_x}Eo#k}kz12kO zLNEVySCXH4e2VHq4eatKJvq!y{_v1P=FivdR}mKfa&uF0B5{{e&|^j_UcKgll0QW7 za>2j+bpa7!vK{fdgObmY|K|UCq7z}Ip3C#n>ryReu3O|J(ZmvVuy)wIPfbSTzxSA6 znGg(0*W9XjZ4rwwBCA|lqvW_O%X6ZK6fgJ+AF=tbl?^SQjGC-jGX6kJ7e{V9jMCFl zrzCyAW9tNz{Jn9ArFvW!=PZm!UxUH?r_4ud#Nk%h5|4`w>rqp8JQt^+*1SZ?c5<^v zwtagkg_qP*$-fNbn30^&_Zz;LRfRByDpH5|`z6U8Sq8-Zu2VF@vL(NYP_g}rB+B=# zi`eT&LHq(q})q3G Date: Fri, 4 Jul 2025 16:51:27 +0530 Subject: [PATCH 11/13] added Nodesecrets.yml file --- .github/workflows/test-NodeSecrets.yml | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/test-NodeSecrets.yml diff --git a/.github/workflows/test-NodeSecrets.yml b/.github/workflows/test-NodeSecrets.yml new file mode 100644 index 00000000..9bf79ba1 --- /dev/null +++ b/.github/workflows/test-NodeSecrets.yml @@ -0,0 +1,56 @@ +name: Run Node tests + +on: + pull_request: + branches: + - master + paths: + - 'Node.js/**' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Create env.json from secrets + working-directory: Node.js + run: | + cat << EOF > env.json + { + "MQ_ENDPOINTS": [{ + "HOST": "${{ secrets.HOST }}", + "PORT": "${{ secrets.PORT }}", + "CHANNEL": "CLOUD.APP.SVRCONN", + "QMGR": "QMHE", + "APP_USER": "${{ secrets.APP_USER }}", + "APP_PASSWORD": "${{ secrets.APP_PASSWORD }}", + "QUEUE_NAME": "DEV.QUEUE.1", + "BACKOUT_QUEUE": "DEV.QUEUE.2", + "MODEL_QUEUE_NAME": "CLOUD.APP.MODEL.QUEUE", + "DYNAMIC_QUEUE_PREFIX": "APP.REPLIES.*", + "TOPIC_NAME": "dev/", + "CIPHER": "TLS_AES_256_GCM_SHA384", + "CIPHER_SUITE": "TLS_AES_256_GCM_SHA384", + "KEY_REPOSITORY": "../serverless/codeengine/clientapp/keys/clientkey" + }] + } + EOF + + echo "env.json path: $(pwd)/env.json" + cat env.json + + - name: Install dependencies + working-directory: Node.js + run: | + npm install + npm install --global mocha + + - name: Run Node.js tests + working-directory: Node.js + env: + EnvFile: "/home/runner/work/mq-dev-patterns/mq-dev-patterns/Node.js/env.json" + run: mocha + From c7ade3e72c757477387f78746e4bf952f854b029 Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Fri, 4 Jul 2025 16:55:39 +0530 Subject: [PATCH 12/13] added the JMSSecrets.yml --- .github/workflows/test-JMSSecrets.yml | 48 ++++++++++++++++++++++++++ .github/workflows/test-NodeSecrets.yml | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-JMSSecrets.yml diff --git a/.github/workflows/test-JMSSecrets.yml b/.github/workflows/test-JMSSecrets.yml new file mode 100644 index 00000000..96e35a51 --- /dev/null +++ b/.github/workflows/test-JMSSecrets.yml @@ -0,0 +1,48 @@ +name: Run JMS Tests using git actions secrets + +on: + pull_request: + branches: + - master + paths: + - 'JMS/**' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Create env.json from secrets + working-directory: JMS + run: | + cat << EOF > env.json + { + "MQ_ENDPOINTS": [{ + "HOST": "${{ secrets.HOST }}", + "PORT": "${{ secrets.PORT }}", + "CHANNEL": "CLOUD.APP.SVRCONN", + "QMGR": "QMHE", + "APP_USER": "${{ secrets.APP_USER }}", + "APP_PASSWORD": "${{ secrets.APP_PASSWORD }}", + "QUEUE_NAME": "DEV.QUEUE.1", + "BACKOUT_QUEUE": "DEV.QUEUE.2", + "MODEL_QUEUE_NAME": "CLOUD.APP.MODEL.QUEUE", + "DYNAMIC_QUEUE_PREFIX": "APP.REPLIES.*", + "TOPIC_NAME": "dev/", + "CIPHER": "TLS_AES_256_GCM_SHA384", + "CIPHER_SUITE": "TLS_AES_256_GCM_SHA384", + "KEY_REPOSITORY": "../serverless/codeengine/clientapp/keys/clientkey" + }] + } + EOF + + echo "env.json path: $(pwd)/env.json" + cat env.json + + - name: Run the tests + working-directory: JMS + run: | + mvn -Dmaven.test.skip=false test -DEnvFile="$(pwd)/env.json" \ No newline at end of file diff --git a/.github/workflows/test-NodeSecrets.yml b/.github/workflows/test-NodeSecrets.yml index 9bf79ba1..60d1f46e 100644 --- a/.github/workflows/test-NodeSecrets.yml +++ b/.github/workflows/test-NodeSecrets.yml @@ -1,4 +1,4 @@ -name: Run Node tests +name: Run Node tests using git actions secrets on: pull_request: From 3738c616701f134abfe0c503e2e06b7dadfa4bff Mon Sep 17 00:00:00 2001 From: Anitha K J Date: Fri, 4 Jul 2025 17:03:16 +0530 Subject: [PATCH 13/13] added copyright and license --- .github/workflows/test-JMS.yml | 15 +++++++++++++++ .github/workflows/test-JMSSecrets.yml | 15 +++++++++++++++ .github/workflows/test-Node.yml | 15 +++++++++++++++ .github/workflows/test-NodeSecrets.yml | 15 +++++++++++++++ 4 files changed, 60 insertions(+) diff --git a/.github/workflows/test-JMS.yml b/.github/workflows/test-JMS.yml index c194155c..08ef4cde 100644 --- a/.github/workflows/test-JMS.yml +++ b/.github/workflows/test-JMS.yml @@ -1,3 +1,18 @@ +# +# Copyright 2025 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# name: Run JMS Tests on: diff --git a/.github/workflows/test-JMSSecrets.yml b/.github/workflows/test-JMSSecrets.yml index 96e35a51..d08f3ff1 100644 --- a/.github/workflows/test-JMSSecrets.yml +++ b/.github/workflows/test-JMSSecrets.yml @@ -1,3 +1,18 @@ +# +# Copyright 2025 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# name: Run JMS Tests using git actions secrets on: diff --git a/.github/workflows/test-Node.yml b/.github/workflows/test-Node.yml index 28b430a3..e34791b1 100644 --- a/.github/workflows/test-Node.yml +++ b/.github/workflows/test-Node.yml @@ -1,3 +1,18 @@ +# +# Copyright 2025 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# name: Run Node Tests on: diff --git a/.github/workflows/test-NodeSecrets.yml b/.github/workflows/test-NodeSecrets.yml index 60d1f46e..b807eb85 100644 --- a/.github/workflows/test-NodeSecrets.yml +++ b/.github/workflows/test-NodeSecrets.yml @@ -1,3 +1,18 @@ +# +# Copyright 2025 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# name: Run Node tests using git actions secrets on: