=== modified file 'java/com/mysql/cluster/ndbj/NdbResultSetImpl.java'
--- a/java/com/mysql/cluster/ndbj/NdbResultSetImpl.java	2008-04-21 23:19:01 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbResultSetImpl.java	2008-05-17 06:19:36 +0000
@@ -238,12 +238,15 @@
 		return this.op.getBlobHandle(columnName);
 	}
 
+	/**
+	 * Allow fine-grained handling of tuple fetching.
+	 *
+	 * @todo This needs to return int for proper usage.
+	 */
     public boolean next(boolean fetchAllowed) throws NdbApiException {
 	  // TODO: Seriously - this method and the next need to be redesigned
 	  if (NdbScanOperationImpl.class.isInstance(op))  {
 	    int scanCheck = ((NdbScanOperation)op).nextResult(fetchAllowed);
-	  	  System.out.println("Ok, fetch:" + scanCheck);
-
 	    return (scanCheck==0);
 	  } else {
 //		 It's not a scan operation

=== modified file 'java/testsuite/ndbj/ImmediatePollTimeoutTest.java'
--- a/java/testsuite/ndbj/ImmediatePollTimeoutTest.java	2008-04-29 03:40:11 +0000
+++ b/java/testsuite/ndbj/ImmediatePollTimeoutTest.java	2008-05-17 06:19:36 +0000
@@ -12,9 +12,9 @@
 	static long    ourOutstandingTransactionCount = 0;
 	static long    ourCallbackCount               = 0;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// GENERAL STUFF
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	static int MAXIMUM_OPERATION_VOLUME       = 300; // TO DO: Calculate this
 
@@ -27,15 +27,15 @@
 
 	static boolean USE_SYNCHRONOUS            = false;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// TABLE METADATA
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	static String tablename      = "t_immediatepolltimeouttest";
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// INITIALISATION CODE
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 
 	public ImmediatePollTimeoutTest(String arg0) {
@@ -62,72 +62,65 @@
 		}
 	}
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// TEST CODE
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
-	public void testOperation() {
+	public void testOperation() throws NdbApiException {
 		
 		HashMap<Integer,BaseCallback> hash=new HashMap<Integer,BaseCallback>();
 	
-		try {
-			for (int loop = 0;
-			loop < 100;
-			loop++) {
-				// Process request transaction
-
-				NdbOperation orderOp;
-				BaseCallback callback;
-
-				for (int elementCount = 0;
-				     elementCount < NUMBER_OF_ELEMENT_INSERTIONS;
-				     elementCount++) {
-					int id = (NUMBER_OF_ELEMENT_INSERTIONS * loop) + elementCount;
-
-					trans = ndb.startTransaction();
-					orderOp = trans.getInsertOperation(tablename);
-					orderOp.equalInt("ATTR1", id);
-					orderOp.setInt("ATTR2", id);
-
-					callback = new MyCallback(hash, id, ndb, trans, orderOp.resultData());
-					hash.put(new Integer(callback.hashCode()), callback);
-
-					trans.executeAsynchPrepare(ExecType.Commit,
-							callback,
-							AbortOption.AbortOnError);
-
-					ourOutstandingTransactionCount++;
-				}
-
-				ourCallbackCount = 0;
-
-				ndb.sendPreparedTransactions(FORCE_SEND);
-
-				long then = System.nanoTime();
-				ndb.pollNdb(REQUEST_TRANSACTIONS_TIMEOUT);
-				long now = System.nanoTime();
-
-				ourOutstandingTransactionCount = ourOutstandingTransactionCount - ourCallbackCount;
-				//System.out.println("Poll took " + (now - then) + " nanos (" + ourCallbackCount + 
-				//			" txs received) [" + ourOutstandingTransactionCount + " outstanding]");
+		for (int loop = 0;
+		loop < 100;
+		loop++) {
+			// Process request transaction
+
+			NdbOperation orderOp;
+			BaseCallback callback;
+
+			for (int elementCount = 0;
+				 elementCount < NUMBER_OF_ELEMENT_INSERTIONS;
+				 elementCount++) {
+				int id = (NUMBER_OF_ELEMENT_INSERTIONS * loop) + elementCount;
+
+				trans = ndb.startTransaction();
+				orderOp = trans.getInsertOperation(tablename);
+				orderOp.equalInt("ATTR1", id);
+				orderOp.setInt("ATTR2", id);
+
+				callback = new MyCallback(hash, id, ndb, trans, orderOp.resultData());
+				hash.put(new Integer(callback.hashCode()), callback);
+
+				trans.executeAsynchPrepare(ExecType.Commit,
+						callback,
+						AbortOption.AbortOnError);
+
+				ourOutstandingTransactionCount++;
 			}
 
-
 			ourCallbackCount = 0;
 
+			ndb.sendPreparedTransactions(FORCE_SEND);
+
 			long then = System.nanoTime();
-			ndb.pollNdb(100000,100000);
+			ndb.pollNdb(REQUEST_TRANSACTIONS_TIMEOUT);
 			long now = System.nanoTime();
 
 			ourOutstandingTransactionCount = ourOutstandingTransactionCount - ourCallbackCount;
-			//System.out.println("Closedown poll took " + (now - then) + " nanos (" + ourCallbackCount + 
+			//System.out.println("Poll took " + (now - then) + " nanos (" + ourCallbackCount + 
 			//			" txs received) [" + ourOutstandingTransactionCount + " outstanding]");
 		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Insert:\t" + e.getMessage());
-			e.printStackTrace();
-			assertFalse(true);
-		}
+
+
+		ourCallbackCount = 0;
+
+		long then = System.nanoTime();
+		ndb.pollNdb(100000,100000);
+		long now = System.nanoTime();
+
+		ourOutstandingTransactionCount = ourOutstandingTransactionCount - ourCallbackCount;
+		//System.out.println("Closedown poll took " + (now - then) + " nanos (" + ourCallbackCount + 
+		//			" txs received) [" + ourOutstandingTransactionCount + " outstanding]");
 	}
 
 	class HashCallback extends BaseCallback {

=== modified file 'java/testsuite/ndbj/InsertRetryTest.java'
--- a/java/testsuite/ndbj/InsertRetryTest.java	2008-02-12 18:08:14 +0000
+++ b/java/testsuite/ndbj/InsertRetryTest.java	2008-05-17 06:19:36 +0000
@@ -26,10 +26,6 @@
 
 	protected static final int NUM_INSERTS = 2;
 
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(InsertRetryTest.class);
-	}
-
 	public InsertRetryTest(String arg0) {
 		super(arg0);
 	}
@@ -44,7 +40,7 @@
 	/*
 	 * Test method for 'com.mysql.ndbapi.Ndb.destroy()'
 	 */
-	public void testInsert() throws java.sql.SQLException {
+	public void testInsert() throws java.sql.SQLException, NdbApiException {
 
 		boolean done = false;
 		int numRetries = 0;
@@ -61,14 +57,10 @@
 				trans.execute(ExecType.Commit,AbortOption.AbortOnError, true);
 
 				done = true;
-				assertTrue(true);
 			} catch (NdbApiTemporaryException e) {
 				numRetries++;
 				assertTrue("Temporary error. Retrying insert. Num Retries == "
 						+ numRetries + " error msg:" + e.getMessage(),true);
-			} catch (NdbApiException e) {
-				assertTrue("Caught NdbApiException in Insert:\t" + e.getMessage(), false);
-				done = true;
 			} finally {
 				if (trans != null)
 					trans.close();
@@ -91,7 +83,7 @@
 					+ ", '" + setting + "')");
 		}
 	}
-	public void testRead() throws SQLException {
+	public void testRead() throws SQLException, NdbApiException {
 
 		this.jdbcInsert();
 
@@ -124,17 +116,11 @@
 					j++;
 				}
 
-				assertTrue(true);
 				done = true;
 			} catch (NdbApiTemporaryException e) {
 				numRetries++;
 				assertTrue("Temporary error. Retrying Read. Num Retries == "
 						+ numRetries + " error msg:" + e.getMessage(), true);
-			} catch (NdbApiException e) {
-				assertTrue(
-						"Caught NdbApiException in Read:\t" + e.getMessage(),
-						false);
-				done = true;
 			} finally {
 				if (trans != null)
 					trans.close();
@@ -143,7 +129,7 @@
 
 	}
 
-	public void testDelete() throws java.sql.SQLException {
+	public void testDelete() throws java.sql.SQLException, NdbApiException {
 		
 		this.jdbcInsert();
 		
@@ -161,17 +147,11 @@
 
 				trans.execute(ExecType.Commit, AbortOption.AbortOnError, true);
 
-				assertTrue(true);
 				done = true;
 			} catch (NdbApiTemporaryException e) {
 				numRetries++;
 				assertTrue("Temporary error. Retrying delete. Num Retries == "
 						+ numRetries + " error msg:" + e.getMessage(), true);
-			} catch (NdbApiException e) {
-				assertTrue(
-						"Caught NdbApiException in delete:\t" + e.getMessage(),
-						false);
-				done = true;
 			} finally {
 				if (trans != null)
 					trans.close();

=== modified file 'java/testsuite/ndbj/InvalidSchemaObjectVersionTest.java'
--- a/java/testsuite/ndbj/InvalidSchemaObjectVersionTest.java	2008-02-11 18:35:32 +0000
+++ b/java/testsuite/ndbj/InvalidSchemaObjectVersionTest.java	2008-05-17 06:19:36 +0000
@@ -55,9 +55,6 @@
 			fail("InvalidSchemaObjectVersionException should be thrown");
 		} catch (InvalidSchemaObjectVersionException e) { 
 			dictionary.invalidateTable(table_name);
-		} catch (Exception e) { 
-			e.printStackTrace();
-			fail("expected InvalidSchemaObjectVersionException");
 		}
 		
 		trans = ndb.startTransaction();

=== modified file 'java/testsuite/ndbj/Latin1InsertReadTest.java'
--- a/java/testsuite/ndbj/Latin1InsertReadTest.java	2008-04-29 03:40:11 +0000
+++ b/java/testsuite/ndbj/Latin1InsertReadTest.java	2008-05-17 06:19:36 +0000
@@ -45,7 +45,7 @@
 	/*
 	 * Test method for 'com.mysql.ndbapi.Ndb.destroy()'
 	 */
-	public void testLatin1() {
+	public void testLatin1() throws NdbApiException {
 
 		boolean done = false;
 		int numRetries = 0;
@@ -65,21 +65,13 @@
 								AbortOption.AbortOnError, true);
 
 				done = true;
-				assertTrue(true);
 			} catch (NdbApiTemporaryException e) {
 				numRetries++;
-			} catch (NdbApiException e) {
-				System.out.println("Caught NdbApiException in Insert:\t"
-						+ e.getMessage());
-
-				System.out.println(e.getErrorObj().getMessage());
-				assertTrue(false);
-				done = true;
 			} finally {
 				if (trans != null)
 					trans.close();
 			}
-	}
+		}
 
 		try {
 			trans = ndb.startTransaction();
@@ -103,26 +95,15 @@
 				while (r.next()) {
 					String val = r.getString(col2);
 					if (val.compareTo(col2Val)!=0)
-						assertFalse(true);
+						fail("val=" + val + " != col2Val=" + col2Val);
 				}
 			}
-
-			assertTrue(true);
-		} catch (NdbApiUserErrorPermanentException e) {
-			System.out.println("User Permanent error. Retrying insert. Num Retries == "
-							+ e.getMessage());
-		} catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Delete:\t"
-					+ e.getMessage());
-			assertTrue(false);
 		} finally {
 			if (trans != null)
 				trans.close();
 		}
 
