List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:September 13 2007 10:57pm
Subject:Rev 155: A few test cleanups. Nothing major. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge

------------------------------------------------------------
revno: 155
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Thu 2007-09-13 15:57:45 -0700
message:
  A few test cleanups. Nothing major.
modified:
  java/testsuite/ndbj/OrderedIndexScanTest.java
orderedindexscantest-20070913200612-yxpzo7ji93xk863r-1
  java/testsuite/ndbj/SelectCountTest.java
selectcounttest.java-20070517181935-98huwjarzuh25b30-61
=== modified file 'java/testsuite/ndbj/OrderedIndexScanTest.java'
--- a/java/testsuite/ndbj/OrderedIndexScanTest.java	2007-09-13 22:09:24 +0000
+++ b/java/testsuite/ndbj/OrderedIndexScanTest.java	2007-09-13 22:57:45 +0000
@@ -1,7 +1,5 @@
 package testsuite.ndbj;
 
-import java.math.BigInteger;
-
 import testsuite.BaseNdbjTestCase;
 
 import com.mysql.cluster.errors.NdbApiException;
@@ -28,13 +26,12 @@
 	public void setUp() throws Exception {
 		super.setUp();
 		this.createTable(theTableName,
-		"(a integer, b integer, c integer, primary key(a,b)) engine=ndbcluster" 
-		);
-		this.stmt.executeUpdate("insert into t_oi_scan values (1,1,1)");
-		this.stmt.executeUpdate("insert into t_oi_scan values (1,2,1)");
-		this.stmt.executeUpdate("insert into t_oi_scan values (1,3,1)");
-		this.stmt.executeUpdate("insert into t_oi_scan values (1,4,1)");
-		this.stmt.executeUpdate("insert into t_oi_scan values (1,5,1)");
+				"(`"+col1+"` INT, `"+col2+"` int, primary key (`"+col1+"`,`"+col2+"`))
ENGINE=ndbcluster;");
+		this.stmt.executeUpdate("insert into " + theTableName + " values (1,1)");
+		this.stmt.executeUpdate("insert into " + theTableName + " values (1,2)");
+		this.stmt.executeUpdate("insert into " + theTableName + " values (1,3)");
+		this.stmt.executeUpdate("insert into " + theTableName + " values (1,4)");
+		this.stmt.executeUpdate("insert into " + theTableName + " values (1,5)");
 	}
 
 	public void tearDown() throws Exception {
@@ -59,7 +56,8 @@
 				trans.getNdbIndexScanOperation("PRIMARY", theTableName);
 			    
 			iop.readTuples(NdbOperation.LockMode.LM_CommittedRead);
-			//iop.readTuples(NdbOperationRef.LockMode.LM_CommittedRead, 0,0,false,false,false
/*readRangeNo set to true to be able to read "many" ranges in one scan op*/);
+			// We'll use this once we've implemented it
+			// iop.readTuples(NdbOperationRef.LockMode.LM_CommittedRead, 0,0,false,false,false
/*readRangeNo set to true to be able to read "many" ranges in one scan op*/);
 
 
 			/*   System.out.println("foo");
@@ -76,8 +74,8 @@
 			iop.endOfBound(bound_no);
 
 
-			iop.getValue("a");
-			iop.getValue("b");
+			iop.getValue(col1);
+			iop.getValue(col2);
 
 			NdbResultSet rs = iop.resultData();
 			trans.execute(NdbTransaction.ExecType.NoCommit, 
@@ -89,10 +87,10 @@
 			int count=1;
 			while(rs.next())
 			{
-				int a = rs.getInt("a");
-				int b = rs.getInt("b");
-				assertEquals(a,1);
-				assertEquals(b,count);
+				int col1Val = rs.getInt(col1);
+				int col2Val = rs.getInt(col2);
+				assertEquals(col1Val,1);
+				assertEquals(col2Val,count);
 				
 				count++;
 			}

=== modified file 'java/testsuite/ndbj/SelectCountTest.java'
--- a/java/testsuite/ndbj/SelectCountTest.java	2007-05-25 00:08:44 +0000
+++ b/java/testsuite/ndbj/SelectCountTest.java	2007-09-13 22:57:45 +0000
@@ -26,7 +26,8 @@
 	public void setUp() throws Exception {
 		super.setUp();
 		this.createTable(theTableName,
-		"(`id` INT PRIMARY KEY, `name` VARCHAR(256)) ENGINE=ndbcluster;");
+		"(`"+col1+"` INT PRIMARY KEY, `"+col2+"` VARCHAR(256)) ENGINE=ndbcluster;");
+				
 	}
 
 	public void tearDown() throws Exception {

Thread
Rev 155: A few test cleanups. Nothing major. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmergeMonty Taylor14 Sep