18 package testsuite.clusterj;
20 import testsuite.clusterj.model.StringTypes;
21 import testsuite.clusterj.model.IdBase;
33 void createInstances(
int number) {
34 createAllStringTypesInstances(number);
77 btreeIndexScanString();
78 hashIndexScanString();
79 bothIndexScanString();
80 noneIndexScanString();
84 public void btreeIndexScanString() {
85 likeQuery(
"string_not_null_btree",
"none",
"%", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
86 likeQuery(
"string_not_null_btree",
"none",
"_");
87 likeQuery(
"string_not_null_btree",
"none",
"_____", 7);
88 likeQuery(
"string_not_null_btree",
"none",
"%York", 4);
89 likeQuery(
"string_not_null_btree",
"none",
"New York", 4);
90 likeQuery(
"string_not_null_btree",
"none",
"New Yor_", 4);
91 likeQuery(
"string_not_null_btree",
"none",
"New%", 3, 4);
92 greaterEqualAndLikeQuery(
"string_not_null_btree",
"idx_string_not_null_btree", getString(4),
"%", 4, 5, 6, 7, 8, 9);
93 greaterEqualAndLikeQuery(
"string_not_null_btree",
"idx_string_not_null_btree", getString(4),
"%enns%", 5);
94 greaterThanAndLikeQuery(
"string_not_null_btree",
"idx_string_not_null_btree", getString(4),
"%e%", 5, 6, 7);
97 public void hashIndexScanString() {
98 greaterEqualAndLikeQuery(
"string_not_null_hash",
"none", getString(4),
"%enns%", 5);
99 greaterThanAndLikeQuery(
"string_not_null_hash",
"none", getString(4),
"%e%", 5, 6, 7);
102 public void bothIndexScanString() {
103 greaterEqualAndLikeQuery(
"string_not_null_both",
"idx_string_not_null_both", getString(4),
"%enns%", 5);
104 greaterThanAndLikeQuery(
"string_not_null_both",
"idx_string_not_null_both", getString(4),
"%e%", 5, 6, 7);
107 public void noneIndexScanString() {
108 greaterEqualAndLikeQuery(
"string_not_null_none",
"none", getString(4),
"%enns%", 5);
109 greaterThanAndLikeQuery(
"string_not_null_none",
"none", getString(4),
"%e%", 5, 6, 7);
112 private void createAllStringTypesInstances(
int number) {
113 for (
int i = 0;
i < number; ++
i) {
114 StringTypes instance = session.
newInstance(StringTypes.class);
116 instance.setString_not_null_hash(getString(
i));
117 instance.setString_not_null_btree(getString(
i));
118 instance.setString_not_null_both(getString(
i));
119 instance.setString_not_null_none(getString(
i));
120 instance.setString_null_hash(getString(
i));
121 instance.setString_null_btree(getString(
i));
122 instance.setString_null_both(getString(
i));
123 instance.setString_null_none(getString(
i));
128 protected String getString(
int number) {
129 return strings[number];
139 @SuppressWarnings(
"unused")
140 StringTypes stringType = (StringTypes)instance;
148 buffer.append(instance.getId());
149 buffer.append(
"; string_not_null_both: ");
150 buffer.append(instance.getString_not_null_both());
151 buffer.append(
"; string_not_null_btree: ");
152 buffer.append(instance.getString_not_null_btree());
153 buffer.append(
"; string_not_null_hash: ");
154 buffer.append(instance.getString_not_null_hash());
155 buffer.append(
"; string_not_null_none: ");
156 buffer.append(instance.getString_not_null_none());
157 buffer.append(
"; string_null_both: ");
158 buffer.append(instance.getString_null_both().toString());
159 buffer.append(
"; string_null_btree: ");
160 buffer.append(instance.getString_null_btree().toString());
161 buffer.append(
"; string_null_hash: ");
162 buffer.append(instance.getString_null_hash().toString());
163 buffer.append(
"; string_null_none: ");
164 buffer.append(instance.getString_null_none().toString());
165 return buffer.toString();