List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:April 13 2012 11:08am
Subject:bzr push into mysql-5.5-cluster-7.3 branch (magnus.blaudd:3880 to 3881)
View as plain text  
 3881 magnus.blaudd@stripped	2012-04-13 [merge]
      Merge 7.2 -> 7.3

    modified:
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DeleteAllByClassTest.java
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/ObjectNotFoundTest.java
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryExplainTest.java
 3880 magnus.blaudd@stripped	2012-04-13 [merge]
      Merge 7.2 -> 7.3

    modified:
      sql/ha_ndbcluster.cc
=== modified file 'storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DeleteAllByClassTest.java'
--- a/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DeleteAllByClassTest.java	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DeleteAllByClassTest.java	2012-04-13 11:00:31 +0000
@@ -1,6 +1,5 @@
 /*
-   Copyright 2010 Sun Microsystems, Inc.
-   All rights reserved. Use is subject to license terms.
+   Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -55,7 +54,8 @@ public class DeleteAllByClassTest extend
         tx.begin();
         int count = session.deletePersistentAll(Employee.class);
         tx.commit();
-        assertEquals("Mismatch on number of deleted instances: ",
+        errorIfNotEqual("Mismatch on number of deleted instances: ",
                 NUMBER_TO_INSERT, count);
+        failOnError();
     }
 }

=== modified file 'storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/ObjectNotFoundTest.java'
--- a/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/ObjectNotFoundTest.java	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/ObjectNotFoundTest.java	2012-04-13 11:00:31 +0000
@@ -1,6 +1,5 @@
 /*
-   Copyright 2010 Sun Microsystems, Inc.
-   All rights reserved. Use is subject to license terms.
+   Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -16,6 +15,7 @@
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 */
 
+
 package testsuite.clusterj;
 
 import testsuite.clusterj.model.Employee;
@@ -26,6 +26,7 @@ public class ObjectNotFoundTest extends 
         createSessionFactory();
         session = sessionFactory.getSession();
         Employee e = session.find(Employee.class, 9999999);
-        assertNull("Result of find of non-existent object should be null.", e);
+        errorIfNotEqual("Result of find of non-existent object should be null.", null, e);
+        failOnError();
     }
 }

=== modified file 'storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryExplainTest.java'
--- a/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryExplainTest.java	2011-02-02 09:52:33 +0000
+++ b/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryExplainTest.java	2012-04-12 20:59:50 +0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -20,12 +20,10 @@ package testsuite.clusterj;
 import java.util.Map;
 
 import com.mysql.clusterj.ClusterJUserException;
-import com.mysql.clusterj.Constants;
 import com.mysql.clusterj.Query;
 import com.mysql.clusterj.query.QueryBuilder;
 import com.mysql.clusterj.query.QueryDomainType;
 
