expectedDiagnostic =
ImmutableMap.of(
- "error",
+ "end-exec-error",
new Diagnostic(
- new Range(new Position(14, 12), new Position(14, 20)),
+ new Range(),
"Syntax error on 'END-EXEC'",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()));
- CICSTestUtils.errorTest(ASKTIME_INVALID, expectedDiagnostic);
+ CICSTestUtils.errorTestWithEndExecError(ASKTIME_INVALID, ImmutableList.of(), expectedDiagnostic);
}
}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSBif.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSBif.java
index b3439fcf79..20ea936cfe 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSBif.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSBif.java
@@ -19,7 +19,6 @@
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
- import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -51,9 +50,9 @@ public class TestCICSBif {
private static final String BIF_DIGEST_RECORD_RECORDLEN_DIGESTTYPE_RESULT_VALID =
"BIF DIGEST RECORD(100) RECORDLEN(100) DIGESTTYPE({$varFour}) RESULT({$varFour})";
private static final String BIF_DIGEST_DIGESTTYPE_INVALID =
- "BIF DIGEST {RECORD |errorResultMissing }(100) RECORDLEN(100) {HEX | errorDigestType} {BASE64 | errorDigestType2}";
+ "BIF {_DIGEST RECORD(100) RECORDLEN(100) {HEX|errorDigestType} {BASE64|errorDigestType2}|errorResultMissing_}";
private static final String BIF_DIGEST_RESULT_MISSING_INVALID =
- "BIF DIGEST RECORD(100) {RECORDLEN | errorResultMissing}(100)";
+ "BIF {_DIGEST RECORD(100) RECORDLEN(100)|errorResultMissing_}";
@Test
void testBifDeeditField() {
@@ -104,19 +103,19 @@ void testBifDigestDigesttypeInvalid() {
ImmutableMap.of(
"errorResultMissing",
new Diagnostic(
- new Range(new Position(13, 12), new Position(17, 18)),
+ new Range(),
"Missing required option: RESULT",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()),
"errorDigestType",
new Diagnostic(
- new Range(new Position(16, 12), new Position(16, 15)),
+ new Range(),
"Exactly one option required, options are mutually exclusive: HEX or BINARY or BASE64 or DIGESTTYPE",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()),
"errorDigestType2",
new Diagnostic(
- new Range(new Position(17, 12), new Position(17, 18)),
+ new Range(),
"Exactly one option required, options are mutually exclusive: HEX or BINARY or BASE64 or DIGESTTYPE",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText())
@@ -129,7 +128,7 @@ void testBifDigestResultMissingInvalid() {
ImmutableMap.of(
"errorResultMissing",
new Diagnostic(
- new Range(new Position(13, 12), new Position(15, 26)),
+ new Range(),
"Missing required option: RESULT",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()));
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCancel.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCancel.java
index 420b6db08c..ed7298538f 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCancel.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCancel.java
@@ -19,7 +19,6 @@
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
- import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -55,10 +54,10 @@ public class TestCICSCancel {
private static final String CANCEL_TRANSID_INVALID =
"CANCEL {TRANSID(100) | errorTransid} ";
private static final String CANCEL_ACQACTIVITY_ACQPROCESS_INVALID =
- "CANCEL {ACQACTIVITY | errorAcqactivityAcqProcess} {ACQPROCESS | errorAcqactivityAcqProcess2} ";
+ "CANCEL {ACQACTIVITY|errorAcqactivityAcqProcess} {ACQPROCESS|errorAcqactivityAcqProcess2} ";
private static final String CANCEL_ACTIVITY_ACQPROCESS_INVALID =
- "CANCEL {ACTIVITY | errorActivityAcqProcess }(100) {ACQPROCESS | errorActivityAcqProcess2} ";
+ "CANCEL {ACTIVITY|errorActivityAcqProcess}(100) {ACQPROCESS|errorActivityAcqProcess2} ";
@Test
void testCancelActivityValid() {
@@ -125,7 +124,7 @@ void testCancelAcqactivityAcqprocess() {
ErrorSource.PARSING.getText()),
"errorAcqactivityAcqProcess2",
new Diagnostic(
- new Range(new Position(14, 12), new Position(14, 22)),
+ new Range(),
"Exactly one option required, options are mutually exclusive: ACTIVITY or ACQACTIVITY or ACQPROCESS",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()));
@@ -143,7 +142,7 @@ void testCancelActivityAcqprocess() {
ErrorSource.PARSING.getText()),
"errorActivityAcqProcess2",
new Diagnostic(
- new Range(new Position(14, 12), new Position(14, 22)),
+ new Range(),
"Exactly one option required, options are mutually exclusive: ACTIVITY or ACQACTIVITY or ACQPROCESS",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()));
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCheck.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCheck.java
index 7563fb162d..e4df74789a 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCheck.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCheck.java
@@ -19,7 +19,6 @@
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
-import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -43,9 +42,9 @@ public class TestCICSCheck {
private static final String CHECK_TIMER_VALID =
"CHECK TIMER({$varFour}) STATUS({$varOne}) ";
private static final String CHECK_ACTIVITY_ACQPROCESS_INVALID =
- "CHECK COMPSTATUS({$varOne}) {ACTIVITY(100) ACQPROCESS | errorAcqprocess | errorAcqprocess2} ";
+ "CHECK COMPSTATUS({$varOne}) {ACTIVITY|errorAcqprocess}(100) {ACQPROCESS|errorAcqprocess2} ";
private static final String CHECK_ACTIVITY_INVALID_COMPSTATUS =
- "CHECK ACTIVITY ({$varOne}) {SUSPSTATUS(100) | errorMissingCompstatus }";
+ "CHECK {_ACTIVITY ({$varOne}) SUSPSTATUS(100)|errorMissingCompstatus_}";
@Test
void testCheckAcqprocessValid() {
CICSTestUtils.noErrorTest(CHECK_ACQPROCESS_VALID);
@@ -65,13 +64,13 @@ void testCheckActivityInvalid() {
ImmutableMap.of(
"errorAcqprocess",
new Diagnostic(
- new Range(new Position(14, 12), new Position(14, 20)),
+ new Range(),
"Exactly one option required, options are mutually exclusive: ACTIVITY or ACQACTIVITY or ACQPROCESS",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()),
"errorAcqprocess2",
new Diagnostic(
- new Range(new Position(14, 25), new Position(14, 35)),
+ new Range(),
"Exactly one option required, options are mutually exclusive: ACTIVITY or ACQACTIVITY or ACQPROCESS",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()));
@@ -84,7 +83,7 @@ void testCancelTransidInvalid() {
ImmutableMap.of(
"errorMissingCompstatus",
new Diagnostic(
- new Range(new Position(13, 12), new Position(15, 27)),
+ new Range(),
"Missing required option: COMPSTATUS",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()));
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSConnectProcessStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSConnectProcessStatement.java
index 30bac2ed33..2e2d12bb5a 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSConnectProcessStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSConnectProcessStatement.java
@@ -19,7 +19,6 @@
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
- import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -39,7 +38,7 @@ public class TestCICSConnectProcessStatement {
"CONNECT PROCESS CONVID({$varFour}) PARTNER({$varFour}) "
+ "SYNCLEVEL({$varFour}) ";
private static final String CONNECT_PROCESS_INVALID =
- "CONNECT PROCESS SESSION({$varFour}) SYNCLEVEL({$varFour}) {PARTNER | errorMissingProc | errorPartner}(100)";
+ "CONNECT {_PROCESS SESSION({$varFour}) SYNCLEVEL({$varFour}) {PARTNER|errorPartner}(100)|errorMissingProc_}";
private static final String CONNECT_PROCESS_PIPLENGTH_INVALID =
"CONNECT {_PROCESS CONVID(100) PIPLENGTH(100) \n "
+ "SYNCLEVEL(100) PROCNAME(100)|errorPiplength_}";
@@ -58,13 +57,13 @@ void testConnectProcessSessionPartnerInvalid() {
ImmutableMap.of(
"errorMissingProc",
new Diagnostic(
- new Range(new Position(13, 12), new Position(16, 24)),
+ new Range(),
"Missing required option: PROCNAME",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()),
"errorPartner",
new Diagnostic(
- new Range(new Position(16, 12), new Position(16, 19)),
+ new Range(),
"Invalid option provided: PARTNER",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCreateSp.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCreateSp.java
new file mode 100644
index 0000000000..534cebfba1
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCreateSp.java
@@ -0,0 +1,225 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+ import com.google.common.collect.ImmutableMap;
+ import org.eclipse.lsp.cobol.common.error.ErrorSource;
+ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+ import org.eclipse.lsp4j.Diagnostic;
+ import org.eclipse.lsp4j.DiagnosticSeverity;
+ import org.eclipse.lsp4j.Range;
+ import org.junit.jupiter.api.Test;
+ import org.junit.jupiter.params.ParameterizedTest;
+ import org.junit.jupiter.params.provider.MethodSource;
+
+ import java.util.Map;
+ import java.util.stream.Stream;
+
+/**
+ * Test CICS Create System Command. Documentation link: Create System Commands
+ *
+ * This class tests all variations of the Create System Commands found in the link above.
+ */
+public class TestCICSCreateSp {
+
+ private static Stream getValidOptions() {
+ return Stream.of(
+ "CREATE ATOMSERVICE({$varFour}) NOLOG ATTRLEN({$varFour}) ATTRIBUTES({$varFour})",
+ "CREATE BUNDLE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE CONNECTION({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE DB2CONN({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE DB2ENTRY({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE DB2TRAN({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE DOCTEMPLATE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE DUMPCODE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE ENQMODEL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE FILE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE IPCONN({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE JOURNALMODEL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE JVMSERVER({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE LIBRARY({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE LSRPOOL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE MAPSET({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE MQCONN({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE MQMONITOR({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE PARTITIONSET({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE PARTNER({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE PIPELINE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE PROCESSTYPE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE PROFILE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE PROGRAM({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE TCPIPSERVICE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE TDQUEUE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE TRANCLASS({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE TRANSACTION({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE TSMODEL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE TYPETERM({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE URIMAP({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE WEBSERVICE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE SESSIONS({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE TERMINAL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})",
+ "CREATE CONNECTION({$varFour}) ATTRLEN({$varOne}) ATTRIBUTES({$varFour}) NOLOG");
+ };
+
+ private static final String CREATE_INVALID =
+ "CREATE CONNECTION({$varFour})"
+ + "{ATTRIBUTES|errorInvalidDiscard}(1)"
+ + "{DISCARD|errorInvalidDiscard2}";
+ private static final String CREATE_BUNDLE_MISSING_ATTRIBUTES_INVALID =
+ "CREATE {_BUNDLE({$varFour}) NOLOG |error_}";
+ private static final String CREATE_CONNECTION_MUTUALEX_INVALID =
+ "CREATE CONNECTION({$varFour}) {COMPLETE|error} {DISCARD|error2}";
+ private static final String CREATE_DB2CONN_MUTUALEX_INVALID =
+ "CREATE DB2CONN({$varFour}) ATTRIBUTES({$varFour}) {LOG|error} {NOLOG|error2}";
+ private static final String CREATE_DB2ENTRY_DISCARD_INVALID =
+ "CREATE DB2ENTRY({$varFour}) ATTRIBUTES({$varFour}) {DISCARD|error}";
+ private static final String CREATE_DB2ENTRY_FILE_INVALID =
+ "CREATE NOHANDLE {DB2ENTRY|error}({$varFour}) ATTRIBUTES({$varFour}) {FILE|error2}({$varFour})";
+ private static final String CREATE_DB2ENTRY_FILE_CASE_SENSITIVE_INVALID =
+ "CREATE NOHANDLE {DB2ENTRY|error}({$varFour}) ATTRIBUTES({$varFour}) {FILE|error2}({$varFour})"
+ + "{FiLe|error3}({$varFour})";
+ @ParameterizedTest
+ @MethodSource("getValidOptions")
+ void testCreateSpAllValid(String valid) {
+ CICSTestUtils.noErrorTest(valid, "SP");
+ }
+ @Test
+ void testCreateSpInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "errorInvalidDiscard",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: ATTRIBUTES or COMPLETE or DISCARD",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorInvalidDiscard2",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: ATTRIBUTES or COMPLETE or DISCARD",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(CREATE_INVALID, expectedDiagnostic, "SP");
+ }
+ @Test
+ void testCreateBundleSpInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: ATTRIBUTES",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(CREATE_BUNDLE_MISSING_ATTRIBUTES_INVALID, expectedDiagnostic, "SP");
+ }
+ @Test
+ void testCreateConnectionSpInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: ATTRIBUTES or COMPLETE or DISCARD",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "error2",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: ATTRIBUTES or COMPLETE or DISCARD",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+
+ CICSTestUtils.errorTest(CREATE_CONNECTION_MUTUALEX_INVALID, expectedDiagnostic, "SP");
+ }
+ @Test
+ void testCreateDb2ConnSpInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: LOG or NOLOG or LOGMESSAGE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "error2",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: LOG or NOLOG or LOGMESSAGE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+
+ CICSTestUtils.errorTest(CREATE_DB2CONN_MUTUALEX_INVALID, expectedDiagnostic, "SP");
+ }
+ @Test
+ void testCreateDb2EntrySpInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: DISCARD",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+
+ CICSTestUtils.errorTest(CREATE_DB2ENTRY_DISCARD_INVALID, expectedDiagnostic, "SP");
+ }
+ @Test
+ void testCreateMutualExSpInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: DB2ENTRY or FILE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "error2",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: DB2ENTRY or FILE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+
+ CICSTestUtils.errorTest(CREATE_DB2ENTRY_FILE_INVALID, expectedDiagnostic, "SP");
+ }
+ @Test
+ void testCreateMutualExCaseSensitiveSpInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: DB2ENTRY or FILE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "error2",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: DB2ENTRY or FILE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "error3",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: FiLe",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+
+ CICSTestUtils.errorTest(CREATE_DB2ENTRY_FILE_CASE_SENSITIVE_INVALID, expectedDiagnostic, "SP");
+ }
+}
+
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndBrowse.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndBrowse.java
index c637c447ee..a4f09e1831 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndBrowse.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndBrowse.java
@@ -25,22 +25,12 @@
import java.util.Map;
/**
- * Test CICS ENDBR & ENDBROWSE commands. Documentation link: ENDBROWSE Command
- * href="https://www.ibm.com/docs/en/cics-ts/6.x?topic=summary-endbr">ENDBR Command
*
- * This class tests all variations of the ENDBR & ENDBROWSE command found in the link above.
+ *
This class tests all variations of the ENDBROWSE command found in the link above.
*/
public class TestCICSEndBrowse {
- // ENDBR
- private static final String ENDBR_FILE_VALID = "ENDBR FILE({$varFour})";
- private static final String ENDBR_DATASET_VALID = "ENDBR DATASET({$varFour})";
- private static final String ENDBR_FILE_DATASET_INVALID = "ENDBR {FILE|error1}({$varFour}) {DATASET|error2}({$varFour})";
- private static final String ENDBR_FILE_REQID_VALID = "ENDBR FILE({$varFour}) REQID({$varOne})";
- private static final String ENDBR_FILE_SYSID_VALID = "ENDBR FILE({$varFour}) SYSID({$varOne})";
- private static final String ENDBR_FILE_REQID_SYSID_VALID = "ENDBR FILE({$varFour}) REQID({$varOne}) SYSID({$varFive})";
-
- // ENDBROWSE
private static final String ENDBROWSE_ACTIVITY_VALID = "ENDBROWSE ACTIVITY BROWSETOKEN({$varOne})";
private static final String ENDBROWSE_ACTIVITY_INVALID = "ENDBROWSE ACTIVITY {ACTIVITY|error1} BROWSETOKEN({$varOne})";
private static final String ENDBROWSE_ACTIVITY_CONTAINER_INVALID = "ENDBROWSE {ACTIVITY|error1} {CONTAINER|error2} BROWSETOKEN({$varOne}) RETCODE({$varOne})";
@@ -50,51 +40,7 @@ public class TestCICSEndBrowse {
private static final String ENDBROWSE_TIMER_VALID = "ENDBROWSE TIMER BROWSETOKEN({$varOne})";
private static final String ENDBROWSE_PROCESS_VALID = "ENDBROWSE PROCESS BROWSETOKEN({$varOne})";
- @Test
- void testEndbrFileValid() {
- CICSTestUtils.noErrorTest(ENDBR_FILE_VALID);
- }
-
- @Test
- void testEndbrDatasetValid() {
- CICSTestUtils.noErrorTest(ENDBR_DATASET_VALID);
- }
-
- @Test
- void testEndbrFileDatasetInvalid() {
- Map expectedDiagnostics =
- ImmutableMap.of(
- "error1",
- new Diagnostic(
- new Range(),
- "Exactly one option required, options are mutually exclusive: FILE or DATASET",
- DiagnosticSeverity.Error,
- ErrorSource.PARSING.getText()),
- "error2",
- new Diagnostic(
- new Range(),
- "Exactly one option required, options are mutually exclusive: FILE or DATASET",
- DiagnosticSeverity.Error,
- ErrorSource.PARSING.getText()));
- CICSTestUtils.errorTest(ENDBR_FILE_DATASET_INVALID, expectedDiagnostics);
- }
- @Test
- void testEndbrFileReqidValid() {
- CICSTestUtils.noErrorTest(ENDBR_FILE_REQID_VALID);
- }
-
- @Test
- void testEndbrFileSysidValid() {
- CICSTestUtils.noErrorTest(ENDBR_FILE_SYSID_VALID);
- }
-
- @Test
- void testEndbrFileReqidSysidValid() {
- CICSTestUtils.noErrorTest(ENDBR_FILE_REQID_SYSID_VALID);
- }
-
-
- @Test
+ @Test
void testEndbrowseActivityValid() {
CICSTestUtils.noErrorTest(ENDBROWSE_ACTIVITY_VALID);
}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndbr.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndbr.java
new file mode 100644
index 0000000000..a3305bbd75
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndbr.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.common.error.ErrorSource;
+import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+import org.eclipse.lsp4j.Diagnostic;
+import org.eclipse.lsp4j.DiagnosticSeverity;
+import org.eclipse.lsp4j.Range;
+import org.junit.jupiter.api.Test;
+
+import java.util.Map;
+
+/**
+ * Test CICS ENDBR commands. Documentation link: ENDBR Command
+ *
+ * This class tests all variations of the ENDBR command found in the link above.
+ */
+public class TestCICSEndbr {
+ private static final String ENDBR_FILE_VALID = "ENDBR FILE({$varFour})";
+ private static final String ENDBR_INVALID = "ENDBR";
+ private static final String ENDBR_DATASET_VALID = "ENDBR DATASET({$varFour})";
+ private static final String ENDBR_FILE_DATASET_INVALID = "ENDBR {FILE|error1}({$varFour}) {DATASET|error2}({$varFour})";
+ private static final String ENDBR_FILE_REQID_VALID = "ENDBR FILE({$varFour}) REQID({$varOne})";
+ private static final String ENDBR_FILE_SYSID_VALID = "ENDBR FILE({$varFour}) SYSID({$varOne})";
+ private static final String ENDBR_FILE_REQID_SYSID_VALID = "ENDBR FILE({$varFour}) REQID({$varOne}) SYSID({$varFive})";
+
+ @Test
+ void testEndbrFileValid() {
+ CICSTestUtils.noErrorTest(ENDBR_FILE_VALID);
+ }
+
+ @Test
+ void testEndbrInvalid() {
+ CICSTestUtils.errorTestWithEndExecError(ENDBR_INVALID,
+ ImmutableList.of("error1"),
+ ImmutableMap.of(
+ "error1",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, none provided: FILE or DATASET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "end-exec-error",
+ new Diagnostic(
+ new Range(),
+ "Syntax error on 'END-EXEC'",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testEndbrDatasetValid() {
+ CICSTestUtils.noErrorTest(ENDBR_DATASET_VALID);
+ }
+
+ @Test
+ void testEndbrFileDatasetInvalid() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "error1",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: FILE or DATASET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "error2",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: FILE or DATASET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(ENDBR_FILE_DATASET_INVALID, expectedDiagnostics);
+ }
+ @Test
+ void testEndbrFileReqidValid() {
+ CICSTestUtils.noErrorTest(ENDBR_FILE_REQID_VALID);
+ }
+
+ @Test
+ void testEndbrFileSysidValid() {
+ CICSTestUtils.noErrorTest(ENDBR_FILE_SYSID_VALID);
+ }
+
+ @Test
+ void testEndbrFileReqidSysidValid() {
+ CICSTestUtils.noErrorTest(ENDBR_FILE_REQID_SYSID_VALID);
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java
new file mode 100644
index 0000000000..56048907ab
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java
@@ -0,0 +1,362 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.common.error.ErrorSource;
+import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+import org.eclipse.lsp4j.Diagnostic;
+import org.eclipse.lsp4j.DiagnosticSeverity;
+import org.eclipse.lsp4j.Range;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test CICS HANDLE commands. Documentation link: HANDLE Command
+ *
+ * This class tests all variations of the HANDLE command: ABEND, AID, and CONDITION.
+ */
+public class TestCICSHandle {
+ private static final String HANDLE_ABEND_VALID =
+ "HANDLE ABEND PROGRAM({$varOne})";
+
+ private static final String HANDLE_ABEND_INVALID =
+ "HANDLE {CANCEL|errorOne}";
+
+ private static final String HANDLE_AID_VALID_ONE =
+ "HANDLE AID ANYKEY({@SEC1})";
+
+ private static final String HANDLE_AID_VALID_TWO =
+ "HANDLE AID PF1({@SEC1})";
+
+ private static final String HANDLE_AID_INVALID =
+ "HANDLE {_ANYKEY({@SEC1})|errorOne_}";
+
+ private static final String HANDLE_AID_VALID_THREE =
+ "HANDLE AID PF1({@SEC1}) PF3";
+
+ private static final String HANDLE_AID_INVALID_TWO =
+ "HANDLE {_AID CLEAR CLRPARTN ENTER OPERID ANYKEY PA1 PF1({@SEC1}) TRIGGER LIGHTPEN PA2 "
+ + "PA3 PF2 PF3 PF4 PF5 PF6 PF7 PF8 PF9 PF10 PF11|errorOne_}";
+
+ private static final String HANDLE_CONDITION_VALID =
+ "HANDLE CONDITION EOC({@SEC1})";
+
+ private static final String HANDLE_CONDITION_VALID_ONE =
+ "HANDLE CONDITION ERROR";
+
+
+ private static final String HANDLE_CONDITION_VALID_TWO =
+ "HANDLE CONDITION";
+
+
+ private static final String HANDLE_CONDITION_INVALID_ONE =
+ "HANDLE {ERROR|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_TWO =
+ "HANDLE CONDITION {CONDITION|errorOne} ERROR";
+
+ private static final String HANDLE_CONDITION_INVALID_THREE =
+ "HANDLE CONDITION NORMAL {NORMAL|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_WRBRK =
+ "HANDLE CONDITION WRBRK {WRBRK|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_INBFMH =
+ "HANDLE CONDITION INBFMH {INBFMH|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_ENDINPT =
+ "HANDLE CONDITION ENDINPT {ENDINPT|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_NONVAL =
+ "HANDLE CONDITION NONVAL {NONVAL|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_NOSTART =
+ "HANDLE CONDITION NOSTART {NOSTART|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_TERMIDERR =
+ "HANDLE CONDITION TERMIDERR {TERMIDERR|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_FILENOTFOUND =
+ "HANDLE CONDITION FILENOTFOUND {FILENOTFOUND|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_NOTFND =
+ "HANDLE CONDITION NOTFND {NOTFND|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_DUPKEY =
+ "HANDLE CONDITION DUPKEY {DUPKEY|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_INVREQ =
+ "HANDLE CONDITION INVREQ {INVREQ|errorOne}";
+
+ private static final String HANDLE_CONDITION_INVALID_IOERR =
+ "HANDLE CONDITION IOERR {IOERR|errorOne}";
+
+ @Test
+ void testHandleAbendValid() {
+ CICSTestUtils.noErrorTest(HANDLE_ABEND_VALID);
+ }
+
+ @Test
+ void testHandleAbendInvalid() {
+ CICSTestUtils.errorTest(
+ HANDLE_ABEND_INVALID,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: ABEND",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleAidValidOne() {
+ CICSTestUtils.noErrorTest(HANDLE_AID_VALID_ONE);
+ }
+
+ @Test
+ void testHandleAidValidTwo() {
+ CICSTestUtils.noErrorTest(HANDLE_AID_VALID_TWO);
+ }
+
+ @Test
+ void testHandleAidInvalid() {
+ CICSTestUtils.errorTest(
+ HANDLE_AID_INVALID,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: AID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleAidValidThree() {
+ CICSTestUtils.noErrorTest(HANDLE_AID_VALID_THREE);
+ }
+
+ @Test
+ void testHandleAidInvalidThree() {
+ CICSTestUtils.errorTest(
+ HANDLE_AID_INVALID_TWO,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Too many options provided for: HANDLE AID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionValid() {
+ CICSTestUtils.noErrorTest(HANDLE_CONDITION_VALID);
+ }
+
+ @Test
+ void testHandleConditionValidOne() {
+ CICSTestUtils.noErrorTest(HANDLE_CONDITION_VALID_ONE);
+ }
+
+ @Test
+ void testHandleConditionValidTwo() {
+ CICSTestUtils.noErrorTest(HANDLE_CONDITION_VALID_TWO);
+ }
+
+ @Test
+ void testHandleConditionInvalidOne() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_ONE,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: CONDITION",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidTwo() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_TWO,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: CONDITION",
+ DiagnosticSeverity.Warning,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidThree() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_THREE,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: NORMAL",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidWrbrk() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_WRBRK,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: WRBRK",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidInbfmh() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_INBFMH,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: INBFMH",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidEndinpt() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_ENDINPT,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: ENDINPT",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidNonval() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_NONVAL,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: NONVAL",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidNostart() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_NOSTART,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: NOSTART",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidTermiderr() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_TERMIDERR,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: TERMIDERR",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidFilenotfound() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_FILENOTFOUND,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: FILENOTFOUND",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidNotfnd() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_NOTFND,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: NOTFND",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidDupkey() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_DUPKEY,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: DUPKEY",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidInvreq() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_INVREQ,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: INVREQ",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testHandleConditionInvalidIoerr() {
+ CICSTestUtils.errorTest(
+ HANDLE_CONDITION_INVALID_IOERR,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: IOERR",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSIgnore.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSIgnore.java
new file mode 100644
index 0000000000..763975e1b2
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSIgnore.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.common.error.ErrorSource;
+import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+import org.eclipse.lsp4j.Diagnostic;
+import org.eclipse.lsp4j.DiagnosticSeverity;
+import org.eclipse.lsp4j.Range;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test CICS IGNORE CONDITION command. Documentation link: IGNORE CONDITION Command
+ *
+ *
This class tests the IGNORE CONDITION command.
+ */
+public class TestCICSIgnore {
+ private static final String IGNORE_CONDITION_VALID_ONE =
+ "IGNORE CONDITION ERROR";
+
+ private static final String IGNORE_CONDITION_VALID_MULTIPLE =
+ "IGNORE CONDITION ERROR MAPFAIL PARTNFAIL";
+
+ private static final String IGNORE_CONDITION_INVALID_ONE =
+ "IGNORE {ERROR|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_TWO =
+ "IGNORE CONDITION {CONDITION|errorOne} ERROR";
+
+ private static final String IGNORE_CONDITION_INVALID_THREE =
+ "IGNORE CONDITION NORMAL {NORMAL|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_WRBRK =
+ "IGNORE CONDITION WRBRK {WRBRK|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_INBFMH =
+ "IGNORE CONDITION INBFMH {INBFMH|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_ENDINPT =
+ "IGNORE CONDITION ENDINPT {ENDINPT|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_NONVAL =
+ "IGNORE CONDITION NONVAL {NONVAL|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_NOSTART =
+ "IGNORE CONDITION NOSTART {NOSTART|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_TERMIDERR =
+ "IGNORE CONDITION TERMIDERR {TERMIDERR|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_FILENOTFOUND =
+ "IGNORE CONDITION FILENOTFOUND {FILENOTFOUND|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_NOTFND =
+ "IGNORE CONDITION NOTFND {NOTFND|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_DUPKEY =
+ "IGNORE CONDITION DUPKEY {DUPKEY|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_INVREQ =
+ "IGNORE CONDITION INVREQ {INVREQ|errorOne}";
+
+ private static final String IGNORE_CONDITION_INVALID_IOERR =
+ "IGNORE CONDITION IOERR {IOERR|errorOne}";
+
+ @Test
+ void testIgnoreConditionValidOne() {
+ CICSTestUtils.noErrorTest(IGNORE_CONDITION_VALID_ONE);
+ }
+
+ @Test
+ void testIgnoreConditionValidMultiple() {
+ CICSTestUtils.noErrorTest(IGNORE_CONDITION_VALID_MULTIPLE);
+ }
+
+ @Test
+ void testIgnoreConditionInvalidOne() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_ONE,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: CONDITION",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidTwo() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_TWO,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: CONDITION",
+ DiagnosticSeverity.Warning,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidThree() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_THREE,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: NORMAL",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidWrbrk() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_WRBRK,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: WRBRK",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidInbfmh() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_INBFMH,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: INBFMH",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidEndinpt() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_ENDINPT,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: ENDINPT",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidNonval() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_NONVAL,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: NONVAL",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidNostart() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_NOSTART,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: NOSTART",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidTermiderr() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_TERMIDERR,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: TERMIDERR",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidFilenotfound() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_FILENOTFOUND,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: FILENOTFOUND",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidNotfnd() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_NOTFND,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: NOTFND",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidDupkey() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_DUPKEY,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: DUPKEY",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidInvreq() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_INVREQ,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: INVREQ",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testIgnoreConditionInvalidIoerr() {
+ CICSTestUtils.errorTest(
+ IGNORE_CONDITION_INVALID_IOERR,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: IOERR",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquire.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquire.java
index a40f9f7e99..edebc29171 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquire.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquire.java
@@ -38,10 +38,12 @@ public class TestCICSInquire {
private static Stream getValidOptions() {
return Stream.of(
"ACTIVITYID({$varOne}) COMPSTATUS({$varOne}) MODE({$varOne}) SUSPSTATUS({$varOne}) ABCODE({$varOne}) ABPROGRAM({$varOne}) ACTIVITY({$varOne}) EVENT({$varOne}) PROCESS({$varOne}) PROCESSTYPE({$varOne}) PROGRAM({$varOne}) TRANSID({$varOne}) USERID({$varOne})",
- "CONTAINER({$varOne}) PROCESS({$varOne}) PROCESSTYPE({$varOne}) DATALENTH({$varOne}) SET({$varOne})",
+ "CONTAINER({$varOne}) PROCESS({$varOne}) PROCESSTYPE({$varOne}) DATALENGTH({$varOne}) SET({$varOne})",
"EVENT({$varOne}) ACTIVITYID({$varOne}) EVENTTYPE({$varOne}) FIRESTATUS({$varOne}) PREDICATE({$varOne}) COMPOSITE({$varOne}) TIMER({$varOne})",
"PROCESS({$varOne}) PROCESSTYPE({$varOne}) ACTIVITYID({$varOne})",
- "TIMER({$varOne}) ACTIVITYID({$varOne}) EVENT({$varOne}) ABSTIME({$varOne})");
+ "TIMER({$varOne}) ACTIVITYID({$varOne}) EVENT({$varOne}) ABSTIME({$varOne})",
+ "TIMER({$varOne})",
+ "EVENT({$varOne})");
}
private static final String CONTAINER_INVALID =
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquireSP.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquireSP.java
index 780b8ca51c..aad064eb20 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquireSP.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquireSP.java
@@ -55,7 +55,7 @@ private static Stream getValidOptions() {
"CAPDATAPRED NEXT CONTAINER({$varOne}) FIELDLENGTH({$varOne}) FIELDOFFSET({$varOne}) FILENAME({$varOne}) FILTERVALUE({$varOne}) LOCATION({$varOne}) STRUCTNAME({$varOne}) VARIABLENAME({$varOne}) OPERATOR({$varOne})",
"CAPINFOSRCE START CAPTURESPEC({$varOne}) EVENTBINDING({$varOne})",
"CAPOPTPRED NEXT FILTERVALUE({$varOne}) OPTIONNAME({$varOne}) OPERATOR({$varOne})",
- "CAPTURESPEC({$varOne}) CAPTUREPOINT({$varOne}) CURRPGM({$varOne}) CURRTRANID({$varOne}) CURRUSERID({$varOne}) EVENTNAME({$varOne}) NUMDATAPRD({$varOne}) NUMINFOSRCE({$varOne}) NUMOPTPRED({$varOne}) PRIMPRED({$varOne}) EVENTBINDING({$varOne}) CAPTUREPTYPE({$varOne}) CURRPGMOP({$varOne}) CURRTRANIDOP({$varOne}) CURRUSERIDOP({$varOne}) PRIMPREDOP({$varOne}) PRIMPREDTYPE({$varOne})",
+ "CAPTURESPEC({$varOne}) CAPTUREPOINT({$varOne}) CURRPGM({$varOne}) CURRTRANID({$varOne}) CURRUSERID({$varOne}) EVENTNAME({$varOne}) NUMDATAPRED({$varOne}) NUMINFOSRCE({$varOne}) NUMOPTPRED({$varOne}) PRIMPRED({$varOne}) EVENTBINDING({$varOne}) CAPTUREPTYPE({$varOne}) CURRPGMOP({$varOne}) CURRTRANIDOP({$varOne}) CURRUSERIDOP({$varOne}) PRIMPREDOP({$varOne}) PRIMPREDTYPE({$varOne})",
"CONNECTION({$varOne}) ACCESSMETHOD({$varOne}) ACQSTATUS({$varOne}) AUTOCONNECT({$varOne}) CHANGEAGENT({$varOne}) CONNSTATUS({$varOne}) CONNTYPE({$varOne}) CQP({$varOne}) EXITTRACING({$varOne}) INSTALLAGENT({$varOne}) PENDSTATUS({$varOne}) PROTOCOL({$varOne}) RECOVSTATUS({$varOne}) SERVSTATUS({$varOne}) XLNSTATUS({$varOne}) ZCPTRACING({$varOne}) AIDCOUNT({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) GRNAME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) LINKSYSTEM({$varOne}) MEMBERNAME({$varOne}) NETNAME({$varOne}) NQNAME({$varOne}) RECEIVECOUNT({$varOne}) REMOTENAME({$varOne}) REMOTESYSNET({$varOne}) REMOTESYSTEM({$varOne}) SENDCOUNT({$varOne})",
"CFDTPOOL({$varOne}) CONNSTATUS({$varOne})",
"DB2CONN ACCOUNTREC({$varOne}) AUTHTYPE({$varOne}) CHANGEAGENT({$varOne}) COMAUTHTYPE({$varOne}) CONNECTERROR({$varOne}) CONNECTST({$varOne}) DROLLBACK({$varOne}) INSTALLAGENT({$varOne}) NONTERMREL({$varOne}) PRIORITY({$varOne}) RESYNCMEMBER({$varOne}) STANDBYMODE({$varOne}) THREADERROR({$varOne}) THREADWAIT({$varOne}) AUTHID({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) COMAUTHID({$varOne}) COMTHREADLIM({$varOne}) COMTHREADS({$varOne}) DB2GROUPID({$varOne}) DB2ID({$varOne}) DB2RELEASE({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) MSGQUEUE1({$varOne}) MSGQUEUE2({$varOne}) MSGQUEUE3({$varOne}) PLAN({$varOne}) PLANEXITNAME({$varOne}) PURGECYCLEM({$varOne}) PURGECYCLES({$varOne}) REUSELIMIT({$varOne}) SIGNID({$varOne}) STATSQUEUE({$varOne}) TCBLIMIT({$varOne}) TCBS({$varOne}) THREADLIMIT({$varOne}) THREADS({$varOne})",
@@ -73,7 +73,7 @@ private static Stream getValidOptions() {
"EPADAPTINSET EPADAPTERSET({$varOne}) EPADAPTER({$varOne})",
"EVENTBINDING({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) EPADAPTERRES({$varOne}) INSTALLAGENT({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) EPADAPTER({$varOne}) EPADAPTERSET({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) USERTAG({$varOne})",
"EVENTPROCESS EPSTATUS({$varOne}) SCHEMALEVEL({$varOne})",
- "EXCI({$varOne}) TASK({$varOne}) UTIL({$varOne})",
+ "EXCI({$varOne}) NEXT TASK({$varOne}) UTIL({$varOne})",
"EXITPROGRAM({$varOne}) EXIT({$varOne}) ENTRYNAME({$varOne}) GAENTRYNAME({$varOne}) GALENGTH({$varOne}) GAUSECOUNT({$varOne}) NUMEXITS({$varOne}) QUALIFIER({$varOne}) TALENGTH({$varOne}) USECOUNT({$varOne}) APIST({$varOne}) CONCURRENTST({$varOne}) CONNECTST({$varOne}) FORMATEDFST({$varOne}) INDOUBTST({$varOne}) PURGEABLEST({$varOne}) SHUTDOWNST({$varOne}) SPIST({$varOne}) STARTSTATUS({$varOne}) TASKSTARTST({$varOne}) ENTRY({$varOne})",
"FEATUREKEY({$varOne}) VALUE({$varOne}) FILEPATH({$varOne})",
"FILE({$varOne}) ACCESSMETHOD({$varOne}) ADD({$varOne}) BLOCKFORMAT({$varOne}) BROWSE({$varOne}) CHANGEAGENT({$varOne}) DELETE({$varOne}) DISPOSITION({$varOne}) EMPTYSTATUS({$varOne}) ENABLESTATUS({$varOne}) EXCLUSIVE({$varOne}) FWDRECSTATUS({$varOne}) INSTALLAGENT({$varOne}) LOADTYPE({$varOne}) OBJECT({$varOne}) OPENSTATUS({$varOne}) RBATYPE({$varOne}) READ({$varOne}) READINTEG({$varOne}) RECORDFORMAT({$varOne}) RECOVSTATUS({$varOne}) RELTYPE({$varOne}) REMOTETABLE({$varOne}) RLSACCESS({$varOne}) TABLE({$varOne}) TYPE({$varOne}) UPDATE({$varOne}) UPDATEMODEL({$varOne}) BASEDSNAME({$varOne}) BLOCKKEYLEN({$varOne}) BLOCKSIZE({$varOne}) CFDTPOOL({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) DSNAME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) JOURNALNUM({$varOne}) KEYLENGTH({$varOne}) KEYPOSITION({$varOne}) LSRPOOLNUM({$varOne}) MAXNUMRECS({$varOne}) RECORDSIZE({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) STRINGS({$varOne}) TABLENAME({$varOne})",
@@ -88,7 +88,7 @@ private static Stream getValidOptions() {
"LIBRARY({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMINORVER({$varOne}) APPLMICROVER({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) DSNAME01({$varOne}) DSNAME02({$varOne}) DSNAME03({$varOne}) DSNAME04({$varOne}) DSNAME05({$varOne}) DSNAME06({$varOne}) DSNAME07({$varOne}) DSNAME08({$varOne}) DSNAME09({$varOne}) DSNAME10({$varOne}) DSNAME11({$varOne}) DSNAME12({$varOne}) DSNAME13({$varOne}) DSNAME14({$varOne}) DSNAME15({$varOne}) DSNAME16({$varOne}) INSTALLUSRID({$varOne}) INSTALLTIME({$varOne}) NUMDSNAMES({$varOne}) PLATFORM({$varOne}) RANKING({$varOne}) SEARCHPOS({$varOne}) CHANGEAGENT({$varOne}) CRITICALST({$varOne}) ENABLESTATUS({$varOne}) INSTALLAGENT({$varOne}) DSNAMELIST({$varOne})",
"MODENAME({$varOne}) CONNECTION({$varOne}) ACTIVE({$varOne}) AVAILABLE({$varOne}) MAXIMUM({$varOne}) MAXWINNERS({$varOne}) AUTOCONNECT({$varOne})",
"MONITOR APPLNAMEST({$varOne}) COMPRESSST({$varOne}) CONVERSEST({$varOne}) EXCEPTCLASS({$varOne}) IDNTYCLASS({$varOne}) PERFCLASS({$varOne}) RESRCECLASS({$varOne}) RMIST({$varOne}) STATUS({$varOne}) SYNCPOINTST({$varOne}) TIME({$varOne}) DPLLIMIT({$varOne}) FILELIMIT({$varOne}) FREQUENCY({$varOne}) FREQUENCYHRS({$varOne}) FREQUENCYMINS({$varOne}) FREQUENCYSECS({$varOne}) TSQUEUELIMIT({$varOne}) URIMAPLIMIT({$varOne}) WEBSERVLIMIT({$varOne})",
- "MQCONN CHANGEAGENT({$varOne}) CONNECTST({$varOne}) INSTALLAGENT({$varOne}) RESYNCNUMBER({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) MQNAME({$varOne}) MQQMGR({$varOne}) MQRELEASE({$varOne}) TASKS({$varOne}) TRIGMONTASKS({$varOne})",
+ "MQCONN CHANGEAGENT({$varOne}) CONNECTST({$varOne}) INSTALLAGENT({$varOne}) RESYNCMEMBER({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) MQNAME({$varOne}) MQQMGR({$varOne}) MQRELEASE({$varOne}) TASKS({$varOne}) TRIGMONTASKS({$varOne})",
"MQINI({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INITQNAME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne})",
"MQMONITOR({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) INSTALLAGENT({$varOne}) MONSTATUS({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) MONDATA({$varOne}) MONUSERID({$varOne}) QNAME({$varOne}) TASKID({$varOne}) TRANSACTION({$varOne}) USERID({$varOne})",
"MVSTCB({$varOne}) NEXT SET({$varOne}) NUMELEMENTS({$varOne})",
@@ -104,30 +104,30 @@ private static Stream getValidOptions() {
"PROGRAM({$varOne}) APIST({$varOne}) CEDFSTATUS({$varOne}) CHANGEAGENT({$varOne}) COBOLTYPE({$varOne}) COPY({$varOne}) CONCURRENCY({$varOne}) DATALOCATION({$varOne}) DYNAMSTATUS({$varOne}) EXECKEY({$varOne}) EXECUTIONSET({$varOne}) HOLDSTATUS({$varOne}) INSTALLAGENT({$varOne}) LANGDEDUCED({$varOne}) LANGUAGE({$varOne}) LPASTATUS({$varOne}) PROGTYPE({$varOne}) REPLICATION({$varOne}) RESIDENCY({$varOne}) RUNTIME({$varOne}) SHARESTATUS({$varOne}) STATUS({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMINORVER({$varOne}) APPLMICROVER({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) JVMCLASS({$varOne}) JVMPROFILE({$varOne}) JVMSERVER({$varOne}) LENGTH({$varOne}) LIBRARY({$varOne}) LIBRARYDSN({$varOne}) OPERATION({$varOne}) PLATFORM({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) RESCOUNT({$varOne}) TRANSID({$varOne}) USECOUNT({$varOne}) ENTRYPOINT({$varOne}) LOADPOINT({$varOne})",
"REQID({$varOne}) AFTER REQTYPE({$varOne}) FMHSTATUS({$varOne}) SET({$varOne}) TERMID({$varOne}) TRANSID({$varOne}) TIME({$varOne}) HOURS({$varOne}) MINUTES({$varOne}) SECONDS({$varOne}) LENGTH({$varOne}) RTRANSID({$varOne}) RTERMID({$varOne}) QUEUE({$varOne}) USERID({$varOne})",
"RRMS OPENSTATUS({$varOne})",
- "SECDISCOVERY STATUS({$varOne}) CMD({$varOne}) DB2({$varOne}) DCT({$varOne}) FCT({$varOne}) HFS({$varOne}) JCT({$varOne}) PCT({$varOne}) PPT({$varOne}) PSB({$varOne}) RES({$varOne}) TRAN({$varOne}) TST({$varOne}) USER({$varOne}) LATSECDTIME({$varOne}) LASTWRITTIME({$varOne}) SECDCOUNT({$varOne}) NEWSECDCOUNT({$varOne})",
+ "SECDISCOVERY STATUS({$varOne}) CMD({$varOne}) DB2({$varOne}) DCT({$varOne}) FCT({$varOne}) HFS({$varOne}) JCT({$varOne}) PCT({$varOne}) PPT({$varOne}) PSB({$varOne}) RES({$varOne}) TRAN({$varOne}) TST({$varOne}) USER({$varOne}) LASTSECDTIME({$varOne}) LASTWRITTIME({$varOne}) SECDCOUNT({$varOne}) NEWSECDCOUNT({$varOne})",
"SECRECORDING({$varOne}) ODADPTRID({$varOne}) ODADPTRDATA1({$varOne}) ODADPTRDATA2({$varOne}) ODADPTRDATA3({$varOne}) ODAPPLID({$varOne}) ODCLNTIPADDR({$varOne}) ODCLNTPORT({$varOne}) ODFACILNAME({$varOne}) ODFACILTYPE({$varOne}) ODIPFAMILY({$varOne}) ODLUNAME({$varOne}) ODNETID({$varOne}) ODNETWORKID({$varOne}) ODSERVERPORT({$varOne}) ODTCPIPS({$varOne}) ODTRANSID({$varOne}) ODUSERID({$varOne}) MAXIMUM({$varOne}) CURRENT({$varOne})",
- "STATISTICS RECORDING({$varOne}) ENDOFDAY({$varOne}) ENDOFDAYHRS({$varOne}) ENDOFDAYMINS({$varOne}) ENDOFDAYSECS({$varOne}) INTERVAL({$varOne}) INTERVALHRS({$varOne}) INTERVALMINS({$varOne}) INTERVALSECS({$varOne}) NEXTTIME({$varOne}) NEXTTIMEHRS({$varOne}) NEXTTIMEMINS({$varOne}) NEXTTIMESECS({$varOne})",
- "STORAGE ADDRESS({$varOne}) ELEMENT({$varOne}) ELEMENTLIST({$varOne}) LENGTHLIST({$varOne}) FLENGTH({$varOne}) NUMELEMENTS({$varOne}) TASK({$varOne})",
- "STORAGE64 ELEMENT64({$varOne}) ELEMENTLIST({$varOne}) LENGTHLIST({$varOne}) ADRESS64({$varOne}) DSANAME({$varOne}) TASK({$varOne}) FLENGTH({$varOne}) NUMELEMENTS({$varOne})",
+ "STATISTICS RECORDING({$varOne}) ENDOFDAYHRS({$varOne}) ENDOFDAYMINS({$varOne}) ENDOFDAYSECS({$varOne}) INTERVALHRS({$varOne}) INTERVALMINS({$varOne}) INTERVALSECS({$varOne}) NEXTTIME({$varOne})",
+ "STORAGE ADDRESS({$varOne}) ELEMENT({$varOne}) FLENGTH({$varOne})",
+ "STORAGE64 ELEMENT64({$varOne}) ADDRESS64({$varOne}) DSANAME({$varOne}) FLENGTH({$varOne})",
"STREAMNAME({$varOne}) STATUS({$varOne}) SYSTEMLOG({$varOne}) USECOUNT({$varOne})",
- "SUBPOOL({$varOne}) DSANAME({$varOne})",
+ "SUBPOOL({$varOne}) NEXT DSANAME({$varOne})",
"SYSDUMPCODE({$varOne}) CHANGEAGENT({$varOne}) DAEOPTION({$varOne}) DUMPSCOPE({$varOne}) INSTALLAGENT({$varOne}) SHUTOPTION({$varOne}) SYSDUMPING({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) CURRENT({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) DSPLIST({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) JOBLIST({$varOne}) MAXIMUM({$varOne})",
"SYSTEM ACTOPENTCBS({$varOne}) AIDCOUNT({$varOne}) AKP({$varOne}) CDSASIZE({$varOne}) CICSSYS({$varOne}) CICSTSLEVEL({$varOne}) DB2CONN({$varOne}) DFLTUSER({$varOne}) DSALIMIT({$varOne}) DSRTPROGRAM({$varOne}) DTRPROGRAM({$varOne}) ECDSASIZE({$varOne}) EDSALIMIT({$varOne}) EPCDSASIZE({$varOne}) EPUDSASIZE({$varOne}) ERDSASIZE({$varOne}) ESDSASIZE({$varOne}) EUDSASIZE({$varOne}) GCDSASIZE({$varOne}) GMMTEXT({$varOne}) GMMLENGTH({$varOne}) GSDSASIZE({$varOne}) GUDSASIZE({$varOne}) GMMTRANID({$varOne}) JOBNAME({$varOne}) LASTCOLDTIME({$varOne}) LASTEMERTIME({$varOne}) LASTINITTIME({$varOne}) LASTWARMTIME({$varOne}) LOGDEFER({$varOne}) MAXOPENTCBS({$varOne}) MAXTASKS({$varOne}) MEMLIMIT({$varOne}) MQCONN({$varOne}) MROBATCH({$varOne}) MVSSMFID({$varOne}) MVSSYSNAME({$varOne}) OPREL({$varOne}) OPSYS({$varOne}) OSLEVEL({$varOne}) PCDSASIZE({$varOne}) PLTPIUSR({$varOne}) PROGAUTOEXIT({$varOne}) PRTYAGING({$varOne}) PUDSASIZE({$varOne}) RDSASIZE({$varOne}) REGIONUSERID({$varOne}) RELEASE({$varOne}) RUNAWAY({$varOne}) SCANDELAY({$varOne}) SDSASIZE({$varOne}) SDTMEMLIMIT({$varOne}) SDTRAN({$varOne}) STARTUPDATE({$varOne}) TIME({$varOne}) UDSASIZE({$varOne}) SRRTASKS({$varOne}) CICSSTATUS({$varOne}) CMDPROTECT({$varOne}) COLDSTATUS({$varOne}) DEBUGTOOL({$varOne}) DUMPING({$varOne}) FORCEQR({$varOne}) HEALTHCHECK({$varOne}) INITSTATUS({$varOne}) MESSAGECASE({$varOne}) PROGAUTOCTLG({$varOne}) PROGAUTOINST({$varOne}) REENTPROTECT({$varOne}) RLSSTATUS({$varOne}) SECURITYMGR({$varOne}) SHUTSTATUS({$varOne}) SOSABOVEBAR({$varOne}) SOSABOVELINE({$varOne}) SOSBELOWLINE({$varOne}) SOSSTATUS({$varOne}) STARTUP({$varOne}) STOREPROTECT({$varOne}) TRANISOLATE({$varOne}) XRFSTATUS({$varOne})",
- "TAG START NEXT END",
+ "TAG START",
"TASK ACTIVITY({$varOne}) ACTIVITYID({$varOne}) ATTACHTIME({$varOne}) BRFACILITY({$varOne}) BRIDGE({$varOne}) CURRENTPROG({$varOne}) DB2PLAN({$varOne}) DTIMEOUT({$varOne}) FACILITY({$varOne}) IDENTIFIER({$varOne}) INDOUBTMINS({$varOne}) IPFLISTSIZE({$varOne}) PRIORITY({$varOne}) PROCESS({$varOne}) PROCESSTYPE({$varOne}) PROFILE({$varOne}) PROGRAM({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) RTIMEOUT({$varOne}) RUNAWAY({$varOne}) STARTCODE({$varOne}) SUSPENDTIME({$varOne}) SUSPENDTYPE({$varOne}) SUSPENDVALUE({$varOne}) RESNAME({$varOne}) TRANCLASS({$varOne}) TCLASS({$varOne}) TRANPRIORITY({$varOne}) TRANSACTION({$varOne}) TRPROF({$varOne}) TWASIZE({$varOne}) UOW({$varOne}) USERID({$varOne}) CMDSEC({$varOne}) DUMPING({$varOne}) FACILITYTYPE({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) ISOLATEST({$varOne}) PURGEABILITY({$varOne}) RESSEC({$varOne}) ROUTING({$varOne}) RUNSTATUS({$varOne}) SCRNSIZE({$varOne}) SRRSTATUS({$varOne}) STORAGECLEAR({$varOne}) TASKDATAKEY({$varOne}) TASKDATALOC({$varOne}) TCB({$varOne}) TRACING({$varOne}) IPFACILITIES({$varOne})",
"TASK LIST DISPATCHABLE RUNNING SUSPENDED LISTSIZE({$varOne}) SET({$varOne}) SETTRANSID({$varOne})",
"TCLASS({$varOne}) CURRENT({$varOne}) MAXIMUM({$varOne})",
"TCPIP ACTSOCKETS({$varOne}) CRLPROFILE({$varOne}) MAXSOCKETS({$varOne}) OPENSTATUS({$varOne}) SSLCACHE({$varOne})",
"TCPIPSERVICE({$varOne}) CERTIFICATE({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) CIPHERS({$varOne}) CLOSETIMEOUT({$varOne}) CONNECTIONS({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) GENERICTCPS({$varOne}) HOST({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) IPADDRESS({$varOne}) IPRESOLVED({$varOne}) MAXDATALEN({$varOne}) MAXPERSIST({$varOne}) NUMCIPHERS({$varOne}) OPTIONSPGM({$varOne}) PORT({$varOne}) REALM({$varOne}) SPECIFTCPS({$varOne}) TRANSID({$varOne}) URM({$varOne}) BACKLOG({$varOne}) ATTACHSEC({$varOne}) ATTLS({$varOne}) AUTHENTICATE({$varOne}) CHANGEAGENT({$varOne}) HOSTTYPE({$varOne}) INSTALLAGENT({$varOne}) IPFAMILY({$varOne}) OPENSTATUS({$varOne}) PRIVACY({$varOne}) PROTOCOL({$varOne}) SOCKETCLOSE({$varOne}) SSLTYPE({$varOne})",
- "TDQUEUE({$varOne}) ATITERMID({$varOne}) ATITRANID({$varOne}) ATIUSERID({$varOne}) BLOCKSIZE({$varOne}) DATABUFFERS({$varOne}) DDNAME({$varOne}) DSNAME({$varOne}) INDIRECTNAME({$varOne}) MEMBER({$varOne}) NUMITEMS({$varOne}) RECORDLENGTH({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) TRIGGERLEVEL({$varOne}) ATIFACILITY({$varOne}) BLOCKFORMAT({$varOne}) DISPOSITION({$varOne}) EMPTYSTATUS({$varOne}) ENABLESTATUS({$varOne}) ERROROPTION({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) IOTYPE({$varOne}) OPENSTATUS({$varOne}) PRINTCONTROL({$varOne}) RECORDFORMAT({$varOne}) RECOVSTATUS({$varOne}) REWIND({$varOne}) SYSOUTCLASS({$varOne}) TYPE({$varOne})",
+ "TDQUEUE({$varOne}) CHANGEAGENT({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLAGENT({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) ATITERMID({$varOne}) ATITRANID({$varOne}) ATIUSERID({$varOne}) BLOCKSIZE({$varOne}) DATABUFFERS({$varOne}) DDNAME({$varOne}) DSNAME({$varOne}) INDIRECTNAME({$varOne}) MEMBER({$varOne}) NUMITEMS({$varOne}) RECORDLENGTH({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) TRIGGERLEVEL({$varOne}) ATIFACILITY({$varOne}) BLOCKFORMAT({$varOne}) DISPOSITION({$varOne}) EMPTYSTATUS({$varOne}) ENABLESTATUS({$varOne}) ERROROPTION({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) IOTYPE({$varOne}) OPENSTATUS({$varOne}) PRINTCONTROL({$varOne}) RECORDFORMAT({$varOne}) RECOVSTATUS({$varOne}) REWIND({$varOne}) SYSOUTCLASS({$varOne}) TYPE({$varOne})",
"TEMPSTORAGE TSMAININUSE({$varOne}) TSMAINLIMIT({$varOne})",
"TERMINAL({$varOne}) NETNAME({$varOne}) AIDCOUNT({$varOne}) ALTPAGEHT({$varOne}) ALTPAGEWD({$varOne}) ALTPRINTER({$varOne}) ALTSCRNHT({$varOne}) ALTSCRNWD({$varOne}) ALTSUFFIX({$varOne}) CONSOLE({$varOne}) CORRELID({$varOne}) DEFPAGEHT({$varOne}) DEFPAGEWD({$varOne}) DEFSCRNHT({$varOne}) DEFSCRNWD({$varOne}) GCHARS({$varOne}) GCODES({$varOne}) LINKSYSTEM({$varOne}) MAPNAME({$varOne}) MAPSETNAME({$varOne}) MODENAME({$varOne}) NATLANG({$varOne}) NEXTTRANSID({$varOne}) NQNAME({$varOne}) OPERID({$varOne}) PAGEHT({$varOne}) PAGEWD({$varOne}) PRINTER({$varOne}) REMOTENAME({$varOne}) REMOTESYSNET({$varOne}) REMOTESYSTEM({$varOne}) SCRNHT({$varOne}) SCRNWD({$varOne}) TASKID({$varOne}) TCAMCONTROL({$varOne}) TERMMODEL({$varOne}) TERMPRIORITY({$varOne}) TNADDR({$varOne}) TNPORT({$varOne}) TRANSACTION({$varOne}) USERAREALEN({$varOne}) USERID({$varOne}) USERNAME({$varOne}) ACCESSMETHOD({$varOne}) ACQSTATUS({$varOne}) ALTPRTCOPYST({$varOne}) APLKYBDST({$varOne}) APLTEXTST({$varOne}) ASCII({$varOne}) ATISTATUS({$varOne}) AUDALARMST({$varOne}) AUTOCONNECT({$varOne}) BACKTRANSST({$varOne}) COLORST({$varOne}) COPYST({$varOne}) CREATESESS({$varOne}) DATASTREAM({$varOne}) DEVICE({$varOne}) DISCREQST({$varOne}) DUALCASEST({$varOne}) EXITTRACING({$varOne}) EXTENDEDDSST({$varOne}) FMHPARMST({$varOne}) FORMFEEDST({$varOne}) HFORMST({$varOne}) HILIGHTST({$varOne}) KATAKANAST({$varOne}) LIGHTPENST({$varOne}) MSRCONTROLST({$varOne}) NATURE({$varOne}) OBFORMATST({$varOne}) OBOPERIDST({$varOne}) OUTLINEST({$varOne}) PAGESTATUS({$varOne}) PARTITIONSST({$varOne}) PRINTADAPTST({$varOne}) PROGSYMBOLST({$varOne}) PRTCOPYST({$varOne}) QUERYST({$varOne}) RELREQST({$varOne}) SECURITY({$varOne}) SERVSTATUS({$varOne}) SESSIONTYPE({$varOne}) SIGNONSTATUS({$varOne}) SOSIST({$varOne}) TERMSTATUS({$varOne}) TEXTKYBDST({$varOne}) TEXTPRINTST({$varOne}) TNIPFAMILY({$varOne}) TRACING({$varOne}) TTISTATUS({$varOne}) UCTRANST({$varOne}) VALIDATIONST({$varOne}) VFORMST({$varOne}) ZCPTRACING({$varOne}) USERAREA({$varOne})",
"TRACEDEST CURAUXDS({$varOne}) TABLESIZE({$varOne}) AUXSTATUS({$varOne}) GTFSTATUS({$varOne}) INTSTATUS({$varOne}) SWITCHSTATUS({$varOne})",
"TRACEFLAG SINGLESTATUS({$varOne}) SYSTEMSTATUS({$varOne}) TCEXITSTATUS({$varOne}) USERSTATUS({$varOne})",
- "TRACETYPE SPECIAL STANDARD COMPID({$varOne}) FLAGSET({$varOne})",
+ "TRACETYPE DD({$varOne}) FLAGSET({$varOne})",
"TRANCLASS({$varOne}) ACTIVE({$varOne}) MAXACTIVE({$varOne}) PURGETHRESH({$varOne}) QUEUED({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne}) PURGEACTION({$varOne})",
"TRANDUMPCODE({$varOne}) CURRENT({$varOne}) MAXIMUM({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) DUMPSCOPE({$varOne}) SHUTOPTION({$varOne}) SYSDUMPING({$varOne}) TRANDUMPING({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne})",
- "TRANSACTION({$varOne}) BREXIT({$varOne}) DTIMEOUT({$varOne}) FACILITYLIKE({$varOne}) INDOUBTMINS({$varOne}) OTSTIMEOUT({$varOne}) PRIORITY({$varOne}) PROFILE({$varOne}) PROGRAM({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) RTIMEOUT({$varOne}) RUNAWAY({$varOne}) TCLASS({$varOne}) TRANCLASS({$varOne}) TRPROF({$varOne}) TWASIZE({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMICROVER({$varOne}) APPLMINORVER({$varOne}) OPERATION({$varOne}) PLATFORM({$varOne}) AVAILSTATUS({$varOne}) CMDSEC({$varOne}) DUMPING({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) ISOLATEST({$varOne}) PURGEABILITY({$varOne}) RESSEC({$varOne}) ROUTING({$varOne}) ROUTESTATUS({$varOne}) RUNAWAYTYPE({$varOne}) SCRNSIZE({$varOne}) SHUTDOWN({$varOne}) STATUS({$varOne}) STORAGECLEAR({$varOne}) TASKDATAKEY({$varOne}) TASKDATALOC({$varOne}) TRACING({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne})",
+ "TRANSACTION({$varOne}) BREXIT({$varOne}) DTIMEOUT({$varOne}) FACILITYLIKE({$varOne}) INDOUBTMINS({$varOne}) OTSTIMEOUT({$varOne}) PRIORITY({$varOne}) PROFILE({$varOne}) PROGRAM({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) RTIMEOUT({$varOne}) RUNAWAY({$varOne}) TRANCLASS({$varOne}) TRPROF({$varOne}) TWASIZE({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMICROVER({$varOne}) APPLMINORVER({$varOne}) OPERATION({$varOne}) PLATFORM({$varOne}) AVAILSTATUS({$varOne}) CMDSEC({$varOne}) DUMPING({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) ISOLATEST({$varOne}) PURGEABILITY({$varOne}) RESSEC({$varOne}) ROUTING({$varOne}) ROUTESTATUS({$varOne}) RUNAWAYTYPE({$varOne}) SCRNSIZE({$varOne}) SHUTDOWN({$varOne}) STATUS({$varOne}) STORAGECLEAR({$varOne}) TASKDATAKEY({$varOne}) TASKDATALOC({$varOne}) TRACING({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne})",
"TSMODEL({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) EXPIRYINT({$varOne}) EXPIRYINTMIN({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) POOLNAME({$varOne}) PREFIX({$varOne}) REMOTEPREFIX({$varOne}) REMOTESYSTEM({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne}) LOCATION({$varOne}) RECOVSTATUS({$varOne}) SECURITYST({$varOne})",
"TSPOOL({$varOne}) CONNSTATUS({$varOne})",
"TSQUEUE({$varOne}) EXPIRYINT({$varOne}) EXPIRYINTMIN({$varOne}) FLENGTH({$varOne}) LASTUSEDINT({$varOne}) MAXITEMLEN({$varOne}) MINITEMLEN({$varOne}) NUMITEMS({$varOne}) TRANSID({$varOne}) POOLNAME({$varOne}) TSMODEL({$varOne}) LOCATION({$varOne}) RECOVSTATUS({$varOne})",
@@ -136,11 +136,14 @@ private static Stream getValidOptions() {
"UOWENQ NEXT DURATION({$varOne}) ENQFAILS({$varOne}) NETUOWID({$varOne}) QUALIFIER({$varOne}) QUALLEN({$varOne}) TASKID({$varOne}) TRANSID({$varOne}) RESOURCE({$varOne}) RESLEN({$varOne}) RELATION({$varOne}) STATE({$varOne}) TYPE({$varOne})",
"UOWLINK({$varOne}) HOST({$varOne}) PORT({$varOne}) BRANCHQUAL({$varOne}) LINK({$varOne}) NETUOWID({$varOne}) RMIQFY({$varOne}) SYSID({$varOne}) UOW({$varOne}) URID({$varOne}) XID({$varOne}) PROTOCOL({$varOne}) RESYNCSTATUS({$varOne}) ROLE({$varOne}) TYPE({$varOne})",
"URIMAP({$varOne}) ATOMSERVICE({$varOne}) CERTIFICATE({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) CHARACTERSET({$varOne}) CIPHERS({$varOne}) CONVERTER({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) HFSFILE({$varOne}) HOST({$varOne}) HOSTCODEPAGE({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) IPRESOLVED({$varOne}) LOCATION({$varOne}) MEDIATYPE({$varOne}) NUMCIPHERS({$varOne}) PATH({$varOne}) PIPELINE({$varOne}) PORT({$varOne}) PROGRAM({$varOne}) SOCKETCLOSE({$varOne}) SOCKPOOLSIZE({$varOne}) TCPIPSERVICE({$varOne}) TEMPLATENAME({$varOne}) TRANSACTION({$varOne}) USERID({$varOne}) WEBSERVICE({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMINORVER({$varOne}) APPLMICROVER({$varOne}) OPERATION({$varOne}) PLATFORM({$varOne}) ANALYZERSTAT({$varOne}) AUTHENTICATE({$varOne}) AVAILSTATUS({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) HOSTTYPE({$varOne}) INSTALLAGENT({$varOne}) IPFAMILY({$varOne}) REDIRECTTYPE({$varOne}) SCHEME({$varOne}) USAGE({$varOne})",
- "VTAM GRNAME({$varOne}) PSDINTERVAL({$varOne}) PSDINTHRS({$varOne}) PSDINTMINS({$varOne}) PSDINTSECS({$varOne}) GRSTATUS({$varOne}) OPENSTATUS({$varOne}) PSTYPE({$varOne})",
+ "VTAM GRNAME({$varOne}) PSDINTHRS({$varOne}) PSDINTMINS({$varOne}) PSDINTSECS({$varOne}) GRSTATUS({$varOne}) OPENSTATUS({$varOne}) PSTYPE({$varOne})",
"WEB GARBAGEINT({$varOne}) TIMEOUTINT({$varOne})",
"WEBSERVICE({$varOne}) ARCHIVEFILE({$varOne}) BINDING({$varOne}) CCSID({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) CONTAINER({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) ENDPOINT({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) LASTMODTIME({$varOne}) MAPPINGLEVEL({$varOne}) MAPPINGRNUM({$varOne}) MAPPINGVNUM({$varOne}) MINRUNLEVEL({$varOne}) MINRUNRNUM({$varOne}) MINRUNVNUM({$varOne}) PIPELINE({$varOne}) PROGRAM({$varOne}) URIMAP({$varOne}) WSBIND({$varOne}) WSDLFILE({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne}) PGMINTERFACE({$varOne}) STATE({$varOne}) VALIDATIONST({$varOne}) XOPDIRECTST({$varOne}) XOPSUPPORTST({$varOne})",
"WLMHEALTH ADJUSTMENT({$varOne}) HEALTH({$varOne}) HEALTHABSTIM({$varOne}) INTERVAL({$varOne}) OPENSTATUS({$varOne})",
- "XMLTRANSFORM({$varOne})BUNDLE({$varOne}) CCSID({$varOne}) MAPPINGLEVEL({$varOne}) MAPPINGRNUM({$varOne}) MAPPINGVNUM({$varOne}) MINRUNLEVEL({$varOne}) MINRUNRNUM({$varOne}) MINRUNVNUM({$varOne}) XMLSCHEMA({$varOne}) XSDBIND({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) VALIDATIONST({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) INSTALLAGENT({$varOne})");
+ "XMLTRANSFORM({$varOne}) BUNDLE({$varOne}) CCSID({$varOne}) MAPPINGLEVEL({$varOne}) MAPPINGRNUM({$varOne}) MAPPINGVNUM({$varOne}) MINRUNLEVEL({$varOne}) MINRUNRNUM({$varOne}) MINRUNVNUM({$varOne}) XMLSCHEMA({$varOne}) XSDBIND({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) VALIDATIONST({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) INSTALLAGENT({$varOne})",
+ "UOWENQ NEXT ENQSCOPE({$varOne}) RESOURCE({$varOne}) RESLEN({$varOne}) UOW({$varOne})",
+ "UOWENQ START",
+ "UOWDSNFAIL START");
}
private static final String INVALID_BROWSE_BRFACILITY =
@@ -203,6 +206,316 @@ private static Stream getValidOptions() {
private static final String BUNDLEPART_INVALID = "INQUIRE {_BUNDLEPART(1) BUNDLE(1)|errorOne_}";
+ private static final String BUNDLEPART_BROWSE_WITH_PARAM_INVALID = "INQUIRE BUNDLEPART{(1)|errorOne} START BUNDLE(1)";
+
+ private static final String ENQ_VALID = "INQUIRE ENQ NEXT RESOURCE({$varOne}) RESLEN({$varOne}) UOW({$varOne})";
+
+ private static final String TRACETYPE_INVALID = "INQUIRE TRACETYPE {SPECIAL|errorOne} {FLAGSET|errorTwo}(1) {AP|errorThree}(1) {APPLICATION|errorFour}(1)";
+
+ private static final String TRANSACTION_INVALID = "INQUIRE TRANSACTION(1) {TCLASS|errorOne}(1) {TRANCLASS|errorTwo}(1)";
+
+ private static final String TCPIPSERVICE_VALID = "INQUIRE TCPIPSERVICE START";
+
+ private static final String TASKLIST_INVALID = "INQUIRE {_TASK LIST DISPATCHABLE RUNNING SETTRANSID(1) SUSPENDED|errorOne|errorTwo_}";
+
+ private static final String TASK_VALID = "INQUIRE TASK";
+
+ private static final String TAG_VALID = "INQUIRE TAG({$varOne}) NEXT";
+
+ private static final String TAG_INVALID = "INQUIRE {TAG|errorOne} NEXT";
+
+ private static final String SUBPOOL_VALID = "INQUIRE SUBPOOL START";
+
+ private static final String STORAGE64_INVALID = "INQUIRE STORAGE64 NUMELEMENTS(1) {DSANAME|errorOne}(1)";
+
+ private static final String STORAGE_INVALID = "INQUIRE STORAGE NUMELEMENTS(1) {ELEMENT|errorOne}(1)";
+
+ private static final String STATS_INVALID = "INQUIRE {_STATISTICS {ENDOFDAY|errorOne}(1) {ENDOFDAYHRS|errorTwo}(1) RECORDING(1)|errorThree|errorFour_}";
+
+ private static final String PROGRAM_INVALID = "INQUIRE {_PROGRAM(1) APPLICATION(1) APPLMAJORVER(1) APPLMICROVER(1) APPLMINORVER(1)|errorOne_}";
+
+ private static final String PROGRAM_VALID = "INQUIRE PROGRAM({$varOne})";
+
+ private static final String PROCESSTYPE_VALID = "INQUIRE PROCESSTYPE({$varOne})";
+
+ private static final String NETNAME_VALID = "INQUIRE NETNAME({$varOne}) NEXT TERMINAL({$varOne})";
+
+ private static final String MQCONN_VALID = "INQUIRE MQCONN RESYNCMEMBER({$varOne})";
+
+ private static final String SECDISCOVERY_VALID = "INQUIRE SECDISCOVERY STATUS({$varOne}) LASTSECDTIME({$varOne})";
+
+ private static final String XMLTRANS_INVALID = "INQUIRE {XMLTRANSFORM|errorOne}";
+
+ private static final String VTAM_INVALID = "INQUIRE VTAM {PSDINTERVAL|errorOne}(1) {PSDINTHRS|errorTwo}(1) PSDINTMINS(1) PSDINTSECS(1)";
+
+ private static final String TASKLIST_INVALID_LIST = "INQUIRE {_TASK LISTSIZE(1)|errorOne_}";
+
+ @Test
+ void testInvalidTaskListTwo() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: LIST",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(TASKLIST_INVALID_LIST, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testInvalidVTAM() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: PSDINTHRS with PSDINTERVAL",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: PSDINTHRS with PSDINTERVAL",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorThree",
+ new Diagnostic(
+ new Range(),
+ "Invalid option or parameter provided: Missing required option parameter",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(VTAM_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testInvalidXMLTrans() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option or parameter provided: Missing required option parameter",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(XMLTRANS_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testLastSecD() {
+ CICSTestUtils.noErrorTest(SECDISCOVERY_VALID, "SP");
+ }
+
+ @Test
+ void testMQConn() {
+ CICSTestUtils.noErrorTest(MQCONN_VALID, "SP");
+ }
+
+ @Test
+ void testNetname() {
+ CICSTestUtils.noErrorTest(NETNAME_VALID, "SP");
+ }
+
+ @Test
+ void testProcesstype() {
+ CICSTestUtils.noErrorTest(PROCESSTYPE_VALID, "SP");
+ }
+
+ @Test
+ void testProgram() {
+ CICSTestUtils.noErrorTest(PROGRAM_VALID, "SP");
+ }
+
+ @Test
+ void testInvalidProgram() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: PLATFORM with APPLICATION",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(PROGRAM_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testInvalidStatistics() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: ENDOFDAY or ENDOFDAYHRS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: ENDOFDAY or ENDOFDAYHRS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorThree",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: ENDOFDAYMINS with ENDOFDAYHRS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorFour",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: ENDOFDAYSECS with ENDOFDAYHRS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(STATS_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testInvalidStorage() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: ELEMENT with NUMELEMENTS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(STORAGE_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testInvalidS64() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: DSANAME with NUMELEMENTS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(STORAGE64_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testSubPool() {
+ CICSTestUtils.noErrorTest(SUBPOOL_VALID, "SP");
+ }
+
+ @Test
+ void testInvalidTag() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option or parameter provided: Missing required option parameter",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(TAG_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testTagValid() {
+ CICSTestUtils.noErrorTest(TAG_VALID, "SP");
+ }
+
+ @Test
+ void testTaskValid() {
+ CICSTestUtils.noErrorTest(TASK_VALID, "SP");
+ }
+
+ @Test
+ void testInvalidTaskList() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: LISTSIZE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Missing required option for: SETTRANSID without SET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(TASKLIST_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testTCPIPServValid() {
+ CICSTestUtils.noErrorTest(TCPIPSERVICE_VALID, "SP");
+ }
+
+ @Test
+ void testInvalidTransaction() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: TCLASS and TRANCLASS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: TCLASS and TRANCLASS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(TRANSACTION_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testInvalidTracetype() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: FLAGSET or SPECIAL or STANDARD",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: FLAGSET or SPECIAL or STANDARD",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorThree",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: AP and APPLICATION",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorFour",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: AP and APPLICATION",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(TRACETYPE_INVALID, expectedDiagnostics, "SP");
+ }
+
+ @Test
+ void testENQValid() {
+ CICSTestUtils.noErrorTest(ENQ_VALID, "SP");
+ }
+
+ @Test
+ void testInvalidBundlepartBrowseWithParam() {
+ Map expectedDiagnostics =
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option or parameter provided: Parameter usage when browsing with START or END",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()));
+ CICSTestUtils.errorTest(BUNDLEPART_BROWSE_WITH_PARAM_INVALID, expectedDiagnostics, "SP");
+ }
+
@Test
void testInvalidBundlepartBrowseOnly() {
Map expectedDiagnostics =
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSRelease.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSRelease.java
index 7757a15e19..bbef69a6f5 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSRelease.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSRelease.java
@@ -14,12 +14,12 @@
*/
package org.eclipse.lsp.cobol.usecases;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.eclipse.lsp.cobol.common.error.ErrorSource;
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
-import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -35,7 +35,7 @@ public class TestCICSRelease {
"RELEASE PROGRAM({$varOne})";
private static final String RELEASE_INVALID_NO_PROGRAM =
- "{_RELEASE|errorOne|errorTwo_}";
+ "RELEASE";
private static final String RELEASE_INVALID_EXTRA_OPTION =
"RELEASE PROGRAM({$varOne}) {PROGRAM|errorOne}({$varOne})";
@@ -47,18 +47,19 @@ void testReleaseValid() {
@Test
void testReleaseInvalidNoProgram() {
- CICSTestUtils.errorTest(
+ CICSTestUtils.errorTestWithEndExecError(
RELEASE_INVALID_NO_PROGRAM,
+ ImmutableList.of("errorOne"),
ImmutableMap.of(
"errorOne",
new Diagnostic(
- new Range(new Position(13, 12), new Position(13, 12)),
+ new Range(),
"Missing required option: PROGRAM",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()),
- "errorTwo",
+ "end-exec-error",
new Diagnostic(
- new Range(new Position(13, 12), new Position(13, 20)),
+ new Range(),
"Syntax error on 'END-EXEC'",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText())));
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSReset.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSReset.java
index 08e880168e..69be9abc31 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSReset.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSReset.java
@@ -14,12 +14,12 @@
*/
package org.eclipse.lsp.cobol.usecases;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.eclipse.lsp.cobol.common.error.ErrorSource;
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
-import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -37,7 +37,7 @@ public class TestCICSReset {
"RESET ACTIVITY({$varOne})";
private static final String RESET_INVALID =
- "RESET {|errorOne}";
+ "RESET ";
@Test
void testResetAcqprocessValid() {
@@ -51,12 +51,13 @@ void testResetActivityValid() {
@Test
void testResetInvalid() {
- CICSTestUtils.errorTest(
+ CICSTestUtils.errorTestWithEndExecError(
RESET_INVALID,
+ ImmutableList.of(),
ImmutableMap.of(
- "errorOne",
+ "end-exec-error",
new Diagnostic(
- new Range(new Position(14, 12), new Position(14, 20)),
+ new Range(),
"Syntax error on 'END-EXEC'",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText())));
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSignalEvent.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSignalEvent.java
new file mode 100644
index 0000000000..b0bff9df6b
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSignalEvent.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.common.error.ErrorSource;
+import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+import org.eclipse.lsp4j.Diagnostic;
+import org.eclipse.lsp4j.DiagnosticSeverity;
+import org.eclipse.lsp4j.Range;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test CICS SIGNAL EVENT command. Documentation link: SIGNAL EVENT Command
+ *
+ * This class tests the SIGNAL EVENT command.
+ */
+public class TestCICSSignalEvent {
+ private static final String SIGNAL_EVENT_VALID_MINIMAL =
+ "SIGNAL EVENT({$varOne})";
+
+ private static final String SIGNAL_FROM_INVALID =
+ "SIGNAL {FROM(123)|errorOne}";
+
+ private static final String SIGNAL_EVENT_VALID_FROMCHANNEL =
+ "SIGNAL EVENT({$varOne}) FROMCHANNEL({$varTwo})";
+
+ private static final String SIGNAL_EVENT_VALID_FROM =
+ "SIGNAL EVENT({$varOne}) FROM({$varTwo}) FROMLENGTH({$varThree})";
+
+ private static final String SIGNAL_EVENT_INVALID_BOTH_FROM =
+ "SIGNAL EVENT({$varOne}) {FROMCHANNEL|errorOne}({$varTwo}) {FROM|errorTwo}({$varThree})";
+
+ private static final String SIGNAL_EVENT_INVALID_FROMLENGTH_WITHOUT_FROM =
+ "SIGNAL {_EVENT({$varOne}) FROMLENGTH(123)|errorOne_}";
+
+ @Test
+ void testSignalEventValidMinimal() {
+ CICSTestUtils.noErrorTest(SIGNAL_EVENT_VALID_MINIMAL);
+ }
+
+ @Test
+ void testSignalFromInvalid() {
+ CICSTestUtils.errorTest(
+ SIGNAL_FROM_INVALID,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: EVENT",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testSignalEventValidFromchannel() {
+ CICSTestUtils.noErrorTest(SIGNAL_EVENT_VALID_FROMCHANNEL);
+ }
+
+ @Test
+ void testSignalEventValidFrom() {
+ CICSTestUtils.noErrorTest(SIGNAL_EVENT_VALID_FROM);
+ }
+
+ @Test
+ void testSignalEventInvalidBothFrom() {
+ CICSTestUtils.errorTest(
+ SIGNAL_EVENT_INVALID_BOTH_FROM,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: FROMCHANNEL or FROM",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: FROMCHANNEL or FROM",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testSignalEventInvalidFromlengthWithoutFrom() {
+ CICSTestUtils.errorTest(
+ SIGNAL_EVENT_INVALID_FROMLENGTH_WITHOUT_FROM,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: FROM",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSStartbr.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSStartbr.java
new file mode 100644
index 0000000000..7069a2ed49
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSStartbr.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.common.error.ErrorSource;
+import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+import org.eclipse.lsp4j.Diagnostic;
+import org.eclipse.lsp4j.DiagnosticSeverity;
+import org.eclipse.lsp4j.Range;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test CICS STARTBR command. Documentation link: STARTBR Command
+ *
+ *
This class tests the STARTBR command.
+ */
+public class TestCICSStartbr {
+ private static final String STARTBR_VALID_MINIMAL =
+ "STARTBR FILE({$varOne}) RIDFLD({$varTwo})";
+
+ private static final String STARTBR_DATASET_VALID =
+ "STARTBR DATASET({$varOne}) RIDFLD({$varTwo})";
+
+ private static final String STARTBR_INVALID_NO_KEYLENGTH =
+ "STARTBR {_FILE({$varOne}) RIDFLD({$varTwo}) GENERIC|errorOne_}";
+
+ private static final String STARTBR_VALID_FULL =
+ "STARTBR FILE({$varOne}) RIDFLD({$varTwo}) KEYLENGTH({$varThree}) GENERIC REQID({$varFour}) SYSID({$varFive}) DEBKEY GTEQ";
+
+ private static final String STARTBR_SYSID_INVALID =
+ "STARTBR {_FILE({$varOne}) RIDFLD({$varTwo}) SYSID({$varFive}) GTEQ|errorOne_}";
+
+ private static final String STARTBR_INVALID_NO_FILE =
+ "STARTBR {_RIDFLD({$varTwo}) KEYLENGTH({$varOne}) GENERIC|errorOne_}";
+
+ private static final String STARTBR_INVALID_NO_RIDFLD =
+ "STARTBR {_FILE({$varOne}) KEYLENGTH({$varTwo}) GENERIC|errorOne_}";
+
+ private static final String STARTBR_INVALID_MULTIPLE_POSITIONING =
+ "STARTBR FILE({$varOne}) RIDFLD({$varTwo}) {DEBKEY|errorOne} {RBA|errorTwo}";
+
+ private static final String STARTBR_INVALID_MULTIPLE_COMPARISON =
+ "STARTBR FILE({$varOne}) RIDFLD({$varTwo}) {GTEQ|errorOne} {EQUAL|errorTwo}";
+
+ @Test
+ void testStartbrValidMinimal() {
+ CICSTestUtils.noErrorTest(STARTBR_VALID_MINIMAL);
+ }
+
+ @Test
+ void testStartbrDatasetValid() {
+ CICSTestUtils.noErrorTest(STARTBR_DATASET_VALID);
+ }
+
+ @Test
+ void testStartbrInvalidNoKeylength() {
+ CICSTestUtils.errorTest(
+ STARTBR_INVALID_NO_KEYLENGTH,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: KEYLENGTH",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testStartbrSysidInvalid() {
+ CICSTestUtils.errorTest(
+ STARTBR_SYSID_INVALID,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, none provided: KEYLENGTH, RBA, RRN, or XRBA",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testStartbrValidFull() {
+ CICSTestUtils.noErrorTest(STARTBR_VALID_FULL);
+ }
+
+ @Test
+ void testStartbrInvalidNoFile() {
+ CICSTestUtils.errorTest(
+ STARTBR_INVALID_NO_FILE,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, none provided: FILE or DATASET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testStartbrInvalidNoRidfld() {
+ CICSTestUtils.errorTest(
+ STARTBR_INVALID_NO_RIDFLD,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: RIDFLD",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testStartbrInvalidMultiplePositioning() {
+ CICSTestUtils.errorTest(
+ STARTBR_INVALID_MULTIPLE_POSITIONING,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: DEBKEY, DEBREC, RBA, RRN, or XRBA",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: DEBKEY, DEBREC, RBA, RRN, or XRBA",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testStartbrInvalidMultipleComparison() {
+ CICSTestUtils.errorTest(
+ STARTBR_INVALID_MULTIPLE_COMPARISON,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: GTEQ or EQUAL",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: GTEQ or EQUAL",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSyncPoint.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSyncPoint.java
new file mode 100644
index 0000000000..9e476a4cd3
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSyncPoint.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.common.error.ErrorSource;
+import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+import org.eclipse.lsp4j.Diagnostic;
+import org.eclipse.lsp4j.DiagnosticSeverity;
+import org.eclipse.lsp4j.Range;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test CICS SYNCPOINT commands. Documentation link: SYNCPOINT Command
+ *
+ *
This class tests all variations of the SYNCPOINT command: standard and ROLLBACK.
+ */
+public class TestCICSSyncPoint {
+ private static final String SYNCPOINT_STANDARD_VALID =
+ "SYNCPOINT";
+
+ private static final String SYNCPOINT_ROLLBACK_VALID =
+ "SYNCPOINT ROLLBACK";
+
+ private static final String SYNCPOINT_ROLLBACK_INVALID =
+ "SYNCPOINT ROLLBACK {ROLLBACK|errorOne}";
+
+ @Test
+ void testSyncpointStandardValid() {
+ CICSTestUtils.noErrorTest(SYNCPOINT_STANDARD_VALID);
+ }
+
+ @Test
+ void testSyncpointRollbackValid() {
+ CICSTestUtils.noErrorTest(SYNCPOINT_ROLLBACK_VALID);
+ }
+
+ @Test
+ void testSyncpointRollbackInvalid() {
+ CICSTestUtils.errorTest(
+ SYNCPOINT_ROLLBACK_INVALID,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: ROLLBACK",
+ DiagnosticSeverity.Warning,
+ ErrorSource.PARSING.getText())));
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSUpdate.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSUpdate.java
new file mode 100644
index 0000000000..ad3b756e2e
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSUpdate.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.common.error.ErrorSource;
+import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+import org.eclipse.lsp4j.Diagnostic;
+import org.eclipse.lsp4j.DiagnosticSeverity;
+import org.eclipse.lsp4j.Range;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test CICS UPDATE COUNTER and UPDATE DCOUNTER commands. Documentation link: UPDATE COUNTER DCOUNTER Command
+ *
+ *
This class tests all variations of the UPDATE command: COUNTER and DCOUNTER.
+ */
+public class TestCICSUpdate {
+ private static final String UPDATE_COUNTER_VALID =
+ "UPDATE COUNTER({$varOne}) POOL({$varTwo}) VALUE({$varThree}) COMPAREMIN({$varFour}) COMPAREMAX({$varFive})";
+
+ private static final String UPDATE_COUNTER_INVALID =
+ "UPDATE {_POOL({$varTwo})|errorOne|errorTwo_}";
+
+ private static final String UPDATE_DCOUNTER_VALID =
+ "UPDATE DCOUNTER({$varOne}) POOL({$varTwo}) VALUE({$varThree}) COMPAREMIN({$varFour}) COMPAREMAX({$varFive})";
+
+ private static final String UPDATE_DCOUNTER_INVALID =
+ "UPDATE DCOUNTER({$varOne}) {DCOUNTER|errorOne}({$varOne}) POOL({$varTwo}) VALUE({$varThree})";
+
+ @Test
+ void testUpdateCounterValid() {
+ CICSTestUtils.noErrorTest(UPDATE_COUNTER_VALID);
+ }
+
+ @Test
+ void testUpdateCounterInvalid() {
+ CICSTestUtils.errorTest(
+ UPDATE_COUNTER_INVALID,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, none provided: COUNTER or DCOUNTER",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: VALUE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+
+ @Test
+ void testUpdateDcounterValid() {
+ CICSTestUtils.noErrorTest(UPDATE_DCOUNTER_VALID);
+ }
+
+ @Test
+ void testUpdateDcounterInvalid() {
+ CICSTestUtils.errorTest(
+ UPDATE_DCOUNTER_INVALID,
+ ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: DCOUNTER",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())));
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsDelayStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsDelayStatement.java
index e4aafab223..69fae1b536 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsDelayStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsDelayStatement.java
@@ -21,7 +21,6 @@
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
-import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -82,9 +81,9 @@ void test_delayStatement_flow3() {
private static final String DELAY_VALID_ALL =
"DELAY FOR HOURS(100) MINUTES(20) SECONDS(10) MILLISECS(1)";
private static final String DELAY_FOR_UNTIL_INVALID =
- "DELAY { FOR | error2 } HOURS(1) {UNTIL | error} ";
+ "DELAY {FOR|error2} HOURS(1) {UNTIL|error} ";
private static final String DELAY_INTERVAL_TIME_INVALID =
- "DELAY { INTERVAL | errorIntervalTime2 }(100) {TIME | errorIntervalTime }(100)";
+ "DELAY {INTERVAL|errorIntervalTime2}(100) {TIME|errorIntervalTime}(100)";
private static final String DELAY_UNTIL_MILLISEC_INVALID =
"DELAY UNTIL HOURS({$varFour}) {MILLISECS | errorMillisecs}(100)";
@@ -106,7 +105,7 @@ void testDelayForUntilInvalid() {
ImmutableMap.of(
"error",
new Diagnostic(
- new Range(new Position(15, 12), new Position(15, 17)),
+ new Range(),
"Exactly one option required, options are mutually exclusive: INTERVAL, TIME, UNTIL, FOR",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()),
@@ -124,7 +123,7 @@ void testDelayIntervalTimeInvalid() {
ImmutableMap.of(
"errorIntervalTime",
new Diagnostic(
- new Range(new Position(14, 12), new Position(14, 16)),
+ new Range(),
"Exactly one option required, options are mutually exclusive: INTERVAL, TIME, UNTIL, FOR",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText()),
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java
index 54cfe22b59..005079604f 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java
@@ -36,7 +36,7 @@ public class TestCicsExciGetContainerStatement {
+ "\n"
+ " PROCEDURE DIVISION.\n"
+ " EXEC CICS HANDLE CONDITION \n"
- + " ERRORS \n"
+ + " ERROR \n"
+ " RESP({$RETURN-CODE})\n"
+ " END-EXEC.\n"
+ "\n"
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExtractSP.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExtractSP.java
new file mode 100644
index 0000000000..7fe8e32504
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExtractSP.java
@@ -0,0 +1,388 @@
+/*
+ * Copyright (c) 2024 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.common.error.ErrorSource;
+import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+import org.eclipse.lsp4j.Diagnostic;
+import org.eclipse.lsp4j.DiagnosticSeverity;
+import org.eclipse.lsp4j.Range;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test CICS EXTRACT System Programming commands. Documentation links:
+ *
+ * EXTRACT STATISTICS Command
+ *
+ * EXTRACT EXIT Command
+ *
This class tests all variations of the EXTRACT System Programming commands found in the links above.
+ */
+public class TestCicsExtractSP {
+ private static final String EXIT_ALL_OPTIONS = "EXTRACT EXIT PROGRAM({$varOne}) ENTRYNAME({$varTwo}) GALENGTH({$varThree}) GASET({$varFour})";
+ private static final String EXIT_BARE = "EXTRACT PROGRAM({$varOne}) GASET({$varFour}) EXIT GALENGTH({$varThree})";
+
+ private static final String STATISTICS_ALL_OPTIONS = "EXTRACT STATISTICS RESTYPE({$varOne}) RESID({$varTwo}) RESIDLEN({$varThree}) SET({$varFour})"
+ + " SUBRESTYPE({$varFive}) SUBRESID({$varSix}) SUBRESIDLEN({$varOne}) APPLICATION({$varTwo}) APPLMAJORVER({$varThree}) APPLMINORVER({$varFour})"
+ + " APPLMICROVER({$varFive}) PLATFORM({$varSix}) LASTRESET({$varThree})";
+ private static final String STATISTICS_SOME_ONE = "EXTRACT ASYNCSERVICE SUBRESID({$varSix}) SUBRESIDLEN({$varOne}) SET({$varFour}) STATISTICS SUBRESTYPE({$varFive})";
+ private static final String STATISTICS_SOME_TWO = "EXTRACT RESID({$varTwo}) APPLMAJORVER({$varThree}) APPLICATION({$varTwo}) RESTYPE({$varOne}) STATISTICS APPLMINORVER({$varFour}) APPLMICROVER({$varFive}) SET({$varFour}) PLATFORM({$varSix})";
+ private static final String STATISTICS_SOME_THREE = "EXTRACT RESIDLEN({$varThree}) STATISTICS LASTRESETMIN({$varFive}) LASTRESETHRS({$varSix}) SET({$varFour}) LASTRESETSEC({$varOne}) TASKSUBPOOL RESID({$varTwo})";
+ private static final String STATISTICS_SOME_FOUR = "EXTRACT STATISTICS SET({$varFour}) BUNDLE RESID({$varTwo}) SUBRESID({$varSix}) POLICYRULE";
+ private static final String STATISTICS_BARE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS";
+
+ private static final String EXIT_INVALID_MISSING_EXIT = "EXTRACT {_GASET({$varFour}) GALENGTH({$varThree}) PROGRAM({$varOne})|error_}";
+ private static final String EXIT_INVALID_MISSING_PROGRAM = "EXTRACT {_EXIT ENTRYNAME({$varTwo}) GALENGTH({$varThree}) GASET({$varFour})|error_}";
+ private static final String EXIT_INVALID_MISSING_GALENGTH = "EXTRACT {_GASET({$varFour}) EXIT PROGRAM({$varOne})|error_}";
+ private static final String EXIT_INVALID_MISSING_GASET = "EXTRACT {_PROGRAM({$varOne}) EXIT GALENGTH({$varThree})|error_}";
+
+ private static final String STATISTICS_INVALID_MISSING_RESTYPE = "EXTRACT {_SET({$varFour}) STATISTICS|error_}";
+ private static final String STATISTICS_INVALID_MISSING_SET = "EXTRACT {_RESTYPE({$varOne}) STATISTICS|error_}";
+ private static final String STATISTICS_INVALID_MISSING_STATISTICS = "EXTRACT {_SET({$varFour}) RESTYPE({$varOne})|error_}";
+ private static final String STATISTICS_INVALID_MISSING_RESID_ONE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {RESIDLEN|error}({$varThree})";
+ private static final String STATISTICS_INVALID_MISSING_RESID_TWO = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {APPLMAJORVER|errorOne}({$varThree}) {APPLICATION|errorTwo}({$varTwo}) {APPLMINORVER|errorThree}({$varFour}) {APPLMICROVER|errorFour}({$varFive})";
+ private static final String STATISTICS_INVALID_MISSING_SUBRESID_ONE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {SUBRESIDLEN|errorOne|errorTwo}({$varOne})";
+ private static final String STATISTICS_INVALID_MISSING_SUBRESID_TWO = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {_SUBRESTYPE({$varFive})|error_}";
+ private static final String STATISTICS_INVALID_MISSING_SUBRESTYPE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {SUBRESID|errorOne}({$varSix}) {SUBRESIDLEN|errorTwo}({$varOne})";
+ private static final String STATISTICS_INVALID_APPLCONTEXT_ONE = "EXTRACT {_SET({$varFour}) RESTYPE({$varOne}) STATISTICS PLATFORM({$varSix}) RESID({$varTwo})|error_}";
+ private static final String STATISTICS_INVALID_APPLCONTEXT_TWO = "EXTRACT {_SET({$varFour}) RESID({$varTwo}) RESTYPE({$varOne}) STATISTICS APPLICATION({$varSix}) APPLMAJORVER({$varThree}) APPLMINORVER({$varFour}) APPLMICROVER({$varFive})|error_}";
+ private static final String STATISTICS_INVALID_LAST_TIME_ONE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS LASTRESET({$varThree}) {LASTRESETMIN|errorOne}({$varFive}) {LASTRESETHRS|errorTwo}({$varSix}) {LASTRESETSEC|errorThree}({$varOne})";
+ private static final String STATISTICS_INVALID_LAST_TIME_TWO = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {LASTRESET|errorOne}({$varThree}) {LASTRESETABS|errorTwo}({$varOne})";
+ private static final String STATISTICS_INVALID_LAST_TIME_THREE = "EXTRACT {_SET({$varFour}) RESTYPE({$varOne}) STATISTICS LASTRESETHRS({$varOne})|error_}";
+ private static final String STATISTICS_INVALID_DUPLICATE_RESTYPE_ONE = "EXTRACT SET({$varFour}) {_RESTYPE({$varOne})|error_} STATISTICS {_ATOMSERVICE|error_}";
+ private static final String STATISTICS_INVALID_DUPLICATE_RESTYPE_TWO = "EXTRACT SET({$varFour}) {_BUNDLE|error_} STATISTICS {_ASYNCSERVICE|error_}";
+ private static final String STATISTICS_INVALID_DUPLICATE_SUBRESTYPE = "EXTRACT SUBRESID({$varSix}) SET({$varFour}) RESTYPE({$varOne}) {SUBRESTYPE|error}({$varFive}) {CAPTURESPEC|error} STATISTICS";
+ private static final String STATISTICS_WARNING_DUPLICATE_RESTYPE = "EXTRACT SET({$varFour}) STATISTICS ASYNCSERVICE {ASYNCSERVICE|warning}";
+
+ @Test
+ void testAllExitOptions() {
+ CICSTestUtils.noErrorTest(EXIT_ALL_OPTIONS, "SP");
+ }
+
+ @Test
+ void testExitBare() {
+ CICSTestUtils.noErrorTest(EXIT_BARE, "SP");
+ }
+
+ @Test
+ void testAllStatisticsOptions() {
+ CICSTestUtils.noErrorTest(STATISTICS_ALL_OPTIONS, "SP");
+ }
+
+ @Test
+ void testSomeStatisticsOptionsOne() {
+ CICSTestUtils.noErrorTest(STATISTICS_SOME_ONE, "SP");
+ }
+
+ @Test
+ void testSomeStatisticsOptionsTwo() {
+ CICSTestUtils.noErrorTest(STATISTICS_SOME_TWO, "SP");
+ }
+
+ @Test
+ void testSomeStatisticsOptionsThree() {
+ CICSTestUtils.noErrorTest(STATISTICS_SOME_THREE, "SP");
+ }
+
+ @Test
+ void testSomeStatisticsOptionsFour() {
+ CICSTestUtils.noErrorTest(STATISTICS_SOME_FOUR, "SP");
+ }
+
+ @Test
+ void testStatisticsBare() {
+ CICSTestUtils.noErrorTest(STATISTICS_BARE, "SP");
+ }
+
+ @Test
+ void testInvalidNoExit() {
+ CICSTestUtils.errorTest(EXIT_INVALID_MISSING_EXIT, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: EXIT",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidNoProgram() {
+ CICSTestUtils.errorTest(EXIT_INVALID_MISSING_PROGRAM, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: PROGRAM",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidNoGalength() {
+ CICSTestUtils.errorTest(EXIT_INVALID_MISSING_GALENGTH, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: GALENGTH",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidNoGaset() {
+ CICSTestUtils.errorTest(EXIT_INVALID_MISSING_GASET, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: GASET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidNoRestype() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_RESTYPE, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: RESTYPE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidNoSubresid() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_SUBRESID_ONE, ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: SUBRESIDLEN without SUBRESTYPE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: SUBRESIDLEN without SUBRESID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidNoSubresidTwo() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_SUBRESID_TWO, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: SUBRESTYPE without SUBRESID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidLastTimeOne() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_LAST_TIME_ONE, ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: LASTRESETMIN with LASTRESET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: LASTRESETHRS with LASTRESET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorThree",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: LASTRESETSEC with LASTRESET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidLastTimeTwo() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_LAST_TIME_TWO, ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: LASTRESET with LASTRESETABS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: LASTRESETABS with LASTRESET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidLastTimeThree() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_LAST_TIME_THREE, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "If one option is specified, all options must be present: LASTRESETHRS, LASTRESETMIN, LASTRESETSEC",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidMissingStatistics() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_STATISTICS, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: STATISTICS",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidMissingSet() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_SET, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: SET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidMissingResidOne() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_RESID_ONE, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: RESIDLEN without RESID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidMissingResidTwo() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_RESID_TWO, ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: APPLMAJORVER without RESID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: APPLICATION without RESID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorThree",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: APPLMINORVER without RESID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorFour",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: APPLMICROVER without RESID",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidMissingSubrestype() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_SUBRESTYPE, ImmutableMap.of(
+ "errorOne",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: SUBRESID without SUBRESTYPE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "errorTwo",
+ new Diagnostic(
+ new Range(),
+ "Invalid option provided: SUBRESIDLEN without SUBRESTYPE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidApplContextOne() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_APPLCONTEXT_ONE, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "If one option is specified, all options must be present: APPLICATION, APPLMAJORVER, APPLMINORVER, APPLMICROVER, PLATFORM",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidApplContextTwo() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_APPLCONTEXT_TWO, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "If one option is specified, all options must be present: APPLICATION, APPLMAJORVER, APPLMINORVER, APPLMICROVER, PLATFORM",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidDuplicateRestypeOne() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_DUPLICATE_RESTYPE_ONE, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Multiple RESTYPE options are not allowed",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidDuplicateRestypeTwo() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_DUPLICATE_RESTYPE_TWO, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Multiple RESTYPE options are not allowed",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void testInvalidDuplicateSubrestype() {
+ CICSTestUtils.errorTest(STATISTICS_INVALID_DUPLICATE_SUBRESTYPE, ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: SUBRESTYPE or CAPTURESPEC or POLICYRULE",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+ @Test
+ void tesWarningDuplicateRestype() {
+ CICSTestUtils.errorTest(STATISTICS_WARNING_DUPLICATE_RESTYPE, ImmutableMap.of(
+ "warning",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: ASYNCSERVICE",
+ DiagnosticSeverity.Warning,
+ ErrorSource.PARSING.getText())), "SP");
+ }
+
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsRewindCounter.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsRewindCounter.java
new file mode 100644
index 0000000000..0d63e8720f
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsRewindCounter.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2025 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+package org.eclipse.lsp.cobol.usecases;
+
+ import com.google.common.collect.ImmutableMap;
+ import org.eclipse.lsp.cobol.common.error.ErrorSource;
+ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
+ import org.eclipse.lsp4j.Diagnostic;
+ import org.eclipse.lsp4j.DiagnosticSeverity;
+ import org.eclipse.lsp4j.Range;
+ import org.junit.jupiter.api.Test;
+
+ import java.util.Map;
+
+/**
+ * Test CICS REWIND COUNTER command. Documentation link: REWIND COUNTER Command
+ *
+ *
This class tests all variations of the REWIND COUNTER command found in the link above.
+ */
+public class TestCicsRewindCounter {
+ private static final String REWIND_COUNTER_ALL_VALID =
+ "REWIND NOHANDLE COUNTER({$varFour}) POOL({$varFour}) INCREMENT({$varFour}) NOSUSPEND";
+ private static final String REWIND_DCOUNTER_ALL_VALID =
+ "REWIND NOHANDLE DCOUNTER({$varFour}) POOL({$varFour}) INCREMENT({$varFour}) NOSUSPEND";
+ private static final String REWIND_INVALID =
+ "REWIND {COUNTER|error}({$varFour}) {DCOUNTER|error2}({$varFour})";
+ private static final String REWIND_COUNTER_INVALID =
+ "REWIND COUNTER({$varFour}) {COUNTER|error}({$varFour})";
+
+ @Test
+ void testRewindCounterValid() {
+ CICSTestUtils.noErrorTest(REWIND_COUNTER_ALL_VALID);
+ }
+ @Test
+ void testRewindDCounterValid() {
+ CICSTestUtils.noErrorTest(REWIND_DCOUNTER_ALL_VALID);
+ }
+
+ @Test
+ void testRewindInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: COUNTER or DCOUNTER",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()),
+ "error2",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, options are mutually exclusive: COUNTER or DCOUNTER",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())
+ );
+ CICSTestUtils.errorTest(REWIND_INVALID, expectedDiagnostic);
+ }
+ @Test
+ void testRewindCounterInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error",
+ new Diagnostic(
+ new Range(),
+ "Excessive options provided for: COUNTER",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText())
+ );
+ CICSTestUtils.errorTest(REWIND_COUNTER_INVALID, expectedDiagnostic);
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsTest.java
index 7c9e4bf0bd..a1d6cb3162 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsTest.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsTest.java
@@ -19,7 +19,6 @@
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
-import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -34,8 +33,8 @@ public class TestCicsTest {
private static final String TEST_EVENT_VALID_ONE = "TEST EVENT({$varOne}) FIRESTATUS({$varTwo})";
private static final String TEST_EVENT_VALID_TWO = "TEST FIRESTATUS({$varTwo}) EVENT({$varOne})";
- private static final String TEST_EVENT_INVALID_ONE = "TEST {EVENT|error1}({$varOne})";
- private static final String TEST_EVENT_INVALID_TWO = "TEST {FIRESTATUS|error1}({$varTwo})";
+ private static final String TEST_EVENT_INVALID_ONE = "TEST {_EVENT({$varOne})|error1_}";
+ private static final String TEST_EVENT_INVALID_TWO = "TEST {_FIRESTATUS({$varTwo})|error1_}";
@Test
@@ -54,7 +53,7 @@ void testCicsTestInvalidOne() {
ImmutableMap.of(
"error1",
new Diagnostic(
- new Range(new Position(12, 12), new Position(13, 25)),
+ new Range(),
"Missing required option: FIRESTATUS",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText())));
@@ -66,7 +65,7 @@ void testCicsTestInvalidTwo() {
ImmutableMap.of(
"error1",
new Diagnostic(
- new Range(new Position(12, 12), new Position(13, 30)),
+ new Range(),
"Missing required option: EVENT",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText())));
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsUnlock.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsUnlock.java
index 1f2f37e455..def1303b01 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsUnlock.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsUnlock.java
@@ -19,7 +19,6 @@
import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.DiagnosticSeverity;
-import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.junit.jupiter.api.Test;
@@ -70,7 +69,7 @@ void testInvalid() {
CICSTestUtils.errorTest(INVALID, ImmutableMap.of(
"error",
new Diagnostic(
- new Range(new Position(12, 12), new Position(13, 27)),
+ new Range(),
"Missing required option: FILE",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText())));
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsWSAEPR.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsWSAEPR.java
index db37ade89c..53341004d2 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsWSAEPR.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsWSAEPR.java
@@ -40,6 +40,7 @@ public class TestCicsWSAEPR {
private static final String WSAEPR_CREATE_SOME_OPTIONS_VALID_THREE = "WSAEPR EPRINTO(1) EPRLENGTH(1) METADATA(2) CREATE METADATALEN(2)";
private static final String WSAEPR_CREATE_BARE_VALID = "WSAEPR CREATE EPRINTO(2) EPRLENGTH(1) METADATA(1)";
+ private static final String WSAEPR_CREATE_BARE_INVALID = "WSAEPR {CREATE|error1|error2|error3}";
private static final String WSAEPR_CREATE_INVALID_ONE = "WSAEPR CREATE {EPRINTO|error1}(1) EPRLENGTH(1) {EPRSET|error1}(1) ADDRESS(2)";
private static final String WSAEPR_CREATE_INVALID_TWO = "WSAEPR {REFPARMSLEN|error1}(2) CREATE EPRLENGTH(1) EPRSET(1) ADDRESS(2)";
@@ -72,6 +73,34 @@ void testWSAEPRCreateBareValid() {
CICSTestUtils.noErrorTest(WSAEPR_CREATE_BARE_VALID);
}
+ @Test
+ void testWSAEPRCreateBareInvalid() {
+ Map expectedDiagnostic =
+ ImmutableMap.of(
+ "error1",
+ new Diagnostic(
+ new Range(),
+ "Exactly one option required, none provided: EPRINTO or EPRSET",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()
+ ),
+ "error2",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: ADDRESS or REFPARMS or METADATA",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()
+ ),
+ "error3",
+ new Diagnostic(
+ new Range(),
+ "Missing required option: EPRLENGTH",
+ DiagnosticSeverity.Error,
+ ErrorSource.PARSING.getText()
+ ));
+ CICSTestUtils.errorTest(WSAEPR_CREATE_BARE_INVALID, expectedDiagnostic);
+ }
+
@Test
void testWSAEPRCreateInvalidOne() {
Map expectedDiagnostic =
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java
index a7768fa289..0fd1edef76 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java
@@ -35,7 +35,7 @@ class TestExecCicsHandleAidClear {
+ " {#*10-EXIT}.\n"
+ " EXIT.\n"
+ " {#*NACT}.\n"
- + " EXEC CICS HANDLE AID CLEAR() END-EXEC.\n"
+ + " EXEC CICS HANDLE AID CLEAR END-EXEC.\n"
+ " EXEC CICS HANDLE AID CLEAR({#10-EXIT}) END-EXEC.\n";
@Test
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSetUpDownBy.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSetUpDownBy.java
index d2a44d63be..129b17ce96 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSetUpDownBy.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSetUpDownBy.java
@@ -53,6 +53,8 @@ class TestSetUpDownBy {
+ " SET {$IND1} {$IND2} {$IND3} DOWN BY 1.\n"
+ " SET {$IND1} {$INTVAL|1} DOWN BY -1.\n"
+ " SET {$NOT-A-TABLE|1} UP BY 1.\n"
+ + " SET {$NOT-A-TABLE|1} TO 4.\n"
+ + " SET {$INTVAL} TO {$IND3}.\n"
+ " SET {$NOT-A-TABLE|1} DOWN BY 1.\n"
+ " SET {$NOT-A-TABLE|1} {$IND1} UP BY 1.\n"
+ " SET {$IND1} UP BY {$INTVAL}.\n"
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCallStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCallStatement.java
deleted file mode 100644
index 6f611b330d..0000000000
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCallStatement.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2020 Broadcom.
- * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Broadcom, Inc. - initial API and implementation
- *
- */
-
-package org.eclipse.lsp.cobol.usecases;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import org.eclipse.lsp.cobol.test.engine.UseCaseEngine;
-import org.junit.jupiter.api.Test;
-
-/** This test checks if sql CALL statement works correctly. */
-class TestSqlCallStatement {
- private static final String TEXT =
- " IDENTIFICATION DIVISION.\n"
- + " PROGRAM-ID. HELLO-SQL.\n"
- + " DATA DIVISION.\n"
- + " WORKING-STORAGE SECTION.\n"
- + " PROCEDURE DIVISION.\n"
- + " EXEC SQL\n"
- + " CALL myProc USING DESCRIPTOR SQLD;\n"
- + " END-EXEC.";
-
- @Test
- void test() {
- UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of());
- }
-}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteImmediateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteImmediateStatement.java
deleted file mode 100644
index 07af446a8c..0000000000
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteImmediateStatement.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2020 Broadcom.
- * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Broadcom, Inc. - initial API and implementation
- *
- */
-
-package org.eclipse.lsp.cobol.usecases;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import org.eclipse.lsp.cobol.test.engine.UseCaseEngine;
-import org.junit.jupiter.api.Test;
-
-/** This test checks if sql EXECUTE IMMEDIATE statement works correctly. */
-class TestSqlExecuteImmediateStatement {
-
- private static final String TEXT =
- " IDENTIFICATION DIVISION.\n"
- + " PROGRAM-ID. HELLO-SQL.\n"
- + " DATA DIVISION.\n"
- + " WORKING-STORAGE SECTION.\n"
- + " PROCEDURE DIVISION.\n"
- + " EXEC SQL\n"
- + " EXECUTE IMMEDIATE \"DELETE FROM DSN8C10.DEPT WHERE ABC = 1\" \n"
- + " END-EXEC.\n";
-
- @Test
- void test() {
- UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of());
- }
-}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlPrepareStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlPrepareStatement.java
deleted file mode 100644
index 7c750e1e2b..0000000000
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlPrepareStatement.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2020 Broadcom.
- * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Broadcom, Inc. - initial API and implementation
- *
- */
-
-package org.eclipse.lsp.cobol.usecases;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import org.eclipse.lsp.cobol.test.engine.UseCaseEngine;
-import org.junit.jupiter.api.Test;
-
-/** This test checks if sql PREPARE statement works correctly. */
-class TestSqlPrepareStatement {
- private static final String TEXT =
- " IDENTIFICATION DIVISION.\n"
- + " PROGRAM-ID. HELLO-SQL.\n"
- + " DATA DIVISION.\n"
- + " WORKING-STORAGE SECTION.\n"
- + " PROCEDURE DIVISION.\n"
- + " EXEC SQL PREPARE DEPT_INSERT FROM\n"
- + " 'INSERT INTO DSN8C10.DEPT VALUES(?,?,?,?,?)';\n"
- + " END-EXEC.\n";
-
- @Test
- void test() {
- UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of());
- }
-}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/common/CICSTestUtils.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/common/CICSTestUtils.java
index a420879a53..64d165e542 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/common/CICSTestUtils.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/common/CICSTestUtils.java
@@ -17,6 +17,9 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+
+import lombok.NonNull;
+
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp.cobol.test.engine.UseCaseEngine;
@@ -41,17 +44,22 @@ public class CICSTestUtils {
+ " 01 {$*varFive} PIC X VALUE 'NAME_TWO'.\n"
+ " 01 {$*varSix} PIC X VALUE 'NAME_THREE'.\n"
+ " PROCEDURE DIVISION.\n"
- + " EXEC CICS \n"
- + " END-EXEC.";
+ + " {@*SEC1} SECTION.\n"
+ + " DISPLAY \"Text: \".\n"
+ + " EXEC CICS ";
+
+ private static final String END_EXEC = " END-EXEC.";
+ private static final String END_EXEC_ERROR = " {END-EXEC|end-exec-error}.";
/**
* Retrieves a formatted test string for CICS command testing
*
* @param components Components to add to the EXEC CICS block of the test string
+ * @param errorTags Error tags to inject before END-EXEC or null
* @param compilerOptions Compiler options fo translator specification
* @return Formatted test string
*/
- public static String getTestString(String components, String... compilerOptions) {
+ public static String getTestString(String components, List errorTags, String... compilerOptions) {
List instances = Arrays.asList(components.split("\\s"));
instances.replaceAll(String.join("", Collections.nCopies(12, " "))::concat);
List compilerOptionsList =
@@ -61,7 +69,14 @@ public static String getTestString(String components, String... compilerOptions)
ArrayList base = new ArrayList(Arrays.asList(BASE_TEXT.split("\n")));
base.addAll(0, compilerOptionsList);
- base.addAll(base.size() - 1, instances);
+ base.addAll(instances);
+ if (errorTags == null)
+ base.add(END_EXEC);
+ else if (errorTags.isEmpty())
+ base.add(END_EXEC_ERROR);
+ else {
+ base.add(END_EXEC_ERROR.replace("{", "{|" + String.join("|", errorTags) + "}{"));
+ }
return String.join("\n", base);
}
@@ -73,7 +88,7 @@ public static String getTestString(String components, String... compilerOptions)
*/
public static void noErrorTest(String newCommand, String... options) {
UseCaseEngine.runTest(
- getTestString(newCommand, options), ImmutableList.of(), ImmutableMap.of());
+ getTestString(newCommand, null, options), ImmutableList.of(), ImmutableMap.of());
}
/**
@@ -86,6 +101,20 @@ public static void noErrorTest(String newCommand, String... options) {
public static void errorTest(
String newCommand, Map expectedDiagnostic, String... options) {
UseCaseEngine.runTest(
- getTestString(newCommand, options), ImmutableList.of(), expectedDiagnostic);
+ getTestString(newCommand, null, options), ImmutableList.of(), expectedDiagnostic);
+ }
+
+ /**
+ * Runs a test with asserting error conditions passed as argument
+ *
+ * @param newCommand Error command to execute
+ * @param errorTags Error tags to inject before END-EXEC
+ * @param expectedDiagnostic Errors to match
+ * @param options Compiler options fo translator specification
+ */
+ public static void errorTestWithEndExecError(
+ String newCommand, @NonNull List errorTags, Map expectedDiagnostic, String... options) {
+ UseCaseEngine.runTest(
+ getTestString(newCommand, errorTags, options), ImmutableList.of(), expectedDiagnostic);
}
}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllAlterStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllAlterStatements.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllAlterStatements.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllAlterStatements.java
index 167006fc5f..4388b17749 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllAlterStatements.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllAlterStatements.java
@@ -12,7 +12,7 @@
* Broadcom, Inc. - initial API and implementation
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllCreateStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllCreateStatements.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllCreateStatements.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllCreateStatements.java
index 18e3067166..493800bc1f 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllCreateStatements.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllCreateStatements.java
@@ -12,7 +12,7 @@
* Broadcom, Inc. - initial API and implementation
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllDescribeStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllDescribeStatements.java
similarity index 80%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllDescribeStatements.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllDescribeStatements.java
index 9a42bcbcd5..6e4eb76414 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllDescribeStatements.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllDescribeStatements.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -47,22 +47,22 @@ class TestSqlAllDescribeStatements {
+ " EXEC SQL\n";
private static final String DESCRIBE_CURSOR =
- TEXT + " DESCRIBE CURSOR C1 INTO SQLDA\n" + " END-EXEC.";
+ TEXT + " DESCRIBE CURSOR C1 INTO :{$HOSTVAR}\n" + " END-EXEC.";
private static final String DESCRIBE_INPUT =
- TEXT + " DESCRIBE INPUT STMT1_NAME INTO SQLDA;\n" + " END-EXEC.";
+ TEXT + " DESCRIBE INPUT STMT1_NAME INTO :{$HOSTVAR};\n" + " END-EXEC.";
private static final String DESCRIBE_OUTPUT =
TEXT
- + " DESCRIBE OUTPUT STMT1_NAME INTO SQLDA USING LABELS;\n"
+ + " DESCRIBE OUTPUT STMT1_NAME INTO :{$HOSTVAR} USING LABELS;\n"
+ " END-EXEC.";
private static final String DESCRIBE_PROCEDURE =
- TEXT + " DESCRIBE PROCEDURE MyProc INTO procDesc;\n" + " END-EXEC.";
+ TEXT + " DESCRIBE PROCEDURE MyProc INTO :{$HOSTVAR};\n" + " END-EXEC.";
private static final String DESCRIBE_TABLE =
TEXT
- + " DESCRIBE TABLE {$HOSTVAR} INTO tabDesc USING BOTH;\n"
+ + " DESCRIBE TABLE :{$HOSTVAR} INTO :{$HOSTVAR} USING BOTH;\n"
+ " END-EXEC.";
private static Stream textsToTest() {
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllGrantStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllGrantStatements.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllGrantStatements.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllGrantStatements.java
index e1d1ac5571..09b09967f8 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllGrantStatements.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllGrantStatements.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllRevokeStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllRevokeStatements.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllRevokeStatements.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllRevokeStatements.java
index ed8a319069..e83427fcc9 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllRevokeStatements.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllRevokeStatements.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllSetStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllSetStatements.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllSetStatements.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllSetStatements.java
index e1d72ad162..d7bc67ce39 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllSetStatements.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllSetStatements.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -226,7 +226,7 @@ class TestSqlAllSetStatements {
TEXT + " SET CURRENT TEMPORAL BUSINESS_TIME = NULL\n" + " END-EXEC.";
private static final String SET_ENCRYPTION_PASSWORD =
- TEXT + " SET ENCRYPTION PASSWORD = :hv1\n" + " END-EXEC.";
+ TEXT + " SET ENCRYPTION PASSWORD = :{$hv1}\n" + " END-EXEC.";
private static final String SET_ENCRYPTION_PASSWORD2 =
TEXT
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllocateCursorStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllocateCursorStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllocateCursorStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllocateCursorStatement.java
index d248439434..073b15fcd4 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllocateCursorStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllocateCursorStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAnalysisDisabled.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAnalysisDisabled.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAnalysisDisabled.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAnalysisDisabled.java
index e16ca13f35..28d012fb1d 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAnalysisDisabled.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAnalysisDisabled.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import static org.eclipse.lsp.cobol.implicitDialects.sql.Db2SqlDialect.SQL_BACKEND_SETTING;
import static org.eclipse.lsp.cobol.test.engine.UseCaseUtils.DOCUMENT_URI;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAssociateLocatorsStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAssociateLocatorsStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAssociateLocatorsStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAssociateLocatorsStatement.java
index 498702e471..8b95a0413b 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAssociateLocatorsStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAssociateLocatorsStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlBeginDeclareSectionStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlBeginDeclareSectionStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlBeginDeclareSectionStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlBeginDeclareSectionStatement.java
index 595c48ed50..16a371571e 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlBeginDeclareSectionStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlBeginDeclareSectionStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCallStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCallStatement.java
new file mode 100644
index 0000000000..199f2a27a1
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCallStatement.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2020 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+
+package org.eclipse.lsp.cobol.usecases.sql;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.test.engine.UseCaseEngine;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/** This test checks if sql CALL statement works correctly. */
+class TestSqlCallStatement {
+ private static final String TEXT =
+ " IDENTIFICATION DIVISION.\n"
+ + " PROGRAM-ID. HELLO-SQL.\n"
+ + " DATA DIVISION.\n"
+ + " WORKING-STORAGE SECTION.\n"
+ + " PROCEDURE DIVISION.\n"
+ + " EXEC SQL\n"
+ + " CALL myProc USING DESCRIPTOR SQLD;\n"
+ + " END-EXEC.";
+
+ /**
+ * compile output
+ * 000035 EXEC SQL
+ *
+ * ==000035==> IGYPS0226-E DSNH104I DSNHSM2V LINE 35 COL 38 ILLEGAL SYMBOL "SQLD". SOME SYMBOLS
+ * THAT MIGHT BE LEGAL ARE: :
+ *
+ * 000036 CALL myProc USING DESCRIPTOR SQLD
+ * 000037 END-EXEC.
+ */
+ @Disabled("Compilation error")
+ @Test
+ void test() {
+ UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of());
+ }
+
+ public static final String VALID_TEXT =
+ " IDENTIFICATION DIVISION.\n"
+ + " PROGRAM-ID. HELLO-SQL.\n"
+ + " DATA DIVISION.\n"
+ + " WORKING-STORAGE SECTION.\n"
+ + " EXEC SQL INCLUDE {~SQLCA} END-EXEC.\n"
+ + " 01 {$*SQLD}.\n"
+ + " 49 {$*SQL-STMT-LEN} PIC S9(4) COMP.\n"
+ + " 49 {$*SQL-STMT-TEXT} PIC X(100).\n"
+ + " PROCEDURE DIVISION.\n"
+ + " EXEC SQL\n"
+ + " CALL myProc USING DESCRIPTOR :{$SQLD}\n"
+ + " END-EXEC.";
+
+ @Test
+ void validTest() {
+ UseCaseEngine.runTest(VALID_TEXT, ImmutableList.of(), ImmutableMap.of());
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCaseStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCaseStatement.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCaseStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCaseStatement.java
index 03c84f6635..faf3edb804 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCaseStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCaseStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCloseStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCloseStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCloseStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCloseStatement.java
index 799ad7733e..f1babe18e5 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCloseStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCloseStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommentStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommentStatement.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommentStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommentStatement.java
index 1fa229ae8c..a8f379eb7b 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommentStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommentStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommitStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommitStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommitStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommitStatement.java
index 0622ccd573..6188d3e544 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommitStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommitStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlConnectStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlConnectStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlConnectStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlConnectStatement.java
index e556051744..cbe0a0ef31 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlConnectStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlConnectStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDeleteStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDeleteStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDeleteStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDeleteStatement.java
index 0b3506e40c..0a4a8d161b 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDeleteStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDeleteStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDropStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDropStatement.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDropStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDropStatement.java
index 0f99610ca1..cc486bed76 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDropStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDropStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlEndDeclareSectionStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlEndDeclareSectionStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlEndDeclareSectionStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlEndDeclareSectionStatement.java
index c926a1b0c1..4d41954ee3 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlEndDeclareSectionStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlEndDeclareSectionStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExchangeStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExchangeStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExchangeStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExchangeStatement.java
index f5998652a8..d21dc35898 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExchangeStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExchangeStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteImmediateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteImmediateStatement.java
new file mode 100644
index 0000000000..7f6d45f52c
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteImmediateStatement.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2020 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+
+package org.eclipse.lsp.cobol.usecases.sql;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.test.engine.UseCaseEngine;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/** This test checks if sql EXECUTE IMMEDIATE statement works correctly. */
+class TestSqlExecuteImmediateStatement {
+
+ private static final String TEXT =
+ " IDENTIFICATION DIVISION.\n"
+ + " PROGRAM-ID. HELLO-SQL.\n"
+ + " DATA DIVISION.\n"
+ + " WORKING-STORAGE SECTION.\n"
+ + " PROCEDURE DIVISION.\n"
+ + " EXEC SQL\n"
+ + " EXECUTE IMMEDIATE \"DELETE FROM DSN8C10.DEPT WHERE ABC = 1\" \n"
+ + " END-EXEC.\n";
+
+ /*
+ COMPILATION FAILS
+ -----------------------
+ 000035 EXEC SQL
+
+ ==000035==> IGYPS0226-E DSNH104I DSNHSMS1 LINE 35 COL 75 ILLEGAL SYMBOL "'DELETE FROM
+ DSN8C10.DEPT WHERE ABC = 1'". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: :
+
+ 000036 EXECUTE IMMEDIATE
+ 000037 'DELETE FROM DSN8C10.DEPT WHERE ABC = 1'
+ 000038 END-EXEC.
+ 000039
+ */
+ @Disabled("Compilation Fails")
+ @Test
+ void test() {
+ UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of());
+ }
+
+ public static final String VALID_TEXT =
+ " IDENTIFICATION DIVISION.\n"
+ + " PROGRAM-ID. HELLO-SQL.\n"
+ + " DATA DIVISION.\n"
+ + " WORKING-STORAGE SECTION.\n"
+ + " EXEC SQL INCLUDE {~SQLCA} END-EXEC.\n"
+ + " 01 {$*SQL-STMT}.\n"
+ + " 49 {$*SQL-STMT-LEN} PIC S9(4) COMP.\n"
+ + " 49 {$*SQL-STMT-TEXT} PIC X(100).\n"
+ + " PROCEDURE DIVISION.\n"
+ + " MOVE 'DELETE FROM DSN8C10.DEPT WHERE ABC = 1' \n"
+ + " TO {$SQL-STMT-TEXT}.\n"
+ + "\n"
+ + " EXEC SQL\n"
+ + " EXECUTE IMMEDIATE :{$SQL-STMT}\n"
+ + " END-EXEC.";
+
+ @Test
+ void validTest() {
+ UseCaseEngine.runTest(VALID_TEXT, ImmutableList.of(), ImmutableMap.of());
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteStatement.java
index 238f862f03..73d583c950 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExplainStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExplainStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExplainStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExplainStatement.java
index 8a5c32137e..6910bfff9a 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExplainStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExplainStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlFreeLocatorStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlFreeLocatorStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlFreeLocatorStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlFreeLocatorStatement.java
index a8144df55a..9c7513f24d 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlFreeLocatorStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlFreeLocatorStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGetDiagnosticsStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGetDiagnosticsStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGetDiagnosticsStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGetDiagnosticsStatement.java
index b71577d1c4..e67f20d278 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGetDiagnosticsStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGetDiagnosticsStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGroupVariableUsage.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGroupVariableUsage.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGroupVariableUsage.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGroupVariableUsage.java
index a807beb953..082cf4707c 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGroupVariableUsage.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGroupVariableUsage.java
@@ -12,7 +12,7 @@
* Broadcom, Inc. - initial API and implementation
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHoldLocatorStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHoldLocatorStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHoldLocatorStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHoldLocatorStatement.java
index c28fc5476a..55714a5b5d 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHoldLocatorStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHoldLocatorStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHostedVariableInNestedProgram.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHostedVariableInNestedProgram.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHostedVariableInNestedProgram.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHostedVariableInNestedProgram.java
index dc2d93c2c4..565126bf17 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHostedVariableInNestedProgram.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHostedVariableInNestedProgram.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatement.java
index 284b26f3ce..ee0c998ab1 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForDefinedFields.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForDefinedFields.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForDefinedFields.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForDefinedFields.java
index a80d65c631..48a9f83294 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForDefinedFields.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForDefinedFields.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForImplicitlyDefinedCpy.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForImplicitlyDefinedCpy.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForImplicitlyDefinedCpy.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForImplicitlyDefinedCpy.java
index 0b990a742b..e6cef93b84 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForImplicitlyDefinedCpy.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForImplicitlyDefinedCpy.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import static org.eclipse.lsp4j.DiagnosticSeverity.Error;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotDefinedCorrectly.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotDefinedCorrectly.java
index 30df37b934..deb44a4ab0 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotDefinedCorrectly.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import static org.eclipse.lsp4j.DiagnosticSeverity.Error;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotFoundCopybook.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotFoundCopybook.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotFoundCopybook.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotFoundCopybook.java
index bf9583a790..09e4b2c858 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotFoundCopybook.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotFoundCopybook.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import static org.eclipse.lsp4j.DiagnosticSeverity.Error;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementUsingRepeatedly.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementUsingRepeatedly.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementUsingRepeatedly.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementUsingRepeatedly.java
index 6792eb7802..6efe7dbbcb 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementUsingRepeatedly.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementUsingRepeatedly.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlInsertStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlInsertStatement.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlInsertStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlInsertStatement.java
index 1302287b55..89af7b4ac9 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlInsertStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlInsertStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlKeywordAllowedAsCobolVarIdentifier.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlKeywordAllowedAsCobolVarIdentifier.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlKeywordAllowedAsCobolVarIdentifier.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlKeywordAllowedAsCobolVarIdentifier.java
index f9729b638c..0f72f9d6a6 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlKeywordAllowedAsCobolVarIdentifier.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlKeywordAllowedAsCobolVarIdentifier.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLabelStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLabelStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLabelStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLabelStatement.java
index f1ddfe06e3..d5c8a73325 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLabelStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLabelStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLockTableStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLockTableStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLockTableStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLockTableStatement.java
index 6f4517de30..c4974ad887 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLockTableStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLockTableStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlMergeStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlMergeStatement.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlMergeStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlMergeStatement.java
index 289c8b48bc..577b59032f 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlMergeStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlMergeStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlOpenStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlOpenStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlOpenStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlOpenStatement.java
index 14a5ce70dd..c028c7641b 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlOpenStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlOpenStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlPrepareStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlPrepareStatement.java
new file mode 100644
index 0000000000..e6954db740
--- /dev/null
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlPrepareStatement.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2020 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ */
+
+package org.eclipse.lsp.cobol.usecases.sql;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.eclipse.lsp.cobol.test.engine.UseCaseEngine;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/** This test checks if sql PREPARE statement works correctly. */
+class TestSqlPrepareStatement {
+
+ /**
+ * -----------------
+ * COMPILE OUTPUT
+ * ------------------
+ * 000035 EXEC SQL
+ *
+ * ==000035==> IGYPS0226-E DSNH104I DSNHSMS1 LINE 35 COL 72 ILLEGAL SYMBOL "'INSERT INTO
+ * DSN8C10.DEPT VALUES(?,?,?,?,?)'". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: :
+ *
+ * 000036 PREPARE DEPT_INSERT FROM
+ * 000037 'INSERT INTO DSN8C10.DEPT VALUES(?,?,?,?,?)'
+ * 000038 END-EXEC.
+ * 000039
+ */
+ private static final String TEXT =
+ " IDENTIFICATION DIVISION.\n"
+ + " PROGRAM-ID. HELLO-SQL.\n"
+ + " DATA DIVISION.\n"
+ + " WORKING-STORAGE SECTION.\n"
+ + " PROCEDURE DIVISION.\n"
+ + " EXEC SQL PREPARE DEPT_INSERT FROM\n"
+ + " 'INSERT INTO DSN8C10.DEPT VALUES(?,?,?,?,?)';\n"
+ + " END-EXEC.\n";
+
+ public static final String VALID_TEXT =
+ " IDENTIFICATION DIVISION.\n"
+ + " PROGRAM-ID. HELLO-SQL.\n"
+ + " DATA DIVISION.\n"
+ + " WORKING-STORAGE SECTION.\n"
+ + " EXEC SQL INCLUDE {~SQLCA} END-EXEC.\n"
+ + " 01 {$*SQL-STMT}.\n"
+ + " 49 {$*SQL-STMT-LEN} PIC S9(4) COMP.\n"
+ + " 49 {$*SQL-STMT-TEXT} PIC X(100).\n"
+ + " PROCEDURE DIVISION.\n"
+ + " MOVE 'INSERT INTO DSN8C10.DEPT VALUES(?,?,?,?,?)' \n"
+ + " TO {$SQL-STMT-TEXT}.\n"
+ + " EXEC SQL\n"
+ + " PREPARE sample FROM :{$SQL-STMT}\n"
+ + " END-EXEC.";
+
+ @Disabled("Compilation error")
+ @Test
+ void test() {
+ UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of());
+ }
+
+ @Test
+ void validTest() {
+ UseCaseEngine.runTest(VALID_TEXT, ImmutableList.of(), ImmutableMap.of());
+ }
+}
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRefreshTableStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRefreshTableStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRefreshTableStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRefreshTableStatement.java
index 32479a524f..1ccf3f345b 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRefreshTableStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRefreshTableStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseConnectionStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseConnectionStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseConnectionStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseConnectionStatement.java
index eeb9ee5eaf..24a5ba88fb 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseConnectionStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseConnectionStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseSavepointStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseSavepointStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseSavepointStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseSavepointStatement.java
index fee9b25370..1aa0e2aadb 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseSavepointStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseSavepointStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRenameStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRenameStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRenameStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRenameStatement.java
index 6792017f7d..131a0bdd94 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRenameStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRenameStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRollbackStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRollbackStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRollbackStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRollbackStatement.java
index 842ba6b51e..e9b7cc2e62 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRollbackStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRollbackStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSavepointStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSavepointStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSavepointStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSavepointStatement.java
index c4ab61df68..2e3020573f 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSavepointStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSavepointStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectIntoStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectIntoStatement.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectIntoStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectIntoStatement.java
index b194f11a1c..efed2b6c72 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectIntoStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectIntoStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectStatement.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectStatement.java
index eab6b00830..d3dd87092f 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSignalStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSignalStatement.java
similarity index 96%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSignalStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSignalStatement.java
index f162bf9fef..31098be48b 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSignalStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSignalStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSpecialNames.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSpecialNames.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSpecialNames.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSpecialNames.java
index bc3231b7c8..95e0e5a0d5 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSpecialNames.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSpecialNames.java
@@ -12,7 +12,7 @@
* Broadcom, Inc. - initial API and implementation
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTransferOwnershipStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTransferOwnershipStatement.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTransferOwnershipStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTransferOwnershipStatement.java
index 1a9dc30f92..9db784e151 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTransferOwnershipStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTransferOwnershipStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTruncateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTruncateStatement.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTruncateStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTruncateStatement.java
index d9236286a0..2d738167c3 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTruncateStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTruncateStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlUpdateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlUpdateStatement.java
similarity index 99%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlUpdateStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlUpdateStatement.java
index 1567012038..fb4888cb85 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlUpdateStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlUpdateStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesIntoStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesIntoStatement.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesIntoStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesIntoStatement.java
index 4984bb04d4..428dda35e7 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesIntoStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesIntoStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesStatement.java
index b5f8009c1c..898933f615 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlVariableReferenceInCopybook.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlVariableReferenceInCopybook.java
similarity index 98%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlVariableReferenceInCopybook.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlVariableReferenceInCopybook.java
index 96562442e2..405fbe7088 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlVariableReferenceInCopybook.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlVariableReferenceInCopybook.java
@@ -12,7 +12,7 @@
* Broadcom, Inc. - initial API and implementation
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlWheneverStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlWheneverStatement.java
similarity index 97%
rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlWheneverStatement.java
rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlWheneverStatement.java
index 11d999c897..27b7213c8d 100644
--- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlWheneverStatement.java
+++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlWheneverStatement.java
@@ -13,7 +13,7 @@
*
*/
-package org.eclipse.lsp.cobol.usecases;
+package org.eclipse.lsp.cobol.usecases.sql;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
diff --git a/server/engine/src/test/resources/cfast/case_conditional_perform.result.json b/server/engine/src/test/resources/cfast/case_conditional_perform.result.json
index 7edf37900e..1760cd8a65 100644
--- a/server/engine/src/test/resources/cfast/case_conditional_perform.result.json
+++ b/server/engine/src/test/resources/cfast/case_conditional_perform.result.json
@@ -15,6 +15,7 @@
},
"children": [
{
+ "untilExit": false,
"type": "inlineperform",
"location": {
"uri": "fake/path",
diff --git a/server/engine/src/test/resources/cfast/case_exit_perform.result.json b/server/engine/src/test/resources/cfast/case_exit_perform.result.json
index 0bbceefeed..3adefc8ced 100644
--- a/server/engine/src/test/resources/cfast/case_exit_perform.result.json
+++ b/server/engine/src/test/resources/cfast/case_exit_perform.result.json
@@ -15,6 +15,7 @@
},
"children": [
{
+ "untilExit": false,
"type": "inlineperform",
"location": {
"uri": "fake/path",
diff --git a/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.cbl b/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.cbl
new file mode 100644
index 0000000000..d064e9cedd
--- /dev/null
+++ b/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.cbl
@@ -0,0 +1,23 @@
+ * Copyright (c) 2025 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. EVAL.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 WS-NUM1 PIC 9(9).
+ PROCEDURE DIVISION.
+ PERFORM UNTIL EXIT
+ GO TO PAR1
+ END-PERFORM.
+ PAR1.
+ STOP RUN.
\ No newline at end of file
diff --git a/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.result.json b/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.result.json
new file mode 100644
index 0000000000..3a8991a250
--- /dev/null
+++ b/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.result.json
@@ -0,0 +1,97 @@
+[
+ {
+ "name": "EVAL",
+ "type": "program",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 18,
+ "character": 8
+ },
+ "end": {
+ "line": 23,
+ "character": 21
+ }
+ },
+ "children": [
+ {
+ "untilExit": true,
+ "type": "inlineperform",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 19,
+ "character": 20
+ },
+ "end": {
+ "line": 21,
+ "character": 23
+ }
+ }
+ },
+ {
+ "targetName": [
+ "PAR1"
+ ],
+ "type": "goto",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 20,
+ "character": 16
+ },
+ "end": {
+ "line": 20,
+ "character": 26
+ }
+ }
+ },
+ {
+ "type": "endinlineperform",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 19,
+ "character": 20
+ },
+ "end": {
+ "line": 21,
+ "character": 23
+ }
+ }
+ },
+ {
+ "snippet": " PAR1.\r\n STOP RUN.",
+ "name": "PAR1",
+ "type": "paragraph",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 22,
+ "character": 8
+ },
+ "end": {
+ "line": 23,
+ "character": 21
+ }
+ },
+ "children": [
+ {
+ "type": "stop",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 23,
+ "character": 12
+ },
+ "end": {
+ "line": 23,
+ "character": 20
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/server/engine/src/test/resources/cfast/case_perform-until-exit.cbl b/server/engine/src/test/resources/cfast/case_perform-until-exit.cbl
new file mode 100644
index 0000000000..6806812b5b
--- /dev/null
+++ b/server/engine/src/test/resources/cfast/case_perform-until-exit.cbl
@@ -0,0 +1,21 @@
+ * Copyright (c) 2025 Broadcom.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Broadcom, Inc. - initial API and implementation
+ *
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. EVAL.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 WS-NUM1 PIC 9(9).
+ PROCEDURE DIVISION.
+ PERFORM PAR1 UNTIL EXIT.
+ PAR1.
+ STOP RUN.
\ No newline at end of file
diff --git a/server/engine/src/test/resources/cfast/case_perform-until-exit.result.json b/server/engine/src/test/resources/cfast/case_perform-until-exit.result.json
new file mode 100644
index 0000000000..752b7ad079
--- /dev/null
+++ b/server/engine/src/test/resources/cfast/case_perform-until-exit.result.json
@@ -0,0 +1,67 @@
+[
+ {
+ "name": "EVAL",
+ "type": "program",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 18,
+ "character": 8
+ },
+ "end": {
+ "line": 21,
+ "character": 21
+ }
+ },
+ "children": [
+ {
+ "targetName": "PAR1",
+ "performUntilType": "UNTIL_EXIT",
+ "type": "perform",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 19,
+ "character": 12
+ },
+ "end": {
+ "line": 19,
+ "character": 35
+ }
+ }
+ },
+ {
+ "snippet": " PAR1.\r\n STOP RUN.",
+ "name": "PAR1",
+ "type": "paragraph",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 20,
+ "character": 8
+ },
+ "end": {
+ "line": 21,
+ "character": 21
+ }
+ },
+ "children": [
+ {
+ "type": "stop",
+ "location": {
+ "uri": "fake/path",
+ "start": {
+ "line": 21,
+ "character": 12
+ },
+ "end": {
+ "line": 21,
+ "character": 20
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4 b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4
index c5b97676a2..35746aeb00 100644
--- a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4
+++ b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4
@@ -1590,9 +1590,13 @@ performTimes
;
performUntil
- : performTestClause? UNTIL condition
+ : performTestClause? performUntilCondition
;
+performUntilCondition
+ : UNTIL (EXIT | condition)
+ ;
+
performVarying
: performTestClause performVaryingClause | performVaryingClause performTestClause?
;
diff --git a/server/pom.xml b/server/pom.xml
index 14c71c3fc8..d03e438998 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -19,7 +19,7 @@
- 1.0.11
+ 1.0.12
8
8
1.10.0
diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCasePreprocessorListener.java b/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCasePreprocessorListener.java
index 18576c3b77..38f8b79c25 100644
--- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCasePreprocessorListener.java
+++ b/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCasePreprocessorListener.java
@@ -373,7 +373,7 @@ public void exitMultiTokenError(MultiTokenErrorContext ctx) {
stop = closingOfMultiToken.getCharPositionInLine() + stopMarkLen - lineShifts[startLine];
start = stop - affectedTokens.length();
} else {
- stop = closingOfMultiToken.getCharPositionInLine() + stopMarkLen;
+ stop = closingOfMultiToken.getCharPositionInLine() + stopMarkLen - lineShifts[stopLine];
start = ctx.getStart().getCharPositionInLine();
}
lineShifts[startLine] += ctx.getStop().getText().length();
diff --git a/tests/test_files/project/settings/default.json b/tests/test_files/project/settings/default.json
new file mode 100644
index 0000000000..9e26dfeeb6
--- /dev/null
+++ b/tests/test_files/project/settings/default.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file