tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdan...@apache.org
Subject svn commit: r451460 [6/6] - in /incubator/tuscany/java/das/rdb/src: main/java/org/apache/tuscany/das/rdb/ main/java/org/apache/tuscany/das/rdb/config/wrapper/ main/java/org/apache/tuscany/das/rdb/generator/impl/ main/java/org/apache/tuscany/das/rdb/gra...
Date Fri, 29 Sep 2006 21:36:41 GMT
Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/BookData.java Fri Sep 29 14:36:37 2006
@@ -23,25 +23,23 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns;
 
-
 public class BookData extends TestDataWithExplicitColumns {
 
-	//CREATE TABLE BOOK (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), AUTHOR VARCHAR(30), QUANTITY INT, OCC INTEGER)
+    // CREATE TABLE BOOK (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), AUTHOR VARCHAR(30), QUANTITY INT, OCC INTEGER)
+
+    private static int[] bookTypes = { Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER };
+
+    private static Object[][] bookData = { { new Integer(1), "The Brothers Karamazov", "Fyodor Dostoevsky", new Integer(5), new Integer(17) },
+            { new Integer(2), "Cat in the Hat", "Doctor Seuss", new Integer(10), new Integer(1) } };
+
+    private static String[] bookColumns = { "BOOK_ID", "NAME", "AUTHOR", "QUANTITY", "OCC" };
+
+    public BookData(Connection connection) {
+        super(connection, bookData, bookColumns, bookTypes);
+    }
 
-	private static int[] bookTypes = {Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER};
-	
-	private static Object[][] bookData = {
-			{ new Integer(1), "The Brothers Karamazov", "Fyodor Dostoevsky", new Integer(5), new Integer(17) },
-			{ new Integer(2), "Cat in the Hat", "Doctor Seuss", new Integer(10), new Integer(1) }};
-
-	private static String[] bookColumns = { "BOOK_ID", "NAME", "AUTHOR", "QUANTITY", "OCC"};
-	
-	public BookData(Connection connection) {
-		super(connection, bookData, bookColumns, bookTypes);
-	}
-
-	public String getTableName() {
-		return "BOOK";
-	}
+    public String getTableName() {
+        return "BOOK";
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CityData.java Fri Sep 29 14:36:37 2006
@@ -23,34 +23,29 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestData;
 
-
 public class CityData extends TestData {
 
-	private static Object[][] cityData = {
-		{new Integer(1), "Lizard Lick", "1"}, 
-		{new Integer(2), "Morrisville", "1"},
-		{new Integer(3), "Breckenridge", "2"},
-		{new Integer(4), "Barstow", "3"},
-		{new Integer(5), "Sacramento", "3"}
-		
-		};
-	
-	public CityData(Connection c) {
-		super(c, cityData);
-	}
-
-	public String getTableName() {
-		return "CITIES";
-	}
-
-	public void doDeletes() throws SQLException {
-		deleteRowsFromTable();
-		
-	}
-
-	public void doInserts() throws SQLException {
-		insertRows();
-		
-	}
+    private static Object[][] cityData = { { new Integer(1), "Lizard Lick", "1" }, { new Integer(2), "Morrisville", "1" },
+            { new Integer(3), "Breckenridge", "2" }, { new Integer(4), "Barstow", "3" }, { new Integer(5), "Sacramento", "3" }
+
+    };
+
+    public CityData(Connection c) {
+        super(c, cityData);
+    }
+
+    public String getTableName() {
+        return "CITIES";
+    }
+
+    public void doDeletes() throws SQLException {
+        deleteRowsFromTable();
+
+    }
+
+    public void doInserts() throws SQLException {
+        insertRows();
+
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyData.java Fri Sep 29 14:36:37 2006
@@ -23,25 +23,22 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns;
 
-
 public class CompanyData extends TestDataWithExplicitColumns {
 
-	//CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY ,NAME VARCHAR(30))
-	
-	private static int[] columnTypes = {Types.VARCHAR}; 
-	
-	private static Object[][] companyData = { { "ACME Publishing" },
-			{ "Do-rite plumbing" },
-			{ "MegaCorp" } };
-
-	private static String[] companyColumns = { "NAME" };
-
-	public CompanyData(Connection connection) {
-		super(connection, companyData, companyColumns, columnTypes);
-	}
-
-	public String getTableName() {
-		return "COMPANY";
-	}
+    // CREATE TABLE COMPANY (ID INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY ,NAME VARCHAR(30))
+
+    private static int[] columnTypes = { Types.VARCHAR };
+
+    private static Object[][] companyData = { { "ACME Publishing" }, { "Do-rite plumbing" }, { "MegaCorp" } };
+
+    private static String[] companyColumns = { "NAME" };
+
+    public CompanyData(Connection connection) {
+        super(connection, companyData, companyColumns, columnTypes);
+    }
+
+    public String getTableName() {
+        return "COMPANY";
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CompanyDeptData.java Fri Sep 29 14:36:37 2006
@@ -22,23 +22,20 @@
 
 import org.apache.tuscany.das.rdb.test.framework.RelationshipData;
 
-
 public class CompanyDeptData extends RelationshipData {
 
-	public static Object[][] data = {
-		{"MegaCorp", "Advanced Technologies"}
-		};
-	
-	public CompanyDeptData(Connection c) {
-		super(c, data);
-	}
+    public static Object[][] data = { { "MegaCorp", "Advanced Technologies" } };
+
+    public CompanyDeptData(Connection c) {
+        super(c, data);
+    }
 
-	protected String getParentRetrievalStatement() {
-		return "select id from company where name = ?";
-	}
+    protected String getParentRetrievalStatement() {
+        return "select id from company where name = ?";
+    }
 
-	protected String getChildUpdateStatement() {
-		return "update department set companyid = ? where department.name = ?";
-	}
+    protected String getChildUpdateStatement() {
+        return "update department set companyid = ? where department.name = ?";
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/CustomerData.java Fri Sep 29 14:36:37 2006
@@ -22,26 +22,18 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestData;
 
-
 public class CustomerData extends TestData {
 
-	private static Object[][] customerData = {
-			{new Integer(1), "Williams", "1212 foobar lane"}, 
-			{new Integer(2), "Daniel", "156 Brentfield Loop"},
-			{new Integer(3), "Williams", "456 penny lane"},
-			{new Integer(4), "Williams", "5000 pineville"},
-			{new Integer(5), "Williams", "100000 firefly lane"}
-			};
-
-	public CustomerData(Connection connection) {
-		super(connection, customerData);
-	}
+    private static Object[][] customerData = { { new Integer(1), "Williams", "1212 foobar lane" },
+            { new Integer(2), "Daniel", "156 Brentfield Loop" }, { new Integer(3), "Williams", "456 penny lane" },
+            { new Integer(4), "Williams", "5000 pineville" }, { new Integer(5), "Williams", "100000 firefly lane" } };
 
-	
-	public String getTableName() {
-		return "CUSTOMER";
-	}
+    public CustomerData(Connection connection) {
+        super(connection, customerData);
+    }
 
-	
+    public String getTableName() {
+        return "CUSTOMER";
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepEmpData.java Fri Sep 29 14:36:37 2006
@@ -22,26 +22,21 @@
 
 import org.apache.tuscany.das.rdb.test.framework.RelationshipData;
 
-
 public class DepEmpData extends RelationshipData {
 
-	private static Object[][] data = { 
-		{"Advanced Technologies", "John Jones"},
-		{"Advanced Technologies", "Jane Doe"},
-		{"Advanced Technologies", "Al Smith"}
-	};
-	
-	
-	public DepEmpData(Connection c) {
-		super(c, data);
-	}
+    private static Object[][] data = { { "Advanced Technologies", "John Jones" }, { "Advanced Technologies", "Jane Doe" },
+            { "Advanced Technologies", "Al Smith" } };
+
+    public DepEmpData(Connection c) {
+        super(c, data);
+    }
 
-	protected String getParentRetrievalStatement() {
-		return "select department.id from department where department.name = ?";
-	}
+    protected String getParentRetrievalStatement() {
+        return "select department.id from department where department.name = ?";
+    }
 
-	protected String getChildUpdateStatement() {
-		return "update employee set employee.departmentid = ? where employee.name = ?";
-	}
+    protected String getChildUpdateStatement() {
+        return "update employee set employee.departmentid = ? where employee.name = ?";
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DepartmentData.java Fri Sep 29 14:36:37 2006
@@ -28,9 +28,10 @@
 	
 	private static int[] columnTypes = {Types.VARCHAR, Types.VARCHAR, Types.VARCHAR};
 
-	private static Object[][] deptData = { { "Advanced Technologies", "NY", "123" } };
+	private static Object[][] deptData = {{"Advanced Technologies", "NY",
+			"123"}};
 
-	private static String[] deptColumns = { "NAME", "LOCATION", "DEPNUMBER" };
+	private static String[] deptColumns = {"NAME", "LOCATION", "DEPNUMBER"};
 	
 	public DepartmentData(Connection connection) {
 		super(connection, deptData, deptColumns, columnTypes);

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DogData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DogData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DogData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/DogData.java Fri Sep 29 14:36:37 2006
@@ -39,11 +39,11 @@
     private static int[] columnTypes = {Types.VARCHAR, Types.VARCHAR, Types.INTEGER}; 
 	
 	private static Object[][] data = { 
-            { "Fido", "Mutt", new Integer(1) },
-			{ "Max", "German Shepherd", new Integer(1) },
-			{ "Saddie", "Collie", new Integer(1)} };
+            {"Fido", "Mutt", new Integer(1)},
+			{"Max", "German Shepherd", new Integer(1)},
+			{"Saddie", "Collie", new Integer(1)}};
 
-	private static String[] columns = { "NAME", "BREED", "OCC_COUNT" };
+	private static String[] columns = {"NAME", "BREED", "OCC_COUNT"};
 
 	public DogData(Connection connection) {
 		super(connection, data, columns, columnTypes);

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/EmployeeData.java Fri Sep 29 14:36:37 2006
@@ -29,12 +29,12 @@
 	private static int[] columnTypes = {Types.VARCHAR, Types.VARCHAR, Types.SMALLINT};
 
 	private static Object[][] employeeData = { 
-        { "John Jones", "E0001", new Boolean(false) },
-		{ "Mary Smith", "E0002", new Boolean(true)},
-		{ "Jane Doe", "E0003", new Boolean(false)},
-		{ "Al Smith", "E0004", new Boolean(true) } };
+        {"John Jones", "E0001", new Boolean(false)},
+		{"Mary Smith", "E0002", new Boolean(true)},
+		{"Jane Doe", "E0003", new Boolean(false)},
+		{"Al Smith", "E0004", new Boolean(true)}};
 
-	private static String[] employeeColumns = { "NAME", "SN", "MANAGER" };
+	private static String[] employeeColumns = {"NAME", "SN", "MANAGER"};
 	
 	public EmployeeData(Connection connection) {
 		super(connection, employeeData, employeeColumns, columnTypes);

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/KennelData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/KennelData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/KennelData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/KennelData.java Fri Sep 29 14:36:37 2006
@@ -38,11 +38,11 @@
     private static int[] columnTypes = {Types.INTEGER, Types.VARCHAR, Types.INTEGER}; 
 	
 	private static Object[][] data = { 
-            { new Integer(100), "Small", new Integer(1) },
-			{ new Integer(101), "Small", new Integer(1) },
-			{ new Integer(102), "Large", new Integer(1)} };
+            {new Integer(100), "Small", new Integer(1)},
+			{new Integer(101), "Small", new Integer(1)},
+			{new Integer(102), "Large", new Integer(1)}};
 
-	private static String[] columns = { "KNUMBER", "KIND", "OCC_COUNT" };
+	private static String[] columns = {"KNUMBER", "KIND", "OCC_COUNT"};
 
 	public KennelData(Connection connection) {
 		super(connection, data, columns, columnTypes);

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OrderData.java Fri Sep 29 14:36:37 2006
@@ -22,23 +22,18 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestData;
 
-
 public class OrderData extends TestData {
 
+    public static Object[][] orderData = { { new Integer(1), "recombobulator", new Integer(47), new Integer(1) },
+            { new Integer(2), "wrench", new Integer(17), new Integer(3) }, { new Integer(3), "pliers", new Integer(500), new Integer(1) },
+            { new Integer(4), "Tooth Paste", new Integer(12), new Integer(2) } };
+
+    public OrderData(Connection c) {
+        super(c, orderData);
+    }
 
-	public static Object[][] orderData = {
-			{new Integer(1), "recombobulator", new Integer(47), new Integer(1)},
-			{new Integer(2), "wrench", new Integer(17), new Integer(3)},
-			{new Integer(3), "pliers", new Integer(500), new Integer(1)},
-			{new Integer(4), "Tooth Paste", new Integer(12), new Integer(2)}
-	};
-	
-	public OrderData(Connection c) {
-		super(c, orderData);
-	}
-	
-	public String getTableName() {
-		return "ANORDER";
-	}
+    public String getTableName() {
+        return "ANORDER";
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OwnerData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OwnerData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OwnerData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OwnerData.java Fri Sep 29 14:36:37 2006
@@ -38,11 +38,11 @@
     private static int[] columnTypes = {Types.VARCHAR, Types.VARCHAR, Types.INTEGER}; 
 	
 	private static Object[][] data = { 
-            { "Fanny", "222-2222", new Integer(1) },
-			{ "Manny", "333-3333", new Integer(1) },
-			{ "Sammy", "444-4444", new Integer(1)} };
+            {"Fanny", "222-2222", new Integer(1)},
+			{"Manny", "333-3333", new Integer(1)},
+			{"Sammy", "444-4444", new Integer(1)}};
 
-	private static String[] columns = { "NAME", "CONTACT_PHONE", "OCC_COUNT" };
+	private static String[] columns = {"NAME", "CONTACT_PHONE", "OCC_COUNT"};
 
 	public OwnerData(Connection connection) {
 		super(connection, data, columns, columnTypes);

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OwnerDogData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OwnerDogData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OwnerDogData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/OwnerDogData.java Fri Sep 29 14:36:37 2006
@@ -24,7 +24,7 @@
 
 public class OwnerDogData extends RelationshipData {
 
-    public static Object[][] data = { { "Fanny", "Fido" }, { "Manny", "Max" }, { "Sammy", "Saddie" } };
+    public static Object[][] data = {{"Fanny", "Fido"}, {"Manny", "Max"}, {"Sammy", "Saddie"}};
 
     public OwnerDogData(Connection c) {
         super(c, data);

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/PartData.java Fri Sep 29 14:36:37 2006
@@ -23,32 +23,24 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns;
 
-
 public class PartData extends TestDataWithExplicitColumns {
 
+    // CREATE TABLE PART (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), QUANTITY INT, PARENT_ID INT )
 
-	//CREATE TABLE PART (ID INT PRIMARY KEY NOT NULL, NAME VARCHAR(50), QUANTITY INT, PARENT_ID INT )
-	
-	private static String[] partColumns = { "ID" , "NAME", "QUANTITY", "PARENT_ID"};
-	
-	private static int[] columnTypes = {Types.INTEGER, Types.VARCHAR, Types.INTEGER, Types.INTEGER};
-	
-	private static Object[][] partData = {
-			{new Integer(1), "Engine", 		new Integer(1), null}, 
-			{new Integer(2), "Block", 		new Integer(1), new Integer(1)}, 
-			{new Integer(3), "Cam Shaft", 	new Integer(2), new Integer(1)}, 
-			{new Integer(4), "Piston", 		new Integer(8), new Integer(1)},
-			{new Integer(5), "Piston Ring", new Integer(2), new Integer(4)}
-			};
-	
-	public PartData(Connection connection) {
-		super(connection, partData, partColumns, columnTypes);
-	}
-
-	public String getTableName() {
-		return "PART";
-	}
+    private static String[] partColumns = { "ID", "NAME", "QUANTITY", "PARENT_ID" };
 
-}
+    private static int[] columnTypes = { Types.INTEGER, Types.VARCHAR, Types.INTEGER, Types.INTEGER };
+
+    private static Object[][] partData = { { new Integer(1), "Engine", new Integer(1), null },
+            { new Integer(2), "Block", new Integer(1), new Integer(1) }, { new Integer(3), "Cam Shaft", new Integer(2), new Integer(1) },
+            { new Integer(4), "Piston", new Integer(8), new Integer(1) }, { new Integer(5), "Piston Ring", new Integer(2), new Integer(4) } };
 
+    public PartData(Connection connection) {
+        super(connection, partData, partColumns, columnTypes);
+    }
 
+    public String getTableName() {
+        return "PART";
+    }
+
+}

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/StateData.java Fri Sep 29 14:36:37 2006
@@ -23,31 +23,25 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestData;
 
-
 public class StateData extends TestData {
+    private static Object[][] stateData = { { new Integer(1), "NC" }, { new Integer(2), "CO" }, { new Integer(3), "CA" } };
+    
+    public StateData(Connection c) {
+        super(c, stateData);
+    }
 
-	public StateData(Connection c) {
-		super(c, stateData);
-	}
+    public String getTableName() {
+        return "STATES";
+    }
 
-	public String getTableName() {
-		return "STATES";
-	}
-	
-	private static Object[][] stateData = {
-		{new Integer(1), "NC"}, 
-		{new Integer(2), "CO"},
-		{new Integer(3), "CA"}
-		};
 
-	public void doDeletes() throws SQLException {
-		deleteRowsFromTable();
-	}
+    public void doDeletes() throws SQLException {
+        deleteRowsFromTable();
+    }
 
-	public void doInserts() throws SQLException {
-		insertRows();
-		
-	}
+    public void doInserts() throws SQLException {
+        insertRows();
 
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/TypesData.java Fri Sep 29 14:36:37 2006
@@ -22,20 +22,16 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestData;
 
-
 public class TypesData extends TestData {
-			
-	private static Object[][] customerData = {
-			{new Integer(1), timestamp, new Float(1234567.89), new Float(1234567.89)}
-			};
 
-	public TypesData(Connection connection) {
-		super(connection, customerData);
-	}
-	
-	public String getTableName() {
-		return "TYPETEST";
-	}
+    private static Object[][] customerData = { { new Integer(1), timestamp, new Float(1234567.89), new Float(1234567.89) } };
+
+    public TypesData(Connection connection) {
+        super(connection, customerData);
+    }
+
+    public String getTableName() {
+        return "TYPETEST";
+    }
 
-	
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/VisitData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/VisitData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/VisitData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/data/VisitData.java Fri Sep 29 14:36:37 2006
@@ -23,34 +23,28 @@
 
 import org.apache.tuscany.das.rdb.test.framework.TestDataWithExplicitColumns;
 
-
 public class VisitData extends TestDataWithExplicitColumns {
 
-/*    CREATE TABLE VISIT (
-            ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
-            CHECK_IN TIMESTAMP NULL,
-            CHECK_OUT TIMESTAMP NULL,
-            OCC_COUNT INTEGER UNSIGNED NULL,
-            PRIMARY KEY(ID)
-          );*/
-    
-	//id omitted.  id is auto-generated.
-    private static int[] columnTypes = {Types.TIMESTAMP, Types.TIMESTAMP, Types.INTEGER}; 
-	
-	private static Object[][] data = { 
-            { getTimestamp("2006-10-20 00:00:00.0"), getTimestamp("2006-10-22 00:00:00.0"), new Integer(1) },
+    /*
+     * CREATE TABLE VISIT ( ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, CHECK_IN TIMESTAMP NULL, CHECK_OUT TIMESTAMP NULL, OCC_COUNT INTEGER UNSIGNED
+     * NULL, PRIMARY KEY(ID) );
+     */
+
+    // id omitted. id is auto-generated.
+    private static int[] columnTypes = { Types.TIMESTAMP, Types.TIMESTAMP, Types.INTEGER };
+
+    private static Object[][] data = { { getTimestamp("2006-10-20 00:00:00.0"), getTimestamp("2006-10-22 00:00:00.0"), new Integer(1) },
             { getTimestamp("2006-10-20 00:00:00.0"), getTimestamp("2006-10-22 00:00:00.0"), new Integer(1) },
-            { getTimestamp("2006-10-20 00:00:00.0"), getTimestamp("2006-10-22 00:00:00.0"), new Integer(1) }
-    };
+            { getTimestamp("2006-10-20 00:00:00.0"), getTimestamp("2006-10-22 00:00:00.0"), new Integer(1) } };
+
+    private static String[] columns = { "CHECK_IN", "CHECK_OUT", "OCC_COUNT" };
 
-	private static String[] columns = { "CHECK_IN", "CHECK_OUT", "OCC_COUNT" };
+    public VisitData(Connection connection) {
+        super(connection, data, columns, columnTypes);
+    }
 
-	public VisitData(Connection connection) {
-		super(connection, data, columns, columnTypes);
-	}
-
-	public String getTableName() {
-		return "VISIT";
-	}
+    public String getTableName() {
+        return "VISIT";
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DB2Setup.java Fri Sep 29 14:36:37 2006
@@ -22,16 +22,16 @@
 
 public class DB2Setup extends DatabaseSetup {
 
-	public DB2Setup(Test test) {
-		super(test);
-	}
+    public DB2Setup(Test test) {
+        super(test);
+    }
+
+    protected void initConnectionProtocol() {
+
+        platformName = "DB2";
+        driverName = "com.ibm.db2.jcc.DB2Driver";
+        databaseURL = "jdbc:db2:DASTEST";
+
+    }
 
-	protected void initConnectionProtocol() {
-		
-		platformName = "DB2";
-		driverName = "com.ibm.db2.jcc.DB2Driver";
-		databaseURL = "jdbc:db2:DASTEST";
-		
-	}
-	
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DasTest.java Fri Sep 29 14:36:37 2006
@@ -34,121 +34,112 @@
 import commonj.sdo.Property;
 
 /**
- *
+ * 
  */
 public class DasTest extends TestCase {
 
-	public static Connection connection = null;
+    protected static Connection connection;
 
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() throws Exception {
-//		if (usingDefaultSetup)
-//			connection = null;
-	}
-
-	protected Connection getAutoConnection() throws SQLException {
-		
-		Connection c = primGetConnection();
-		c.setAutoCommit(true);
-		return connection;
-
-	}
-
-	protected Connection getConnection() throws SQLException {
-		
-		Connection c = primGetConnection();
-		c.setAutoCommit(false);
-		return connection;
-	}
-	
-	/**
-	 * This provides the default connection for runing single test cases on a 
-	 * chosen platform.    
-	 */
-	private Connection primGetConnection() {
-		if (connection == null)
-			defaultSetup();
-		return connection;
-	}
-
-
-	
-	/**
-	 * This is a bit of a hack since it counts on constructor initialization of the 
-	 * DatabaseSet up class and also calls its setUp method directly.  This is a misuse 
-	 * of this JUnit TestSetup subclass .
-	 * 
-	 * TODO - refactor to avoid this hackiness ... could move this logic to its own
-	 * class that is then invoked by DatabaseSetUp
-	 */
-	private void defaultSetup() {	
-		
-//		DatabaseSetup setUp = new DB2Setup(this);
+    /**
+     * Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
+     */
+    protected void tearDown() throws Exception {
+        // if (usingDefaultSetup)
+        // connection = null;
+    }
+
+    protected Connection getAutoConnection() throws SQLException {
+
+        Connection c = primGetConnection();
+        c.setAutoCommit(true);
+        return connection;
+
+    }
+
+    protected Connection getConnection() throws SQLException {
+
+        Connection c = primGetConnection();
+        c.setAutoCommit(false);
+        return connection;
+    }
+
+    /**
+     * This provides the default connection for runing single test cases on a chosen platform.
+     */
+    private Connection primGetConnection() {
+        if (connection == null)
+            defaultSetup();
+        return connection;
+    }
+
+    /**
+     * This is a bit of a hack since it counts on constructor initialization of the DatabaseSet up class and also calls its setUp method directly.
+     * This is a misuse of this JUnit TestSetup subclass .
+     * 
+     * TODO - refactor to avoid this hackiness ... could move this logic to its own class that is then invoked by DatabaseSetUp
+     */
+    private void defaultSetup() {
+
+        // DatabaseSetup setUp = new DB2Setup(this);
         DatabaseSetup setUp = new DerbySetup(this);
-		try {
-			setUp.setUp();
-		} catch (Exception e) {
-			throw new RuntimeException(e);
-		}
-		
-	}
-	
-	
-	//Utilities
+        try {
+            setUp.setUp();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+    }
+
+    // Utilities
     protected InputStream getConfig(String fileName) throws FileNotFoundException {
         return Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
     }
 
-	protected void write(String label, ResultSet rs) throws IOException, SQLException {
-		
-		ResultSetMetaData md = rs.getMetaData();
-		int count = md.getColumnCount();
-		System.out.println("Contents of ResultSet from " + label);
-		for (int i = 1; i <= count; i++) {
-			System.out.print("\t");
-			System.out.println (md.getColumnLabel(i));
-		}
-		System.out.println("");
-		while (rs.next()) {
-			for (int i = 1; i <= count; i++) {
-				System.out.print("\t");
-				System.out.print(rs.getString(i));
-			}
-			System.out.println("\t");
-		}
-		System.out.println("done");
-	}
-	
-	
-	protected void printList(List data) {
-		Iterator i = data.iterator();
-		while ( i.hasNext()) {
-			System.out.println();
-			DataObject obj = (DataObject) i.next();
-			Iterator props = obj.getType().getProperties().iterator();
-			while ( props.hasNext()) {
-				Property p = (Property) props.next();
-				if ( p.isMany() ) {
-					System.out.print("[ " + p.getName() + " ] ");
-					Iterator children = obj.getList(p).iterator();
-					while ( children.hasNext()) {
-						DataObject child = (DataObject) children.next();
-						System.out.print("[ " + child.get("ID") + " ]");
-					}
-					System.out.println();
-				} else if ( !p.getType().isDataType()) {
-					DataObject child = obj.getDataObject(p);
-					if ( child != null ) 
-						System.out.println("[ " + p.getName() + " ] " + "[ " + child.get("ID") + " ]");
-				} else {
-					System.out.println("[ " + p.getName() + " ] " + obj.get(p));
-				}
-			}	
-		}
-	}
-	
-	
+    protected void write(String label, ResultSet rs) throws IOException, SQLException {
+
+        ResultSetMetaData md = rs.getMetaData();
+        int count = md.getColumnCount();
+        System.out.println("Contents of ResultSet from " + label);
+        for (int i = 1; i <= count; i++) {
+            System.out.print("\t");
+            System.out.println(md.getColumnLabel(i));
+        }
+        System.out.println("");
+        while (rs.next()) {
+            for (int i = 1; i <= count; i++) {
+                System.out.print("\t");
+                System.out.print(rs.getString(i));
+            }
+            System.out.println("\t");
+        }
+        System.out.println("done");
+    }
+
+    protected void printList(List data) {
+        Iterator i = data.iterator();
+        while (i.hasNext()) {
+            System.out.println();
+            DataObject obj = (DataObject) i.next();
+            Iterator props = obj.getType().getProperties().iterator();
+            while (props.hasNext()) {
+                Property p = (Property) props.next();
+                if (p.isMany()) {
+                    System.out.print("[ " + p.getName() + " ] ");
+                    Iterator children = obj.getList(p).iterator();
+                    while (children.hasNext()) {
+                        DataObject child = (DataObject) children.next();
+                        System.out.print("[ " + child.get("ID") + " ]");
+                    }
+                    System.out.println();
+                } else if (!p.getType().isDataType()) {
+                    DataObject child = obj.getDataObject(p);
+                    if (child != null)
+                        System.out.println("[ " + p.getName() + " ] " + "[ " + child.get("ID") + " ]");
+                } else {
+                    System.out.println("[ " + p.getName() + " ] " + obj.get(p));
+                }
+            }
+        }
+    }
+
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/DatabaseSetup.java Fri Sep 29 14:36:37 2006
@@ -28,19 +28,17 @@
 
 public class DatabaseSetup extends TestSetup {
 
+    protected Statement s;
+
     protected String platformName = "Not initialized";
 
     protected String driverName = "Not initialized";
 
     protected String databaseURL = "Not initialized";
 
-    protected String userName = null;
-
-    protected String password = null;
-
-    private Connection connection;
+    protected String userName;
 
-    protected Statement s;
+    protected String password;
 
     // Data Types
     protected String stringType = "VARCHAR";
@@ -52,7 +50,9 @@
     protected String floatType = "FLOAT";
 
     protected String decimalType = "DECIMAL";
-    
+
+    private Connection connection;
+
     public DatabaseSetup(Test test) {
         super(test);
         initConnectionProtocol();
@@ -130,11 +130,12 @@
         // System.out.println("Dropping tables");
 
         String[] statements = {
-
-        "DROP TABLE CUSTOMER", "DROP TABLE ANORDER", "DROP TABLE ORDERDETAILS", "DROP TABLE ITEM", "DROP TABLE COMPANY", "DROP TABLE EMPLOYEE",
-                "DROP TABLE DEPARTMENT", "DROP TABLE BOOK", "DROP TABLE PART", "DROP TABLE TYPETEST", "DROP TABLE CITIES", "DROP TABLE STATES",
-                "DROP TABLE conmgt.SERVERSTATUS", "DROP TABLE DOG", "DROP TABLE OWNER", "DROP TABLE KENNEL", "DROP TABLE VISIT"
-
+            "DROP TABLE CUSTOMER", "DROP TABLE ANORDER", "DROP TABLE ORDERDETAILS", 
+            "DROP TABLE ITEM", "DROP TABLE COMPANY", "DROP TABLE EMPLOYEE",
+            "DROP TABLE DEPARTMENT", "DROP TABLE BOOK", "DROP TABLE PART", 
+            "DROP TABLE TYPETEST", "DROP TABLE CITIES", "DROP TABLE STATES",
+            "DROP TABLE conmgt.SERVERSTATUS", "DROP TABLE DOG", "DROP TABLE OWNER", 
+            "DROP TABLE KENNEL", "DROP TABLE VISIT"
         };
 
         for (int i = 0; i < statements.length; i++) {
@@ -142,9 +143,10 @@
                 s.execute(statements[i]);
             } catch (SQLException e) {
                 // If the table does not exist then ignore the exception on drop
-                if ((!e.getMessage().contains("does not exist")) && (!e.getMessage().contains("Unknown table"))
-                		&& (!e.getMessage().contains("42704")))
+                if ((!e.getMessage().contains("does not exist")) && (!e.getMessage().contains("Unknown table")) 
+                        && (!e.getMessage().contains("42704"))) {
                     throw new RuntimeException(e);
+                }
             }
         }
     }
@@ -171,8 +173,9 @@
 
         String[] statements = {
 
-        "DROP PROCEDURE GETALLCOMPANIES", "DROP PROCEDURE DELETECUSTOMER", "DROP PROCEDURE GETNAMEDCOMPANY", "DROP PROCEDURE GETCUSTOMERANDORDERS",
-                "DROP PROCEDURE GETNAMEDCUSTOMERS", "DROP PROCEDURE GETALLCUSTOMERSANDORDERS"
+            "DROP PROCEDURE GETALLCOMPANIES", "DROP PROCEDURE DELETECUSTOMER", 
+            "DROP PROCEDURE GETNAMEDCOMPANY", "DROP PROCEDURE GETCUSTOMERANDORDERS",
+            "DROP PROCEDURE GETNAMEDCUSTOMERS", "DROP PROCEDURE GETALLCUSTOMERSANDORDERS"
 
         };
 
@@ -181,8 +184,9 @@
                 s.execute(statements[i]);
             } catch (SQLException e) {
                 // If the proc does not exist then ignore the exception on drop
-                if (!e.getMessage().contains("does not exist") && !e.getMessage().contains("42704"))
+                if (!e.getMessage().contains("does not exist") && !e.getMessage().contains("42704")) {
                     throw new RuntimeException(e);
+                }
             }
         }
     }
@@ -222,18 +226,25 @@
         // System.out.println("Creating procedures");
         try {
 
-            s
-                    .execute("CREATE PROCEDURE GETALLCOMPANIES() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getAllCompanies'");
-            s
-                    .execute("CREATE PROCEDURE DELETECUSTOMER(theId int) PARAMETER STYLE JAVA LANGUAGE JAVA MODIFIES SQL DATA EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.deleteCustomer'");
-            s
-                    .execute("CREATE PROCEDURE GETNAMEDCOMPANY(theName VARCHAR(100)) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getNamedCompany'");
-            s
-                    .execute("CREATE PROCEDURE GETCUSTOMERANDORDERS(theID INTEGER) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getCustomerAndOrders'");
-            s
-                    .execute("CREATE PROCEDURE GETNAMEDCUSTOMERS(theName VARCHAR(100), OUT theCount INTEGER) PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getNamedCustomers'");
-            s
-                    .execute("CREATE PROCEDURE GETALLCUSTOMERSANDORDERS() PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 2 EXTERNAL NAME 'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getAllCustomersAndAllOrders'");
+            s.execute("CREATE PROCEDURE GETALLCOMPANIES() PARAMETER STYLE JAVA LANGUAGE JAVA "
+                            + "READS SQL DATA DYNAMIC RESULT SETS 1 "
+                            + "EXTERNAL NAME " 
+                            + "'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getAllCompanies'");
+            s.execute("CREATE PROCEDURE DELETECUSTOMER(theId int) PARAMETER STYLE JAVA LANGUAGE JAVA " 
+                    + "MODIFIES SQL DATA EXTERNAL NAME " 
+                    + "'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.deleteCustomer'");
+            s.execute("CREATE PROCEDURE GETNAMEDCOMPANY(theName VARCHAR(100)) PARAMETER STYLE JAVA LANGUAGE JAVA " 
+                    + "READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME " 
+                    + "'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getNamedCompany'");
+            s.execute("CREATE PROCEDURE GETCUSTOMERANDORDERS(theID INTEGER) PARAMETER STYLE JAVA LANGUAGE JAVA " 
+                    + "READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME " 
+                    + "'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getCustomerAndOrders'");
+            s.execute("CREATE PROCEDURE GETNAMEDCUSTOMERS(theName VARCHAR(100), OUT theCount INTEGER) " 
+                    + "PARAMETER STYLE JAVA LANGUAGE JAVA READS SQL DATA DYNAMIC RESULT SETS 1 EXTERNAL NAME " 
+                    + "'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getNamedCustomers'");
+            s.execute("CREATE PROCEDURE GETALLCUSTOMERSANDORDERS() PARAMETER STYLE JAVA LANGUAGE JAVA " 
+                    + "READS SQL DATA DYNAMIC RESULT SETS 2 EXTERNAL NAME " 
+                    + "'org.apache.tuscany.das.rdb.test.framework.JavaStoredProcs.getAllCustomersAndAllOrders'");
             // TODO - "GETNAMEDCUSTOMERS" is failing on DB2 with SQLCODE: 42723. Need to investigate
         } catch (SQLException e) {
             throw new RuntimeException(e);
@@ -247,47 +258,56 @@
     //
 
     protected String getCreateCustomer() {
-        return "CREATE TABLE CUSTOMER (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL, " + getStringColumn("LASTNAME", 30)
+        return "CREATE TABLE CUSTOMER (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL, " 
+            + getStringColumn("LASTNAME", 30)
                 + " DEFAULT 'Garfugengheist', " + getStringColumn("ADDRESS", 30) + ")";
     }
 
     protected String getCreateAnOrder() {
-        return "CREATE TABLE ANORDER (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL, " + getStringColumn("PRODUCT", 30) + ", "
+        return "CREATE TABLE ANORDER (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL, " 
+            + getStringColumn("PRODUCT", 30) + ", "
                 + getIntegerColumn("QUANTITY") + "," + getIntegerColumn("CUSTOMER_ID") + ")";
     }
 
     protected String getCreateOrderDetails() {
-        return "CREATE TABLE ORDERDETAILS (" + getIntegerColumn("ORDERID") + " NOT NULL, " + getIntegerColumn("PRODUCTID")
+        return "CREATE TABLE ORDERDETAILS (" + getIntegerColumn("ORDERID") + " NOT NULL, " 
+            + getIntegerColumn("PRODUCTID")
                 + " NOT NULL, PRICE FLOAT, PRIMARY KEY (ORDERID, PRODUCTID))";
     }
 
     protected String getCreateItem() {
-        return "CREATE TABLE ITEM (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL, " + getStringColumn("NAME", 30) + ")";
+        return "CREATE TABLE ITEM (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL, " 
+            + getStringColumn("NAME", 30) + ")";
     }
 
     protected String getCreateCompany() {
-        return "CREATE TABLE COMPANY (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL " + getGeneratedKeyClause() + " , "
+        return "CREATE TABLE COMPANY (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL " 
+            + getGeneratedKeyClause() + " , "
                 + getStringColumn("NAME", 30) + ", " + getIntegerColumn("EOTMID") + ")";
     }
 
     protected String getCreateEmployee() {
-        return "CREATE TABLE EMPLOYEE (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL " + getGeneratedKeyClause() + ","
+        return "CREATE TABLE EMPLOYEE (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL " 
+            + getGeneratedKeyClause() + ","
                 + getStringColumn("NAME", 30) + "," + getStringColumn("SN", 10) + ", MANAGER SMALLINT, " + getIntegerColumn("DEPARTMENTID") + ")";
     }
 
     protected String getCreateDepartment() {
-        return "CREATE TABLE DEPARTMENT (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL " + getGeneratedKeyClause() + ", "
+        return "CREATE TABLE DEPARTMENT (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL " 
+            + getGeneratedKeyClause() + ", "
                 + getStringColumn("NAME", 30) + "," + getStringColumn("LOCATION", 30) + ", " + getStringColumn("DEPNUMBER", 10) + ","
                 + getIntegerColumn("COMPANYID") + ")";
     }
 
     protected String getCreateBook() {
-        return "CREATE TABLE BOOK (" + getIntegerColumn("BOOK_ID") + " PRIMARY KEY NOT NULL, " + getStringColumn("NAME", 50) + ","
+        return "CREATE TABLE BOOK (" + getIntegerColumn("BOOK_ID") + " PRIMARY KEY NOT NULL, " 
+            + getStringColumn("NAME", 50) + ","
                 + getStringColumn("AUTHOR", 30) + ", " + getIntegerColumn("QUANTITY") + "," + getIntegerColumn("OCC") + ")";
     }
 
     protected String getCreatePart() {
-        return "CREATE TABLE PART (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL, NAME VARCHAR(50),  " + getIntegerColumn("QUANTITY") + ","
+        return "CREATE TABLE PART (" + getIntegerColumn("ID") + " PRIMARY KEY NOT NULL, NAME VARCHAR(50),  " 
+            + getIntegerColumn("QUANTITY") + ","
                 + getIntegerColumn("PARENT_ID") + " )";
     }
 
@@ -324,26 +344,17 @@
         return "CREATE TABLE OWNER (" + getIntegerColumn("ID") + " NOT NULL " + getGeneratedKeyClause() + " , " + getStringColumn("NAME", 20) + ", "
                 + getStringColumn("CONTACT_PHONE", 20) + ", " + getIntegerColumn("OCC_COUNT") + ", " + "PRIMARY KEY(ID))";
     }
-    
+
     protected String getCreateKennel() {
-        return "CREATE TABLE KENNEL (" 
-        + getIntegerColumn("ID") + " NOT NULL " + getGeneratedKeyClause() + " , " 
-        + getIntegerColumn("KNUMBER") + ", "
-        + getStringColumn("KIND", 20) + ", " 
-        + getIntegerColumn("OCC_COUNT") + ", " 
-        + "PRIMARY KEY(ID))";
+        return "CREATE TABLE KENNEL (" + getIntegerColumn("ID") + " NOT NULL " + getGeneratedKeyClause() + " , " + getIntegerColumn("KNUMBER") + ", "
+                + getStringColumn("KIND", 20) + ", " + getIntegerColumn("OCC_COUNT") + ", " + "PRIMARY KEY(ID))";
     }
-    
+
     protected String getCreateVisit() {
-        return "CREATE TABLE VISIT (" 
-        + getIntegerColumn("ID") + " NOT NULL " + getGeneratedKeyClause() + " , " 
-        + getTimestampColumn("CHECK_IN") + ", "
-        + getTimestampColumn("CHECK_OUT") + ", "
-        + getIntegerColumn("OCC_COUNT") + ", " 
-        + "PRIMARY KEY(ID))";
+        return "CREATE TABLE VISIT (" + getIntegerColumn("ID") + " NOT NULL " + getGeneratedKeyClause() + " , " + getTimestampColumn("CHECK_IN")
+                + ", " + getTimestampColumn("CHECK_OUT") + ", " + getIntegerColumn("OCC_COUNT") + ", " + "PRIMARY KEY(ID))";
     }
-    
-    
+
     // /////////////////
 
     protected String getForeignKeyConstraint(String pkTable, String pkColumn, String foreignKey) {
@@ -380,7 +391,6 @@
 
     protected String getTimestampColumn(String name) {
         return name + ' ' + timestampType;
-    }   
-    
-    
+    }
+
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/JavaStoredProcs.java Fri Sep 29 14:36:37 2006
@@ -28,19 +28,23 @@
  * Stored Procedures for DB2 and Derby SP tests
  * 
  */
-public class JavaStoredProcs {
+public final class JavaStoredProcs {
+
+    private JavaStoredProcs() {
+
+    }
+
+    public static void getAllCustomersAndAllOrders(ResultSet[] result1, ResultSet[] result2) throws SQLException {
+        Connection conn = DriverManager.getConnection("jdbc:default:connection");
+        PreparedStatement ps = conn.prepareStatement("SELECT * FROM CUSTOMER");
 
-	public static void getAllCustomersAndAllOrders(ResultSet[] result1, ResultSet[] result2) throws SQLException {		
-		Connection conn = DriverManager.getConnection("jdbc:default:connection");
-        PreparedStatement ps = conn
-                .prepareStatement("SELECT * FROM CUSTOMER");
-        
         result1[0] = ps.executeQuery();
-        
-        PreparedStatement ps2 = conn.prepareStatement("select * from anorder");       
-        result2[0] = ps2.executeQuery();          
-        
-	}
+
+        PreparedStatement ps2 = conn.prepareStatement("select * from anorder");
+        result2[0] = ps2.executeQuery();
+
+    }
+
     public static void getAllCompanies(ResultSet[] results) throws SQLException {
 
         Connection conn = DriverManager.getConnection("jdbc:default:connection");
@@ -69,7 +73,8 @@
 
         Connection conn = DriverManager.getConnection("jdbc:default:connection");
         PreparedStatement ps = conn
-                .prepareStatement("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID = ?");
+                .prepareStatement("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID " 
+                        + "WHERE CUSTOMER.ID = ?");
         ps.setInt(1, theId);
         results[0] = ps.executeQuery();
     }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/MySQLSetup.java Fri Sep 29 14:36:37 2006
@@ -37,33 +37,25 @@
 	}
 	
 	
-	protected void createProcedures () {
+	protected void createProcedures() {
 		
-		String createGetAllCompanies = 
-			"CREATE PROCEDURE `dastest`.`GETALLCOMPANIES` () "+ 
-			"	SELECT * FROM COMPANY ";
-		  
-		  
-		String createDeleteCustomer = 
-			"CREATE PROCEDURE `dastest`.`DELETECUSTOMER` (theId INT) " +
-		    "  DELETE FROM CUSTOMER WHERE ID = theId ";
+		String createGetAllCompanies = "CREATE PROCEDURE `dastest`.`GETALLCOMPANIES` () "
+				+ "	SELECT * FROM COMPANY ";
 
+		String createDeleteCustomer = "CREATE PROCEDURE `dastest`.`DELETECUSTOMER` (theId INT) "
+				+ "  DELETE FROM CUSTOMER WHERE ID = theId ";
 
-		String createGetNamedCustomers = 
-			"CREATE PROCEDURE `dastest`.`GETNAMEDCUSTOMERS`(IN thename VARCHAR(30), OUT theCount INTEGER ) " +
-		    " BEGIN " +
-		    "  SELECT * FROM CUSTOMER AS CUSTOMER WHERE LASTNAME = theName; " +
-            "  SET theCount =  (SELECT COUNT(*) FROM CUSTOMER WHERE LASTNAME = theName); " +
-            " END ";
-		  
-		String createGetCustomerAndOrders = 
-			" CREATE PROCEDURE `dastest`.`GETCUSTOMERANDORDERS` (theId INT) " +
-		    " SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID =  theId "; 
-		
+		String createGetNamedCustomers = "CREATE PROCEDURE `dastest`.`GETNAMEDCUSTOMERS`(IN thename VARCHAR(30), OUT theCount INTEGER ) "
+				+ " BEGIN "
+				+ "  SELECT * FROM CUSTOMER AS CUSTOMER WHERE LASTNAME = theName; "
+				+ "  SET theCount =  (SELECT COUNT(*) FROM CUSTOMER WHERE LASTNAME = theName); "
+				+ " END ";
+
+		String createGetCustomerAndOrders = " CREATE PROCEDURE `dastest`.`GETCUSTOMERANDORDERS` (theId INT) "
+				+ " SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID WHERE CUSTOMER.ID =  theId ";
 
-		String createGetNamedCompany = 
-			" CREATE PROCEDURE `dastest`.`GETNAMEDCOMPANY` (theName VARCHAR(100)) " +
-		    " SELECT * FROM COMPANY WHERE NAME = theName"; 
+		String createGetNamedCompany = " CREATE PROCEDURE `dastest`.`GETNAMEDCOMPANY` (theName VARCHAR(100)) "
+				+ " SELECT * FROM COMPANY WHERE NAME = theName"; 
 		
 		System.out.println("Creating procedures");
 		try {

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/RelationshipData.java Fri Sep 29 14:36:37 2006
@@ -24,60 +24,60 @@
 import java.sql.SQLException;
 
 public abstract class RelationshipData {
-	protected Object[][] data;
-	private int currentRow = -1;
-	protected Connection connection;
-	
-
-	public RelationshipData(Connection c, Object[][] inputData) {
-		this.connection = c; 
-		this.data = inputData;
-	}
-
-	public int size() {
-		return data[0].length;
-	}
-	
-	public int numberOfRows() {
-		return data.length;
-	}
-	
-	public boolean next() {
-		++currentRow;
-		if ( currentRow < numberOfRows() ) 
-			return true;
-		else
-			return false;
-	}
-
-	
-	public void refresh() throws SQLException {
-		updateRelationships();
-	}
-	
-	protected abstract String getParentRetrievalStatement();
-	protected abstract String getChildUpdateStatement();
-	
-	
-	protected void updateRelationships() throws SQLException {
-		// { MegaCorp, Advanced Technologies } 
-		// select company.id from company where company.name = ?
-		PreparedStatement retrieveParent = connection.prepareStatement(getParentRetrievalStatement());
-		// update department set department.companyid = ? where department.name = ?
-		PreparedStatement updateChild = connection.prepareStatement(getChildUpdateStatement());
-		
-		while ( next() ) {
-			retrieveParent.setObject(1, data[currentRow][0]);
-			retrieveParent.execute();
-			ResultSet rs = retrieveParent.getResultSet();
-			rs.next();
-			Object parentID = rs.getObject(1);
-			retrieveParent.clearParameters();
-			
-			updateChild.setObject(1, parentID);
-			updateChild.setObject(2, data[currentRow][1]);
-			updateChild.execute();
-			updateChild.clearParameters();
-		}
-	}
+    protected Object[][] data;
+    
+    protected Connection connection;
+    
+    private int currentRow = -1;
+
+    public RelationshipData(Connection c, Object[][] inputData) {
+        this.connection = c;
+        this.data = inputData;
+    }
+
+    public int size() {
+        return data[0].length;
+    }
+
+    public int numberOfRows() {
+        return data.length;
+    }
+
+    public boolean next() {
+        ++currentRow;
+        if (currentRow < numberOfRows())
+            return true;
+        else
+            return false;
+    }
+
+    public void refresh() throws SQLException {
+        updateRelationships();
+    }
+
+    protected abstract String getParentRetrievalStatement();
+
+    protected abstract String getChildUpdateStatement();
+
+    protected void updateRelationships() throws SQLException {
+        // { MegaCorp, Advanced Technologies }
+        // select company.id from company where company.name = ?
+        PreparedStatement retrieveParent = connection.prepareStatement(getParentRetrievalStatement());
+        // update department set department.companyid = ? where department.name = ?
+        PreparedStatement updateChild = connection.prepareStatement(getChildUpdateStatement());
+
+        while (next()) {
+            retrieveParent.setObject(1, data[currentRow][0]);
+            retrieveParent.execute();
+            ResultSet rs = retrieveParent.getResultSet();
+            rs.next();
+            Object parentID = rs.getObject(1);
+            retrieveParent.clearParameters();
+
+            updateChild.setObject(1, parentID);
+            updateChild.setObject(2, data[currentRow][1]);
+            updateChild.execute();
+            updateChild.clearParameters();
+        }
+    }
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestData.java Fri Sep 29 14:36:37 2006
@@ -28,100 +28,99 @@
 import java.util.Date;
 
 public abstract class TestData {
-	
-	protected Object[][] data;
-	private int currentRow = -1;
-	protected Connection connection;
-    
-    
+
     protected static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:ss:mm.SSS");
-    protected static Timestamp timestamp = getTimestamp();
 
-	public TestData(Connection c, Object[][] customerData) {
-		this.connection = c; 
-		this.data = customerData;
-	}
-
-	public int size() {
-		return data[0].length;
-	}
-	
-	public int numberOfRows() {
-		return data.length;
-	}
-	
-	public boolean next() {
-		++currentRow;
-		if ( currentRow < numberOfRows() ) 
-			return true;
-		else
-			return false;
-	}
-
-	public abstract String getTableName();
-	
-	
-	public Object getObject(int i) {
-		return data[currentRow][i-1];
-	}
-	
-	public void refresh() throws SQLException {
-		deleteRowsFromTable();
-		insertRows();
-	}
-	
-	protected void deleteRowsFromTable() throws SQLException {
-		PreparedStatement ps = connection.prepareStatement("delete from " + getTableName());
-		ps.execute();
-		ps.close();
-	}
-	
-	protected void insertRows() throws SQLException {
-		StringBuffer sql = new StringBuffer();
-		sql.append("insert into ");
-		sql.append(getTableName());
-		sql.append(" values (");
-		for ( int i=1; i < size(); i++) {
-			sql.append("?,");
-		}
-		sql.append("?)");
-		PreparedStatement ps = connection.prepareStatement(sql.toString());
-		
-		while ( next() ) {
-			for ( int i=1; i <= size(); i++ ) {
-				ps.setObject(i, getObject(i));
-			}
-			ps.execute();
-			ps.clearParameters();
-		}
-		ps.close();
-	}
+    protected static Timestamp timestamp = getTimestamp();
     
-    //Utilities
+    protected Object[][] data;
+
+    protected Connection connection;
+
+    private int currentRow = -1;
+ 
+
+    public TestData(Connection c, Object[][] customerData) {
+        this.connection = c;
+        this.data = customerData;
+    }
+
+    public int size() {
+        return data[0].length;
+    }
+
+    public int numberOfRows() {
+        return data.length;
+    }
+
+    public boolean next() {
+        ++currentRow;
+        return currentRow < numberOfRows();
+    }
+
+    public abstract String getTableName();
+
+    public Object getObject(int i) {
+        return data[currentRow][i - 1];
+    }
+
+    public void refresh() throws SQLException {
+        deleteRowsFromTable();
+        insertRows();
+    }
+
+    protected void deleteRowsFromTable() throws SQLException {
+        PreparedStatement ps = connection.prepareStatement("delete from " + getTableName());
+        ps.execute();
+        ps.close();
+    }
+
+    protected void insertRows() throws SQLException {
+        StringBuffer sql = new StringBuffer();
+        sql.append("insert into ");
+        sql.append(getTableName());
+        sql.append(" values (");
+        for (int i = 1; i < size(); i++) {
+            sql.append("?,");
+        }
+        sql.append("?)");
+        PreparedStatement ps = connection.prepareStatement(sql.toString());
+
+        while (next()) {
+            for (int i = 1; i <= size(); i++) {
+                ps.setObject(i, getObject(i));
+            }
+            ps.execute();
+            ps.clearParameters();
+        }
+        ps.close();
+    }
+
+    // Utilities
     protected static Date getDate() {
-        
+
         try {
             return dateFormat.parse("1966-12-20 00:00:00.0");
         } catch (ParseException e) {
             throw new RuntimeException(e);
         }
     }
-    
+
     protected static Date getDate(String timeStamp) {
-        
+
         try {
             return dateFormat.parse("1966-12-20 00:00:00.0");
         } catch (ParseException e) {
             throw new RuntimeException(e);
         }
     }
-    
+
     public static Timestamp getTimestamp() {
         return new Timestamp(getDate().getTime());
     }
-    
+
     public static Timestamp getTimestamp(String timeStamp) {
         return new Timestamp(getDate(timeStamp).getTime());
     }
-    
+
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/framework/TestDataWithExplicitColumns.java Fri Sep 29 14:36:37 2006
@@ -25,63 +25,64 @@
 import org.apache.log4j.Logger;
 import org.apache.tuscany.das.rdb.util.LoggerFactory;
 
-
 public abstract class TestDataWithExplicitColumns extends TestData {
 
-    private final Logger logger = LoggerFactory.INSTANCE.getLogger(TestDataWithExplicitColumns.class);
-
-	protected String[] columns;
+    protected String[] columns;
 
     protected int[] sqlTypes;
+    
+    private final Logger logger = LoggerFactory.INSTANCE.getLogger(TestDataWithExplicitColumns.class);
 
-	public TestDataWithExplicitColumns(Connection c, Object[][] data, String[] columns, int[] sqlTypes) {
-		super(c, data);
-		this.columns = columns;
-		this.sqlTypes = sqlTypes;
-	}
-
-	private String getColumn(int i) {
-		return columns[i - 1];
-	}
-
-	private int getSqlType(int i) {
-		return (sqlTypes[i - 1]);
-	}
-
-	// Create an insert statement of the following form ...
-	//    "INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)"
-	// This is necessary for tables with a generated column since the PK value is not provided
-	protected void insertRows() throws SQLException {
-		StringBuffer sql = new StringBuffer();
-		sql.append("insert into ");
-		sql.append(getTableName());
-
-		sql.append(" (");
-		for (int i = 1; i <= size(); i++) {
-			sql.append(getColumn(i));
-			if ( i < size() )
-				sql.append(',');
-		}
-		sql.append(" )");
-
-		sql.append(" values (");
-		for (int i = 1; i < size(); i++) {
-			sql.append("?,");
-		}
-		sql.append("?)");
+    public TestDataWithExplicitColumns(Connection c, Object[][] data, String[] columns, int[] sqlTypes) {
+        super(c, data);
+        this.columns = columns;
+        this.sqlTypes = sqlTypes;
+    }
+
+    private String getColumn(int i) {
+        return columns[i - 1];
+    }
+
+    private int getSqlType(int i) {
+        return sqlTypes[i - 1];
+    }
+
+    // Create an insert statement of the following form ...
+    // "INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)"
+    // This is necessary for tables with a generated column since the PK value is not provided
+    protected void insertRows() throws SQLException {
+        StringBuffer sql = new StringBuffer();
+        sql.append("insert into ");
+        sql.append(getTableName());
+
+        sql.append(" (");
+        for (int i = 1; i <= size(); i++) {
+            sql.append(getColumn(i));
+            if (i < size()) {
+                sql.append(',');
+            }
+        }
+        sql.append(" )");
+
+        sql.append(" values (");
+        for (int i = 1; i < size(); i++) {
+            sql.append("?,");
+        }
+        sql.append("?)");
 
-        if(this.logger.isDebugEnabled())
+        if (this.logger.isDebugEnabled()) {
             this.logger.debug(sql.toString());
+        }
 
-		PreparedStatement ps = connection.prepareStatement(sql.toString());
+        PreparedStatement ps = connection.prepareStatement(sql.toString());
 
-		while (next()) {
-			for (int i = 1; i <= size(); i++) {
-				ps.setObject(i, getObject(i), getSqlType(i));
-			}
-			ps.execute();
-			ps.clearParameters();
-		}
-	}
+        while (next()) {
+            for (int i = 1; i <= size(); i++) {
+                ps.setObject(i, getObject(i), getSqlType(i));
+            }
+            ps.execute();
+            ps.clearParameters();
+        }
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/IntegerToBooleanConverter.java Fri Sep 29 14:36:37 2006
@@ -33,7 +33,7 @@
 	
 	public Object getColumnValue(Object propertyData) {
 		Boolean value = (Boolean) propertyData;
-		if ( value.booleanValue())
+		if (value.booleanValue())
 			return new Integer(1);
 		else
 			return new Integer(0);

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/SillyDateStringConverter.java Fri Sep 29 14:36:37 2006
@@ -25,51 +25,53 @@
 
 import org.apache.tuscany.das.rdb.Converter;
 
+public class SillyDateStringConverter implements Converter {
 
-public class SillyDateStringConverter  implements Converter {
+    private static DateFormat myformat = new SimpleDateFormat("yyyy.MM.dd");
 
-	public SillyDateStringConverter() {
-		super();
-	}
+    private static Date kbday;
 
-	private static DateFormat myformat = new SimpleDateFormat("yyyy.MM.dd");
+    private static Date tbday;
 
-	private static Date kbday;
+    public SillyDateStringConverter() {
+        super();
+    }
 
-	private static Date tbday;
+    static {
+        try {
+            kbday = myformat.parse("1957.09.27");
+            tbday = myformat.parse("1966.12.20");
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
+        }
+    }
 
-	static {
-		try {
-			kbday = myformat.parse("1957.09.27");
-			tbday = myformat.parse("1966.12.20");
-		} catch (ParseException e) {
-			throw new RuntimeException(e);
-		}
-	}
+    public Object getPropertyValue(Object columnData) {
 
-	public Object getPropertyValue(Object columnData) {
+        if (columnData.equals("Williams")) {
+            return kbday;
+        }
 
-		if (columnData.equals("Williams"))
-			return kbday;
+        if (columnData.equals("Pavick")) {
+            return tbday;
+        }
 
-		if (columnData.equals("Pavick"))
-			return tbday;
+        throw new IllegalArgumentException();
 
-		throw new IllegalArgumentException();
+    }
 
-	}
+    public Object getColumnValue(Object propertyData) {
 
-	public Object getColumnValue(Object propertyData) {
+        if (propertyData.equals(kbday)) {
+            return "Williams";
+        }
 
-		if (propertyData.equals(kbday))
-			return "Williams";
+        if (propertyData.equals(tbday)) {
+            return "Pavick";
+        }
 
-		if (propertyData.equals(tbday))
-			return "Pavick";
-
-		throw new IllegalArgumentException();
-		
-	}
+        throw new IllegalArgumentException();
 
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToIntegerConverter.java Fri Sep 29 14:36:37 2006
@@ -22,18 +22,18 @@
 
 public class StringToIntegerConverter implements Converter {
 
-	public StringToIntegerConverter() {
-		super();
-	}
+    public StringToIntegerConverter() {
+        super();
+    }
 
-	public Object getPropertyValue(Object columnData) {
-	//	System.out.println("Converting object..  " + columnData);
-		
-		return new Integer(columnData.toString());
-	}
+    public Object getPropertyValue(Object columnData) {
+        // System.out.println("Converting object.. " + columnData);
 
-	public Object getColumnValue(Object columnData) {
-		return columnData.toString();
-	}
+        return new Integer(columnData.toString());
+    }
+
+    public Object getColumnValue(Object columnData) {
+        return columnData.toString();
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/mappings/StringToLongConverter.java Fri Sep 29 14:36:37 2006
@@ -22,16 +22,16 @@
 
 public class StringToLongConverter implements Converter {
 
-	public StringToLongConverter() {
-		super();
-	}
+    public StringToLongConverter() {
+        super();
+    }
 
-	public Object getPropertyValue(Object columnData) {
-		return new Long(columnData.toString());
-	}
+    public Object getPropertyValue(Object columnData) {
+        return new Long(columnData.toString());
+    }
 
-	public Object getColumnValue(Object columnData) {
-		return columnData.toString();
-	}
+    public Object getColumnValue(Object columnData) {
+        return columnData.toString();
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllCommonTests.java Fri Sep 29 14:36:37 2006
@@ -53,55 +53,57 @@
 import org.apache.tuscany.das.rdb.test.TypeTests;
 import org.apache.tuscany.das.rdb.test.typed.SimplestStaticCrud;
 
-public class AllCommonTests {
+public final class AllCommonTests {
 
-	public static Test suite() {
-		TestSuite suite = new TestSuite("All platform-common DAS tests");
-		//$JUnit-BEGIN$
-		
-		suite.addTest(new TestSuite (SimplestCrud.class));
-		suite.addTest(new TestSuite (CrudWithChangeHistory.class));
-		suite.addTest(new TestSuite (SimplestStaticCrud.class));
-		suite.addTest(new TestSuite (Paging.class));
-		suite.addTest(new TestSuite (GeneratedId.class));
-    	
-		suite.addTest(new TestSuite (StoredProcs.class));
-    	suite.addTest(new TestSuite (CUDGeneration.class));
-		suite.addTest(new TestSuite (TopDown.class));
-		suite.addTest(new TestSuite (OCCTests.class));
-		suite.addTest(new TestSuite (RecursiveTests.class));
-
-		suite.addTest(new TestSuite (GraphMergeTests.class));
-		suite.addTest(new TestSuite (CompoundKeyTests.class));
-		suite.addTest(new TestSuite (RelationshipTests.class));		
-		suite.addTest(new TestSuite (GeneratedCommandTests.class));
-		
-		suite.addTest(new TestSuite (CompanyTests.class));
-		suite.addTest(new TestSuite (ResultSetShapeTests.class));
-		suite.addTest(new TestSuite (TypeTests.class));
-		suite.addTest(new TestSuite (OperationOrderingTests.class));
-		suite.addTest(new TestSuite (ConverterTests.class));
-
-		suite.addTest(new TestSuite (PartialUpdateTests.class));
-		suite.addTest(new TestSuite (ExceptionTests.class));
-		suite.addTest(new TestSuite (PassiveConnectionTests.class));
-		suite.addTest(new TestSuite (SerializationTests.class));
-		
-        suite.addTest(new TestSuite (CommandGroupTests.class));
-        suite.addTest(new TestSuite (BestPracticeTests.class));
-        suite.addTest(new TestSuite (CorrectedDefectTests.class));
-        suite.addTest(new TestSuite (OneToOneRelationshipTests.class));
-       
-        suite.addTest(new TestSuite (ProgrammaticConfigTests.class));
-        suite.addTest(new TestSuite (AliasTests.class));
-       
-        suite.addTest(new TestSuite (ImpliedRelationshipTests.class));
-        
-        suite.addTest(new TestSuite (KennelTests.class));
+    private AllCommonTests() {  
+    }
     
-        
-		//$JUnit-END$
-		return suite;
-	}
+    public static Test suite() {
+        TestSuite suite = new TestSuite("All platform-common DAS tests");
+        // $JUnit-BEGIN$
+
+        suite.addTest(new TestSuite(SimplestCrud.class));
+        suite.addTest(new TestSuite(CrudWithChangeHistory.class));
+        suite.addTest(new TestSuite(SimplestStaticCrud.class));
+        suite.addTest(new TestSuite(Paging.class));
+        suite.addTest(new TestSuite(GeneratedId.class));
+
+        suite.addTest(new TestSuite(StoredProcs.class));
+        suite.addTest(new TestSuite(CUDGeneration.class));
+        suite.addTest(new TestSuite(TopDown.class));
+        suite.addTest(new TestSuite(OCCTests.class));
+        suite.addTest(new TestSuite(RecursiveTests.class));
+
+        suite.addTest(new TestSuite(GraphMergeTests.class));
+        suite.addTest(new TestSuite(CompoundKeyTests.class));
+        suite.addTest(new TestSuite(RelationshipTests.class));
+        suite.addTest(new TestSuite(GeneratedCommandTests.class));
+
+        suite.addTest(new TestSuite(CompanyTests.class));
+        suite.addTest(new TestSuite(ResultSetShapeTests.class));
+        suite.addTest(new TestSuite(TypeTests.class));
+        suite.addTest(new TestSuite(OperationOrderingTests.class));
+        suite.addTest(new TestSuite(ConverterTests.class));
+
+        suite.addTest(new TestSuite(PartialUpdateTests.class));
+        suite.addTest(new TestSuite(ExceptionTests.class));
+        suite.addTest(new TestSuite(PassiveConnectionTests.class));
+        suite.addTest(new TestSuite(SerializationTests.class));
+
+        suite.addTest(new TestSuite(CommandGroupTests.class));
+        suite.addTest(new TestSuite(BestPracticeTests.class));
+        suite.addTest(new TestSuite(CorrectedDefectTests.class));
+        suite.addTest(new TestSuite(OneToOneRelationshipTests.class));
+
+        suite.addTest(new TestSuite(ProgrammaticConfigTests.class));
+        suite.addTest(new TestSuite(AliasTests.class));
+
+        suite.addTest(new TestSuite(ImpliedRelationshipTests.class));
+
+        suite.addTest(new TestSuite(KennelTests.class));
+
+        //$JUnit-END$
+        return suite;
+    }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDB2.java Fri Sep 29 14:36:37 2006
@@ -24,18 +24,21 @@
 import org.apache.tuscany.das.rdb.test.ReadDBSchemaTests;
 import org.apache.tuscany.das.rdb.test.framework.DB2Setup;
 
-public class AllTestsDB2 {
-	
-	
-	public static Test suite() {	
-		
-		TestSuite suite = new TestSuite();
-		suite.addTest(AllCommonTests.suite());
-		suite.addTest(new TestSuite (ReadDBSchemaTests.class));
+public final class AllTestsDB2 {
 
-		TestSuite suite2 = new TestSuite("All DAS tests on DB2");
-		suite2.addTest(new DB2Setup(suite));
-		return suite2;
+    private AllTestsDB2() {
+        
+    }
+    
+    public static Test suite() {
 
-	}
+        TestSuite suite = new TestSuite();
+        suite.addTest(AllCommonTests.suite());
+        suite.addTest(new TestSuite(ReadDBSchemaTests.class));
+
+        TestSuite suite2 = new TestSuite("All DAS tests on DB2");
+        suite2.addTest(new DB2Setup(suite));
+        return suite2;
+
+    }
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsDerby.java Fri Sep 29 14:36:37 2006
@@ -24,13 +24,12 @@
 import org.apache.tuscany.das.rdb.test.framework.DerbySetup;
 
 public class AllTestsDerby extends TestSuite {
-	
-	
-	public static Test suite() {
-		
-		TestSuite suite = new TestSuite("All DAS tests on Derby");
-		suite.addTest(new DerbySetup(AllCommonTests.suite()));
-		return suite;
-		
-	}
+
+    public static Test suite() {
+
+        TestSuite suite = new TestSuite("All DAS tests on Derby");
+        suite.addTest(new DerbySetup(AllCommonTests.suite()));
+        return suite;
+
+    }
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/suites/AllTestsMySQL.java Fri Sep 29 14:36:37 2006
@@ -23,14 +23,17 @@
 
 import org.apache.tuscany.das.rdb.test.framework.MySQLSetup;
 
-public class AllTestsMySQL {
-	
-	
-	public static Test suite() {
-		
-		TestSuite suite = new TestSuite("All DAS tests on MySQL");
-		suite.addTest(new MySQLSetup(AllCommonTests.suite()));
-		return suite;
-		
-	}
+public final class AllTestsMySQL {
+
+    private AllTestsMySQL() {
+        
+    }
+    
+    public static Test suite() {
+
+        TestSuite suite = new TestSuite("All DAS tests on MySQL");
+        suite.addTest(new MySQLSetup(AllCommonTests.suite()));
+        return suite;
+
+    }
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java?view=diff&rev=451460&r1=451459&r2=451460
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java Fri Sep 29 14:36:37 2006
@@ -30,29 +30,27 @@
 
 import commonj.sdo.DataObject;
 
-
 /**
  */
 public class SimplestStaticCrud extends DasTest {
 
-	protected void setUp() throws Exception {
-		super.setUp();
-		new CustomerData(getAutoConnection()).refresh();
-	}
-	
-	public void testRead() throws Exception {
-		InputStream mapping = getClass().getClassLoader().getResourceAsStream("basicStaticCustomer.xml");
-		DAS das = DAS.FACTORY.createDAS(mapping, getConnection());
-		SDOUtil.registerStaticTypes(CustomerFactory.class);
-		
-		Command select = das.createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where LASTNAME = ?");		
-		select.setParameter(1, "Williams");	
-		
-		DataObject root = select.executeQuery();
-		
-		Collection customers = root.getList("Customer");
-		assertEquals(4, customers.size());
-	}
+    protected void setUp() throws Exception {
+        super.setUp();
+        new CustomerData(getAutoConnection()).refresh();
+    }
+
+    public void testRead() throws Exception {
+        InputStream mapping = getClass().getClassLoader().getResourceAsStream("basicStaticCustomer.xml");
+        DAS das = DAS.FACTORY.createDAS(mapping, getConnection());
+        SDOUtil.registerStaticTypes(CustomerFactory.class);
+
+        Command select = das.createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where LASTNAME = ?");
+        select.setParameter(1, "Williams");
+
+        DataObject root = select.executeQuery();
 
+        Collection customers = root.getList("Customer");
+        assertEquals(4, customers.size());
+    }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message