-import testsuite.clusterj.AbstractQueryTest.QueryHolder;
 import testsuite.clusterj.model.AllPrimitives;
 
 /**
@@ -72,7 +70,7 @@ create table allprimitives (
 public class QueryExplainTest extends AbstractQueryTest {
 
     @Override
-    public Class getInstanceType() {
+    public Class<?> getInstanceType() {
         return AllPrimitives.class;
     }
 
@@ -88,8 +86,9 @@ public class QueryExplainTest extends Ab
         Map<String, Object> result = query.explain();
         String indexUsed = result.get(Query.INDEX_USED).toString();
         String scanType = result.get(Query.SCAN_TYPE).toString();
-        assertEquals("Query explain with no where clause should have index none", "none", indexUsed);
-        assertEquals("Query explain with no where clause should have scan type TABLE_SCAN", "TABLE_SCAN", scanType);
+        errorIfNotEqual("Query explain with no where clause should have index none", "none", indexUsed);
+        errorIfNotEqual("Query explain with no where clause should have scan type TABLE_SCAN", "TABLE_SCAN", scanType);
+        failOnError();
     }
 
     public void testExplainBeforeBindingParameters() {
@@ -102,8 +101,9 @@ public class QueryExplainTest extends Ab
             fail("Explain before binding parameters should throw ClusterJUserException");
         } catch (ClusterJUserException ex) {
             // good catch; make sure message includes parameter name "equal"
-            assertTrue("Message should include parameter name \"equal\"", ex.getMessage().contains("equal"));
+            errorIfNotEqual("Message should include parameter name \"equal\"", true, ex.getMessage().contains("equal"));
         }
+        failOnError();
     }
 
     public void testExplainAfterBindingParametersNoIndexEqual() {
@@ -115,8 +115,9 @@ public class QueryExplainTest extends Ab
         Map<String, Object> result = query.explain();
         String indexUsed = result.get(Query.INDEX_USED).toString();
         String scanType = result.get(Query.SCAN_TYPE).toString();
-        assertEquals("Query explain with no index should have index none", "none", indexUsed);
-        assertEquals("Query explain with no index should have scan type TABLE_SCAN", Query.SCAN_TYPE_TABLE_SCAN, scanType);
+        errorIfNotEqual("Query explain with no index should have index none", "none", indexUsed);
+        errorIfNotEqual("Query explain with no index should have scan type TABLE_SCAN", Query.SCAN_TYPE_TABLE_SCAN, scanType);
+        failOnError();
     }
 
     public void testExplainAfterBindingParametersUniqueEqual() {
@@ -128,8 +129,9 @@ public class QueryExplainTest extends Ab
         Map<String, Object> result = query.explain();
         String indexUsed = result.get(Query.INDEX_USED).toString();
         String scanType = result.get(Query.SCAN_TYPE).toString();
-        assertEquals("Query explain with PRIMARY key equal should have index int_not_null_hash", "idx_int_not_null_hash", indexUsed);
-        assertEquals("Query explain with PRIMARY key equal should have scan type UNIQUE_KEY", Query.SCAN_TYPE_UNIQUE_KEY, scanType);
+        errorIfNotEqual("Query explain with PRIMARY key equal should have index int_not_null_hash", "idx_int_not_null_hash", indexUsed);
+        errorIfNotEqual("Query explain with PRIMARY key equal should have scan type UNIQUE_KEY", Query.SCAN_TYPE_UNIQUE_KEY, scanType);
+        failOnError();
     }
 
     public void testExplainAfterBindingParametersPrimaryEqual() {
@@ -141,8 +143,9 @@ public class QueryExplainTest extends Ab
         Map<String, Object> result = query.explain();
         String indexUsed = result.get(Query.INDEX_USED).toString();
         String scanType = result.get(Query.SCAN_TYPE).toString();
-        assertEquals("Query explain with PRIMARY key equal should have index PRIMARY", "PRIMARY", indexUsed);
-        assertEquals("Query explain with PRIMARY key equal should have scan type PRIMARY_KEY", Query.SCAN_TYPE_PRIMARY_KEY, scanType);
+        errorIfNotEqual("Query explain with PRIMARY key equal should have index PRIMARY", "PRIMARY", indexUsed);
+        errorIfNotEqual("Query explain with PRIMARY key equal should have scan type PRIMARY_KEY", Query.SCAN_TYPE_PRIMARY_KEY, scanType);
+        failOnError();
     }
 
     public void testExplainAfterBindingParametersPrimaryLessThan() {
@@ -154,8 +157,9 @@ public class QueryExplainTest extends Ab
         Map<String, Object> result = query.explain();
         String indexUsed = result.get(Query.INDEX_USED).toString();
         String scanType = result.get(Query.SCAN_TYPE).toString();
-        assertEquals("Query explain with PRIMARY key lessThan should have index PRIMARY", "PRIMARY", indexUsed);
-        assertEquals("Query explain with PRIMARY key lessThan should have scan type INDEX_SCAN", Query.SCAN_TYPE_INDEX_SCAN, scanType);
+        errorIfNotEqual("Query explain with PRIMARY key lessThan should have index PRIMARY", "PRIMARY", indexUsed);
+        errorIfNotEqual("Query explain with PRIMARY key lessThan should have scan type INDEX_SCAN", Query.SCAN_TYPE_INDEX_SCAN, scanType);
+        failOnError();
     }
 
     public void testExplainAfterBindingParametersPrimaryLessThanNull() {
@@ -167,8 +171,9 @@ public class QueryExplainTest extends Ab
         Map<String, Object> result = query.explain();
         String indexUsed = result.get(Query.INDEX_USED).toString();
         String scanType = result.get(Query.SCAN_TYPE).toString();
-        assertEquals("Query explain with PRIMARY key lessThan null should have index none", "none", indexUsed);
-        assertEquals("Query explain with PRIMARY key lessThan null should have scan type TABLE_SCAN", Query.SCAN_TYPE_TABLE_SCAN, scanType);
+        errorIfNotEqual("Query explain with PRIMARY key lessThan null should have index none", "none", indexUsed);
+        errorIfNotEqual("Query explain with PRIMARY key lessThan null should have scan type TABLE_SCAN", Query.SCAN_TYPE_TABLE_SCAN, scanType);
+        failOnError();
     }
 
 }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.3 branch (magnus.blaudd:3880 to 3881) magnus.blaudd13 Apr