18 package testsuite.clusterj;
20 import testsuite.clusterj.model.Employee;
21 import testsuite.clusterj.model.LongIntStringPK;
23 import com.mysql.clusterj.ClusterJUserException;
29 createSessionFactory();
35 wrongKeyTypePrimitive();
36 wrongKeyTypePrimitiveNull();
37 wrongKeyTypeCompound();
38 wrongKeyTypeCompoundNull();
39 wrongKeyTypeCompoundNullPart();
40 setPartitionKeyTwice();
47 protected void badClass() {
51 error(
"Failed to throw exception on setPartitionKey(Integer.class, 0)");
52 }
catch (ClusterJUserException ex){
60 protected void wrongKeyTypePrimitive() {
64 error(
"Failed to throw exception on setPartitionKey(Employee.class, 0L)");
65 }
catch (ClusterJUserException ex){
73 protected void wrongKeyTypePrimitiveNull() {
77 error(
"Failed to throw exception on setPartitionKey(Employee.class, null)");
78 }
catch (ClusterJUserException ex){
86 protected void wrongKeyTypeCompound() {
90 error(
"Failed to throw exception on setPartitionKey(LongIntStringPK.class, 0L)");
91 }
catch (ClusterJUserException ex){
99 protected void wrongKeyTypeCompoundPart() {
101 Object[] key =
new Object[] {0L, 0L,
""};
104 error(
"Failed to throw exception on setPartitionKey(LongIntStringPK.class, new Object[] {0L, 0L, \"\"})");
105 }
catch (ClusterJUserException ex){
113 protected void wrongKeyTypeCompoundNull() {
117 error(
"Failed to throw exception on setPartitionKey(LongIntStringPK.class, null)");
118 }
catch (ClusterJUserException ex){
126 protected void wrongKeyTypeCompoundNullPart() {
129 Object[] key =
new Object[] {0L, null,
""};
131 error(
"Failed to throw exception on setPartitionKey(LongIntStringPK.class, new Object[] {0L, null, \"\"})");
132 }
catch (ClusterJUserException ex){
140 protected void setPartitionKeyTwice() {
144 Object[] key =
new Object[] {0L, 0,
""};
147 error(
"Failed to throw exception on second setPartitionKey");
148 }
catch (ClusterJUserException ex){
156 protected void goodIntKey() {
161 employee.setId(1000);
162 employee.setAge(1000);
163 employee.setMagic(1000);
164 employee.setName(
"Employee 1000");
173 protected void goodCompoundKey() {
178 Object[] key =
new Object[] { 1000L, 1000, null};
179 LongIntStringPK instance = session
181 instance.setLongpk(1000L);
182 instance.setIntpk(1000);
183 instance.setStringpk(
"1 Thousand");