-
 		try {
-			
 			trans = ndb.startTransaction();
 
 			for (int i = 0; i < NUM_INSERTS; i++) {
@@ -136,16 +117,6 @@
 
 			trans.execute(ExecType.Commit,
 							AbortOption.AbortOnError, true);
-
-			assertTrue(true);
-		} catch (NdbApiUserErrorPermanentException e) {
-			System.out
-					.println("User Permanent error. Retrying insert. Num Retries == "
-							+ e.getMessage());
-		} catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Delete:\t"
-					+ e.getMessage());
-			assertTrue(false);
 		} finally {
 			if (trans != null)
 				trans.close();

=== modified file 'java/testsuite/ndbj/MultiPartPrimaryKeyStringTest.java'
--- a/java/testsuite/ndbj/MultiPartPrimaryKeyStringTest.java	2008-04-29 03:00:39 +0000
+++ b/java/testsuite/ndbj/MultiPartPrimaryKeyStringTest.java	2008-05-17 06:19:36 +0000
@@ -53,9 +53,7 @@
 				+ " PARTITION BY KEY(a,b);");
 	}
 
-	public void testMultiPartPrimaryKey() {
-
-
+	public void testMultiPartPrimaryKey() throws NdbApiException, SQLException {
 
 	    for (int i=0; i < NUM_ITERATIONS; i++) {
 
@@ -72,7 +70,7 @@
 			}
 
 
-       //TODO: Actuall support sending multiple agrs to TC hint
+       //TODO: Actually support sending multiple args to TC hint
 		    trans = ndb.startTransaction();
 	    	NdbOperation op = trans.getInsertOperation(tablename);
 
@@ -85,11 +83,6 @@
 			    trans.execute(ExecType.Commit,
 					      AbortOption.AbortOnError,
 					      true);
-			assertTrue(true);
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Insert:\t" + e.getMessage());
-			assertFalse(true);
 		}
 		finally {
 			if (trans!=null)
@@ -133,17 +126,12 @@
 			}
 			assertEquals(numRes,1);
 		}
