Skip to content

Commit

Permalink
Testcase updates (#110)
Browse files Browse the repository at this point in the history
Signed-off-by: John Eberhard <[email protected]>
  • Loading branch information
jeber-ibm authored Nov 21, 2024
1 parent 5305801 commit 371309d
Show file tree
Hide file tree
Showing 12 changed files with 417 additions and 292 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public void Var009()
BeanInfo[] bis = bi.getAdditionalBeanInfo();

PropertyDescriptor[] pd = bis[0].getPropertyDescriptors();
if (pd.length != 113) //@A1C //@A5C //@A6C //@B1C //@C1C //@PDC //@D1C //@PDC //@D3C @ac1 cc1 @dmy 91=query replace truncated parameter
if (pd.length != 115)
{
failMessage.append("Wrong number of property descriptors returned: " + String.valueOf(pd.length)+"\n");
passed = false;
Expand Down Expand Up @@ -597,7 +597,12 @@ public void Var009()
propertyTypes.put("maxRetriesForClientReroute","int");
propertyTypes.put("retryIntervalForClientReroute","int");
propertyTypes.put("enableSeamlessFailover","int");

propertyTypes.put("additionalAuthenticationFactore", "[C");
propertyTypes.put("stayAlive", "int");




for (int i=0; i< pd.length; i++)
{
String value = (String)propertyTypes.get(pd[i].getName());
Expand Down Expand Up @@ -725,7 +730,8 @@ public void Var009()
getPropertyMethods.put("maxRetriesForClientReroute","getMaxRetriesForClientReroute");
getPropertyMethods.put("retryIntervalForClientReroute","getRetryIntervalForClientReroute");
getPropertyMethods.put("enableSeamlessFailover","getEnableSeamlessFailover");

getPropertyMethods.put("additionalAuthenticationFactor","getAdditionalAuthenticationFactor");
getPropertyMethods.put("stayAlive","getStayAlive");


for (int i=0; i< pd.length; i++)
Expand Down Expand Up @@ -887,7 +893,8 @@ public void Var009()
setPropertyMethods.put("maxRetriesForClientReroute","setMaxRetriesForClientReroute");
setPropertyMethods.put("retryIntervalForClientReroute","setRetryIntervalForClientReroute");
setPropertyMethods.put("enableSeamlessFailover","setEnableSeamlessFailover");

setPropertyMethods.put("additionalAuthenticationFactor","setAdditionalAuthenticationFactor");
setPropertyMethods.put("stayAlive","setStayAlive");


Properties setPropertyMethods2 = new Properties() ;
Expand Down Expand Up @@ -1063,7 +1070,9 @@ public void Var009()
propertyShortDescs.put("maxRetriesForClientReroute","The maximum number of connection retries for automatic client reroute.");
propertyShortDescs.put("retryIntervalForClientReroute","The number of seconds between consecutive connection retries.");
propertyShortDescs.put("enableSeamlessFailover","Specifies whether the JTOpen JDBC driver uses seamless failover for client reroute.");

propertyShortDescs.put("additionalAuthenticationFactor","Specifies the additional authentication factor to be used in conjunction with the password.");
propertyShortDescs.put("stayAlive","Specifies the number of seconds between pings to the Host Server. This is used to prevent a connection from being viewed as inactive.");

for (int i=0; i< pd.length; i++)
{

Expand Down
2 changes: 1 addition & 1 deletion src/test/AS400JDBC/AS400JDBCRowSetTestcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void setup()
env_.put("java.naming.security.credentials", authorityPwd_); //@A2A
} //@A2A
else
env_.put(Context.PROVIDER_URL,"file:."); //@pda for linux authority. default is "/" location of file created
env_.put(Context.PROVIDER_URL,"file:.");


env_.put(Context.INITIAL_CONTEXT_FACTORY, jndiType_);
Expand Down
2 changes: 1 addition & 1 deletion src/test/JDCleanCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private static void cleanRelatedFiles(AS400 as400, IFSFile javacorefile) throws
"Failed to create thread",
};

// Search strings in rder they are found in field
// Search strings in order they are found in field
// Once the a string has been found, the algorithm will
// try to find the remaining strings in the current set
// without checking the other sets
Expand Down
12 changes: 6 additions & 6 deletions src/test/JDCleanSplfJdbc.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ public static JDCleanSplfJdbcResults deleteUselessSpoolFiles(PrintStream out, Co
}
}

public static void runCleaningQuery(Statement stmt, String query, JDCleanSplfJdbc clean) throws SQLException {
System.out.println("Running query " + query);
public static void runCleaningQuery(PrintStream out, Statement stmt, String query, JDCleanSplfJdbc clean) throws SQLException {
out.println("Running query " + query);

ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
Expand Down Expand Up @@ -357,7 +357,7 @@ public static JDCleanSplfJdbcResults deleteSpoolFilesAttempt(PrintStream out, Co
+ " FROM QSYS2 . OUTPUT_QUEUE_ENTRIES_BASIC WHERE CREATE_TIMESTAMP >= '"
+ startTimestamp.toString() + "'" + " AND CREATE_TIMESTAMP <= '" + endTimestamp.toString() + "'";
System.out.println(query);
runCleaningQuery(stmt, query, clean);
runCleaningQuery(out, stmt, query, clean);
stmt.close();

} else {
Expand All @@ -375,8 +375,8 @@ public static JDCleanSplfJdbcResults deleteSpoolFilesAttempt(PrintStream out, Co
+ " FROM QSYS2 . OUTPUT_QUEUE_ENTRIES_BASIC WHERE " + " USER_NAME IN (" + userInClause + ") AND "
+ " CREATE_TIMESTAMP >= '" + startTimestamp.toString() + "'" + " AND CREATE_TIMESTAMP <= '"
+ endTimestamp.toString() + "'";
System.out.println(query);
runCleaningQuery(stmt, query, clean);
out.println(query);
runCleaningQuery(out,stmt, query, clean);
stmt.close();
}
long finishMillis = System.currentTimeMillis();
Expand All @@ -402,7 +402,7 @@ public static JDCleanSplfJdbcResults deleteUselessSpoolFilesAttempt(PrintStream
String query = " SELECT USER_NAME, SPOOLED_FILE_NAME, FILE_NUMBER ,JOB_NAME , CREATE_TIMESTAMP , TOTAL_PAGES, SIZE , USER_DATA "
+ " FROM QSYS2 . OUTPUT_QUEUE_ENTRIES_BASIC WHERE CREATE_TIMESTAMP >= '"
+ startTimestamp.toString() + "'" + " AND CREATE_TIMESTAMP <= '" + endTimestamp.toString() + "'";
runCleaningQuery(stmt, query, clean);
runCleaningQuery(out, stmt, query, clean);
stmt.close();
System.out.println("Running query " + query);

Expand Down
3 changes: 3 additions & 0 deletions src/test/JDJSTPOutputThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public void addOutputString(String currentString ) {
}
if (writer != null) {
writer.print(currentString);
if (currentString.indexOf(TestDriver.RUN_COMPLETED) >= 0) {
flushOnce= true;
}
if (doFlush || flushOnce ) {
if (flushOnce) flushOnce = false;
writer.flush();
Expand Down
Loading

0 comments on commit 371309d

Please sign in to comment.