Skip to content

Commit

Permalink
Testcase cleanup (#90)
Browse files Browse the repository at this point in the history
Signed-off-by: John Eberhard <[email protected]>
  • Loading branch information
jeber-ibm authored Mar 29, 2024
1 parent 9325a3e commit f95ce92
Show file tree
Hide file tree
Showing 72 changed files with 330 additions and 357 deletions.
11 changes: 5 additions & 6 deletions src/test/AS400CertificateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package test;

import java.io.IOException;
import java.util.Vector;
import java.util.Enumeration;
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400Message;
Expand Down Expand Up @@ -150,7 +149,7 @@ else if (runMode_!=Testcase.UNATTENDED)
{
AS400CertificateVldlBeans tc =
new AS400CertificateVldlBeans(systemObject_,
(Vector) namesAndVars_.get("AS400CertificateVldlBeans"), runMode_,
namesAndVars_.get("AS400CertificateVldlBeans"), runMode_,
fileOutputStream_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400CertificateVldlBeans");
Expand All @@ -161,7 +160,7 @@ else if (runMode_!=Testcase.UNATTENDED)
{
AS400CertificateVldlTestcase tc =
new AS400CertificateVldlTestcase(systemObject_,
(Vector) namesAndVars_.get("AS400CertificateVldlTestcase"), runMode_,
namesAndVars_.get("AS400CertificateVldlTestcase"), runMode_,
fileOutputStream_, "e");
testcases_.addElement(tc);
namesAndVars_.remove("AS400CertificateVldlTestcase");
Expand All @@ -171,7 +170,7 @@ else if (runMode_!=Testcase.UNATTENDED)
{
AS400CertificateUsrPrfTestcase tc =
new AS400CertificateUsrPrfTestcase(systemObject_,
(Vector) namesAndVars_.get("AS400CertificateUsrPrfTestcase"), runMode_,
namesAndVars_.get("AS400CertificateUsrPrfTestcase"), runMode_,
fileOutputStream_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400CertificateUsrPrfTestcase");
Expand All @@ -183,7 +182,7 @@ else if (runMode_!=Testcase.UNATTENDED)
{
AS400CertificateUsrPrfBeans tc =
new AS400CertificateUsrPrfBeans(systemObject_,
(Vector) namesAndVars_.get("AS400CertificateUsrPrfBeans"), runMode_,
namesAndVars_.get("AS400CertificateUsrPrfBeans"), runMode_,
fileOutputStream_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400CertificateUsrPrfBeans");
Expand All @@ -196,7 +195,7 @@ else if (runMode_!=Testcase.UNATTENDED)
PwrSys.disconnectService(AS400.COMMAND);
}
// Put out error message for each invalid testcase name.
for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();)
for (Enumeration<String> e = namesAndVars_.keys(); e.hasMoreElements();)
{
System.out.println("Testcase " + e.nextElement() + " not found.");
}
Expand Down
17 changes: 8 additions & 9 deletions src/test/AS400JDBCConnectionPoolTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.io.IOException;
import java.util.Enumeration;
import java.util.Vector;
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400SecurityException;
import com.ibm.as400.access.Job;
Expand Down Expand Up @@ -127,7 +126,7 @@ public void createTestcases()
// Repeat the following 'if' block for each testcase.
if (allTestcases || namesAndVars_.containsKey("ConnectionPoolPropertiesTestcase"))
{
ConnectionPoolPropertiesTestcase tc = new ConnectionPoolPropertiesTestcase(systemObject_, (Vector) namesAndVars_.get("ConnectionPoolPropertiesTestcase"), runMode_, fileOutputStream_, password_);
ConnectionPoolPropertiesTestcase tc = new ConnectionPoolPropertiesTestcase(systemObject_, namesAndVars_.get("ConnectionPoolPropertiesTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("ConnectionPoolPropertiesTestcase");
}
Expand All @@ -140,47 +139,47 @@ public void createTestcases()

if (allTestcases || namesAndVars_.containsKey("AS400JDBCPooledConnectionTestcase"))
{
AS400JDBCPooledConnectionTestcase tc = new AS400JDBCPooledConnectionTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCPooledConnectionTestcase"), runMode_, fileOutputStream_, password_);
AS400JDBCPooledConnectionTestcase tc = new AS400JDBCPooledConnectionTestcase(systemObject_, namesAndVars_.get("AS400JDBCPooledConnectionTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCPooledConnectionTestcase");
}
if (allTestcases || namesAndVars_.containsKey("AS400JDBCConnectionPoolTestcase"))
{
AS400JDBCConnectionPoolTestcase tc = new AS400JDBCConnectionPoolTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCConnectionPoolTestcase"), runMode_, fileOutputStream_, password_);
AS400JDBCConnectionPoolTestcase tc = new AS400JDBCConnectionPoolTestcase(systemObject_, namesAndVars_.get("AS400JDBCConnectionPoolTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCConnectionPoolTestcase");
}


if (allTestcases || namesAndVars_.containsKey("AS400JDBCConnectionPoolBeanInfoTestcase"))
{
AS400JDBCConnectionPoolBeanInfoTestcase tc = new AS400JDBCConnectionPoolBeanInfoTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCConnectionPoolBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
AS400JDBCConnectionPoolBeanInfoTestcase tc = new AS400JDBCConnectionPoolBeanInfoTestcase(systemObject_, namesAndVars_.get("AS400JDBCConnectionPoolBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCConnectionPoolBeanInfoTestcase");
}
if (allTestcases || namesAndVars_.containsKey("ConnectionPoolBeanInfoTestcase"))
{
ConnectionPoolBeanInfoTestcase tc = new ConnectionPoolBeanInfoTestcase(systemObject_, (Vector) namesAndVars_.get("ConnectionPoolBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
ConnectionPoolBeanInfoTestcase tc = new ConnectionPoolBeanInfoTestcase(systemObject_, namesAndVars_.get("ConnectionPoolBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("ConnectionPoolBeanInfoTestcase");
}

if (allTestcases || namesAndVars_.containsKey("AS400JDBCManagedConnectionPoolTestcase"))
{
AS400JDBCManagedConnectionPoolTestcase tc = new AS400JDBCManagedConnectionPoolTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCManagedConnectionPoolTestcase"), runMode_, fileOutputStream_, password_, pwrSys_, pwrSysPassword_);///, duration_);
AS400JDBCManagedConnectionPoolTestcase tc = new AS400JDBCManagedConnectionPoolTestcase(systemObject_, namesAndVars_.get("AS400JDBCManagedConnectionPoolTestcase"), runMode_, fileOutputStream_, password_, pwrSys_, pwrSysPassword_);///, duration_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCManagedConnectionPoolTestcase");
}

if (allTestcases || namesAndVars_.containsKey("AS400JDBCManagedConnectionPool2Testcase"))
{
AS400JDBCManagedConnectionPool2Testcase tc = new AS400JDBCManagedConnectionPool2Testcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCManagedConnectionPool2Testcase"), runMode_, fileOutputStream_, password_, pwrSys_, pwrSysPassword_);///, duration_);
AS400JDBCManagedConnectionPool2Testcase tc = new AS400JDBCManagedConnectionPool2Testcase(systemObject_, namesAndVars_.get("AS400JDBCManagedConnectionPool2Testcase"), runMode_, fileOutputStream_, password_, pwrSys_, pwrSysPassword_);///, duration_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCManagedConnectionPool2Testcase");
}

// Put out error message for each invalid testcase name.
for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();)
for (Enumeration<String> e = namesAndVars_.keys(); e.hasMoreElements();)
{
System.out.println("Testcase " + e.nextElement() + " not found.");
}
Expand Down
20 changes: 10 additions & 10 deletions src/test/AS400JDBCDataSourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import java.io.IOException;
import java.util.Enumeration;
import java.util.Vector;


import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400SecurityException;
Expand Down Expand Up @@ -195,62 +195,62 @@ public void createTestcases()
// Repeat the following 'if' block for each testcase.
if (allTestcases || namesAndVars_.containsKey("AS400JDBCDataSourceTestcase"))
{
AS400JDBCDataSourceTestcase tc = new AS400JDBCDataSourceTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCDataSourceTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName()); //@A1C //@A2C
AS400JDBCDataSourceTestcase tc = new AS400JDBCDataSourceTestcase(systemObject_, namesAndVars_.get("AS400JDBCDataSourceTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName()); //@A1C //@A2C
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCDataSourceTestcase");
}

if (/*allTestcases ||*/ namesAndVars_.containsKey("AS400JDBCDataSourceSerialTestcase"))
{
AS400JDBCDataSourceSerialTestcase tc = new AS400JDBCDataSourceSerialTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCDataSourceSerialTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName());
AS400JDBCDataSourceSerialTestcase tc = new AS400JDBCDataSourceSerialTestcase(systemObject_, namesAndVars_.get("AS400JDBCDataSourceSerialTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName());
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCDataSourceSerialTestcase");
}

if (allTestcases || namesAndVars_.containsKey("AS400JDBCDataSourcePropertiesTestcase"))
{
AS400JDBCDataSourcePropertiesTestcase tc = new AS400JDBCDataSourcePropertiesTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCDataSourcePropertiesTestcase"), runMode_, fileOutputStream_, password_);
AS400JDBCDataSourcePropertiesTestcase tc = new AS400JDBCDataSourcePropertiesTestcase(systemObject_, namesAndVars_.get("AS400JDBCDataSourcePropertiesTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCDataSourcePropertiesTestcase");
}
if (allTestcases || namesAndVars_.containsKey("AS400JDBCDataSourceBeanInfoTestcase"))
{
AS400JDBCDataSourceBeanInfoTestcase tc = new AS400JDBCDataSourceBeanInfoTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCDataSourceBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
AS400JDBCDataSourceBeanInfoTestcase tc = new AS400JDBCDataSourceBeanInfoTestcase(systemObject_, namesAndVars_.get("AS400JDBCDataSourceBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCDataSourceBeanInfoTestcase");
}

if (allTestcases || namesAndVars_.containsKey("AS400JDBCConnectionPoolDataSourceTestcase"))
{
AS400JDBCConnectionPoolDataSourceTestcase tc = new AS400JDBCConnectionPoolDataSourceTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCConnectionPoolDataSourceTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName()); //@A1C //@A2C
AS400JDBCConnectionPoolDataSourceTestcase tc = new AS400JDBCConnectionPoolDataSourceTestcase(systemObject_, namesAndVars_.get("AS400JDBCConnectionPoolDataSourceTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName()); //@A1C //@A2C
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCConnectionPoolDataSourceTestcase");
}
if (allTestcases || namesAndVars_.containsKey("AS400JDBCConnectionPoolDataSourceBeanInfoTestcase"))
{
AS400JDBCConnectionPoolDataSourceBeanInfoTestcase tc = new AS400JDBCConnectionPoolDataSourceBeanInfoTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCConnectionPoolDataSourceBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
AS400JDBCConnectionPoolDataSourceBeanInfoTestcase tc = new AS400JDBCConnectionPoolDataSourceBeanInfoTestcase(systemObject_, namesAndVars_.get("AS400JDBCConnectionPoolDataSourceBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCConnectionPoolDataSourceBeanInfoTestcase");
}

// Testcase for AS400JDBCManagedConnectionPoolDataSource.
if (allTestcases || namesAndVars_.containsKey("AS400JDBCMCPDSTestcase"))
{
AS400JDBCMCPDSTestcase tc = new AS400JDBCMCPDSTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCMCPDSTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName()); //@A1C //@A2C
AS400JDBCMCPDSTestcase tc = new AS400JDBCMCPDSTestcase(systemObject_, namesAndVars_.get("AS400JDBCMCPDSTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName()); //@A1C //@A2C
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCMCPDSTestcase");
}

// Testcase for AS400JDBCManagedDataSource.
if (allTestcases || namesAndVars_.containsKey("AS400JDBCMDSTestcase"))
{
AS400JDBCMDSTestcase tc = new AS400JDBCMDSTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCMDSTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName()); //@A1C //@A2C
AS400JDBCMDSTestcase tc = new AS400JDBCMDSTestcase(systemObject_, namesAndVars_.get("AS400JDBCMDSTestcase"), runMode_, fileOutputStream_, password_, jndi, ldapUsr, ldapPwd, getSystemName()); //@A1C //@A2C
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCMDSTestcase");
}

// Put out error message for each invalid testcase name.
for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();)
for (Enumeration<String> e = namesAndVars_.keys(); e.hasMoreElements();)
{
System.out.println("Testcase " + e.nextElement() + " not found.");
}
Expand Down
9 changes: 4 additions & 5 deletions src/test/AS400JDBCRowSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.io.IOException;
import java.util.Enumeration;
import java.util.Vector;

import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400SecurityException;
Expand Down Expand Up @@ -169,29 +168,29 @@ public void createTestcases()
// Repeat the following 'if' block for each testcase.
if (allTestcases || namesAndVars_.containsKey("AS400JDBCRowSetTestcase"))
{
AS400JDBCRowSetTestcase tc = new AS400JDBCRowSetTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCRowSetTestcase"), runMode_, fileOutputStream_, password_, jndiType, ldapUsr, ldapPwd); //@A1C
AS400JDBCRowSetTestcase tc = new AS400JDBCRowSetTestcase(systemObject_, namesAndVars_.get("AS400JDBCRowSetTestcase"), runMode_, fileOutputStream_, password_, jndiType, ldapUsr, ldapPwd); //@A1C
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCRowSetTestcase");
}

// Repeat the following 'if' block for each testcase.
if (allTestcases || namesAndVars_.containsKey("AS400JDBCRowSetCtorTestcase"))
{
AS400JDBCRowSetCtorTestcase tc = new AS400JDBCRowSetCtorTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCRowSetCtorTestcase"), runMode_, fileOutputStream_, password_, jndiType, ldapUsr, ldapPwd); //@A1C
AS400JDBCRowSetCtorTestcase tc = new AS400JDBCRowSetCtorTestcase(systemObject_, namesAndVars_.get("AS400JDBCRowSetCtorTestcase"), runMode_, fileOutputStream_, password_, jndiType, ldapUsr, ldapPwd); //@A1C
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCRowSetCtorTestcase");
}

// Repeat the following 'if' block for each testcase.
if (allTestcases || namesAndVars_.containsKey("AS400JDBCRowSetBeanInfoTestcase"))
{
AS400JDBCRowSetBeanInfoTestcase tc = new AS400JDBCRowSetBeanInfoTestcase(systemObject_, (Vector) namesAndVars_.get("AS400JDBCRowSetBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
AS400JDBCRowSetBeanInfoTestcase tc = new AS400JDBCRowSetBeanInfoTestcase(systemObject_, namesAndVars_.get("AS400JDBCRowSetBeanInfoTestcase"), runMode_, fileOutputStream_, password_);
testcases_.addElement(tc);
namesAndVars_.remove("AS400JDBCRowSetBeanInfoTestcase");
}

// Put out error message for each invalid testcase name.
for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();)
for (Enumeration<String> e = namesAndVars_.keys(); e.hasMoreElements();)
{
System.out.println("Testcase " + e.nextElement() + " not found.");
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/CHTTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void setup ()
ipAddress = tokenizer.nextToken ();
String uid = tokenizer.nextToken ();
String pwd = tokenizer.nextToken ();
pwrSys_ = new AS400 (systemObject_.getSystemName(), uid, pwd);
pwrSys_ = new AS400 (systemObject_.getSystemName(), uid, pwd.toCharArray());
}

String sysName = getSystemName();
Expand Down Expand Up @@ -250,8 +250,8 @@ public void createTestcases ()


// Reports invalid testcase names.
for (Enumeration e = namesAndVars_.keys (); e.hasMoreElements (); ) {
String name = (String)e.nextElement ();
for (Enumeration<String> e = namesAndVars_.keys (); e.hasMoreElements (); ) {
String name = e.nextElement ();
System.out.println ("Testcase " + name + " not found.");
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/CleanupJavaTestJobs.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public static void cleanup(String system, String userid, String password) {
as400 = new AS400();

} else {
as400 = new AS400(system, userid, password);
as400 = new AS400(system, userid, password.toCharArray());
}
Hashtable userSet = new Hashtable();
Hashtable<String, String> userSet = new Hashtable<String, String>();

for (int i = 0; i < 2; i++) {

Expand All @@ -99,7 +99,7 @@ public static void cleanup(String system, String userid, String password) {

SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
joblist.load();
Enumeration enumeration = joblist.getJobs();
Enumeration<?> enumeration = joblist.getJobs();
long currentTimeMillis = System.currentTimeMillis();
boolean continueLoop=true;
int jobCount = 0;
Expand All @@ -120,7 +120,7 @@ public static void cleanup(String system, String userid, String password) {
System.out.println("Job name is " + j.getNumber() + "/"
+ j.getUser() + "/" + j.getName() + " user is " + user +" function name is "+functionName);
JobLog joblog = j.getJobLog();
Enumeration messageEnumeration = joblog.getMessages();
Enumeration<?> messageEnumeration = joblog.getMessages();
boolean endJob = false;
//
// Look for message of the following form. If the
Expand Down Expand Up @@ -232,7 +232,7 @@ public static void cleanup(String system, String userid, String password) {
} /* for i */
System.out.println("-----------------------------------------");
System.out.println("Here are the users found on the system");
Enumeration userEnumeration = userSet.keys();
Enumeration<String> userEnumeration = userSet.keys();
while (userEnumeration.hasMoreElements()) {
System.out.println(userEnumeration.nextElement());
}
Expand Down
Loading

0 comments on commit f95ce92

Please sign in to comment.