-		catch (SQLException e) {
-			System.out.println("Caught NdbApiException in Read Tuple:\t" + e.getMessage());
-			assertFalse(true);
-		}
 		finally {
 			if (trans!=null)
 				trans.close();
 		}
 
 		}
-	   assertTrue(true);
 
 		try {
 		    trans = ndb.startTransaction();
@@ -178,22 +166,15 @@
 			
 					numRes++;
 					rs.getString(col1);
-					if (rs.wasNull() == true)
-						assertFalse(true);
+					assertFalse(rs.wasNull());
 					rs.getString(col1);
-					if (rs.wasNull() == true)
-						assertFalse(true);
+					assertFalse(rs.wasNull());
 					rs.getBytes(col3);
-					if (rs.wasNull() == true)
-						assertFalse(true);
+					assertFalse(rs.wasNull());
 				
 			}
 			assertEquals(numRes, 1);
 		}
-		catch (SQLException e) {
-			System.out.println("Caught NdbApiException in Read Tuple:\t" + e.getMessage());
-			assertFalse(true);
-		}
 		finally {
 			if (trans!=null)
 				trans.close();
@@ -225,10 +206,6 @@
 			assertEquals(numRes,1);
 
 		}
-		catch (SQLException e) {
-			System.out.println("Caught NdbApiException in Read Tuple:\t" + e.getMessage());
-			assertFalse(true);
-		}
 		finally {
 			if (trans!=null)
 				trans.close();
@@ -259,10 +236,6 @@
 			}
 			assertEquals(numRes,NUM_ITERATIONS-1);
 		}
-		catch (SQLException e) {
-			System.out.println("Caught NdbApiException in Read Tuple:\t" + e.getMessage());
-			assertFalse(true);
-		}
 		finally {
 			if (trans!=null)
 				trans.close();
@@ -281,12 +254,6 @@
 		    trans.execute(ExecType.Commit,
 			      AbortOption.AbortOnError,
 			      true);
-
-			assertTrue(true);
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in update:\t" + e.getMessage());
-			assertFalse(true);
 		}
 		finally {
 			if (trans!=null)
@@ -305,12 +272,6 @@
 		    trans.execute(ExecType.Commit,
 			      AbortOption.AbortOnError,
 			      true);
-
-			assertTrue(true);
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Delete:\t" + e.getMessage());
-			assertFalse(true);
 		}
 		finally {
 			if (trans!=null)

=== modified file 'java/testsuite/ndbj/NdbOperationByteLongTest.java'
--- a/java/testsuite/ndbj/NdbOperationByteLongTest.java	2008-04-28 23:11:51 +0000
+++ b/java/testsuite/ndbj/NdbOperationByteLongTest.java	2008-05-17 06:19:36 +0000
@@ -19,11 +19,6 @@
 	protected String col3="num";
 	byte[] name = null;
 
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(NdbOperationByteLongTest.class);
-	}
-
-
 	public NdbOperationByteLongTest(String arg0) {
 		super(arg0);
 	}
@@ -39,9 +34,7 @@
 	/*
 	 * Test method for 'com.mysql.cluster.ndbj.NdbOperation.equalBytes(String, byte[])'
 	 */
-	public void testInsertAndReadBytesAndLong() {
-
-
+	public void testInsertAndReadBytesAndLong() throws NdbApiException, SQLException {
 		try {
 			trans = ndb.startTransaction();
 
@@ -64,16 +57,11 @@
 			}
 
 			trans.execute(ExecType.Commit, AbortOption.AbortOnError, true);
-			assertTrue(true);
-		} catch (NdbApiException e) {
-			System.out.println("NdbApiException:\t" + e.getMessage());
-			assertFalse(true);
 		} finally {
 			if (trans != null)
 				trans.close();
 		}
 
-
 		try {
 		    trans = ndb.startTransaction();
 		    
@@ -111,18 +99,11 @@
 
 			}
 		}
-		catch (SQLException e) {
-			System.out.println("Caught NdbApiException in Read Tuple:\t" + e.getMessage());
-			assertFalse(true);
-		}
 		finally {
 			if (trans != null)
 				trans.close();
 		}
 
-		assertTrue(true);
-
-
 		try {
 		  trans = ndb.startTransaction();
 		  trans.setOperationLockMode(LockMode.LM_Exclusive);
@@ -164,19 +145,10 @@
 		      assertEquals(longVal,(long) k*65536);
 		      k++;
 		    }
-		    assertTrue(true);
-		}
-		catch (SQLException e) {
-			System.out.println("Caught NdbApiException in Read Tuple:\t" + e.getMessage());
-			assertFalse(true);
 		}
 		finally {
 			if (trans != null)
 				trans.close();
 		}
-
-		assertTrue(true);
-
 	}
-
 }

=== modified file 'java/testsuite/ndbj/NdbOperationIDTest.java'
--- a/java/testsuite/ndbj/NdbOperationIDTest.java	2008-04-29 03:40:11 +0000
+++ b/java/testsuite/ndbj/NdbOperationIDTest.java	2008-05-17 06:19:36 +0000
@@ -29,7 +29,7 @@
     protected String col10="timestamp_col";
     protected String col11="binary_col";
     protected String col12="short_col";
-    
+
 	protected int col1ID=1;
 	protected int col2ID=2;
 	protected int col3ID=3;
