Skip to content

Commit

Permalink
Testcase updates
Browse files Browse the repository at this point in the history
Signed-off-by: John Eberhard <[email protected]>
  • Loading branch information
jeber-ibm committed Jan 3, 2025
1 parent 66d3990 commit a328dcb
Show file tree
Hide file tree
Showing 9 changed files with 544 additions and 88 deletions.
523 changes: 458 additions & 65 deletions src/test/Cmd/CommandHelpRetrieverTestcase.java

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/test/JD/AS/JDASSeamlessFailover.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public void testPSTypeParametersSwitch(String[][] psTransactions,
sb.append("Connecting to " + url + "\n");
connection = testDriver_.getConnection(url,
systemObject_.getUserId(), encryptedPassword_);

seamless_= true;


} catch (Exception e) {
Expand Down Expand Up @@ -504,7 +504,7 @@ public void testDSPSTypeParametersSwitch(String[][] psTransactions,
+ localPort2
+ "," + localPort3 + "," + localPort4);
connection = ds.getConnection();

seamless_ = true;

} catch (Exception e) {
failed(e);
Expand Down
11 changes: 6 additions & 5 deletions src/test/JD/AS/JDASTestcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public class JDASTestcase extends JDTestcase {

public int killCount;

private boolean seamless_;

protected boolean seamless_;

protected static String[] setupSql = {
"create or replace variable COLLECTION.GVCALTCINT INT",
Expand Down Expand Up @@ -2618,7 +2619,7 @@ public void testPSTypeParameters(String[][] psTypeTransactions,
infoAppend(sb,"Connecting to " + url + "\n");
Connection connection = testDriver_.getConnection(url,
systemObject_.getUserId(), encryptedPassword_);

testPSTypeParameters(psTypeTransactions, psTypeParms, javaType,
connection, killerConnection, killThread, runSeconds, sb);
} catch (Exception e) {
Expand Down Expand Up @@ -2674,10 +2675,10 @@ public Connection createDSConnectionFromURL(String url) throws Exception {
} else {
throw new Exception("Unable to processing URL property : "+property+"="+value);
}
if (url.indexOf("Seamless") > 0) {
seamless_ = false;
} else {
if (url.indexOf("enableSeamlessFailover=1") > 0) {
seamless_ = true;
} else {
seamless_ = false;
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/test/JTOpenEclipseExportJars.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
public class JTOpenEclipseExportJars {

public static void usage() {
System.out.println("Usage: java test.JDTOpenEclipseExport IBMi userid password eclipse directory ");
System.out.println("Usage: java test.JDTOpenEclipseExportJars IBMi userid password eclipse directory ");
System.out.println(" Updates an IBM i system with the latest JTOpen jar files from the Eclipse Environment");
}

public static void main(String args[]) {
try {
System.out.println("Usage: java test.JDTOpenEclipseExport IBMi userid password JTOpenDirectory ");
System.out.println("Usage: java test.JDTOpenEclipseExportJars IBMi userid password JTOpenDirectory ");
System.out.println(" Updates an IBM i system with the latest changes in the Eclipse Environment");

String as400Name = args[0];
Expand All @@ -55,6 +55,7 @@ public static void main(String args[]) {
if (!gitDirectoryFile.exists()) {
System.out.println("Error. directory "+gitDirectory+" does not exist. user.home is not the git root");
}
System.out.println("gitDirectory is "+gitDirectory);
System.out.println("Current directory is "+currentDirectory);
/* C:\Users\JohnEberhard\git\JTOpenWorking\target\jt400-20.0.7.jar */

Expand Down
27 changes: 26 additions & 1 deletion src/test/Message/MessageFileTestcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.ibm.as400.access.MessageFile;

import test.JDReflectionUtil;
import test.JDTestDriver;
import test.Testcase;

/**
Expand Down Expand Up @@ -829,6 +830,10 @@ public void Var034()
m = aMessageFile.getMessage("CPD0095");

String helpText = "&N Cause . . . . . : The numeric value specified parameter &";

if (getRelease() > JDTestDriver.RELEASE_V7R5M0) {
helpText = "&N Cause . . . . . : The numeric value specified for parameter &";
}
// Just check the first few words. The message changes from release to release.

// String helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &3 in the command definition object, is too large. The parameter types and their allowed maximum values follow: &P -- *INT2: The maximum value is 32767. &P -- *INT4: The maximum value is 2147483647. &P -- *DEC: The maximum value for this parameter is limited by its defined length. It is defined with LEN(&4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
Expand Down Expand Up @@ -884,6 +889,9 @@ public void Var035()
String helpText =
"\nCause . . . . . : The numeric value specified parameter &2, which is defined as type &" ;
// Just check the first few words. The message changes from release to release.
if (getRelease() > JDTestDriver.RELEASE_V7R5M0) {
helpText = "\nCause . . . . . : The numeric value specified for parameter &2, which is defined as type &";
}

// String helpText =
// "\nCause . . . . . : The numeric value specified parameter &2, which is defined as type &3 in the command definition object, is too large. The parameter types and their allowed maximum values follow:" +
Expand Down Expand Up @@ -960,6 +968,9 @@ public void Var036()

String helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &";
// Just check the first few words. The message changes from release to release.
if (getRelease() > JDTestDriver.RELEASE_V7R5M0) {
helpText = "&N Cause . . . . . : The numeric value specified for parameter &2, which is defined as type &";
}

// String helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &3 in the command definition object, is too large. The parameter types and their allowed maximum values follow: &P -- *INT2: The maximum value is 32767. &P -- *INT4: The maximum value is 2147483647. &P -- *DEC: The maximum value for this parameter is limited by its defined length. It is defined with LEN(&4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
// String helpText2 = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &5 in the command definition object, is not valid. The parameter types and their allowed values follow: &P -- *INT2: The range of values is -32768 to 32767. &P -- *INT4: The range of values is -2147483648 to 2147483647. &P -- *UINT2: The range of values is 0 to 65535. &P -- *UINT4: The range of values is 0 to 4294967295. &P -- *DEC: The range of values for this parameter is limited by its defined length. It is defined with LEN(&4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
Expand All @@ -977,6 +988,9 @@ public void Var036()

helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &";
// Just check the first few words. The message changes from release to release.
if (getRelease() > JDTestDriver.RELEASE_V7R5M0) {
helpText = "&N Cause . . . . . : The numeric value specified for parameter &2, which is defined as type &";
}

// Message changed in v4r5.
if (!m.getHelp().startsWith(helpText))
Expand Down Expand Up @@ -1116,6 +1130,9 @@ public void Var039()
m = aMessageFile.getMessage("CPD0095", (byte[]) null, LEFT_TO_RIGHT);

String helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &";
if (getRelease() > JDTestDriver.RELEASE_V7R5M0) {
helpText = "&N Cause . . . . . : The numeric value specified for parameter &2, which is defined as type &";
}
// Just check the first few words. The message changes from release to release.

// String helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &3 in the command definition object, is too large. The parameter types and their allowed maximum values follow: &P -- *INT2: The maximum value is 32767. &P -- *INT4: The maximum value is 2147483647. &P -- *DEC: The maximum value for this parameter is limited by its defined length. It is defined with LEN(&4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
Expand Down Expand Up @@ -1228,6 +1245,9 @@ public void Var041()

// String helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &3 in the command definition object, is too large. The parameter types and their allowed maximum values follow: &P -- *INT2: The maximum value is 32767. &P -- *INT4: The maximum value is 2147483647. &P -- *DEC: The maximum value for this parameter is limited by its defined length. It is defined with LEN(&4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
// String helpText2 = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &5 in the command definition object, is not valid. The parameter types and their allowed values follow: &P -- *INT2: The range of values is -32768 to 32767. &P -- *INT4: The range of values is -2147483648 to 2147483647. &P -- *UINT2: The range of values is 0 to 65535. &P -- *UINT4: The range of values is 0 to 4294967295. &P -- *DEC: The range of values for this parameter is limited by its defined length. It is defined with LEN(&4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
if (getRelease() > JDTestDriver.RELEASE_V7R5M0) {
helpText = "&N Cause . . . . . : The numeric value specified for parameter &2, which is defined as type &";
}

// Message changed in v4r5.
if (!m.getHelp().startsWith(helpText))
Expand All @@ -1253,7 +1273,9 @@ public void Var041()
helpText = "&N Cause . . . . . : The numeric value specified parameter parameter2, which is defined as type parm3 in the command definition object, is too large. The parameter types and their allowed maximum values follow: &P -- *INT2: The maximum value is 32767. &P -- *INT4: The maximum value is 2147483647. &P -- *DEC: The maximum value for this parameter is limited by its defined length. It is defined with LEN(prm4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
String helpText2 = "&N Cause . . . . . : The numeric value specified parameter parameter2, which is defined as type parameter5 in the command definition object, is not valid. The parameter types and their allowed values follow: &P -- *INT2: The range of values is -32768 to 32767. &P -- *INT4: The range of values is -2147483648 to 2147483647. &P -- *UINT2: The range of values is 0 to 65535. &P -- *UINT4: The range of values is 0 to 4294967295. &P -- *DEC: The range of values for this parameter is limited by its defined length. It is defined with LEN(prm4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
String helpText_v7r1 = "&N Cause . . . . . : The numeric value specified parameter parameter2, which is defined as type parameter5 in the command definition object, is not valid. The parameter types and their allowed values follow: &P -- *INT2: The range of values is -32768 to 32767. &P -- *INT4: The range of values is -2147483648 to 2147483647. &P -- *UINT2: The range of values is 0 to 65535. &P -- *UINT4: The range of values is 0 to 4294967295. &P -- *DEC: The range of values for this parameter is limited by its defined length. It is defined with LEN(prm4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the Information Center.";

if (getRelease() > JDTestDriver.RELEASE_V7R5M0) {
helpText_v7r1 = "&N Cause . . . . . : The numeric value specified for parameter parameter2, which is defined as type parameter5 in the command definition object, is not valid. The parameter types and their allowed values follow: &P -- *INT2: The range of values is -32768 to 32767. &P -- *INT4: The range of values is -2147483648 to 2147483647. &P -- *UINT2: The range of values is 0 to 65535. &P -- *UINT4: The range of values is 0 to 4294967295. &P -- *DEC: The range of values for this parameter is limited by its defined length. It is defined with LEN(prm4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &P -- *X: This error occurred for the CALL or CALLPRC command or for a command parameter defined with type *X where the passed parameter has more than 10 significant integer digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the Information Center.";
}
// Message changed in v4r5.
if (!m.getHelp().equalsIgnoreCase(helpText) &&
!m.getHelp().equalsIgnoreCase(helpText2) &&
Expand Down Expand Up @@ -1349,6 +1371,9 @@ public void Var043()
m = aMessageFile.getMessage("CPD0095", (byte[]) null, LEFT_TO_RIGHT, ccsid, CCSID_EBCDIC);

String helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &";
if (getRelease() > JDTestDriver.RELEASE_V7R5M0) {
helpText = "&N Cause . . . . . : The numeric value specified for parameter &2, which is defined as type &";
}
// Just check the first few words. The message changes from release to release.

// String helpText = "&N Cause . . . . . : The numeric value specified parameter &2, which is defined as type &3 in the command definition object, is too large. The parameter types and their allowed maximum values follow: &P -- *INT2: The maximum value is 32767. &P -- *INT4: The maximum value is 2147483647. &P -- *DEC: The maximum value for this parameter is limited by its defined length. It is defined with LEN(&4) in the command definition object. &P -- *N: This error occurred in an expression with a numeric value with more than 15 significant digits. &N Recovery . . . : Enter a numeric value that is valid for the parameter, or enter one of the special values that is defined for the parameter. More information on parameters and special values can be found in the CL Reference manual.";
Expand Down
5 changes: 4 additions & 1 deletion src/test/MiscAH/AS400ConnectionPoolTestcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ public void Var014()
assertCondition(p.getAvailableConnectionCount(systemObject_.getSystemName(), systemObject_.getUserId()) == numOfConnections
&& p.getActiveConnectionCount(systemObject_.getSystemName(), systemObject_.getUserId()) == 2,
"connections are "+conn1+" " +conn2);
conn1.close();
conn2.close();
p.close();
}
catch (Exception e)
Expand Down Expand Up @@ -552,7 +554,8 @@ public void Var015()
service, numOfConnections);
assertCondition(p.getAvailableConnectionCount(systemObject_.getSystemName(), systemObject_.getUserId()) == numOfConnections++
&& p.getActiveConnectionCount(systemObject_.getSystemName(), systemObject_.getUserId()) == 1);
p.close();

p.close();
PasswordVault.clearPassword(passwordChars);
}
catch (Exception e)
Expand Down
1 change: 1 addition & 0 deletions src/test/Sec/SecSignonInfoTestcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ public void Var010() {
}
}


/**
* Test isAdditionalAuthenticationFactorAccepted
**/
Expand Down
Loading

0 comments on commit a328dcb

Please sign in to comment.