diff --git a/src/test/AS400CertificateTest.java b/src/test/AS400CertificateTest.java index d6316c1..39ef9c6 100644 --- a/src/test/AS400CertificateTest.java +++ b/src/test/AS400CertificateTest.java @@ -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; @@ -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"); @@ -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"); @@ -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"); @@ -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"); @@ -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 e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/AS400JDBCConnectionPoolTest.java b/src/test/AS400JDBCConnectionPoolTest.java index 03867f7..51ead78 100644 --- a/src/test/AS400JDBCConnectionPoolTest.java +++ b/src/test/AS400JDBCConnectionPoolTest.java @@ -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; @@ -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"); } @@ -140,13 +139,13 @@ 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"); } @@ -154,33 +153,33 @@ public void createTestcases() 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 e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/AS400JDBCDataSourceTest.java b/src/test/AS400JDBCDataSourceTest.java index dc067f2..4fbed9b 100644 --- a/src/test/AS400JDBCDataSourceTest.java +++ b/src/test/AS400JDBCDataSourceTest.java @@ -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; @@ -195,40 +195,40 @@ 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"); } @@ -236,7 +236,7 @@ public void createTestcases() // 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"); } @@ -244,13 +244,13 @@ public void createTestcases() // 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 e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/AS400JDBCRowSetTest.java b/src/test/AS400JDBCRowSetTest.java index b62f289..5abf3cb 100644 --- a/src/test/AS400JDBCRowSetTest.java +++ b/src/test/AS400JDBCRowSetTest.java @@ -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; @@ -169,7 +168,7 @@ 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"); } @@ -177,7 +176,7 @@ public void createTestcases() // 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"); } @@ -185,13 +184,13 @@ public void createTestcases() // 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 e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/CHTTest.java b/src/test/CHTTest.java index ed6da4d..93bc2ad 100644 --- a/src/test/CHTTest.java +++ b/src/test/CHTTest.java @@ -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(); @@ -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 e = namesAndVars_.keys (); e.hasMoreElements (); ) { + String name = e.nextElement (); System.out.println ("Testcase " + name + " not found."); } } diff --git a/src/test/CleanupJavaTestJobs.java b/src/test/CleanupJavaTestJobs.java index 6307b7c..89f9f0b 100644 --- a/src/test/CleanupJavaTestJobs.java +++ b/src/test/CleanupJavaTestJobs.java @@ -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 userSet = new Hashtable(); for (int i = 0; i < 2; i++) { @@ -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; @@ -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 @@ -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 userEnumeration = userSet.keys(); while (userEnumeration.hasMoreElements()) { System.out.println(userEnumeration.nextElement()); } diff --git a/src/test/CleanupPsrwJobs.java b/src/test/CleanupPsrwJobs.java index b9495ce..c9c6a2f 100644 --- a/src/test/CleanupPsrwJobs.java +++ b/src/test/CleanupPsrwJobs.java @@ -59,7 +59,7 @@ public static void clean(String system, String userid, String password, PrintWri if (system == null) { as400 = new AS400(); } else { - as400 = new AS400(system, userid, password); + as400 = new AS400(system, userid, password.toCharArray()); } JobList joblist = new JobList(as400); @@ -67,11 +67,11 @@ public static void clean(String system, String userid, String password, PrintWri joblist.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_OUTQ, Boolean.FALSE); joblist.addJobSelectionCriteria(JobList.SELECTION_ACTIVE_JOB_STATUS, Job.ACTIVE_JOB_STATUS_WAIT_PRESTART); - Enumeration enumeration = joblist.getJobs(); + Enumeration enumeration = joblist.getJobs(); StringBuffer endedJobInfo = new StringBuffer(); while (enumeration.hasMoreElements()) { - Job j = (Job) enumeration.nextElement(); + Job j = enumeration.nextElement(); String status = j.getStatus(); if (status.equals(Job.JOB_STATUS_ACTIVE)) { diff --git a/src/test/CleanupQsqsrvrJobs.java b/src/test/CleanupQsqsrvrJobs.java index 02278ed..a5659b4 100644 --- a/src/test/CleanupQsqsrvrJobs.java +++ b/src/test/CleanupQsqsrvrJobs.java @@ -38,16 +38,16 @@ public static void cleanup(String system, String userid, String password) throws if (system == null) { as400 = new AS400(); } else { - as400 = new AS400(system, userid, password); + as400 = new AS400(system, userid, password.toCharArray()); } JobList joblist = new JobList(as400); joblist.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_ACTIVE, Boolean.TRUE); joblist.addJobSelectionCriteria(JobList.SELECTION_JOB_NAME, "QSQSRVR"); - Hashtable userSet = new Hashtable(); + Hashtable userSet = new Hashtable(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(); - Enumeration enumeration = joblist.getJobs(); + Enumeration enumeration = joblist.getJobs(); long currentTimeMillis = System.currentTimeMillis(); while (enumeration.hasMoreElements()) { Job j = (Job) enumeration.nextElement(); @@ -62,7 +62,7 @@ public static void cleanup(String system, String userid, String password) throws System.out.println("Job name is " + j.getNumber() + "/" + j.getUser() + "/" + j.getName() + " user is " + user); JobLog joblog = j.getJobLog(); - Enumeration messageEnumeration = joblog.getMessages(); + Enumeration messageEnumeration = joblog.getMessages(); boolean endJob = false; // // Look for message of the following form. If the message is older than @@ -124,7 +124,7 @@ public static void cleanup(String system, String userid, String password) throws System.out.println("-----------------------------------------"); System.out.println("Here are the users found on the system"); - Enumeration userEnumeration = userSet.keys(); + Enumeration userEnumeration = userSet.keys(); while (userEnumeration.hasMoreElements()) { System.out.println(userEnumeration.nextElement()); } diff --git a/src/test/CleanupQzdasoinitJobs.java b/src/test/CleanupQzdasoinitJobs.java index 9397548..84498ae 100644 --- a/src/test/CleanupQzdasoinitJobs.java +++ b/src/test/CleanupQzdasoinitJobs.java @@ -42,9 +42,9 @@ public static void cleanup(String system, String userid, String password) throws joblist.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_ACTIVE, Boolean.TRUE); joblist.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_OUTQ, Boolean.FALSE); joblist.addJobSelectionCriteria(JobList.SELECTION_JOB_NAME, "QZDASOINIT"); - Hashtable userSet = new Hashtable(); + Hashtable userSet = new Hashtable(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(); - Enumeration enumeration = joblist.getJobs(); + Enumeration enumeration = joblist.getJobs(); long currentTimeMillis = System.currentTimeMillis(); while (enumeration.hasMoreElements()) { Job j = (Job) enumeration.nextElement(); @@ -58,7 +58,7 @@ public static void cleanup(String system, String userid, String password) throws System.out.println("-------------------"); System.out.println("Job name is "+j.getNumber()+"/"+j.getUser()+"/"+j.getName()+" user is "+user); JobLog joblog = j.getJobLog(); - Enumeration messageEnumeration = joblog.getMessages(); + Enumeration messageEnumeration = joblog.getMessages(); boolean endJob = false; // // Look for message of the following form. If the message is older than 1 hour then @@ -114,7 +114,7 @@ public static void cleanup(String system, String userid, String password) throws System.out.println("-----------------------------------------"); System.out.println("Here are the users found on the system"); - Enumeration userEnumeration = userSet.keys(); + Enumeration userEnumeration = userSet.keys(); while (userEnumeration.hasMoreElements()) { System.out.println(userEnumeration.nextElement()); } diff --git a/src/test/CleanupQzrcsrvsJobs.java b/src/test/CleanupQzrcsrvsJobs.java index a23e2a0..e4e4ac9 100644 --- a/src/test/CleanupQzrcsrvsJobs.java +++ b/src/test/CleanupQzrcsrvsJobs.java @@ -45,15 +45,15 @@ public static void main(String args[]) { if (system == null) { as400 = new AS400(); } else { - as400 = new AS400(system, userid, password); + as400 = new AS400(system, userid, password.toCharArray()); } JobList joblist = new JobList(as400); joblist.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_ACTIVE, Boolean.TRUE); joblist.addJobSelectionCriteria(JobList.SELECTION_JOB_NAME, "QZRCSRVS"); - Hashtable userSet = new Hashtable(); + Hashtable userSet = new Hashtable(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(); - Enumeration enumeration = joblist.getJobs(); + Enumeration enumeration = joblist.getJobs(); long currentTimeMillis = System.currentTimeMillis(); while (enumeration.hasMoreElements()) { Job j = (Job) enumeration.nextElement(); @@ -67,7 +67,7 @@ public static void main(String args[]) { System.out.println("-------------------"); System.out.println("Job name is "+j.getNumber()+"/"+j.getUser()+"/"+j.getName()+" user is "+user); JobLog joblog = j.getJobLog(); - Enumeration messageEnumeration = joblog.getMessages(); + Enumeration messageEnumeration = joblog.getMessages(); boolean endJob = false; // // Look for message of the following form. If the message is older than 1 hour then @@ -124,7 +124,7 @@ public static void main(String args[]) { System.out.println("-----------------------------------------"); System.out.println("Here are the users found on the system"); - Enumeration userEnumeration = userSet.keys(); + Enumeration userEnumeration = userSet.keys(); while (userEnumeration.hasMoreElements()) { System.out.println(userEnumeration.nextElement()); } diff --git a/src/test/CmdTest.java b/src/test/CmdTest.java index 888ddb9..7a81f75 100644 --- a/src/test/CmdTest.java +++ b/src/test/CmdTest.java @@ -33,7 +33,7 @@ public class CmdTest extends TestDriver /** * */ - private static final long serialVersionUID = 1L; +public static final long serialVersionUID = 1L; public static boolean assumeCommandsThreadSafe_ = false; // Determine if testcase is running on an iSeries server. diff --git a/src/test/CommTraceDriver.java b/src/test/CommTraceDriver.java index 6aeddec..0aa7ebb 100644 --- a/src/test/CommTraceDriver.java +++ b/src/test/CommTraceDriver.java @@ -15,7 +15,7 @@ package test; -import java.util.Vector; + import test.MiscAH.CommTraceTestcase; @@ -87,14 +87,14 @@ public void createTestcases() { CommTraceTestcase tc = new CommTraceTestcase(systemObject_, - (Vector) namesAndVars_.get("example"), runMode_, + namesAndVars_.get("example"), runMode_, fileOutputStream_); testcases_.addElement(tc); namesAndVars_.remove("example"); } // Put out error message for each invalid testcase name. - for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) + for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/CommandHelpTest.java b/src/test/CommandHelpTest.java index f00142c..c483c56 100644 --- a/src/test/CommandHelpTest.java +++ b/src/test/CommandHelpTest.java @@ -15,13 +15,12 @@ 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; -import test.TestDriver; import test.Cmd.CommandBeanInfoTestcase; import test.Cmd.CommandHelpRetrieverTestcase; import test.Cmd.CommandListBeanInfoTestcase; @@ -128,28 +127,28 @@ public void createTestcases() // Repeat the following 'if' block for each testcase. if (allTestcases || namesAndVars_.containsKey("CommandTestcase")) { - CommandTestcase tc = new CommandTestcase(systemObject_, (Vector) namesAndVars_.get("CommandTestcase"), runMode_, fileOutputStream_ ); + CommandTestcase tc = new CommandTestcase(systemObject_, namesAndVars_.get("CommandTestcase"), runMode_, fileOutputStream_ ); testcases_.addElement(tc); namesAndVars_.remove("CommandTestcase"); } if (allTestcases || namesAndVars_.containsKey("CommandBeanInfoTestcase")) { - CommandBeanInfoTestcase tc = new CommandBeanInfoTestcase(systemObject_, (Vector) namesAndVars_.get("CommandBeanInfoTestcase"), runMode_, fileOutputStream_ ); + CommandBeanInfoTestcase tc = new CommandBeanInfoTestcase(systemObject_, namesAndVars_.get("CommandBeanInfoTestcase"), runMode_, fileOutputStream_ ); testcases_.addElement(tc); namesAndVars_.remove("CommandBeanInfoTestcase"); } if (allTestcases || namesAndVars_.containsKey("CommandListTestcase")) { - CommandListTestcase tc = new CommandListTestcase(systemObject_, (Vector) namesAndVars_.get("CommandListTestcase"), runMode_, fileOutputStream_ ); + CommandListTestcase tc = new CommandListTestcase(systemObject_, namesAndVars_.get("CommandListTestcase"), runMode_, fileOutputStream_ ); testcases_.addElement(tc); namesAndVars_.remove("CommandListTestcase"); } if (allTestcases || namesAndVars_.containsKey("CommandListBeanInfoTestcase")) { - CommandListBeanInfoTestcase tc = new CommandListBeanInfoTestcase(systemObject_, (Vector) namesAndVars_.get("CommandListBeanInfoTestcase"), runMode_, fileOutputStream_ ); + CommandListBeanInfoTestcase tc = new CommandListBeanInfoTestcase(systemObject_, namesAndVars_.get("CommandListBeanInfoTestcase"), runMode_, fileOutputStream_ ); testcases_.addElement(tc); namesAndVars_.remove("CommandListBeanInfoTestcase"); } @@ -157,14 +156,14 @@ public void createTestcases() if (allTestcases || namesAndVars_.containsKey("CommandHelpRetrieverTestcase")) { - CommandHelpRetrieverTestcase tc = new CommandHelpRetrieverTestcase(systemObject_, (Vector) namesAndVars_.get("CommandHelpRetrieverTestcase"), runMode_, fileOutputStream_ ); + CommandHelpRetrieverTestcase tc = new CommandHelpRetrieverTestcase(systemObject_, namesAndVars_.get("CommandHelpRetrieverTestcase"), runMode_, fileOutputStream_ ); testcases_.addElement(tc); namesAndVars_.remove("CommandHelpRetrieverTestcase"); } // Put out error message for each invalid testcase name. - for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) + for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/DDMTest.java b/src/test/DDMTest.java index 5ff6d01..59068d6 100644 --- a/src/test/DDMTest.java +++ b/src/test/DDMTest.java @@ -57,9 +57,7 @@ import test.DDM.DDMWrite; import java.io.IOException; -import java.util.Vector; import java.util.Enumeration; -import java.util.StringTokenizer; /** Test driver for the ddm (record-level database access) component. @@ -753,7 +751,7 @@ public void createTestcases() { DDMConstructors tc = new DDMConstructors(systemObject_, - (Vector) namesAndVars_.get("DDMConstructors"), runMode_, + namesAndVars_.get("DDMConstructors"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMConstructors"); @@ -763,7 +761,7 @@ public void createTestcases() { DDMConnect tc = new DDMConnect(systemObject_, - (Vector) namesAndVars_.get("DDMConnect"), runMode_, + namesAndVars_.get("DDMConnect"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMConnect"); @@ -773,7 +771,7 @@ public void createTestcases() { DDMOpenClose tc = new DDMOpenClose(systemObject_, - (Vector) namesAndVars_.get("DDMOpenClose"), runMode_, + namesAndVars_.get("DDMOpenClose"), runMode_, fileOutputStream_, testLib_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMOpenClose"); @@ -783,7 +781,7 @@ public void createTestcases() { DDMCreateAndAdd tc = new DDMCreateAndAdd(systemObject_, - (Vector) namesAndVars_.get("DDMCreateAndAdd"), runMode_, + namesAndVars_.get("DDMCreateAndAdd"), runMode_, fileOutputStream_, testLib_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCreateAndAdd"); @@ -793,7 +791,7 @@ public void createTestcases() { DDMDelete tc = new DDMDelete(systemObject_, - (Vector) namesAndVars_.get("DDMDelete"), runMode_, + namesAndVars_.get("DDMDelete"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMDelete"); @@ -803,7 +801,7 @@ public void createTestcases() { DDMLocking tc = new DDMLocking(systemObject_, - (Vector) namesAndVars_.get("DDMLocking"), runMode_, + namesAndVars_.get("DDMLocking"), runMode_, fileOutputStream_, testLib_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMLocking"); @@ -813,7 +811,7 @@ public void createTestcases() { DDMCommitmentControl tc = new DDMCommitmentControl(systemObject_, - (Vector) namesAndVars_.get("DDMCommitmentControl"), runMode_, + namesAndVars_.get("DDMCommitmentControl"), runMode_, fileOutputStream_, testLib_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCommitmentControl"); @@ -823,7 +821,7 @@ public void createTestcases() { DDMPosition tc = new DDMPosition(systemObject_, - (Vector) namesAndVars_.get("DDMPosition"), runMode_, + namesAndVars_.get("DDMPosition"), runMode_, fileOutputStream_, testLib_, 1, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMPosition"); @@ -833,7 +831,7 @@ public void createTestcases() { DDMPositionExtended tc = new DDMPositionExtended(systemObject_, - (Vector) namesAndVars_.get("DDMPositionExtended"), runMode_, + namesAndVars_.get("DDMPositionExtended"), runMode_, fileOutputStream_); testcases_.addElement(tc); namesAndVars_.remove("DDMPositionExtended"); @@ -843,7 +841,7 @@ public void createTestcases() { DDMPosition tc = new DDMPosition(systemObject_, - (Vector) namesAndVars_.get("DDMPositionCaching0"), runMode_, + namesAndVars_.get("DDMPositionCaching0"), runMode_, fileOutputStream_, testLib_, 0, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMPositionCaching0"); @@ -853,7 +851,7 @@ public void createTestcases() { DDMPosition tc = new DDMPosition(systemObject_, - (Vector) namesAndVars_.get("DDMPositionCaching2"), runMode_, + namesAndVars_.get("DDMPositionCaching2"), runMode_, fileOutputStream_, testLib_, 2, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMPositionCaching2"); @@ -863,7 +861,7 @@ public void createTestcases() { DDMPosition tc = new DDMPosition(systemObject_, - (Vector) namesAndVars_.get("DDMPositionCaching10"), runMode_, + namesAndVars_.get("DDMPositionCaching10"), runMode_, fileOutputStream_, testLib_, 10, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMPositionCaching10"); @@ -873,7 +871,7 @@ public void createTestcases() { DDMReadSeq tc = new DDMReadSeq(systemObject_, - (Vector) namesAndVars_.get("DDMReadSeq"), runMode_, + namesAndVars_.get("DDMReadSeq"), runMode_, fileOutputStream_, testLib_, 1); testcases_.addElement(tc); namesAndVars_.remove("DDMReadSeq"); @@ -883,7 +881,7 @@ public void createTestcases() { DDMReadSeq tc = new DDMReadSeq(systemObject_, - (Vector) namesAndVars_.get("DDMReadSeqCaching0"), runMode_, + namesAndVars_.get("DDMReadSeqCaching0"), runMode_, fileOutputStream_, testLib_, 0); testcases_.addElement(tc); namesAndVars_.remove("DDMReadSeqCaching0"); @@ -893,7 +891,7 @@ public void createTestcases() { DDMReadSeq tc = new DDMReadSeq(systemObject_, - (Vector) namesAndVars_.get("DDMReadSeqCaching2"), runMode_, + namesAndVars_.get("DDMReadSeqCaching2"), runMode_, fileOutputStream_, testLib_, 2); testcases_.addElement(tc); namesAndVars_.remove("DDMReadSeqCaching2"); @@ -903,7 +901,7 @@ public void createTestcases() { DDMReadSeq tc = new DDMReadSeq(systemObject_, - (Vector) namesAndVars_.get("DDMReadSeqCaching10"), runMode_, + namesAndVars_.get("DDMReadSeqCaching10"), runMode_, fileOutputStream_, testLib_, 10); testcases_.addElement(tc); namesAndVars_.remove("DDMReadSeqCaching10"); @@ -913,7 +911,7 @@ public void createTestcases() { DDMReadKey tc = new DDMReadKey(systemObject_, - (Vector) namesAndVars_.get("DDMReadKey"), runMode_, + namesAndVars_.get("DDMReadKey"), runMode_, fileOutputStream_, testLib_, 1); testcases_.addElement(tc); namesAndVars_.remove("DDMReadKey"); @@ -923,7 +921,7 @@ public void createTestcases() { DDMReadKey tc = new DDMReadKey(systemObject_, - (Vector) namesAndVars_.get("DDMReadKeyCaching0"), runMode_, + namesAndVars_.get("DDMReadKeyCaching0"), runMode_, fileOutputStream_, testLib_, 0); testcases_.addElement(tc); namesAndVars_.remove("DDMReadKeyCaching0"); @@ -933,7 +931,7 @@ public void createTestcases() { DDMReadKey tc = new DDMReadKey(systemObject_, - (Vector) namesAndVars_.get("DDMReadKeyCaching2"), runMode_, + namesAndVars_.get("DDMReadKeyCaching2"), runMode_, fileOutputStream_, testLib_, 2); testcases_.addElement(tc); namesAndVars_.remove("DDMReadKeyCaching2"); @@ -943,7 +941,7 @@ public void createTestcases() { DDMReadKey tc = new DDMReadKey(systemObject_, - (Vector) namesAndVars_.get("DDMReadKeyCaching10"), runMode_, + namesAndVars_.get("DDMReadKeyCaching10"), runMode_, fileOutputStream_, testLib_, 10); testcases_.addElement(tc); namesAndVars_.remove("DDMReadKeyCaching10"); @@ -953,7 +951,7 @@ public void createTestcases() { DDMReadRN tc = new DDMReadRN(systemObject_, - (Vector) namesAndVars_.get("DDMReadRN"), runMode_, + namesAndVars_.get("DDMReadRN"), runMode_, fileOutputStream_, testLib_, 1); testcases_.addElement(tc); namesAndVars_.remove("DDMReadRN"); @@ -963,7 +961,7 @@ public void createTestcases() { DDMReadRN tc = new DDMReadRN(systemObject_, - (Vector) namesAndVars_.get("DDMReadRNCaching0"), runMode_, + namesAndVars_.get("DDMReadRNCaching0"), runMode_, fileOutputStream_, testLib_, 0); testcases_.addElement(tc); namesAndVars_.remove("DDMReadRNCaching0"); @@ -973,7 +971,7 @@ public void createTestcases() { DDMReadRN tc = new DDMReadRN(systemObject_, - (Vector) namesAndVars_.get("DDMReadRNCaching2"), runMode_, + namesAndVars_.get("DDMReadRNCaching2"), runMode_, fileOutputStream_, testLib_, 2); testcases_.addElement(tc); namesAndVars_.remove("DDMReadRNCaching2"); @@ -983,7 +981,7 @@ public void createTestcases() { DDMReadRN tc = new DDMReadRN(systemObject_, - (Vector) namesAndVars_.get("DDMReadRNCaching10"), runMode_, + namesAndVars_.get("DDMReadRNCaching10"), runMode_, fileOutputStream_, testLib_, 10); testcases_.addElement(tc); namesAndVars_.remove("DDMReadRNCaching10"); @@ -993,7 +991,7 @@ public void createTestcases() { DDMDeletedRecords tc = new DDMDeletedRecords(systemObject_, - (Vector) namesAndVars_.get("DDMDeletedRecords"), runMode_, + namesAndVars_.get("DDMDeletedRecords"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMDeletedRecords"); @@ -1003,7 +1001,7 @@ public void createTestcases() { DDMWrite tc = new DDMWrite(systemObject_, - (Vector) namesAndVars_.get("DDMWrite"), runMode_, + namesAndVars_.get("DDMWrite"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMWrite"); @@ -1013,7 +1011,7 @@ public void createTestcases() { DDMWrite tc = new DDMWrite(systemObject_, - (Vector) namesAndVars_.get("DDMWriteCaching0"), runMode_, + namesAndVars_.get("DDMWriteCaching0"), runMode_, fileOutputStream_, testLib_, 0); testcases_.addElement(tc); namesAndVars_.remove("DDMWriteCaching0"); @@ -1023,7 +1021,7 @@ public void createTestcases() { DDMWrite tc = new DDMWrite(systemObject_, - (Vector) namesAndVars_.get("DDMWriteCaching2"), runMode_, + namesAndVars_.get("DDMWriteCaching2"), runMode_, fileOutputStream_, testLib_, 2); testcases_.addElement(tc); namesAndVars_.remove("DDMWriteCaching2"); @@ -1033,7 +1031,7 @@ public void createTestcases() { DDMWrite tc = new DDMWrite(systemObject_, - (Vector) namesAndVars_.get("DDMWriteCaching10"), runMode_, + namesAndVars_.get("DDMWriteCaching10"), runMode_, fileOutputStream_, testLib_, 10); testcases_.addElement(tc); namesAndVars_.remove("DDMWriteCaching10"); @@ -1043,7 +1041,7 @@ public void createTestcases() { DDMUpdate tc = new DDMUpdate(systemObject_, - (Vector) namesAndVars_.get("DDMUpdate"), runMode_, + namesAndVars_.get("DDMUpdate"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMUpdate"); @@ -1053,7 +1051,7 @@ public void createTestcases() { DDMGetSet tc = new DDMGetSet(systemObject_, - (Vector) namesAndVars_.get("DDMGetSet"), runMode_, + namesAndVars_.get("DDMGetSet"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMGetSet"); @@ -1063,7 +1061,7 @@ public void createTestcases() { DDMRecordDescription tc = new DDMRecordDescription(systemObject_, - (Vector) namesAndVars_.get("DDMRecordDescription"), runMode_, + namesAndVars_.get("DDMRecordDescription"), runMode_, fileOutputStream_, testLib_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMRecordDescription"); @@ -1073,7 +1071,7 @@ public void createTestcases() { DDMSerialization tc = new DDMSerialization(systemObject_, - (Vector) namesAndVars_.get("DDMSerialization"), runMode_, + namesAndVars_.get("DDMSerialization"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMSerialization"); @@ -1083,7 +1081,7 @@ public void createTestcases() { DDMEvents tc = new DDMEvents(systemObject_, - (Vector) namesAndVars_.get("DDMEvents"), runMode_, + namesAndVars_.get("DDMEvents"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMEvents"); @@ -1092,7 +1090,7 @@ public void createTestcases() { DDMCaching tc = new DDMCaching(systemObject_, - (Vector) namesAndVars_.get("DDMCaching"), runMode_, + namesAndVars_.get("DDMCaching"), runMode_, fileOutputStream_, testLib_, 1, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCaching"); @@ -1102,7 +1100,7 @@ public void createTestcases() { DDMCaching tc = new DDMCaching(systemObject_, - (Vector) namesAndVars_.get("DDMCaching0"), runMode_, + namesAndVars_.get("DDMCaching0"), runMode_, fileOutputStream_, testLib_, 0, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCaching0"); @@ -1112,7 +1110,7 @@ public void createTestcases() { DDMCaching tc = new DDMCaching(systemObject_, - (Vector) namesAndVars_.get("DDMCaching2"), runMode_, + namesAndVars_.get("DDMCaching2"), runMode_, fileOutputStream_, testLib_, 2, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCaching2"); @@ -1122,7 +1120,7 @@ public void createTestcases() { DDMCaching tc = new DDMCaching(systemObject_, - (Vector) namesAndVars_.get("DDMCaching100"), runMode_, + namesAndVars_.get("DDMCaching100"), runMode_, fileOutputStream_, testLib_, 100, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCaching100"); @@ -1132,7 +1130,7 @@ public void createTestcases() { DDMCaching tc = new DDMCaching(systemObject_, - (Vector) namesAndVars_.get("DDMCaching499"), runMode_, + namesAndVars_.get("DDMCaching499"), runMode_, fileOutputStream_, testLib_, 499, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCaching499"); @@ -1142,7 +1140,7 @@ public void createTestcases() { DDMCaching tc = new DDMCaching(systemObject_, - (Vector) namesAndVars_.get("DDMCaching500"), runMode_, + namesAndVars_.get("DDMCaching500"), runMode_, fileOutputStream_, testLib_, 500, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCaching500"); @@ -1152,7 +1150,7 @@ public void createTestcases() { DDMCaching tc = new DDMCaching(systemObject_, - (Vector) namesAndVars_.get("DDMCaching501"), runMode_, + namesAndVars_.get("DDMCaching501"), runMode_, fileOutputStream_, testLib_, 501, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCaching501"); @@ -1162,7 +1160,7 @@ public void createTestcases() { DDMCaching tc = new DDMCaching(systemObject_, - (Vector) namesAndVars_.get("DDMCaching600"), runMode_, + namesAndVars_.get("DDMCaching600"), runMode_, fileOutputStream_, testLib_, 600, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCaching600"); @@ -1172,7 +1170,7 @@ public void createTestcases() { DDMMultipleFormat tc = new DDMMultipleFormat(systemObject_, - (Vector) namesAndVars_.get("DDMMultipleFormat"), runMode_, + namesAndVars_.get("DDMMultipleFormat"), runMode_, fileOutputStream_, testLib_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMMultipleFormat"); @@ -1182,7 +1180,7 @@ public void createTestcases() { DDMP3666842 tc = new DDMP3666842(systemObject_, - (Vector) namesAndVars_.get("DDMP3666842"), runMode_, + namesAndVars_.get("DDMP3666842"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMP3666842"); @@ -1192,7 +1190,7 @@ public void createTestcases() { DDMP3696575 tc = new DDMP3696575(systemObject_, - (Vector) namesAndVars_.get("DDMP3696575"), runMode_, + namesAndVars_.get("DDMP3696575"), runMode_, fileOutputStream_, testLib_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMP3696575"); @@ -1202,7 +1200,7 @@ public void createTestcases() { DDMP9901531 tc = new DDMP9901531(systemObject_, - (Vector) namesAndVars_.get("DDMP9901531"), runMode_, + namesAndVars_.get("DDMP9901531"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMP9901531"); @@ -1212,7 +1210,7 @@ public void createTestcases() { DDMP9907036 tc = new DDMP9907036(systemObject_, - (Vector) namesAndVars_.get("DDMP9907036"), runMode_, + namesAndVars_.get("DDMP9907036"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMP9907036"); @@ -1222,7 +1220,7 @@ public void createTestcases() { DDMP9908190 tc = new DDMP9908190(systemObject_, - (Vector) namesAndVars_.get("DDMP9908190"), runMode_, + namesAndVars_.get("DDMP9908190"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMP9908190"); @@ -1232,7 +1230,7 @@ public void createTestcases() { DDMP9936798 tc = new DDMP9936798(systemObject_, - (Vector) namesAndVars_.get("DDMP9936798"), runMode_, + namesAndVars_.get("DDMP9936798"), runMode_, fileOutputStream_, testLib_, password_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMP9936798"); @@ -1242,7 +1240,7 @@ public void createTestcases() { DDMP9946152 tc = new DDMP9946152(systemObject_, - (Vector) namesAndVars_.get("DDMP9946152"), runMode_, + namesAndVars_.get("DDMP9946152"), runMode_, fileOutputStream_, testLib_, password_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMP9946152"); @@ -1252,7 +1250,7 @@ public void createTestcases() { DDMP9949891 tc = new DDMP9949891(systemObject_, - (Vector) namesAndVars_.get("DDMP9949891"), runMode_, + namesAndVars_.get("DDMP9949891"), runMode_, fileOutputStream_, testLib_, password_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMP9949891"); @@ -1262,7 +1260,7 @@ public void createTestcases() { DDMPSA94749 tc = new DDMPSA94749(systemObject_, - (Vector) namesAndVars_.get("DDMPSA94749"), runMode_, + namesAndVars_.get("DDMPSA94749"), runMode_, fileOutputStream_, testLib_, password_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMPSA94749"); @@ -1272,7 +1270,7 @@ public void createTestcases() { DDMSQLCompatibility tc = new DDMSQLCompatibility(systemObject_, - (Vector) namesAndVars_.get("DDMSQLCompatibility"), runMode_, + namesAndVars_.get("DDMSQLCompatibility"), runMode_, fileOutputStream_, testLib_, password_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMSQLCompatibility"); @@ -1282,7 +1280,7 @@ public void createTestcases() { DDMPassword tc = new DDMPassword(systemObject_, - (Vector) namesAndVars_.get("DDMPassword"), runMode_, + namesAndVars_.get("DDMPassword"), runMode_, fileOutputStream_, testLib_); testcases_.addElement(tc); namesAndVars_.remove("DDMPassword"); @@ -1292,7 +1290,7 @@ public void createTestcases() { DDMRegressionTestcase tc = new DDMRegressionTestcase(systemObject_, - (Vector) namesAndVars_.get("DDMRegressionTestcase"), runMode_, + namesAndVars_.get("DDMRegressionTestcase"), runMode_, fileOutputStream_, testLib_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMRegressionTestcase"); @@ -1302,7 +1300,7 @@ public void createTestcases() { DDMP9960329 tc = new DDMP9960329(systemObject_, - (Vector) namesAndVars_.get("DDMP9960329"), runMode_, + namesAndVars_.get("DDMP9960329"), runMode_, fileOutputStream_, testLib_, password_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMP9960329"); @@ -1312,7 +1310,7 @@ public void createTestcases() { DDMCheckFields tc = new DDMCheckFields(systemObject_, - (Vector) namesAndVars_.get("DDMCheckFields"), runMode_, + namesAndVars_.get("DDMCheckFields"), runMode_, fileOutputStream_, testLib_, password_, PwrSys); testcases_.addElement(tc); namesAndVars_.remove("DDMCheckFields"); @@ -1344,7 +1342,7 @@ public void createTestcases() // Put out error message for each invalid testcase name. - for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) + for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/DriverDriver.java b/src/test/DriverDriver.java index 00f31f3..a2b4a1b 100644 --- a/src/test/DriverDriver.java +++ b/src/test/DriverDriver.java @@ -16,7 +16,6 @@ package test; import java.util.Vector; -import java.util.StringTokenizer; /** This class invokes all the various component TestDrivers in succession. @@ -46,7 +45,7 @@ public class DriverDriver protected static String installDir_ = null; // local directory for InstallTest protected static String printer_ = null; // printer for NPPrintTest protected static String misc_ = null; // '-misc' argument passed in - protected static Vector common_args_; // everything the caller specified + protected static Vector common_args_; // everything the caller specified // for options, other than the above public static void main(String[] args) @@ -199,10 +198,9 @@ public static void parseParms(String args[]) installDir_ = null; printer_ = null; misc_ = null; - common_args_ = new Vector(); + common_args_ = new Vector(); // Parse the command line parameters. - StringTokenizer vars = null; int state = START; for (int i = 0; i < args.length; i++) @@ -290,14 +288,15 @@ public static void runDriver(TestDriver driver) /** Set up arguments for a Driver. **/ - public static String[] setupArgs(Vector base_args, String misc_val) + public static String[] setupArgs(Vector base_args, String misc_val) { if (base_args == null) - base_args = new Vector(); + base_args = new Vector(); String[] combined_args = null; if (misc_val != null) { - Vector temp_args = (Vector)base_args.clone(); + @SuppressWarnings("unchecked") + Vector temp_args = (Vector)base_args.clone(); temp_args.addElement("-misc"); temp_args.addElement(misc_val); combined_args = new String[temp_args.size()]; diff --git a/src/test/EVTest.java b/src/test/EVTest.java index 57ce76d..a5b1d35 100644 --- a/src/test/EVTest.java +++ b/src/test/EVTest.java @@ -103,16 +103,19 @@ public void createTestcases() public static Object serialize(EnvironmentVariable object, char[] encryptedPassword) throws Exception { // Serialize. + { ObjectOutput out = new ObjectOutputStream(new FileOutputStream(SERIALIZE_FILENAME)); out.writeObject(object); out.flush(); - + out.close(); + } // Deserialize. EnvironmentVariable object2 = null; try { ObjectInputStream in = new ObjectInputStream(new FileInputStream(SERIALIZE_FILENAME)); object2 = (EnvironmentVariable)in.readObject(); + in.close(); } finally { @@ -138,9 +141,12 @@ public static Object serialize(EnvironmentVariable object, char[] encryptedPassw public static Object serialize(EnvironmentVariableList object, char[] encryptedPassword) throws Exception { // Serialize. + { ObjectOutput out = new ObjectOutputStream(new FileOutputStream(SERIALIZE_FILENAME)); out.writeObject(object); out.flush(); + out.close(); + } // Deserialize. EnvironmentVariableList object2 = null; @@ -148,6 +154,7 @@ public static Object serialize(EnvironmentVariableList object, char[] encryptedP { ObjectInputStream in = new ObjectInputStream(new FileInputStream(SERIALIZE_FILENAME)); object2 = (EnvironmentVariableList)in.readObject(); + in.close(); } finally { diff --git a/src/test/ExampleDriver.java b/src/test/ExampleDriver.java index 2da34e0..09c6530 100644 --- a/src/test/ExampleDriver.java +++ b/src/test/ExampleDriver.java @@ -13,7 +13,7 @@ package test; -import java.util.Vector; + import test.MiscAH.ExampleTestcase; @@ -87,14 +87,14 @@ public void createTestcases() { ExampleTestcase tc = new ExampleTestcase(systemObject_, - (Vector) namesAndVars_.get("example"), runMode_, + namesAndVars_.get("example"), runMode_, fileOutputStream_); testcases_.addElement(tc); namesAndVars_.remove("example"); } // Put out error message for each invalid testcase name. - for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) + for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/FDTest.java b/src/test/FDTest.java index 38da53d..a9b408e 100644 --- a/src/test/FDTest.java +++ b/src/test/FDTest.java @@ -13,7 +13,6 @@ package test; -import java.util.Vector; import test.MiscAH.FDConstructAndGet; import test.MiscAH.FDInvUsage; @@ -112,7 +111,7 @@ public void createTestcases() { FDConstructAndGet tc = new FDConstructAndGet(systemObject_, - (Vector) namesAndVars_.get("FDConstructAndGet"), runMode_, + namesAndVars_.get("FDConstructAndGet"), runMode_, fileOutputStream_); testcases_.addElement(tc); namesAndVars_.remove("FDConstructAndGet"); @@ -122,7 +121,7 @@ public void createTestcases() { FDInvUsage tc = new FDInvUsage(systemObject_, - (Vector) namesAndVars_.get("FDInvUsage"), runMode_, + namesAndVars_.get("FDInvUsage"), runMode_, fileOutputStream_); testcases_.addElement(tc); namesAndVars_.remove("FDInvUsage"); @@ -132,7 +131,7 @@ public void createTestcases() { FDSet tc = new FDSet(systemObject_, - (Vector) namesAndVars_.get("FDSet"), runMode_, + namesAndVars_.get("FDSet"), runMode_, fileOutputStream_); testcases_.addElement(tc); namesAndVars_.remove("FDSet"); @@ -142,14 +141,14 @@ public void createTestcases() { FDSerialization tc = new FDSerialization(systemObject_, - (Vector) namesAndVars_.get("FDSerialization"), runMode_, + namesAndVars_.get("FDSerialization"), runMode_, fileOutputStream_); testcases_.addElement(tc); namesAndVars_.remove("FDSerialization"); } // Put out error message for each invalid testcase name. - for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) + for (Enumeration e = namesAndVars_.keys(); e.hasMoreElements();) { System.out.println("Testcase " + e.nextElement() + " not found."); } diff --git a/src/test/FTPTest.java b/src/test/FTPTest.java index 1f414d6..951b135 100644 --- a/src/test/FTPTest.java +++ b/src/test/FTPTest.java @@ -14,7 +14,7 @@ package test; import java.io.File; -import java.io.FileInputStream; + import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; @@ -361,6 +361,7 @@ public void setup() throws Exception // @A2A try { System.out.println("Attempting to extract test/FtPTestDirArchive.zip to /"); ZipFile zipFile = new ZipFile( "test/FTPTestDirArchive.zip"); + @SuppressWarnings("unchecked") Enumeration entries = (Enumeration) zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = (ZipEntry) entries.nextElement(); @@ -388,7 +389,7 @@ public void setup() throws Exception // @A2A } } - + zipFile.close(); } catch (Exception e) { e.printStackTrace(); System.out.println("\nERROR: Local directory does not contain a FTPTestDir subdirectory tree. Many variations may fail."); diff --git a/src/test/JD/CPDS/JDCPDSConnectionClose.java b/src/test/JD/CPDS/JDCPDSConnectionClose.java index 39129f8..8333599 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionClose.java +++ b/src/test/JD/CPDS/JDCPDSConnectionClose.java @@ -29,6 +29,7 @@ import java.sql.Statement; import java.util.Arrays; import java.util.Hashtable; +import java.util.Vector; import javax.sql.DataSource; @@ -68,7 +69,7 @@ public class JDCPDSConnectionClose Constructor. **/ public JDCPDSConnectionClose (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionCommit.java b/src/test/JD/CPDS/JDCPDSConnectionCommit.java index 104ac2d..22c1de4 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionCommit.java +++ b/src/test/JD/CPDS/JDCPDSConnectionCommit.java @@ -29,6 +29,7 @@ import java.sql.Statement; import java.util.Arrays; import java.util.Hashtable; +import java.util.Vector; import javax.sql.DataSource; @@ -68,7 +69,7 @@ public class JDCPDSConnectionCommit Constructor. **/ public JDCPDSConnectionCommit (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionCreateStatement.java b/src/test/JD/CPDS/JDCPDSConnectionCreateStatement.java index 203fec4..658f86a 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionCreateStatement.java +++ b/src/test/JD/CPDS/JDCPDSConnectionCreateStatement.java @@ -30,6 +30,7 @@ import java.sql.SQLWarning; import java.sql.Statement; import java.util.Hashtable; +import java.util.Vector; import javax.sql.DataSource; @@ -75,7 +76,7 @@ public class JDCPDSConnectionCreateStatement extends JDTestcase { /** * Constructor. **/ - public JDCPDSConnectionCreateStatement(AS400 systemObject, Hashtable namesAndVars, int runMode, + public JDCPDSConnectionCreateStatement(AS400 systemObject, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String password) { diff --git a/src/test/JD/CPDS/JDCPDSConnectionFormat.java b/src/test/JD/CPDS/JDCPDSConnectionFormat.java index 78ab29b..c593209 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionFormat.java +++ b/src/test/JD/CPDS/JDCPDSConnectionFormat.java @@ -32,6 +32,7 @@ import java.io.FileOutputStream; import java.util.Arrays; import java.util.Hashtable; +import java.util.Vector; import java.sql.*; import javax.sql.DataSource; @@ -64,7 +65,7 @@ public class JDCPDSConnectionFormat Constructor. **/ public JDCPDSConnectionFormat (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String password) diff --git a/src/test/JD/CPDS/JDCPDSConnectionLibraries.java b/src/test/JD/CPDS/JDCPDSConnectionLibraries.java index 1130369..c33c079 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionLibraries.java +++ b/src/test/JD/CPDS/JDCPDSConnectionLibraries.java @@ -33,6 +33,7 @@ import java.io.FileOutputStream; import java.util.Hashtable; import java.util.StringTokenizer; +import java.util.Vector; import java.sql.*; import javax.sql.*; @@ -60,7 +61,7 @@ public class JDCPDSConnectionLibraries Constructor. **/ public JDCPDSConnectionLibraries (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionMisc.java b/src/test/JD/CPDS/JDCPDSConnectionMisc.java index c0534c6..1f3c864 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionMisc.java +++ b/src/test/JD/CPDS/JDCPDSConnectionMisc.java @@ -29,6 +29,7 @@ import java.io.FileOutputStream; import java.util.Hashtable; +import java.util.Vector; import java.sql.*; import javax.sql.*; @@ -62,7 +63,7 @@ public class JDCPDSConnectionMisc Constructor. **/ public JDCPDSConnectionMisc (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionNaming.java b/src/test/JD/CPDS/JDCPDSConnectionNaming.java index 78742df..5858945 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionNaming.java +++ b/src/test/JD/CPDS/JDCPDSConnectionNaming.java @@ -25,6 +25,8 @@ import java.sql.Connection; import java.sql.Statement; import java.util.Hashtable; +import java.util.Vector; + import javax.sql.*; import com.ibm.as400.access.AS400; @@ -52,7 +54,7 @@ public class JDCPDSConnectionNaming Constructor. **/ public JDCPDSConnectionNaming (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionNativeSQL.java b/src/test/JD/CPDS/JDCPDSConnectionNativeSQL.java index e7f069b..54e88c6 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionNativeSQL.java +++ b/src/test/JD/CPDS/JDCPDSConnectionNativeSQL.java @@ -31,6 +31,7 @@ import java.io.FileOutputStream; import java.sql.*; import java.util.Hashtable; +import java.util.Vector; import javax.sql.*; @@ -58,7 +59,7 @@ public class JDCPDSConnectionNativeSQL Constructor. **/ public JDCPDSConnectionNativeSQL (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionReadOnly.java b/src/test/JD/CPDS/JDCPDSConnectionReadOnly.java index 125ba68..06257d1 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionReadOnly.java +++ b/src/test/JD/CPDS/JDCPDSConnectionReadOnly.java @@ -28,6 +28,8 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.Hashtable; +import java.util.Vector; + import javax.sql.*; import com.ibm.as400.access.AS400; @@ -61,7 +63,7 @@ public class JDCPDSConnectionReadOnly Constructor. **/ public JDCPDSConnectionReadOnly (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionSort.java b/src/test/JD/CPDS/JDCPDSConnectionSort.java index 929a6b3..620eeca 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionSort.java +++ b/src/test/JD/CPDS/JDCPDSConnectionSort.java @@ -28,6 +28,8 @@ import java.sql.Statement; import java.util.Hashtable; import java.util.Properties; +import java.util.Vector; + import javax.sql.*; import com.ibm.as400.access.AS400; @@ -58,7 +60,7 @@ public class JDCPDSConnectionSort Constructor. **/ public JDCPDSConnectionSort (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionTransactionIsolation.java b/src/test/JD/CPDS/JDCPDSConnectionTransactionIsolation.java index 86fbc70..b492672 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionTransactionIsolation.java +++ b/src/test/JD/CPDS/JDCPDSConnectionTransactionIsolation.java @@ -30,6 +30,7 @@ import java.io.FileOutputStream; import java.util.Hashtable; +import java.util.Vector; import java.sql.*; import javax.sql.*; @@ -62,7 +63,7 @@ public class JDCPDSConnectionTransactionIsolation Constructor. **/ public JDCPDSConnectionTransactionIsolation (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSConnectionWarnings.java b/src/test/JD/CPDS/JDCPDSConnectionWarnings.java index c05036b..6e0d51b 100644 --- a/src/test/JD/CPDS/JDCPDSConnectionWarnings.java +++ b/src/test/JD/CPDS/JDCPDSConnectionWarnings.java @@ -42,6 +42,7 @@ import java.io.FileOutputStream; import java.util.Hashtable; +import java.util.Vector; import java.sql.*; import javax.sql.*; @@ -72,7 +73,7 @@ public class JDCPDSConnectionWarnings Constructor. **/ public JDCPDSConnectionWarnings (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSGetConnection.java b/src/test/JD/CPDS/JDCPDSGetConnection.java index b00bc20..da7f841 100644 --- a/src/test/JD/CPDS/JDCPDSGetConnection.java +++ b/src/test/JD/CPDS/JDCPDSGetConnection.java @@ -27,6 +27,7 @@ import java.sql.Statement; import java.util.Arrays; import java.util.Hashtable; +import java.util.Vector; import javax.sql.ConnectionPoolDataSource; import javax.sql.PooledConnection; @@ -66,7 +67,7 @@ public class JDCPDSGetConnection Constructor. **/ public JDCPDSGetConnection (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSGetReference.java b/src/test/JD/CPDS/JDCPDSGetReference.java index a5a44dd..9e6ea5f 100644 --- a/src/test/JD/CPDS/JDCPDSGetReference.java +++ b/src/test/JD/CPDS/JDCPDSGetReference.java @@ -32,6 +32,7 @@ import javax.sql.DataSource; import java.util.Hashtable; +import java.util.Vector; /** @@ -58,7 +59,7 @@ public class JDCPDSGetReference Constructor. **/ public JDCPDSGetReference (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSMisc.java b/src/test/JD/CPDS/JDCPDSMisc.java index 6d216b2..1b6b6e1 100644 --- a/src/test/JD/CPDS/JDCPDSMisc.java +++ b/src/test/JD/CPDS/JDCPDSMisc.java @@ -28,6 +28,8 @@ import java.io.FileOutputStream; import java.util.Hashtable; +import java.util.Vector; + import javax.sql.*; @@ -53,7 +55,7 @@ public class JDCPDSMisc Constructor. **/ public JDCPDSMisc (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/CPDS/JDCPDSProperties.java b/src/test/JD/CPDS/JDCPDSProperties.java index 09e3894..45bc8ac 100644 --- a/src/test/JD/CPDS/JDCPDSProperties.java +++ b/src/test/JD/CPDS/JDCPDSProperties.java @@ -46,6 +46,7 @@ import javax.sql.DataSource; import java.util.Hashtable; +import java.util.Vector; import java.io.PrintWriter; @@ -113,7 +114,7 @@ public class JDCPDSProperties Constructor. **/ public JDCPDSProperties (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/Connection/JDConnectionWarnings.java b/src/test/JD/Connection/JDConnectionWarnings.java index ee15316..4f1da9b 100644 --- a/src/test/JD/Connection/JDConnectionWarnings.java +++ b/src/test/JD/Connection/JDConnectionWarnings.java @@ -37,6 +37,7 @@ import java.sql.Statement; import java.sql.ResultSet; import java.util.Hashtable; +import java.util.Vector; @@ -67,7 +68,7 @@ public class JDConnectionWarnings Constructor. **/ public JDConnectionWarnings (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/DS/JDDSGetConnection.java b/src/test/JD/DS/JDDSGetConnection.java index 698f61b..d11271e 100644 --- a/src/test/JD/DS/JDDSGetConnection.java +++ b/src/test/JD/DS/JDDSGetConnection.java @@ -33,6 +33,7 @@ import javax.sql.DataSource; import java.util.Hashtable; +import java.util.Vector; import java.sql.*; @@ -61,7 +62,7 @@ public class JDDSGetConnection Constructor. **/ public JDDSGetConnection (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/DS/JDDSGetReference.java b/src/test/JD/DS/JDDSGetReference.java index 09a116d..ccf9714 100644 --- a/src/test/JD/DS/JDDSGetReference.java +++ b/src/test/JD/DS/JDDSGetReference.java @@ -43,6 +43,7 @@ import javax.naming.*; import java.io.File; import java.util.Hashtable; +import java.util.Vector; import java.sql.*; import javax.naming.spi.ObjectFactory; @@ -71,7 +72,7 @@ public class JDDSGetReference Constructor. **/ public JDDSGetReference (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/DS/JDDSMisc.java b/src/test/JD/DS/JDDSMisc.java index 879943d..e18c447 100644 --- a/src/test/JD/DS/JDDSMisc.java +++ b/src/test/JD/DS/JDDSMisc.java @@ -29,6 +29,7 @@ import java.io.FileOutputStream; import java.util.Hashtable; +import java.util.Vector; import java.sql.*; @@ -54,7 +55,7 @@ public class JDDSMisc Constructor. **/ public JDDSMisc (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JD/DS/JDDSProperties.java b/src/test/JD/DS/JDDSProperties.java index ed756ca..10102ca 100644 --- a/src/test/JD/DS/JDDSProperties.java +++ b/src/test/JD/DS/JDDSProperties.java @@ -36,6 +36,7 @@ import javax.sql.DataSource; import java.util.Hashtable; +import java.util.Vector; import java.sql.*; import java.io.PrintWriter; import java.io.File; @@ -128,7 +129,7 @@ public class JDDSProperties Constructor. **/ public JDDSProperties (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JDASPTestcase.java b/src/test/JDASPTestcase.java index 6292a3a..c13745c 100644 --- a/src/test/JDASPTestcase.java +++ b/src/test/JDASPTestcase.java @@ -57,7 +57,7 @@ public class JDASPTestcase Constructor. **/ public JDASPTestcase (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JDBUTest.java b/src/test/JDBUTest.java index f85ba36..543a89b 100644 --- a/src/test/JDBUTest.java +++ b/src/test/JDBUTest.java @@ -41,7 +41,7 @@ public class JDBUTest /** * */ - private static final long serialVersionUID = 1L; + public static final long serialVersionUID = 1L; // Constants. public static String COLLECTION = "JDTESTBU"; diff --git a/src/test/JDCCoverage.java b/src/test/JDCCoverage.java index 0e9b7a0..b05779a 100644 --- a/src/test/JDCCoverage.java +++ b/src/test/JDCCoverage.java @@ -26,6 +26,7 @@ import java.sql.Connection; import java.util.Hashtable; import java.util.Properties; +import java.util.Vector; import com.ibm.as400.access.AS400; @@ -54,14 +55,14 @@ public class JDCCoverage extends JDJSTPTestcase { /** * Constructor. **/ - public JDCCoverage(AS400 systemObject, Hashtable namesAndVars, int runMode, + public JDCCoverage(AS400 systemObject, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String password) { super(systemObject, "JDCCoverage", namesAndVars, runMode, fileOutputStream, password); } public JDCCoverage(AS400 systemObject, String testcaseName, - Hashtable namesAndVars, int runMode, FileOutputStream fileOutputStream, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String password) { super(systemObject, testcaseName, namesAndVars, runMode, fileOutputStream, password); diff --git a/src/test/JDCSTest.java b/src/test/JDCSTest.java index 99d3d25..83c40ce 100644 --- a/src/test/JDCSTest.java +++ b/src/test/JDCSTest.java @@ -21,7 +21,6 @@ package test; -import java.awt.TextArea; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; @@ -333,7 +332,6 @@ public void createTestcases2 () } - TextArea output_1 = null ; addTestcase (new JDCSExecute (systemObject_, namesAndVars_, runMode_, fileOutputStream_, password_)); diff --git a/src/test/JDCTest.java b/src/test/JDCTest.java index 5a2251f..50930e4 100644 --- a/src/test/JDCTest.java +++ b/src/test/JDCTest.java @@ -23,8 +23,6 @@ import test.JD.JDSetupCollection; import java.sql.Connection; -import java.util.Enumeration; -import java.util.Vector; diff --git a/src/test/JDCleanCore.java b/src/test/JDCleanCore.java index fa2ab52..529ae03 100644 --- a/src/test/JDCleanCore.java +++ b/src/test/JDCleanCore.java @@ -16,17 +16,13 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.PrintStream; -import java.text.NumberFormat; import java.util.Enumeration; import java.util.Hashtable; import com.ibm.as400.access.AS400; import com.ibm.as400.access.AS400SecurityException; -import com.ibm.as400.access.CommandCall; import com.ibm.as400.access.IFSFile; import com.ibm.as400.access.IFSFileReader; -import com.ibm.as400.access.ObjectDescription; -import com.ibm.as400.access.ObjectList; @@ -68,9 +64,9 @@ public static void main(String args[]) { } } - public static Enumeration getJavacoreList(AS400 as400, String directory) throws IOException { + public static Enumeration getJavacoreList(AS400 as400, String directory) throws IOException { IFSFile file = new IFSFile(as400, directory); - Enumeration files = file.enumerateFiles("javacore.*"); + Enumeration files = file.enumerateFiles("javacore.*"); return files; } @@ -81,7 +77,7 @@ public static void clean(String system, String userid, String password, if (userid == null) { as400 = new AS400(system); } else { - as400 = new AS400(system, userid, password); + as400 = new AS400(system, userid, password.toCharArray()); } String directories[] = { "/", @@ -90,8 +86,8 @@ public static void clean(String system, String userid, String password, JTOpenTestEnvironment.testcaseHomeDirectory+"/ct", "/home/QWLISVR", "/home/jsonTest", "/home/jsontest/bin", "/home/QSRVAGT" }; for (int i = 0; i < directories.length; i++) { - Hashtable foundProblems = new Hashtable(); - Enumeration javacoreList = getJavacoreList(as400,directories[i]); + Hashtable foundProblems = new Hashtable(); + Enumeration javacoreList = getJavacoreList(as400,directories[i]); while (javacoreList.hasMoreElements()) { IFSFile javacorefile = (IFSFile) javacoreList.nextElement(); @@ -129,7 +125,7 @@ private static void cleanRelatedFiles(AS400 as400, IFSFile javacorefile) throws String pattern = "*"+filename.substring(firstDot, fourthDot+1)+"*"; IFSFile directoryFile = new IFSFile(as400, directory); - Enumeration files = directoryFile.enumerateFiles(pattern); + Enumeration files = directoryFile.enumerateFiles(pattern); while (files.hasMoreElements()) { IFSFile file = (IFSFile) files.nextElement(); file.delete(); diff --git a/src/test/JDCleanJrnRcv.java b/src/test/JDCleanJrnRcv.java index ad175f6..2a6c4ac 100644 --- a/src/test/JDCleanJrnRcv.java +++ b/src/test/JDCleanJrnRcv.java @@ -104,7 +104,7 @@ public static void clean(String system, String userid, char[] encryptedPassword, ObjectList jrnList = new ObjectList(as400, "*ALL", "Q*", "*JRN"); - Enumeration enumeration = jrnList.getObjects(); + Enumeration enumeration = jrnList.getObjects(); int totalDeletedCount = 0; long totalDeletedSize = 0L; int totalSkippedCount = 0; diff --git a/src/test/JDCleanSplf.java b/src/test/JDCleanSplf.java index a19a2fb..e274ef6 100644 --- a/src/test/JDCleanSplf.java +++ b/src/test/JDCleanSplf.java @@ -103,7 +103,7 @@ public static void main(String args[]) { } } - Hashtable deleteUserIds = new Hashtable(); + Hashtable deleteUserIds = new Hashtable(); deleteUserIds.put("BOSSJUDF", "BOSSJUDF"); deleteUserIds.put("JAVA", "JAVA"); deleteUserIds.put("JAVA290", "JAVA290"); @@ -217,7 +217,7 @@ public static String filterTimeToString(long filterTime) { } public static JDCleanSplfResults deleteSpoolFiles(PrintStream out, AS400 as400, String nestLevel, - long startFilterTime, long endFilterTime, boolean deleteAll, Hashtable deleteUserIds) throws Exception { + long startFilterTime, long endFilterTime, boolean deleteAll, Hashtable deleteUserIds) throws Exception { long startTime = System.currentTimeMillis(); String startDateFilter = getDateFilter(startFilterTime); @@ -401,7 +401,7 @@ public static String getTimeFilter(long filterTime) { } public static JDCleanSplfResults deleteSpoolFilesAttempt(PrintStream out, AS400 as400, String nestLevel, - long startFilterTime, long endFilterTime, boolean deleteAll, Hashtable deleteUserIds) throws Exception { + long startFilterTime, long endFilterTime, boolean deleteAll, Hashtable deleteUserIds) throws Exception { SpooledFileList spooledFileList = new SpooledFileList(as400); spooledFileList.setUserFilter("*ALL"); @@ -591,7 +591,7 @@ static void waitForComplete(PrintStream out, AS400 as400, String nestLevel, Spoo String nestLevel_ = ""; boolean deleteAll_ = false; boolean deleteUseless_ = false; - Hashtable deleteUserIds_ = null; + Hashtable deleteUserIds_ = null; long deleteCount_ = 0; long deleteBytes_ = 0; long keepCount_ = 0; @@ -601,7 +601,7 @@ static void waitForComplete(PrintStream out, AS400 as400, String nestLevel, Spoo AS400 as400_; private PrintStream out; - public JDCleanSplf(PrintStream out, AS400 as400, String nestLevel, boolean deleteAll, Hashtable deleteUserIds) { + public JDCleanSplf(PrintStream out, AS400 as400, String nestLevel, boolean deleteAll, Hashtable deleteUserIds) { this.as400_ = as400; this.nestLevel_ = nestLevel; this.deleteAll_ = deleteAll; @@ -625,7 +625,7 @@ public JDCleanSplf(PrintStream out, AS400 as400, String nestLevel) { deleteUseless_ = true; this.nestLevel_ = nestLevel; this.deleteAll_ = false; - deleteUserIds_ = new Hashtable(); + deleteUserIds_ = new Hashtable(); deleteCount_ = 0; deleteBytes_ = 0; keepCount_ = 0; diff --git a/src/test/JDCleanup.java b/src/test/JDCleanup.java index 1260ccd..7b1091e 100644 --- a/src/test/JDCleanup.java +++ b/src/test/JDCleanup.java @@ -33,6 +33,7 @@ import java.sql.Statement; import java.util.Calendar; import java.util.Hashtable; +import java.util.Vector; @@ -54,7 +55,7 @@ public class JDCleanup Constructor. **/ public JDCleanup (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JDDMDTest.java b/src/test/JDDMDTest.java index 678e305..ff5fe1f 100644 --- a/src/test/JDDMDTest.java +++ b/src/test/JDDMDTest.java @@ -11,12 +11,6 @@ // /////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////// -// -// -// -// -// //////////////////////////////////////////////////////////////////////// // // File Name: JDDMDTest.java @@ -24,9 +18,6 @@ // Classes: JDDMDTest // //////////////////////////////////////////////////////////////////////// -// -// -//////////////////////////////////////////////////////////////////////// package test; @@ -89,7 +80,7 @@ public class JDDMDTest /** * */ - private static final long serialVersionUID = 1L; + public static final long serialVersionUID = 1L; // Constants. public static String COLLECTION = "JDTSTDMD"; public static String COLLECTION2 = "JDTSTDMD2"; diff --git a/src/test/JDGroupTestInfo.java b/src/test/JDGroupTestInfo.java index ab880f0..944aa9a 100644 --- a/src/test/JDGroupTestInfo.java +++ b/src/test/JDGroupTestInfo.java @@ -57,15 +57,15 @@ public class JDGroupTestInfo { static int lastCount = 0; static long nextRunTime = 0L; - private static Hashtable groupTestSubsystemsHashtable = null; - private static Hashtable groupTestJobsHashtable = null; + private static Hashtable groupTestSubsystemsHashtable = null; + private static Hashtable groupTestJobsHashtable = null; private static boolean isGroupTestJob(String currentSubsystem, String jobName) { // // Setup if needed // if (groupTestSubsystemsHashtable == null) { - groupTestSubsystemsHashtable = new Hashtable(); + groupTestSubsystemsHashtable = new Hashtable(); for (int i = 0; i < groupTestSubsystems.length; i++) { String key = groupTestSubsystems[i]; String value = key; @@ -74,7 +74,7 @@ private static boolean isGroupTestJob(String currentSubsystem, String jobName) { } if (groupTestJobsHashtable == null) { - groupTestJobsHashtable = new Hashtable(); + groupTestJobsHashtable = new Hashtable(); for (int i = 0; i < groupTestJobs.length; i++) { String key = groupTestJobs[i]; String value = key; diff --git a/src/test/JDHandleDump.java b/src/test/JDHandleDump.java index 35ea423..2e6551c 100644 --- a/src/test/JDHandleDump.java +++ b/src/test/JDHandleDump.java @@ -11,7 +11,6 @@ // /////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // // File Name: JDHandleDump.java @@ -19,10 +18,6 @@ // Classes: JDHandleDump // //////////////////////////////////////////////////////////////////////// -// -// -// -//////////////////////////////////////////////////////////////////////// package test; @@ -91,7 +86,7 @@ public boolean isConnectionHandleUsed(int connectionHandle) { } public void dumpConnectionHandles(StringBuffer sb) { - Enumeration enumeration = handleDumpAnalyzer.connectionsHashtable.elements(); + Enumeration enumeration = handleDumpAnalyzer.connectionsHashtable.elements(); while (enumeration.hasMoreElements()) { sb.append(enumeration.nextElement()); sb.append("\n"); diff --git a/src/test/JDHandleDumpAnalyzer.java b/src/test/JDHandleDumpAnalyzer.java index 180e659..93912e8 100644 --- a/src/test/JDHandleDumpAnalyzer.java +++ b/src/test/JDHandleDumpAnalyzer.java @@ -26,15 +26,15 @@ public class JDHandleDumpAnalyzer { // Analysis variables public int lastAllocatedHandles = 0; - public Hashtable connectionsHashtable = new Hashtable(); + public Hashtable connectionsHashtable = new Hashtable(); public Hashtable connectionToStatementVectorHashtable = new Hashtable(); public Hashtable connectionToReusableVectorHashtable = new Hashtable(); public Hashtable connectionToDescriptorVectorHashtable = new Hashtable(); - public Hashtable statementsHashtable = new Hashtable(); - public Hashtable reusableHashtable = new Hashtable(); - public Hashtable descriptorsHashtable = new Hashtable(); - public Hashtable descriptorToStatementHashtable = new Hashtable(); - public Hashtable descriptorToReusableHashtable = new Hashtable(); + public Hashtable statementsHashtable = new Hashtable(); + public Hashtable reusableHashtable = new Hashtable(); + public Hashtable descriptorsHashtable = new Hashtable(); + public Hashtable descriptorToStatementHashtable = new Hashtable(); + public Hashtable descriptorToReusableHashtable = new Hashtable(); public int maxConnection = 0; public int minConnection = 200000; @@ -547,7 +547,7 @@ public void processDump(PrintStream out) throws SQLException { if (out != null) out .println("CONNECTION | STMTCOUNT | REUSEABLECCOUNT | DESCRIPTOR COUNT | ESTIMATED DESCRIPTOR COUNT"); - Enumeration enumeration = connectionsHashtable.keys(); + Enumeration enumeration = connectionsHashtable.keys(); while (enumeration.hasMoreElements()) { String connectionString = (String) enumeration.nextElement(); int connectionStatementCount; diff --git a/src/test/JDHostName.java b/src/test/JDHostName.java index 852266f..fe76a15 100644 --- a/src/test/JDHostName.java +++ b/src/test/JDHostName.java @@ -74,8 +74,8 @@ public static String getHostName() { /* Return the known aliases for the current host name*/ public static String[] getAliases(String hostname) { initializeProperties(); - Vector aliases = new Vector(); - Enumeration keys = renameProperties.keys(); + Vector aliases = new Vector(); + Enumeration keys = renameProperties.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); String value = renameProperties.getProperty(key); diff --git a/src/test/JDJSTPTestcase.java b/src/test/JDJSTPTestcase.java index d3939e2..1b5a090 100644 --- a/src/test/JDJSTPTestcase.java +++ b/src/test/JDJSTPTestcase.java @@ -56,6 +56,7 @@ To do this, they must be able to load code on the server. This superclass contains static functions that permit this to be done. **/ +@SuppressWarnings("deprecation") public class JDJSTPTestcase extends JDTestcase { @@ -110,7 +111,7 @@ public class JDJSTPTestcase **/ public JDJSTPTestcase (AS400 systemObject, String testcaseName, - Hashtable namesAndVars, + Hashtable >namesAndVars, int runMode, FileOutputStream fileOutputStream, @@ -799,7 +800,6 @@ public static String getInheritedJavaOptions() { // check out the sun.boot.class.path. Only add if contains a // /home/ directory // - String javaVmName = System.getProperty("java.vm.name"); String value = System.getProperty("sun.boot.class.path"); if (value != null) { @@ -2268,7 +2268,7 @@ public static JDJSTPOutputThread startProcessOutput(Process p, boolean toStdout, String[] hangMessages, String[] hangMessagesException, - Vector hangMessagesFound, + Vector hangMessagesFound, int encoding) throws Exception { if (debug) { System.out.println("JDJSTPTestcase.startProcessOutput"); @@ -5059,7 +5059,6 @@ public static String getExpectedOutputFile( String expectedOutput; File checkFile; - String javaVmName = System.getProperty("java.vm.name"); String variationString="."+inVariation; if (inVariation.length() == 0) variationString = ""; @@ -5177,8 +5176,6 @@ public static void RunOnServer(String testPgm, String variation) throws Exceptio getFileFromServer(output); } else if (testext.equals("sh")) { command = "rm "+output+"; touch -C 819 "+output+"; cd "+nativeBaseDir+"/"+sourcepath+"; ./"+ testPgm+" "+variation +" > "+output +" 2>&1"; - if (false) - command = "rm "+output+"; touch -C 819 "+output+"; cd "+nativeBaseDir+"/"+sourcepath+"; ./"+ testPgm+" "+variation +" | tee "+output +" > "+output+".2 2>&1"; File f1 = new File(output); if (f1.exists()) f1.delete(); @@ -6084,14 +6081,14 @@ public static void RasUser(String testpgm, String userId, char[] encryptedPasswo } - static Hashtable jdbcReplaceHashtable = new Hashtable(); + static Hashtable jdbcReplaceHashtable = new Hashtable(); static void setJdbcReplace(String from, String to) { jdbcReplaceHashtable.put(from, to); } static String jdbcReplace(String line) { - Enumeration keys = jdbcReplaceHashtable.keys(); + Enumeration keys = jdbcReplaceHashtable.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); String value = (String) jdbcReplaceHashtable.get(key); @@ -6100,7 +6097,7 @@ static String jdbcReplace(String line) { return line; } - private static void runJdbcClient(String command, String output, + private static void runJdbcClient(String command, String output, String userId, char[] encryptedPassword) throws SQLException, IOException { InputStream in; PrintStream out; diff --git a/src/test/JDLobTest.java b/src/test/JDLobTest.java index 41e8d92..053884d 100644 --- a/src/test/JDLobTest.java +++ b/src/test/JDLobTest.java @@ -64,7 +64,7 @@ public class JDLobTest /** * */ - private static final long serialVersionUID = 1L; + public static final long serialVersionUID = 1L; // Constants. public static String COLLECTION = "JDTESTLOB"; diff --git a/src/test/JDPSTest.java b/src/test/JDPSTest.java index a6a5f02..b03d5b5 100644 --- a/src/test/JDPSTest.java +++ b/src/test/JDPSTest.java @@ -124,7 +124,7 @@ public class JDPSTest extends JDTestDriver { private Connection[] handleConnections; - private Vector handles = null; + private Vector handles = null; @@ -211,7 +211,7 @@ public void setup() throws Exception { handleConnections[i] = getConnection(getBaseURL(), systemObject_ .getUserId(), encryptedPassword_); } - handles = new Vector(); + handles = new Vector(); int currentHandle = 0; long nextPrint = 0; diff --git a/src/test/JDParmTest.java b/src/test/JDParmTest.java index 14c9583..aac727e 100644 --- a/src/test/JDParmTest.java +++ b/src/test/JDParmTest.java @@ -11,12 +11,6 @@ // /////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////// -// -// -// -// -// //////////////////////////////////////////////////////////////////////// // // File Name: JDParmTest.java @@ -24,11 +18,6 @@ // Classes: JDParmTest // //////////////////////////////////////////////////////////////////////// -// -// -// -// -//////////////////////////////////////////////////////////////////////// package test; @@ -68,7 +57,7 @@ public class JDParmTest /** * */ - private static final long serialVersionUID = 1L; + public static final long serialVersionUID = 1L; // Constants. public static String COLLECTION = "JDTESTPA"; diff --git a/src/test/JDPerformanceUtil.java b/src/test/JDPerformanceUtil.java index 4e0e47a..690b56f 100644 --- a/src/test/JDPerformanceUtil.java +++ b/src/test/JDPerformanceUtil.java @@ -607,7 +607,7 @@ public static void showResults(ResultSet rs) throws Exception { for (int i = 1; i <= columnCount; i++) { columnHeader[i] = rsmd.getColumnName(i); columnWidth[i]=columnHeader[i].length(); - columnContents[i] = new Vector(); + columnContents[i] = new Vector<>(); } while (rs.next()) { diff --git a/src/test/JDReflectionUtil.java b/src/test/JDReflectionUtil.java index 519dee5..dc65447 100644 --- a/src/test/JDReflectionUtil.java +++ b/src/test/JDReflectionUtil.java @@ -14,15 +14,11 @@ package test; import java.io.InputStream; -import java.io.PrintStream; import java.io.Reader; import java.lang.reflect.*; -import java.sql.Connection; import java.util.ArrayList; import java.util.Hashtable; -import com.ibm.as400.access.AS400; -import com.ibm.as400.access.AS400JDBCDataSource; import java.util.Enumeration; diff --git a/src/test/JDRegressionTestcase.java b/src/test/JDRegressionTestcase.java index 87cf9f9..ecf60c6 100644 --- a/src/test/JDRegressionTestcase.java +++ b/src/test/JDRegressionTestcase.java @@ -13,14 +13,11 @@ package test; -import java.io.OutputStream; import java.io.FileOutputStream; -import java.io.IOException; import java.util.Hashtable; import java.util.Vector; import com.ibm.as400.access.*; -import java.sql.*; public class JDRegressionTestcase extends Testcase @@ -35,7 +32,7 @@ public class JDRegressionTestcase extends Testcase Constructor. **/ public JDRegressionTestcase(AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, @@ -45,7 +42,7 @@ public JDRegressionTestcase(AS400 systemObject, String pwrPwd) //@A1A { super (systemObject, "JDRegressionTestcase", - (Vector) namesAndVars.get ("JDRegressionTestcase"), + namesAndVars.get ("JDRegressionTestcase"), runMode, fileOutputStream, password); diff --git a/src/test/JDReport.java b/src/test/JDReport.java index a5e6512..fbc13c1 100644 --- a/src/test/JDReport.java +++ b/src/test/JDReport.java @@ -42,7 +42,6 @@ import java.io.OutputStream; import java.io.PrintStream; import java.io.PrintWriter; -import java.net.InetAddress; import java.lang.reflect.Constructor; import java.sql.*; import java.util.Date; diff --git a/src/test/JDRunit.java b/src/test/JDRunit.java index 52f0ad1..dadc7a8 100644 --- a/src/test/JDRunit.java +++ b/src/test/JDRunit.java @@ -64,7 +64,6 @@ import java.util.TimeZone; import java.util.Vector; -import com.ibm.as400.access.AS400JDBCDriver; import test.JD.DataSource.JDDatabaseOverride; import test.JTA.JTACleanupTx; @@ -76,8 +75,8 @@ public class JDRunit { public static final String TMP = "/tmp"; public static String testcaseCode = JTOpenTestEnvironment.testcaseHomeDirectory; - static Hashtable rdbToCreatedUserid = new Hashtable(); - static Hashtable rdbToCreatedPassword = new Hashtable(); + static Hashtable rdbToCreatedUserid = new Hashtable(); + static Hashtable rdbToCreatedPassword = new Hashtable(); static boolean debug = false; static boolean passwordDebug = false; static ServerSocket socket; @@ -510,7 +509,7 @@ public static void rerunFailed(String initials, boolean report) StringBuffer rerunCommands = new StringBuffer(); String htmlFile = JDReport.getReportName(initials); - Hashtable addedTestcaseHashtable = new Hashtable(); + Hashtable addedTestcaseHashtable = new Hashtable(); BufferedReader reader = new BufferedReader(new FileReader(htmlFile)); String line = reader.readLine(); @@ -613,9 +612,9 @@ public static void email(String initials, String toAddress) throws Exception { StringBuffer body = new StringBuffer(); String htmlFile = JDReport.getReportName(initials); - Vector regressedTestcases = new Vector(); - Vector notattTestcases = new Vector(); - Vector failedTestcases = new Vector(); + Vector regressedTestcases = new Vector(); + Vector notattTestcases = new Vector(); + Vector failedTestcases = new Vector(); // Process the report BufferedReader reader = new BufferedReader(new FileReader(htmlFile)); @@ -788,7 +787,7 @@ public static void email(String initials, String toAddress) throws Exception { + "cgi-pase/JDReport.acgi?INITIALS=" + initials + "&DAYS=14\n"); if (regressionCount > 0 && regressionCount < 10) { body.append("\n-------------REGRESSION DETAILS-------------\n"); - Enumeration enumeration = regressedTestcases.elements(); + Enumeration enumeration = regressedTestcases.elements(); while (enumeration.hasMoreElements()) { body.append(enumeration.nextElement() + "\n"); } @@ -803,7 +802,7 @@ public static void email(String initials, String toAddress) throws Exception { if (notattCount > 0) { body.append("\nNOTATT DETAILS\n"); - Enumeration enumeration = notattTestcases.elements(); + Enumeration enumeration = notattTestcases.elements(); while (enumeration.hasMoreElements()) { body.append(enumeration.nextElement() + "\n"); } @@ -1112,7 +1111,7 @@ public static String[] getInitialsList(String initials) { prefixCheck = initials.substring(0, starIndex); suffixCheck = initials.substring(starIndex + 1); } - Vector initialsVector = new Vector(); + Vector initialsVector = new Vector(); File outDirectory = new File("ct"); @@ -1153,7 +1152,7 @@ public static String[] getInitialsList(String initials) { } returnString = new String[returnSize]; for (int i = 0; i < returnSize; i++) { - returnString[i] = (String) initialsVector.elementAt(i); + returnString[i] = initialsVector.elementAt(i); } } @@ -1683,7 +1682,7 @@ public static Properties getIniProperties(String initials, StringBuffer iniInfo) } public static String createProfile(String SYSTEM, String newUserid, - String newPassword, String userid, char[] encryptedPassword, Vector inputVector) { + String newPassword, String userid, char[] encryptedPassword, Vector inputVector) { if (newPassword == null) newPassword = "abc212cb"; String sql = "notSet"; @@ -2051,7 +2050,7 @@ public void readIni(StringBuffer iniInfo) throws Exception { // Determine if inherited properties need to be set // Properties systemProperties = System.getProperties(); - Enumeration keys = systemProperties.keys(); + Enumeration keys = systemProperties.keys(); while (keys.hasMoreElements()) { String property = (String) keys.nextElement(); for (int i = 0; i < inheritedProperties.length; i++) { @@ -2516,7 +2515,7 @@ public int go() throws Exception { /* Check to see if profile created */ - String createdUserid = (String) rdbToCreatedUserid.get(SYSTEM); + String createdUserid = rdbToCreatedUserid.get(SYSTEM); if (createdUserid == null || !createdUserid.equals(newUserid)) { /* create the profile for the test on the system */ @@ -2533,7 +2532,7 @@ public int go() throws Exception { } else { /* Use what was already set up */ testUserid = newUserid; - testPassword = (String) rdbToCreatedPassword.get(SYSTEM); + testPassword = rdbToCreatedPassword.get(SYSTEM); encryptedTestPassword = PasswordVault.getEncryptedPassword(testPassword); } @@ -2668,9 +2667,9 @@ public int go() throws Exception { inputVector.addElement("echo exit"); inputVector.addElement("exit"); - Enumeration enumeration = inputVector.elements(); + Enumeration enumeration = inputVector.elements(); while (enumeration.hasMoreElements()) { - String line = (String) enumeration.nextElement(); + String line = enumeration.nextElement(); writer.println(line); } @@ -2686,13 +2685,11 @@ public int go() throws Exception { /* Run the script in a shell process */ String[] cmdArray1; - String shellCommand; String shellArgs = iniProperties.getProperty("shellArgs"); if (shellArgs == null) { cmdArray1 = new String[1]; cmdArray1[0] = shellBinary; System.out.println("Shell binary1 is " + shellBinary); - shellCommand = cmdArray1[0]; /* Fix the command line if running on windows in */ if (debug) System.out.println("JDRunit: osVersion=" + JTOpenTestEnvironment.osVersion); @@ -2718,7 +2715,6 @@ public int go() throws Exception { cmdArray1 = new String[2]; cmdArray1[0] = shellBinary; System.out.println("Shell binary2 is " + shellBinary); - shellCommand = cmdArray1[0]; cmdArray1[1] = shellArgs; if (debug) System.out.println("JDRunit: Shell command (with args) is: " @@ -2770,7 +2766,7 @@ public int go() throws Exception { JDJSTPTestcase.debug = true; /* Assynchronously start the process output threads */ - Vector hangMessagesFound = new Vector(); + Vector hangMessagesFound = new Vector(); JDJSTPOutputThread stdoutThread = JDJSTPTestcase.startProcessOutput( shellTestProcess, runitOutputFile, true, hangMessages, hangMessagesException, @@ -3082,7 +3078,7 @@ public int go() throws Exception { shellProcessOutputStream.write(outString.getBytes()); shellProcessOutputStream.flush(); String shellOutputFile = runitOutputFile + ".shell"; - Vector shellHangMessagesFound = new Vector(); + Vector shellHangMessagesFound = new Vector(); JDJSTPOutputThread stdoutThread2 = JDJSTPTestcase .startProcessOutput(shellProcess, shellOutputFile, true, hangMessages, hangMessagesException, shellHangMessagesFound, encoding); @@ -3210,7 +3206,7 @@ public int go() throws Exception { enumeration = inputVector.elements(); while (enumeration.hasMoreElements()) { - String line = (String) enumeration.nextElement(); + String line = enumeration.nextElement(); writer.println(line); } @@ -3220,10 +3216,10 @@ public int go() throws Exception { * Build the results as the test is running so less post processing needs to * be done */ - Vector testcasesVector = new Vector(); - Vector failedVector = new Vector(); - Vector rxpVector = new Vector(); - Hashtable rerunHashtable = new Hashtable(); + Vector testcasesVector = new Vector(); + Vector failedVector = new Vector(); + Vector rxpVector = new Vector(); + Hashtable> rerunHashtable = new Hashtable>(); int resultsWritten = 0; boolean noOutput = true; int successfulCount = 0; @@ -3275,9 +3271,9 @@ public int go() throws Exception { String testcase = line.substring(0, spaceIndex).trim(); String variation = line.substring(spaceIndex + 1, failedIndex).trim(); - Vector variationsVector = (Vector) rerunHashtable.get(testcase); + Vector variationsVector = rerunHashtable.get(testcase); if (variationsVector == null) { - variationsVector = new Vector(); + variationsVector = new Vector(); rerunHashtable.put(testcase, variationsVector); } variationsVector.addElement(variation); @@ -3297,9 +3293,9 @@ public int go() throws Exception { String testcase = line.substring(0, spaceIndex).trim(); String variation = line.substring(spaceIndex + 1, failedIndex).trim(); - Vector variationsVector = (Vector) rerunHashtable.get(testcase); + Vector variationsVector = rerunHashtable.get(testcase); if (variationsVector == null) { - variationsVector = new Vector(); + variationsVector = new Vector(); rerunHashtable.put(testcase, variationsVector); } variationsVector.addElement(variation); @@ -3358,7 +3354,7 @@ public int go() throws Exception { + fatalErrorString); System.out.println("JDRunit: ERROR: fatal error Message=" + fatalErrorMessage); - Vector badTestVector = new Vector(); + Vector badTestVector = new Vector(); String testBase1 = testBaseProperties.getProperty(test); if (!testBase1.equals(test)) { badTestVector.add(test); @@ -3384,10 +3380,10 @@ public int go() throws Exception { // Add bad results records // - Hashtable todoTests = readTodo(); + Hashtable todoTests = readTodo(); enumeration = badTestVector.elements(); while (enumeration.hasMoreElements()) { - String testcase = (String) enumeration.nextElement(); + String testcase = enumeration.nextElement(); if (todoTests.get(testcase) == null) { resultsWriter.println(dateString + " " + AS400lc + " " + testcase + " 0 1 0 1 66.666"); @@ -3406,7 +3402,7 @@ public int go() throws Exception { failedCount += failedVector.size(); enumeration = failedVector.elements(); while (enumeration.hasMoreElements()) { - String failedTest = (String) enumeration.nextElement(); + String failedTest = enumeration.nextElement(); System.out.println(failedTest); } System.out.println("------------------"); @@ -3421,10 +3417,10 @@ public int go() throws Exception { enumeration = rerunHashtable.keys(); int commandCount = 0; while (enumeration.hasMoreElements()) { - String testcase = (String) enumeration.nextElement(); + String testcase = enumeration.nextElement(); String rerunCommand = "java test.JDRunit " + initials + " " + testcase + " "; - Vector variationsVector = (Vector) rerunHashtable.get(testcase); + Vector variationsVector = rerunHashtable.get(testcase); Enumeration varEnum = variationsVector.elements(); boolean first = true; while (varEnum.hasMoreElements()) { @@ -3458,7 +3454,7 @@ public int go() throws Exception { System.out.println("JDRunit: Dumping the output files that failed"); enumeration = rxpVector.elements(); while (enumeration.hasMoreElements()) { - String rxpFile = (String) enumeration.nextElement(); + String rxpFile = enumeration.nextElement(); System.out.println("Processing file " + rxpFile); } @@ -3500,8 +3496,8 @@ public static long nextRunNumber() { } } - public static Hashtable readTodo() { - Hashtable returnHashtable = new Hashtable(); + public static Hashtable readTodo() { + Hashtable returnHashtable = new Hashtable(); try { File todoFile = new File("ini/TODO.ini"); diff --git a/src/test/JDSavepointsTestcase.java b/src/test/JDSavepointsTestcase.java index e3b20db..3bbab6c 100644 --- a/src/test/JDSavepointsTestcase.java +++ b/src/test/JDSavepointsTestcase.java @@ -52,7 +52,7 @@ public class JDSavepointsTestcase Constructor. **/ public JDSavepointsTestcase (AS400 systemObject, - Hashtable namesAndVars, + Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JDScalarFunctions.java b/src/test/JDScalarFunctions.java index aa75e3d..7c1f065 100644 --- a/src/test/JDScalarFunctions.java +++ b/src/test/JDScalarFunctions.java @@ -25,13 +25,11 @@ import java.io.FileOutputStream; import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.DriverManager; -import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Hashtable; +import java.util.Vector; /** @@ -64,7 +62,7 @@ public class JDScalarFunctions extends JDTestcase { Constructor. **/ public JDScalarFunctions(AS400 systemObject, - Hashtable namesAndVars, + Hashtable >namesAndVars, int runMode, FileOutputStream fileOutputStream, diff --git a/src/test/JDSetupProcedure.java b/src/test/JDSetupProcedure.java index 5f554e8..9b2521f 100644 --- a/src/test/JDSetupProcedure.java +++ b/src/test/JDSetupProcedure.java @@ -144,7 +144,7 @@ public class JDSetupProcedure { public static String STP_CSARRXML = COLLECTION + ".JDCSARRXML"; // array of // xml - public static Hashtable procedureDefinitions = new Hashtable(); + public static Hashtable procedureDefinitions = new Hashtable(); public static String getProcedureDefinition(String stp) { String def = (String) procedureDefinitions.get(stp); @@ -2338,7 +2338,7 @@ public static void setTypesParametersButForOne(CallableStatement cs, String stp, if (except != 15) cs.setObject(15, Date.valueOf("1980-06-25")); if (except != 16) - cs.setObject(16, new Time(14, 11, 19)); + cs.setObject(16, Time.valueOf("14:11:19")); if (except != 17) cs.setObject(17, new Timestamp(32343)); if (supportedFeatures.lobSupport) { @@ -2468,7 +2468,7 @@ public static void setTypesParametersForOne(CallableStatement cs, String stp, return; } if (accept == 16) { - cs.setObject(16, new Time(14, 11, 20)); + cs.setObject(16, Time.valueOf("14:11:20")); return; } if (accept == 17) { diff --git a/src/test/JDStatementTest.java b/src/test/JDStatementTest.java index 8545fd2..4a123c7 100644 --- a/src/test/JDStatementTest.java +++ b/src/test/JDStatementTest.java @@ -69,7 +69,7 @@ public class JDStatementTest /** * */ - private static final long serialVersionUID = 1L; + public static final long serialVersionUID = 1L; // Private data. public static String COLLECTION = "JDTESTSTMT"; diff --git a/src/test/JDTestDriver.java b/src/test/JDTestDriver.java index 611b5cb..73ae6a5 100644 --- a/src/test/JDTestDriver.java +++ b/src/test/JDTestDriver.java @@ -82,7 +82,7 @@ public abstract class JDTestDriver extends TestDriver { public static final int DB_LUW = 1; public static final int DB_ZOS = 2; - // This field and contants can be used to verify which release + // This field and constants can be used to verify which release // is being tested. public static final int RELEASE_NONE = 0; public static final int RELEASE_V7R1M0 = 710; @@ -90,7 +90,7 @@ public abstract class JDTestDriver extends TestDriver { public static final int RELEASE_V7R3M0 = 730; public static final int RELEASE_V7R4M0 = 740; public static final int RELEASE_V7R5M0 = 750; - public static final int RELEASE_V7R5M0_PLUS = 999; + public static final int RELEASE_V7R5M0_PLUS = 888; public static final String CLIENT_windows = "windows"; public static final String CLIENT_as400 = "as400"; @@ -570,6 +570,9 @@ public int getDatabaseType() { * @return The AS/400 release. **/ public int getRelease() { + if (!driverSetupDone) { + driverSetup(); + } return release_; } @@ -659,6 +662,8 @@ else if (token.equalsIgnoreCase("nativeRMI")) registerDriver(DRIVER_CLASS_NATIVE_RMI, DRIVER_NATIVE_RMI); // Was a release specified? + else if (token.equalsIgnoreCase("V7R1M0")) + release_ = RELEASE_V7R1M0; else if (token.equalsIgnoreCase("V7R2M0")) release_ = RELEASE_V7R2M0; else if (token.equalsIgnoreCase("V7R3M0")) @@ -667,7 +672,7 @@ else if (token.equalsIgnoreCase("V7R4M0")) release_ = RELEASE_V7R4M0; else if (token.equalsIgnoreCase("V7R5M0")) release_ = RELEASE_V7R5M0; - else if (token.indexOf("V7R") >= 0 ) + else if (token.toUpperCase().indexOf("V7R") >= 0 ) release_ = RELEASE_V7R5M0_PLUS; // Was "secondary URL mode" specified? diff --git a/src/test/JDTestDriver_NativeDriverMethods.java b/src/test/JDTestDriver_NativeDriverMethods.java index 3064666..cf87919 100644 --- a/src/test/JDTestDriver_NativeDriverMethods.java +++ b/src/test/JDTestDriver_NativeDriverMethods.java @@ -14,7 +14,6 @@ package test; import java.sql.Connection; -import java.sql.SQLException; import java.util.Enumeration; import java.util.Properties; import java.util.StringTokenizer; @@ -168,7 +167,7 @@ public Connection getConnection (String url, Properties info, int driver, int co // property is specified in both the url and the Properties, // the one in url should be used. - Enumeration e = info.propertyNames(); + Enumeration e = info.propertyNames(); while (e.hasMoreElements()) { String field = (String)e.nextElement(); @@ -220,7 +219,7 @@ else if (connType_ == Testcase.CONN_XA) { // property is specified in both the url and the Properties, // the one in url should be used. - Enumeration e = info.propertyNames(); + Enumeration e = info.propertyNames(); while (e.hasMoreElements()) { String field = (String)e.nextElement(); diff --git a/src/test/JDTestcase.java b/src/test/JDTestcase.java index 9eb0f12..d1a9b7d 100644 --- a/src/test/JDTestcase.java +++ b/src/test/JDTestcase.java @@ -161,9 +161,9 @@ public class JDTestcase extends Testcase { * Constructor. **/ - public JDTestcase(AS400 systemObject, String testcaseName, Hashtable namesAndVars, int runMode, + public JDTestcase(AS400 systemObject, String testcaseName, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String password) { - super(systemObject, testcaseName, -1, (Vector) namesAndVars.get(testcaseName), runMode, fileOutputStream, password); + super(systemObject, testcaseName, -1, namesAndVars.get(testcaseName), runMode, fileOutputStream, password); initializeFields(testcaseName); @@ -172,9 +172,9 @@ public JDTestcase(AS400 systemObject, String testcaseName, Hashtable namesAndVar /** * Constructor. **/ - public JDTestcase(AS400 systemObject, String testcaseName, Hashtable namesAndVars, int runMode, + public JDTestcase(AS400 systemObject, String testcaseName, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String password, String pwrSysUid, String pwrSysPwd) { - super(systemObject, testcaseName, -1, (Vector) namesAndVars.get(testcaseName), runMode, fileOutputStream, password, + super(systemObject, testcaseName, -1, namesAndVars.get(testcaseName), runMode, fileOutputStream, password, pwrSysUid, pwrSysPwd); initializeFields(testcaseName); @@ -1887,7 +1887,7 @@ public boolean checkVariationApplies() { } else { try { - Class skipClass = Class.forName("test.JDVariationSkip2"); + Class.forName("test.JDVariationSkip2"); } catch (Exception e) { // If class does not exist then return true return true; @@ -1935,7 +1935,7 @@ public Object createExecutor(String executorClassname, StringBuffer sb) throws E // TimeUnit unit, // BlockingQueue workQueue) - Class[] argTypes = new Class[5]; + Class[] argTypes = new Class[5]; argTypes[0] = Integer.TYPE; argTypes[1] = Integer.TYPE; argTypes[2] = Long.TYPE; @@ -1955,7 +1955,7 @@ public Object createExecutor(String executorClassname, StringBuffer sb) throws E // ScheduledThreadPoolExecutor(int corePoolSize) - Class[] argTypes = new Class[1]; + Class[] argTypes = new Class[1]; argTypes[0] = Integer.TYPE; Object[] args = new Object[1]; args[0] = new Integer(5); diff --git a/src/test/MiscAH/AS400CertificateUsrPrfBeans.java b/src/test/MiscAH/AS400CertificateUsrPrfBeans.java index df56cca..fccb7ad 100644 --- a/src/test/MiscAH/AS400CertificateUsrPrfBeans.java +++ b/src/test/MiscAH/AS400CertificateUsrPrfBeans.java @@ -1499,7 +1499,7 @@ public void Var012() AS400 as400 = new AS400(); AS400CertificateUserProfileUtil aAS400CertificateUserProfileUtil = new AS400CertificateUserProfileUtil(as400, goodUsrPrfName); resetValues(); - AS400 oldAS400 = new AS400("rchasxxx", "JAVA", "JTEAM1"); + AS400 oldAS400 = new AS400("rchasxxx", "JAVA", "JTEAM1".toCharArray()); aAS400CertificateUserProfileUtil.setSystem(oldAS400); aAS400CertificateUserProfileUtil.addPropertyChangeListener(this); AS400 newAS400 = systemObject_; @@ -1561,7 +1561,7 @@ public void Var014() AS400 as400 = new AS400(); AS400CertificateUserProfileUtil aAS400CertificateUserProfileUtil = new AS400CertificateUserProfileUtil(as400, goodUsrPrfName); resetValues(); - AS400 oldAS400 = new AS400("rchasxxx", "JAVA", "JTEAM1"); + AS400 oldAS400 = new AS400("rchasxxx", "JAVA", "JTEAM1".toCharArray()); aAS400CertificateUserProfileUtil.setSystem(oldAS400); aAS400CertificateUserProfileUtil.addVetoableChangeListener(this); AS400 newAS400 = systemObject_; @@ -1633,7 +1633,7 @@ public void Var016() AS400 as400 = new AS400(); AS400CertificateUserProfileUtil aAS400CertificateUserProfileUtil = new AS400CertificateUserProfileUtil(as400, goodUsrPrfName); resetValues(); - AS400 oldAS400 = new AS400("rchasxxx", "JAVA", "JTEAM1"); + AS400 oldAS400 = new AS400("rchasxxx", "JAVA", "JTEAM1".toCharArray()); aAS400CertificateUserProfileUtil.setSystem(oldAS400); veto_ = true; aAS400CertificateUserProfileUtil.addVetoableChangeListener(this); @@ -1669,7 +1669,7 @@ public void Var017() try { - AS400 badSystem = new AS400("rchasxxx", "JAVA", "JTEAM1"); + AS400 badSystem = new AS400("rchasxxx", "JAVA", "JTEAM1".toCharArray()); AS400CertificateUserProfileUtil aAS400CertificateUserProfileUtil = new AS400CertificateUserProfileUtil(badSystem, goodUsrPrfName); String newUSName = "/QSYS.LIB/CERTTEST1.USRPRF"; aAS400CertificateUserProfileUtil.setPath(newUSName); diff --git a/src/test/Testcase.java b/src/test/Testcase.java index 8952c0a..4bd3713 100644 --- a/src/test/Testcase.java +++ b/src/test/Testcase.java @@ -121,7 +121,7 @@ public abstract class Testcase { // the current user id protected String pwrSysUserID_ = null; protected char[] pwrSysEncryptedPassword_ = null; - protected Vector variationsToRun_ = null; + protected Vector variationsToRun_ = null; protected boolean mustUseSockets_ = false; protected boolean isNative_ = false; protected boolean isLocal_ = false; @@ -226,9 +226,9 @@ protected Testcase() { * @param fileOutputStream * The output stream to which to write the results. **/ - protected Testcase(AS400 system, String name, Hashtable namesAndVars, + protected Testcase(AS400 system, String name, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream) { - this(system, name, (Vector) namesAndVars.get(name), runMode, + this(system, name, namesAndVars.get(name), runMode, fileOutputStream); } @@ -248,10 +248,10 @@ protected Testcase(AS400 system, String name, Hashtable namesAndVars, * @param password * The user profile password. **/ - protected Testcase(AS400 system, String name, Hashtable namesAndVars, + protected Testcase(AS400 system, String name, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String password) { - this(system, name, (Vector) namesAndVars.get(name), runMode, + this(system, name, namesAndVars.get(name), runMode, fileOutputStream, password); } @@ -275,10 +275,10 @@ protected Testcase(AS400 system, String name, Hashtable namesAndVars, * @param pwrSysPwd * The power user password. **/ - public Testcase(AS400 system, String name, Hashtable namesAndVars, + public Testcase(AS400 system, String name, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String password, AS400 pwrSys, String pwrSysPwd) { - this(system, name, (Vector) namesAndVars.get(name), runMode, + this(system, name, namesAndVars.get(name), runMode, fileOutputStream, password); pwrSysEncryptedPassword_ = PasswordVault.getEncryptedPassword(pwrSysPwd); pwrSys_ = pwrSys; @@ -306,10 +306,10 @@ public Testcase(AS400 system, String name, Hashtable namesAndVars, * @param pwrSys * The iSeries server, accessed through a SECADM user profile. **/ - protected Testcase(AS400 system, String name, Hashtable namesAndVars, + protected Testcase(AS400 system, String name, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, AS400 pwrSys) { - this(system, name, (Vector) namesAndVars.get(name), runMode, + this(system, name, namesAndVars.get(name), runMode, fileOutputStream); pwrSys_ = pwrSys; if (pwrSys_ != null) { @@ -331,7 +331,7 @@ protected Testcase(AS400 system, String name, Hashtable namesAndVars, * @param fileOutputStream * The output stream to which to write the results. **/ - protected Testcase(AS400 system, String name, Vector variationsToRun, + protected Testcase(AS400 system, String name, Vector variationsToRun, int runMode, FileOutputStream fileOutputStream) { this(system, name, -1, variationsToRun, runMode, fileOutputStream, null); @@ -354,7 +354,7 @@ protected Testcase(AS400 system, String name, Vector variationsToRun, * @param password * The user profile password. **/ - protected Testcase(AS400 system, String name, Vector variationsToRun, + protected Testcase(AS400 system, String name, Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, String password) { this(system, name, -1, variationsToRun, runMode, fileOutputStream, @@ -379,7 +379,7 @@ protected Testcase(AS400 system, String name, Vector variationsToRun, * The output stream to which to write the results. **/ protected Testcase(AS400 system, String name, int totalVariations, - Vector variationsToRun, int runMode, FileOutputStream fileOutputStream) { + Vector variationsToRun, int runMode, FileOutputStream fileOutputStream) { this(system, name, totalVariations, variationsToRun, runMode, fileOutputStream, null); } @@ -403,7 +403,7 @@ protected Testcase(AS400 system, String name, int totalVariations, * The user profile password. **/ protected Testcase(AS400 system, String name, int totalVariations, - Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, + Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, String password) { this(system, name, totalVariations, variationsToRun, runMode, fileOutputStream, password, null); @@ -430,7 +430,7 @@ protected Testcase(AS400 system, String name, int totalVariations, * The iSeries server, accessed through a SECADM user profile. **/ protected Testcase(AS400 system, String name, int totalVariations, - Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, + Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, String password, AS400 pwrSys) { initializeFields(system, name, totalVariations, variationsToRun, runMode, fileOutputStream, password); @@ -477,7 +477,7 @@ protected Testcase(AS400 system, String name, int totalVariations, * The power user password. **/ public Testcase(AS400 system, String name, int totalVariations, - Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, + Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, String password, String pwrSysUid, String pwrSysPwd) { initializeFields(system, name, totalVariations, variationsToRun, runMode, fileOutputStream, password); @@ -505,7 +505,7 @@ public Testcase(AS400 system, String name, int totalVariations, } private void initializeFields(AS400 system, String name, int totalVariations, - Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, + Vector variationsToRun, int runMode, FileOutputStream fileOutputStream, String password) { // System.out.println("checking interactive"); @@ -521,7 +521,7 @@ private void initializeFields(AS400 system, String name, int totalVariations, systemObject_ = system; name_ = name; totalVariations_ = totalVariations; - variationsToRun_ = variationsToRun != null ? variationsToRun : new Vector(); + variationsToRun_ = variationsToRun != null ? variationsToRun : new Vector(); runMode_ = runMode; OutputStream out; if (fileOutputStream != null) @@ -1716,7 +1716,7 @@ protected void invokeVariation(int variation) { try { method = this.getClass().getMethod(methodName, new Class[0]); } catch (NoSuchMethodException ee) { - Class[] parms = new Class[1]; + Class[] parms = new Class[1]; parms[0] = Integer.TYPE; method = this.getClass().getMethod(methodName, parms); } @@ -1724,7 +1724,7 @@ protected void invokeVariation(int variation) { variationStartTime = System.currentTimeMillis(); setVariation(variation); - Class[] paramTypes = method.getParameterTypes(); + Class[] paramTypes = method.getParameterTypes(); if (paramTypes.length == 0) { if (runMode_ != ATTENDED) { if (this.checkVariationApplies()) { @@ -2311,7 +2311,7 @@ public void run() { public void setTestcaseParameters(AS400 system, AS400 pwrSys, String systemName, String userId, String password, String proxy, boolean mustUseSockets, boolean isNative, boolean isLocal, - boolean onAS400, Hashtable namesAndVars, int runMode, + boolean onAS400, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream) { systemObject_ = system; pwrSys_ = pwrSys; @@ -2360,9 +2360,9 @@ public void setTestcaseParameters(AS400 system, AS400 pwrSys, totalVariations_ = countVariations(); - variationsToRun_ = (Vector) namesAndVars.get(name_); + variationsToRun_ = namesAndVars.get(name_); if (variationsToRun_ == null) - variationsToRun_ = new Vector(); + variationsToRun_ = new Vector(); runMode_ = runMode; OutputStream out; if (fileOutputStream != null) { @@ -2377,7 +2377,7 @@ public void setTestcaseParameters(AS400 system, AS400 pwrSys, public void setTestcaseParameters(AS400 system, AS400 pwrSys, String systemName, String userId, String password, String proxy, boolean mustUseSockets, boolean isNative, boolean isLocal, - boolean onAS400, Hashtable namesAndVars, int runMode, + boolean onAS400, Hashtable> namesAndVars, int runMode, FileOutputStream fileOutputStream, String pwrSysUserID, String pwrSysPassword) { setTestcaseParameters(system, pwrSys, systemName, userId, password, proxy, @@ -2703,24 +2703,16 @@ public void finishLongRunning(String testname, int variation, boolean passed) { } - class MethodComparator implements Comparator { + class MethodComparator implements Comparator { /* * Compares its two arguments for order. Returns a negative integer, zero, * or a positive integer as the first argument is less than, equal to, or * greater than the second. */ - public int compare(Object o1, Object o2) { - if ((o1 instanceof Method) && (o2 instanceof Method)) { - Method m1 = (Method) o1; - Method m2 = (Method) o2; + public int compare(Method m1, Method m2) { String name1 = m1.getName(); String name2 = m2.getName(); return name1.compareTo(name2); - - } else { - return o1.hashCode() - o2.hashCode(); - } - } } @@ -2812,7 +2804,7 @@ public static String getLoadPath(Object thisObject) { return getLoadPath(thisObject.getClass()); } - public static String getLoadPath(Class thisClass) { + public static String getLoadPath(Class thisClass) { String loadPath = null; try {