@@ -42,7 +42,7 @@
 	protected int col10ID=10;
 	protected int col11ID=11;
     protected int col12ID=12;
-    
+
 	protected int 	int_val = 100;
 	protected String varcharlong_val="Evelyn";
     // 240+ chars causes crash
@@ -56,12 +56,8 @@
 	protected long long_val = 1233456789L;
 	protected Timestamp timestamp_val = new Timestamp(System.currentTimeMillis());
     protected short short_val = 1974;
-    
+
     protected final static String tablename = "t_ops";
-    
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(NdbOperationIDTest.class);
-	}
 
 	public NdbOperationIDTest(String arg0) {
 		super(arg0);
@@ -86,10 +82,8 @@
 
 				+ ") ENGINE=ndb;");
 	}
-    
-	public void testOperationID() {
-
-
+
+	public void testOperationID() throws NdbApiException, SQLException {
 		try {
 		    trans = ndb.startTransaction();
 
@@ -129,14 +123,6 @@
 		    trans.execute(ExecType.Commit,
 			      AbortOption.AbortOnError,
 			      true);
-
-	
-			assertTrue(true);
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Insert:\t" + e.getMessage());
-			e.printStackTrace();
-			assertFalse(true);
 		}
 		finally {
 			if (trans!=null)
@@ -180,17 +166,10 @@
 			    assertEquals(name,varcharlong_val);  
 
 			    float f = rs.getFloat(col3);
-			    if (f==float_val)
-			    	assertTrue(true);
-			    else 
-			    	assertTrue(false);
+			    assertEquals(f, float_val, 0.001);
 			    
 			    double d = rs.getDouble(col4);
-			    if (d==double_val)
-			    	assertTrue(true);
-			    else
-			    	assertTrue(false);
-
+			    assertEquals(d, double_val, 0.0001);
 			    
 			    long l = rs.getInt(col5);
 			    assertEquals(l,long_val);
@@ -227,14 +206,7 @@
 
                 short sh = rs.getShort(col12);
                 assertEquals(sh,short_val);
-                
 			}
-
-
-		}
-		catch (SQLException e) {
-			System.out.println("Caught NdbApiException in Read Tuple:\t" + e.getMessage());
-			assertFalse(true);
 		}
 		finally {
 			if (trans!=null)
@@ -286,12 +258,6 @@
 		    trans.execute(ExecType.Commit,
 			      AbortOption.AbortOnError,
 			      true);
-
-			assertTrue(true);
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in update:\t" + e.getMessage());
-			assertFalse(true);
 		}
 		finally {
 			if (trans!=null)
@@ -309,11 +275,6 @@
 			      AbortOption.AbortOnError,
 			      true);
 
-			assertTrue(true);
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Delete:\t" + e.getMessage());
-			assertFalse(true);
 		}
 		finally {
 			if (trans!=null)

=== modified file 'java/testsuite/ndbj/NdbOperationMultiPartPrimaryKeyTest.java'
--- a/java/testsuite/ndbj/NdbOperationMultiPartPrimaryKeyTest.java	2008-04-29 02:07:14 +0000
+++ b/java/testsuite/ndbj/NdbOperationMultiPartPrimaryKeyTest.java	2008-05-17 06:19:36 +0000
@@ -30,10 +30,6 @@
 
   protected final static String tablename = "t_str_b";
 
-  public static void main(String[] args) {
-    junit.textui.TestRunner.run(NdbOperationMultiPartPrimaryKeyTest.class);
-  }
-
   public NdbOperationMultiPartPrimaryKeyTest(String arg0) {
     super(arg0);
   }
@@ -51,7 +47,7 @@
   }
 
 
-  public void testOperationMultiPartPrimaryKey() {
+  public void testOperationMultiPartPrimaryKey() throws NdbApiException, SQLException {
 
 
     try {
@@ -67,12 +63,6 @@
       trans.execute(ExecType.Commit,
           AbortOption.AbortOnError,
           true);
-
-      assertTrue(true);
-    }
-    catch (NdbApiException e) {
-      System.out.println("Caught NdbApiException in Insert:\t" + e.getMessage());
-      assertFalse(true);
     }
     finally {
       if (trans!=null)
@@ -102,11 +92,6 @@
           assertEquals(c[i],col3ValBytes[i]) ; 
         }
       }
-      assertTrue(true);
-    }
-    catch (SQLException e) {
-      System.out.println("Caught NdbApiException in Read Tuple:\t" + e.getMessage());
-      assertFalse(true);
     }
     finally {
       if (trans!=null)
@@ -125,12 +110,6 @@
       trans.execute(ExecType.Commit,
           AbortOption.AbortOnError,
           true);
-
-      assertTrue(true);
-    }
-    catch (NdbApiException e) {
-      System.out.println("Caught NdbApiException in update:\t" + e.getMessage());
-      assertFalse(true);
     }
     finally {
       if (trans!=null)
@@ -148,18 +127,10 @@
       trans.execute(ExecType.Commit,
           AbortOption.AbortOnError,
           true);
-
-      assertTrue(true);
-    }
-    catch (NdbApiException e) {
-      System.out.println("Caught NdbApiException in Delete:\t" + e.getMessage());
-      assertFalse(true);
     }
     finally {
       if (trans!=null)
         trans.close();
     }
-
   }
-
 }

=== modified file 'java/testsuite/ndbj/NdbOperationsFailedTest.java'
--- a/java/testsuite/ndbj/NdbOperationsFailedTest.java	2008-04-29 03:19:52 +0000
+++ b/java/testsuite/ndbj/NdbOperationsFailedTest.java	2008-05-17 06:19:36 +0000
@@ -18,11 +18,6 @@
   protected String col1 = "id";
   protected String col2 = "name";
 
-
-  public static void main(String[] args) {
-    junit.textui.TestRunner.run(NdbOperationsFailedTest.class);
-  }
-
   public NdbOperationsFailedTest(String arg0) {
     super(arg0);
   }
@@ -34,11 +29,7 @@
     "(`id` INT PRIMARY KEY, `name` VARCHAR(256)) ENGINE=ndb;");
   }
 
