Skip to content

Commit

Permalink
update JDRunit for windows (#102)
Browse files Browse the repository at this point in the history
* Updated JDDMDGetXxx.java

Signed-off-by: John Eberhard <[email protected]>

* Update JDRunit for windows

Signed-off-by: John Eberhard <[email protected]>

* Testcase cleanup

Signed-off-by: John Eberhard <[email protected]>

---------

Signed-off-by: John Eberhard <[email protected]>
  • Loading branch information
jeber-ibm authored Jun 28, 2024
1 parent 07c5b81 commit 979d36b
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 75 deletions.
6 changes: 4 additions & 2 deletions README.testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ JDRunit setup.
5. Create a ini directory to hold configuration files
mkdir ini
6. Run the setup program to extract the sample .ini configuration files. The files will need to be edited as described below.
java -jar JTOpen-test.jar test.JTOpenTestSetup.jar
java -cp JTOpen-test.jar test.JTOpenTestSetup
The setup will also make sure the latest release of JTOpen-test.jar is begin.
It will also check the test environment.
7. Edit the ini/netrc.ini file and add the appropriate credentials.
Expand All @@ -92,7 +92,9 @@ JDRunit setup.
11. Copy the ini/runitxx8Sx.ini to a file that represents the JVM used for the test. The 8S is a sample configuration for a Java 8 test on a PC.
12. Download the latest JTOpen release.
java -cp JTOpen-test.jar test.JTOpenDownloadReleaseJars
13. For the IFS tests, get a copy of jcifs.jar and copy into the jar directory.
13. For the IFS tests, get a copy of jcifs.jar and copy into the jar directory.
14. Copy the java certificate store to /home/jdbctest/cacerts. Add the necessary certificates in order to establish
secure (TLS) connections to the server you are testing.

*Note: to refresh the test jar, you can use
java -cp .:JTOpen-test.jar test.JTOpenTestSetup
Expand Down
2 changes: 1 addition & 1 deletion src/ini/regressionBaseA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# signon to the system using the same profile you specify on the -uid
# parameter.
# Suggestion: For success with FTPTest, be sure expand FTPTestDirArchive.zip
# (from the testcase CMVC source directory) into both the local directory
# from the test/ directory into both the local directory
# where you're running tests, and into the root directory ("/") of the
# target IBM i system.
# Suggestion: For success with FTPTest, make sure your workstation is not
Expand Down
2 changes: 1 addition & 1 deletion src/ini/regressionBaseB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# signon to the system using the same profile you specify on the -uid
# parameter.
# Suggestion: For success with FTPTest, be sure expand FTPTestDirArchive.zip
# (from the testcase CMVC source directory) into both the local directory
# ( from the test/ source directory) into both the local directory
# where you're running tests, and into the root directory ("/") of the
# target IBM i system.
# Suggestion: For success with FTPTest, make sure your workstation is not
Expand Down
2 changes: 1 addition & 1 deletion src/ini/runitxx8Sx.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ CLIENTOS=WINDOWS
toolboxJar=jars\\jt400.jar

# Run with -Xmx800M to pass lob tests.
javaArgs=-Djavax.net.ssl.trustStore=C:\\\\home\\\\java\\\\cacerts -Xmx800M
javaArgs=-DshowVariationTimes -DshowVariationEndTime -Dos400.stdio.convert=Y -Dcom.ibm.as400.access.AS400.guiAvailable=false -Djavax.net.ssl.trustStore=C:\\\\home\\\\java\\\\cacerts -Xmx800M

2 changes: 1 addition & 1 deletion src/test/DDM/DDMEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ protected void setup()
System.out.println("Either library DDMTESTSAV does not exist or you");
System.out.println("do not have authority to it.");
System.out.println("ftp DDMTESTSAV.SAVF in binary from");
System.out.println("/as400/v3r2m1t.jacl/cur/cmvc/java.pgm/yjac.jacl/test on CMVC");
System.out.println("the test/ directory in GIT");
System.out.println("to the AS/400 system to which you are running.");
System.out.println("Use RSTLIB to restore library DDMTESTSAV to the system.");
throw new Exception("Authority problem or create failure");
Expand Down
2 changes: 1 addition & 1 deletion src/test/DDM/DDMMultipleFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ protected void setup()
System.out.println("Either library DDMTESTSAV does not exist or you");
System.out.println("do not have authority to it.");
System.out.println("ftp DDMTESTSAV.SAVF in binary from");
System.out.println("/as400/v3r2m0t.jacl/cur/cmvc/java.pgm/yjac.jacl/test on CMVC");
System.out.println("test/ in GIT");
System.out.println("to the AS/400 system to which you are running.");
System.out.println("Use RSTLIB to restore library DDMTESTSAV to the system.");
throw new Exception("");
Expand Down
2 changes: 1 addition & 1 deletion src/test/DDM/DDMRecordDescription.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected void setup()
System.out.println("Either library DDMTESTSAV does not exist or you");
System.out.println("do not have authority to it.");
System.out.println("ftp DDMTESTSAV.SAVF in binary from");
System.out.println("/as400/v3r2m1t.jacl/cur/cmvc/java.pgm/yjac.jacl/test on CMVC");
System.out.println("the test/ directory in git");
System.out.println("to the AS/400 system to which you are running.");
System.out.println("Use RSTLIB to restore library DDMTESTSAV to the system.");
throw new Exception("");
Expand Down
2 changes: 1 addition & 1 deletion src/test/FTPTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static void main(String args[])
System.out.println(" Unix: token = ~uid ");
System.out.println(" AS/400: token = / ");
System.out.println();
System.out.println(" 3) In cmvc, the test directory has FTPTestDirArchive.zip. ");
System.out.println(" 3) In git, the test directory has FTPTestDirArchive.zip. ");
System.out.println(" This zip file has files and directories used in list and get/put tests. ");
System.out.println(" Unzip this file into TWO PLACES: ");
System.out.println(" a) The current directory on the client. ");
Expand Down
35 changes: 1 addition & 34 deletions src/test/JD/JDTestUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,6 @@ public static void registerDriver ()
Automates the setup described in jdreadme.txt.
The AS400password should be the password that correlates to the AS/400
userid that's part of the systemObject.
The AFSuserid should have read access to the family and component products
at the cur level in CMVC.
Currently, the JDSetupTest driver is used to call this method and setup
JDBC on a particular 400. It can be called multiple times, if necessary;
Expand Down Expand Up @@ -604,40 +602,9 @@ public static void setupJDBC(AS400 systemObject,
System.out.println("Starting ftp...");
try
{
/*@B0D
String port = null;
FTPConnection rsftp = new FTPConnection();
FTPConnection asftp = new FTPConnection();
rsftp.openConnection(rs6000, AFSuserid, AFSpassword);
rsftp.cwd("/as400/v3r2m0t.jacl/cur/cmvc/java.pgm/yjac.jacl/test");
rsftp.setBinary();
asftp.openConnection(systemObject.getSystemName(), systemObject.getUserId(), AS400password);
asftp.cwd("QGPL");
asftp.setBinary();
port = asftp.receive("jdbcstp.savf");
rsftp.send(port, "jdbcstp.savf");
asftp.readResponse();
asftp.readResponse();
port = asftp.receive("jddmdlib.savf");
rsftp.send(port, "jddmdlib.savf");
asftp.readResponse();
asftp.readResponse();
port = asftp.receive("jddmdtst.savf");
rsftp.send(port, "jddmdtst.savf");
asftp.readResponse();
asftp.readResponse();
rsftp.sendCommand("quit");
asftp.sendCommand("quit");
*/

FTP aix = new FTP(rs6000, AFSuserid, AFSpassword);
aix.cd("/as400/v5r2m0t.jacl/cur/cmvc/java.pgm/yjac.jacl/test");
aix.cd("/github/JTOpen-test/test");
aix.setDataTransferType(FTP.BINARY);
FTP os400 = new FTP(systemObject.getSystemName(), systemObject.getUserId(), AS400password);
os400.cd("QGPL");
Expand Down
8 changes: 4 additions & 4 deletions src/test/JDReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ public static void createIndex() throws Exception {
writer.println(
"<hr>Note: This report is regenerated when any of the individual reports are generated<br>");
writer.println(
"The source for this report generator can be found under /as400/v7r1m0t.jacl/cur/cmvc/java.pgm/yjac.jacl<br>");
"The source for this report generator can be found as JDReport.java in https://github.com/IBM/JTOpen-test<br>");

writer.println("</body>");
writer.println("</html>");
Expand Down Expand Up @@ -1125,7 +1125,7 @@ public static void createToolboxIndex() throws Exception {
writer.println(
"<hr>Note: This report is regenerated when any of the individual reports are generated<br>");
writer.println(
"The source for this report generator can be found under /as400/v7r1m0t.jacl/cur/cmvc/java.pgm/yjac.jacl<br>");
"The source for this report generator can be found as JDReport.java in https://github.com/IBM/JTOpen-test<br>");

writer.println("</body>");
writer.println("</html>");
Expand Down Expand Up @@ -1223,7 +1223,7 @@ public static void createNativeIndex() throws Exception {
writer.println(
"<hr>Note: This report is regenerated when any of the individual reports are generated<br>");
writer.println(
"The source for this report generator can be found under /as400/v7r1m0t.jacl/cur/cmvc/java.pgm/yjac.jacl<br>");
"The source for this report generator can be found as JDReport.java in https://github.com/IBM/JTOpen-test<br>");

writer.println("</body>");
writer.println("</html>");
Expand Down Expand Up @@ -1316,7 +1316,7 @@ public static void createJvmIndex() throws Exception {
writer.println(
"<hr>Note: This report is regenerated when any of the individual reports are generated<br>");
writer.println(
"The source for this report generator can be found under /as400/v7r1m0t.jacl/cur/cmvc/java.pgm/yjac.jacl<br>");
"The source for this report generator can be found as JDReport.java in https://github.com/IBM/JTOpen-test<br>");

writer.println("</body>");
writer.println("</html>");
Expand Down
12 changes: 1 addition & 11 deletions src/test/JDRunit.java
Original file line number Diff line number Diff line change
Expand Up @@ -2699,17 +2699,7 @@ public int go() throws Exception {
if (debug)
System.out.println("JDRunit: osVersion=" + JTOpenTestEnvironment.osVersion);
if (JTOpenTestEnvironment.isWindows && cmdArray1[0].indexOf("/bin") >= 0) {
//
// Get CYGWIN location from user.dir
//
String userDir = System.getProperty("user.dir");
int homeIndex = userDir.indexOf(""+File.separator+"home"+File.separator+"");
if (homeIndex >= 0) {
cmdArray1[0] = userDir.substring(0, homeIndex)
+ cmdArray1[0].replace('/', '\\');
} else {
cmdArray1[0] = JTOpenTestEnvironment.cygwinBase+ cmdArray1[0].replace('/', '\\');
}
cmdArray1[0] = JTOpenTestEnvironment.cygwinBase+ cmdArray1[0].replace('/', '\\');
}

if (debug)
Expand Down
14 changes: 7 additions & 7 deletions src/test/JDTestDriver_NativeDriverMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private boolean handleURLProcessing (String url,
return false;

if (sysNameTok.hasMoreTokens()) {
String schema = sysNameTok.nextToken(); //cmvc
String schema = sysNameTok.nextToken();
System.out.println("schema=" + schema);
JDReflectionUtil.callMethod_V(ds, "setLibraries", schema);

Expand Down Expand Up @@ -479,7 +479,7 @@ else if (field.equals("block size")) {
else if (field.equals("blocking enabled")) {
JDReflectionUtil.callMethod_V(ds,"setUseBlocking",Boolean.valueOf(value).booleanValue());
}
else if (field.equals("block criteria")) { // cmvc
else if (field.equals("block criteria")) {
JDReflectionUtil.callMethod_V(ds,"setUseBlocking",Boolean.valueOf(value).booleanValue());
}
else if (field.equals("date format")) {
Expand Down Expand Up @@ -534,7 +534,7 @@ else if (field.equals("errors")) {
// and currently errors is ignored anyway (even when
// specified in the url)
}
else if (field.equals("reuse objects")) { // cmvc
else if (field.equals("reuse objects")) {
if (value.equalsIgnoreCase("true")) {
JDReflectionUtil.callMethod_V(ds,"setReuseObjects",true);
}
Expand All @@ -543,7 +543,7 @@ else if (field.equals("reuse objects")) { // cmvc
}

}
else if (field.equals("lob threshold")) { // cmvc
else if (field.equals("lob threshold")) {
JDReflectionUtil.callMethod_V(ds,"setLobThreshold",Integer.valueOf(value).intValue());
}
else if (field.equals("data truncation")) {
Expand All @@ -570,13 +570,13 @@ else if (field.equals("decfloat rounding mode")) {
e.printStackTrace();
}
}
else if (field.equals("extended dynamic")) { // cmvc
else if (field.equals("extended dynamic")) {
// ignored
}
else if (field.equals("package cache")) { // cmvc
else if (field.equals("package cache")) {
// ignored
}
else if (field.equals("package library")) { // cmvc
else if (field.equals("package library")) {
// ignored
}
else if (field.equals("cursor hold")) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/JTOpenTestSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ private static void checkJNDIJars() {

public static void checkConfigFile(String filename) throws Exception {

filename = "ini"+File.separator+filename;
File file = new File (filename);
String localFilename = "ini"+File.separator+filename;
File file = new File (localFilename);
if (! file.exists()) {
// Extract from the Jar file and note that it will need updated
System.out.println("WARNING: "+filename+" does not exist");
Expand Down
2 changes: 1 addition & 1 deletion src/test/RF/RFSerialization.java
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ protected void setup()
System.out.println("Either library DDMTESTSAV does not exist or you");
System.out.println("do not have authority to it.");
System.out.println("ftp DDMTESTSAV.SAVF in binary from");
System.out.println("/as400/v3r2m0t.jacl/cur/cmvc/java.pgm/yjac.jacl/test on CMVC");
System.out.println("the test/ git directory");
System.out.println("to the AS/400 system to which you are running.");
System.out.println("Use RSTLIB to restore library DDMTESTSAV to the system.");
System.out.println("ran = "+ran);
Expand Down
2 changes: 1 addition & 1 deletion src/test/Setup/SetupLibraryTestcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void restoreLibrary(String saveFile, String library) throws Exception {
cmd.setCommand("CRTSAVF QGPL/"+saveFile);
cmd.run();

// FTP files from CMVC on to the 400
// FTP files from GIT on to the 400
output_.println("Starting ftp...");

File directory = new File("savf");
Expand Down
6 changes: 0 additions & 6 deletions src/test/SetupDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
public class SetupDriver extends TestDriver
{

// 10/27/2010 -- Removed rs6000_ stuff. We expect save files to be loaded onto the
// client system with the rest of the tests.
//
// String rs6000_ = null; // rs6000 with cmvc save files
// String rsUserId_ = null; // userid with access to cmvc
// String rsPassword_ = null; // password associated with AFSid_

static final int MAXTOKENS = 3; // maximum tokens interpreted in "-misc" parameter

Expand Down
Binary file added src/test/ddmtestsav.savf
Binary file not shown.

0 comments on commit 979d36b

Please sign in to comment.