-
-  public void testCountNumberOfCompletedOperations() {
-
-
-
+  public void testCountNumberOfCompletedOperations() throws NdbApiException {
     try {
       trans = ndb.startTransaction();
 
@@ -62,34 +53,21 @@
 
       trans.execute(ExecType.NoCommit, AbortOption.AbortOnError, true);
 
-      // shouldn't get this far
-      assertFalse(true);
-
+      fail("Exception should be thrown");
     } catch (NdbApiException e) {
-
-      try {
-        int opCount = 0;
-        NdbOperation completedOp = trans.getNextCompletedOperation(null);
-        do {
-          ++opCount;
-
-        } while ((completedOp = trans.getNextCompletedOperation((com.mysql.cluster.ndbj.NdbOperationImpl)completedOp)) != null);
-
-        assertTrue((opCount==NUM_INSERTS+2));
-      }
-      catch (NdbApiException err) {
-        System.out.println("Error while checking for failed operations:\t"
-            + err.getMessage());
-        err.printStackTrace();
-        assertFalse(true);
-      }
+      int opCount = 0;
+      NdbOperation completedOp = trans.getNextCompletedOperation(null);
+      do {
+        ++opCount;
+
+      } while ((completedOp = trans.getNextCompletedOperation((com.mysql.cluster.ndbj.NdbOperationImpl)completedOp)) != null);
+
+      assertTrue((opCount==NUM_INSERTS+2));
     } finally {
       if (trans != null)
         trans.close();
     }
 
-
-
     try {
       trans = ndb.startTransaction();
 

=== modified file 'java/testsuite/ndbj/NullSetTest.java'
--- a/java/testsuite/ndbj/NullSetTest.java	2008-04-29 03:00:39 +0000
+++ b/java/testsuite/ndbj/NullSetTest.java	2008-05-17 06:19:36 +0000
@@ -34,9 +34,7 @@
 	/*
 	 * Test method for 'com.mysql.cluster.ndbj.NdbOperation.setNull(String)'
 	 */
-	public final void testNullSet() {
-
-
+	public final void testNullSet() throws NdbApiException, SQLException {
 		try {
 		    trans = ndb.startTransaction();
 				NdbOperation op = trans.getInsertOperation(tablename);
@@ -51,17 +49,11 @@
 				      AbortOption.AbortOnError,
 				      true);
 			}
-			catch (NdbApiException e) {
-				System.out.println("NdbApiException:\t" + e.getMessage());
-				assertFalse(true);
-			}
 			finally {
 				if (trans != null)
 					trans.close();
 			}
 
-
-
 			try {
 				    trans = ndb.startTransaction();
 				    trans.setOperationLockMode(LockMode.LM_Exclusive);
@@ -79,7 +71,6 @@
 					      AbortOption.AbortOnError,
 					      true);
 
-
 			    while(rs.next())
 				{
 				    byte[] nm = rs.getBytes(col2);
@@ -90,27 +81,16 @@
 
 				    long longVal = rs.getLong(col4);
 				    assertTrue(rs.wasNull());
-				  
-
-
 				}
-
-		}
-		catch (SQLException e) {
-			System.out.println("NdbApiException:\t" + e.getMessage());
-			assertFalse(true);
 		}
 		finally {
 			if (trans != null)
 				trans.close();
 		}
 
-
-
 		try {
 		    trans = ndb.startTransaction();
 
-			
 				NdbOperation op = trans.getInsertOperation(tablename);
 				
 				byte[] pkID = "tim".getBytes();
@@ -123,17 +103,11 @@
 				      AbortOption.AbortOnError,
 				      true);
 			}
-			catch (NdbApiException e) {
-				System.out.println("NdbApiException:\t" + e.getMessage());
-				assertFalse(true);
-			}
 			finally {
 				if (trans != null)
 					trans.close();
 			}
 
-
-
 			try {
 				    trans = ndb.startTransaction();
 				    trans.setOperationLockMode(LockMode.LM_Exclusive);
@@ -149,7 +123,6 @@
 
 				    trans.execute(ExecType.Commit, AbortOption.AbortOnError, true);
 
-
 			    while(rs.next())
 				{
 				    byte[] nm = rs.getBytes(col2);
@@ -164,16 +137,9 @@
 				}
 
 		}
-		catch (SQLException e) {
-			System.out.println("NdbApiException:\t" + e.getMessage());
-			assertFalse(true);
-		}
 		finally {
 			if (trans != null)
 				trans.close();
 		}
-
-
 	}
-
 }

=== modified file 'java/testsuite/ndbj/OrderedIndexScanTest.java'
--- a/java/testsuite/ndbj/OrderedIndexScanTest.java	2008-05-08 19:46:02 +0000
+++ b/java/testsuite/ndbj/OrderedIndexScanTest.java	2008-05-17 06:19:36 +0000
@@ -9,7 +9,6 @@
 import java.sql.SQLException;
 import com.mysql.cluster.ndbj.NdbOperation.LockMode;
 
-
 public class OrderedIndexScanTest extends BaseNdbjTestCase {
 
 	protected String col1="id";
@@ -17,10 +16,6 @@
 	protected String theTableName="t_oi_scan";
 	protected static final int SELECT_COUNT=12000;
 
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(OrderedIndexScanTest.class);
-	}
-
 	public OrderedIndexScanTest(String arg0) {
 		super(arg0);
 	}
@@ -37,9 +32,7 @@
 		this.stmt.executeUpdate("insert into " + theTableName + " values (1,5)");
 	}
 
-	public void testOIScan() {
-		
-
+	public void testOIScan() throws NdbApiException, SQLException {
 		try {
 			
 			trans = ndb.startTransaction();
@@ -48,11 +41,8 @@
 				trans.getSelectIndexScanOperation("PRIMARY", theTableName,
 						NdbIndexScanOperation.ScanFlag.ORDER_BY);
 
-			/*   System.out.println("foo");
-			*/  
 			iop.equalInt(0,1);
-			
-			
+
 			assertEquals(NdbIndexScanOperation.BoundType.BoundEQ.type,4);
 			/*
 			iop.setBoundInt(col1, 
@@ -68,8 +58,6 @@
 					AbortOption.AbortOnError, 
 					true);
 
-
-
 			int count=1;
 			while(rs.next())
 			{
@@ -80,24 +68,10 @@
 				
 				count++;
 			}
-
-
-			assertTrue(true);
-
-	
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException:\t" + e.getMessage() + e.getCode());
-		}
-		catch (SQLException e) {
-			System.out.println("Caught NdbApiException:\t" + e.getMessage());
-			assertTrue(false);
 		}
 		finally {
 			if (trans!=null)
 				trans.close(); 
 		}
-
 	}
-
 }

=== modified file 'java/testsuite/ndbj/OutOfConnectionProblemTest.java'
--- a/java/testsuite/ndbj/OutOfConnectionProblemTest.java	2007-12-27 02:37:27 +0000
+++ b/java/testsuite/ndbj/OutOfConnectionProblemTest.java	2008-05-17 06:19:36 +0000
@@ -7,9 +7,9 @@
 
 	static boolean alreadySetUp = false;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// GENERAL STUFF
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	static final int     NUMBER_OF_TEST_ITERATIONS    = 1000000;
 
@@ -19,24 +19,24 @@
 	static final int     TRANSACTIONS_TIMEOUT         = 10;
 	static final int     FORCE_SEND                   = 1;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// TABLE METADATA
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	static final String PROBTABLE  = "OutOfConnectionProblemTable";
 
 	static int PROBTABLE_FIELD1;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// OTHER
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	static int myTransactionCount      = 0;
 	static int myTotalTransactionCount = 0;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// INITIALISATION CODE
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	public static void main(String[] args) {
 		junit.textui.TestRunner.run(OutOfConnectionProblemTest.class);
@@ -62,11 +62,11 @@
 		}
 	}
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// TEST CODE
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
-	public void testOperation() {
+	public void testOperation()  throws NdbApiException {
 		
 		try {
 			long startTime = System.currentTimeMillis();
@@ -89,11 +89,6 @@
  
 			System.out.println("Test completed with no exceptions and took " + elapsedTime / 1000 + " seconds");
 		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Insert:\t" + e.getMessage());
-			e.printStackTrace();
-			assertFalse(true);
-		}
 		finally {
 			System.out.println("End of test.");
 		}

=== modified file 'java/testsuite/ndbj/QuickBFTest.java'
--- a/java/testsuite/ndbj/QuickBFTest.java	2008-02-12 19:25:08 +0000
+++ b/java/testsuite/ndbj/QuickBFTest.java	2008-05-17 06:19:36 +0000
@@ -8,9 +8,9 @@
 
 	static boolean alreadySetUp = false;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// GENERAL STUFF
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	static int MAXIMUM_OPERATION_VOLUME       = 300; // TO DO: Calculate this
 
@@ -28,9 +28,9 @@
 
 	static boolean USE_SYNCHRONOUS            = false;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// TABLE METADATA
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	static String ORDER      = "accountspike_order";
 	static String EXECUTION  = "accountspike_execution";
@@ -77,9 +77,9 @@
 	static int POSITION_UMSELL_PRODUCT;
 	static int POSITION_MATCHED_PRODUCT;
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// OTHER
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 
 	static int myTransactionCount      = 0;
 	static int myTotalTransactionCount = 0;
@@ -87,13 +87,9 @@
 	ArrayList<NdbTransaction> myCompletedTransactionList = new ArrayList<NdbTransaction>();
 	ArrayList<NdbTransaction> myTransactionList = new ArrayList<NdbTransaction>();
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// INITIALISATION CODE
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(QuickBFTest.class);
-	}
+	/////////////////////////////////////////////////////////////////////
 
 	public QuickBFTest(String arg0) {
 		super(arg0);
@@ -223,162 +219,149 @@
 	}
 
 
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+	/////////////////////////////////////////////////////////////////////
 	// TEST CODE
-	///////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-	public void testOperation() {
-		
-		try {
-			for (int loop = 0;
-                             loop < 100;
-			     loop++) {
-			// Process request transaction
-
-			NdbOperation orderOp;
-			BaseCallback callback;
-
-			for (int elementCount = 1;
-			     elementCount < NUMBER_OF_ELEMENT_INSERTIONS + 1;
-			     elementCount++) {
-				int id = (NUMBER_OF_ELEMENT_INSERTIONS * loop) + elementCount;
-
-				trans = ndb.startTransaction();
-				myTransactionList.add(trans);
-
-				orderOp = trans.getInsertOperation(ORDER);
-
-				orderOp.equalInt(ORDER_PARTID, id);
-				orderOp.equalInt(ORDER_ORDERID, id);
-
-				orderOp.setInt(ORDER_ACCOUNTID, id);
-				orderOp.setInt(ORDER_REQUESTID, id);
-				orderOp.setInt(ORDER_INSTRUMENTID, id);
-				orderOp.setInt(ORDER_ISBUY, id);
-				orderOp.setInt(ORDER_QUANTITY, id);
-				orderOp.setInt(ORDER_PRICE, id);
-
-				if (!USE_SYNCHRONOUS) {
-					callback = new OrderCallback(id, ndb, trans, orderOp.resultData());
-
-					trans.executeAsynchPrepare(ExecType.Commit,
-        		                                           callback,
-					                           AbortOption.AbortOnError);
-				}
-			} 
-
-			if (USE_SYNCHRONOUS) {
-				trans.execute(ExecType.Commit, AbortOption.AbortOnError, true);
-			}
-			else {
-				System.out.println("Performing first sendPollNdb. ");
-				ndb.sendPollNdb(REQUEST_TRANSACTIONS_TIMEOUT, NUM_REQUEST_TRANSACTIONS, FORCE_SEND);
-				System.out.println("Completed first sendPollNdb.");
-
-				clearTransactions();
-			}
-
-			// Process response transaction
-
-			trans = ndb.startTransaction();
-
-			NdbOperation executionOp;
-			NdbOperation tradeOp;
-			NdbOperation settlementOp;
-
-			for (int elementCount = 1;
-			     elementCount < NUMBER_OF_ELEMENT_INSERTIONS + 1;
-			     elementCount++) {
-				int id = (NUMBER_OF_ELEMENT_INSERTIONS * loop) + elementCount;
-				
-				trans = ndb.startTransaction();
-myTransactionList.add(trans);
-
-				executionOp = trans.getInsertOperation(EXECUTION);
-
-				executionOp.equalInt(EXECUTION_PARTID, id);
-				executionOp.equalInt(EXECUTION_EXECUTIONID, id);
-
-				executionOp.setInt(EXECUTION_ACCOUNTID, id);
-				executionOp.setInt(EXECUTION_ORDERID, id);
-
-				if (!USE_SYNCHRONOUS) {
-					callback = new ExecutionCallback(id, ndb, trans, executionOp.resultData());
-
-					trans.executeAsynchPrepare(ExecType.Commit,
-        		                                           callback,
-					                           AbortOption.AbortOnError);
-				}
-				
-				trans = ndb.startTransaction();
-myTransactionList.add(trans);
-
-				tradeOp = trans.getInsertOperation(TRADE);
-
-				tradeOp.equalInt(TRADE_PARTID, id);
-				tradeOp.equalInt(TRADE_TRADEID, id);
-
-				tradeOp.setInt(TRADE_ACCOUNTID, id);
-				tradeOp.setInt(TRADE_ORDERID, id);
-				tradeOp.setInt(TRADE_PRICE, id);
-				tradeOp.setInt(TRADE_QUANTITY, id);
-
-				if (!USE_SYNCHRONOUS) {
-					callback = new TradeCallback(id, ndb, trans, executionOp.resultData());
-
-					trans.executeAsynchPrepare(ExecType.Commit,
-        		                                           callback,
-					                           AbortOption.AbortOnError);
-				}
-
-				trans = ndb.startTransaction();
-myTransactionList.add(trans);
-
-				settlementOp = trans.getInsertOperation(SETTLEMENT);
-
-				settlementOp.equalInt(SETTLEMENT_PARTID, id);
-				settlementOp.equalInt(SETTLEMENT_SETTLEMENTID, id);
-
-				settlementOp.setInt(SETTLEMENT_ACCOUNTID, id);
-				settlementOp.setInt(SETTLEMENT_TRADEID1, id);
-				settlementOp.setInt(SETTLEMENT_TRADEID2, id);
-				settlementOp.setInt(SETTLEMENT_QUANTITY, id);
-				settlementOp.setInt(SETTLEMENT_VALUE, id);
-
-				if (!USE_SYNCHRONOUS) {
-					callback = new SettlementCallback(id, ndb, trans, executionOp.resultData());
-
-					trans.executeAsynchPrepare(ExecType.Commit,
-        		                                           callback,
-					                           AbortOption.AbortOnError);
-				}
-			}
-
-			if (USE_SYNCHRONOUS) {
-				trans.execute(ExecType.Commit, AbortOption.AbortOnError, true);
-			}
-			else {
-				System.out.println("Performing second sendPollNdb. ");
-				ndb.sendPollNdb(REQUEST_TRANSACTIONS_TIMEOUT, NUM_REQUEST_TRANSACTIONS, FORCE_SEND);	
-				System.out.println("Completed second sendPollNdb.");
-
-				clearTransactions();
-			}
-			}
-			System.out.println("Performing cooldown");
-
-			ndb.sendPollNdb(100000, 100000, FORCE_SEND);	
-
-			System.out.println("Test completed.");
-
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Insert:\t" + e.getMessage());
-			e.printStackTrace();
-			assertFalse(true);
-		}
-		finally {
-		}
+	/////////////////////////////////////////////////////////////////////
+
+	public void testOperation() throws NdbApiException {
+		for (int loop = 0;
+						 loop < 100;
+			 loop++) {
+		// Process request transaction
+
+		NdbOperation orderOp;
+		BaseCallback callback;
+
+		for (int elementCount = 1;
+			 elementCount < NUMBER_OF_ELEMENT_INSERTIONS + 1;
+			 elementCount++) {
+			int id = (NUMBER_OF_ELEMENT_INSERTIONS * loop) + elementCount;
+
+			trans = ndb.startTransaction();
+			myTransactionList.add(trans);
+
+			orderOp = trans.getInsertOperation(ORDER);
+
+			orderOp.equalInt(ORDER_PARTID, id);
+			orderOp.equalInt(ORDER_ORDERID, id);
+
+			orderOp.setInt(ORDER_ACCOUNTID, id);
+			orderOp.setInt(ORDER_REQUESTID, id);
+			orderOp.setInt(ORDER_INSTRUMENTID, id);
+			orderOp.setInt(ORDER_ISBUY, id);
+			orderOp.setInt(ORDER_QUANTITY, id);
+			orderOp.setInt(ORDER_PRICE, id);
+
+			if (!USE_SYNCHRONOUS) {
+				callback = new OrderCallback(id, ndb, trans, orderOp.resultData());
+
+				trans.executeAsynchPrepare(ExecType.Commit,
+													   callback,
+										   AbortOption.AbortOnError);
+			}
+		} 
+
+		if (USE_SYNCHRONOUS) {
+			trans.execute(ExecType.Commit, AbortOption.AbortOnError, true);
+		}
+		else {
+			System.out.println("Performing first sendPollNdb. ");
+			ndb.sendPollNdb(REQUEST_TRANSACTIONS_TIMEOUT, NUM_REQUEST_TRANSACTIONS, FORCE_SEND);
+			System.out.println("Completed first sendPollNdb.");
+
+			clearTransactions();
+		}
+
+		// Process response transaction
+
+		trans = ndb.startTransaction();
+
+		NdbOperation executionOp;
+		NdbOperation tradeOp;
+		NdbOperation settlementOp;
+
+		for (int elementCount = 1;
+			 elementCount < NUMBER_OF_ELEMENT_INSERTIONS + 1;
+			 elementCount++) {
+			int id = (NUMBER_OF_ELEMENT_INSERTIONS * loop) + elementCount;
+			
+			trans = ndb.startTransaction();
+myTransactionList.add(trans);
+
+			executionOp = trans.getInsertOperation(EXECUTION);
+
+			executionOp.equalInt(EXECUTION_PARTID, id);
+			executionOp.equalInt(EXECUTION_EXECUTIONID, id);
+
+			executionOp.setInt(EXECUTION_ACCOUNTID, id);
+			executionOp.setInt(EXECUTION_ORDERID, id);
+
+			if (!USE_SYNCHRONOUS) {
+				callback = new ExecutionCallback(id, ndb, trans, executionOp.resultData());
+
+				trans.executeAsynchPrepare(ExecType.Commit,
+													   callback,
+										   AbortOption.AbortOnError);
+			}
+			
+			trans = ndb.startTransaction();
+myTransactionList.add(trans);
+
+			tradeOp = trans.getInsertOperation(TRADE);
+
+			tradeOp.equalInt(TRADE_PARTID, id);
+			tradeOp.equalInt(TRADE_TRADEID, id);
+
+			tradeOp.setInt(TRADE_ACCOUNTID, id);
+			tradeOp.setInt(TRADE_ORDERID, id);
+			tradeOp.setInt(TRADE_PRICE, id);
+			tradeOp.setInt(TRADE_QUANTITY, id);
+
+			if (!USE_SYNCHRONOUS) {
+				callback = new TradeCallback(id, ndb, trans, executionOp.resultData());
+
+				trans.executeAsynchPrepare(ExecType.Commit,
+													   callback,
+										   AbortOption.AbortOnError);
+			}
+
+			trans = ndb.startTransaction();
+myTransactionList.add(trans);
+
+			settlementOp = trans.getInsertOperation(SETTLEMENT);
+
+			settlementOp.equalInt(SETTLEMENT_PARTID, id);
+			settlementOp.equalInt(SETTLEMENT_SETTLEMENTID, id);
+
+			settlementOp.setInt(SETTLEMENT_ACCOUNTID, id);
+			settlementOp.setInt(SETTLEMENT_TRADEID1, id);
+			settlementOp.setInt(SETTLEMENT_TRADEID2, id);
+			settlementOp.setInt(SETTLEMENT_QUANTITY, id);
+			settlementOp.setInt(SETTLEMENT_VALUE, id);
+
+			if (!USE_SYNCHRONOUS) {
+				callback = new SettlementCallback(id, ndb, trans, executionOp.resultData());
+
+				trans.executeAsynchPrepare(ExecType.Commit,
+													   callback,
+										   AbortOption.AbortOnError);
+			}
+		}
+
+		if (USE_SYNCHRONOUS) {
+			trans.execute(ExecType.Commit, AbortOption.AbortOnError, true);
+		}
+		else {
+			System.out.println("Performing second sendPollNdb. ");
+			ndb.sendPollNdb(REQUEST_TRANSACTIONS_TIMEOUT, NUM_REQUEST_TRANSACTIONS, FORCE_SEND);	
+			System.out.println("Completed second sendPollNdb.");
+
+			clearTransactions();
+		}
+		}
+		System.out.println("Performing cooldown");
+
+		ndb.sendPollNdb(100000, 100000, FORCE_SEND);	
 	}
 
 	private synchronized void clearTransactions() {

=== modified file 'java/testsuite/ndbj/SelectCountTest.java'
--- a/java/testsuite/ndbj/SelectCountTest.java	2008-04-29 02:07:14 +0000
+++ b/java/testsuite/ndbj/SelectCountTest.java	2008-05-17 06:19:36 +0000
@@ -17,10 +17,6 @@
 	protected String theTableName="t_select_count";
 	protected static final int SELECT_COUNT=12000;
 
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(SelectCountTest.class);
-	}
-
 	public SelectCountTest(String arg0) {
 		super(arg0);
 	} 
@@ -40,9 +36,7 @@
 //		// TODO Auto-generated method stub
 //	}
 
-	public void testInsert() {
-		
-
+	public void testInsert() throws NdbApiException {
 	  try {
 	    trans = ndb.startTransaction();
 
@@ -58,8 +52,6 @@
 	        true);
 
 		    trans.close();
-		    
-			assertTrue(true);
 
 		    trans = ndb.startTransaction();
 
@@ -80,12 +72,6 @@
 		    trans.execute(ExecType.Commit,
 			      AbortOption.AbortOnError,
 			      true);
-
-			assertTrue(true);
-		}
-		catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException:\t" + e.getMessage());
-			assertTrue(false);
 		}
 		finally {
 			/*if (trans!=null)

=== modified file 'java/testsuite/ndbj/Utf8InsertReadTest.java'
--- a/java/testsuite/ndbj/Utf8InsertReadTest.java	2008-04-29 03:40:11 +0000
+++ b/java/testsuite/ndbj/Utf8InsertReadTest.java	2008-05-17 06:19:36 +0000
@@ -2,7 +2,6 @@
 
 import testsuite.BaseNdbjTestCase;
 
-
 import com.mysql.cluster.ndbj.NdbApiException;
 import com.mysql.cluster.ndbj.NdbApiTemporaryException;
 import com.mysql.cluster.ndbj.NdbApiUserErrorPermanentException;
@@ -24,10 +23,6 @@
 	protected static final int NUM_INSERTS = 2;
 
 	protected static final String tablename = "t_utf8";
-	
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(Utf8InsertReadTest.class);
-	}
 
 	public Utf8InsertReadTest(String arg0) {
 		super(arg0);
@@ -43,9 +38,7 @@
 	/*
 	 * Test method for 'com.mysql.ndbapi.Ndb.destroy()'
 	 */
-	public void testUtf8InsertRead() {
-	
-
+	public void testUtf8InsertRead() throws NdbApiException {
 		boolean done = false;
 		int numRetries = 0;
 		while (numRetries < MAX_RETRIES && !done) {
@@ -62,17 +55,11 @@
 								AbortOption.AbortOnError, true);
 
 				done = true;
-				assertTrue(true);
 			} catch (NdbApiTemporaryException e) {
 				numRetries++;
 				System.out
 						.println("Temporary error. Retrying insert. Num Retries == "
 								+ numRetries + " error msg:" + e.getMessage());
-			} catch (NdbApiException e) {
-				System.out.println("Caught NdbApiException in Insert:\t"
-						+ e.getMessage());
-				assertTrue(false);
-				done = true;
 			} finally {
 				if (trans != null)
 					trans.close();
@@ -100,20 +87,13 @@
 						assertFalse(true);
 				}
 			}
-
-			assertTrue(true);
 		} catch (NdbApiUserErrorPermanentException e) {
 			System.out.println("User Permanent error. Retrying insert. Num Retries == "
 							+ e.getMessage());
-		} catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Delete:\t"
-					+ e.getMessage());
-			assertTrue(false);
 		} finally {
 			if (trans != null)
 				trans.close();
 		}
-
 	
 		try {
 			trans = ndb.startTransaction();
@@ -125,21 +105,13 @@
 
 			trans.execute(ExecType.Commit,
 							AbortOption.AbortOnError, true);
-
-			assertTrue(true);
 		} catch (NdbApiUserErrorPermanentException e) {
 			System.out
 					.println("User Permanent error. Retrying insert. Num Retries == "
 							+ e.getMessage());
-		} catch (NdbApiException e) {
-			System.out.println("Caught NdbApiException in Delete:\t"
-					+ e.getMessage());
-			assertTrue(false);
 		} finally {
 			if (trans != null)
 				trans.close();
 		}
-
 	}
-
 }



