blob: 39e7e9f9c91dcaee7e04a9fde3e750e2a9bf1e14 [file] [log] [blame]
Jonathan Hart6df90172014-04-03 10:13:11 -07001package net.onrc.onos.core.datastore.hazelcast;
Yuta HIGUCHI6a643132014-03-18 22:39:27 -07002
Jonathan Harta88fd242014-04-03 11:24:54 -07003import static org.junit.Assert.assertArrayEquals;
4import static org.junit.Assert.assertEquals;
5import static org.junit.Assert.assertNotEquals;
6import static org.junit.Assert.assertNotNull;
7import static org.junit.Assert.assertNull;
8import static org.junit.Assert.assertTrue;
9import static org.junit.Assert.fail;
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070010
11import java.nio.charset.StandardCharsets;
12import java.util.Map;
13import java.util.TreeMap;
14
Jonathan Harta88fd242014-04-03 11:24:54 -070015import net.onrc.onos.core.datastore.IKVTable.IKVEntry;
Jonathan Hart6df90172014-04-03 10:13:11 -070016import net.onrc.onos.core.datastore.ObjectDoesntExistException;
17import net.onrc.onos.core.datastore.ObjectExistsException;
18import net.onrc.onos.core.datastore.WrongVersionException;
Jonathan Hart6df90172014-04-03 10:13:11 -070019import net.onrc.onos.core.datastore.hazelcast.HZTable.VersionedValue;
20import net.onrc.onos.core.datastore.utils.ByteArrayComparator;
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070021
22import org.junit.After;
23import org.junit.Before;
24import org.junit.Ignore;
25import org.junit.Rule;
26import org.junit.Test;
27import org.junit.rules.TestName;
28
29public class HZTableTest {
30 @Rule
Ray Milkey269ffb92014-04-03 14:43:30 -070031 public TestName name = new TestName();
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070032
33 static final String TEST_TABLE_NAME = "TableForUnitTest";
34 HZTable table;
35
36 @Before
37 public void setUp() throws Exception {
Ray Milkey269ffb92014-04-03 14:43:30 -070038 table = (HZTable) HZClient.getClient().getTable(TEST_TABLE_NAME);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070039 }
40
41 @After
42 public void tearDown() throws Exception {
Ray Milkey269ffb92014-04-03 14:43:30 -070043 HZClient.getClient().dropTable(table);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070044 }
45
46 public void assertEntryInTable(final byte[] key, final byte[] value, final long version) {
Ray Milkey269ffb92014-04-03 14:43:30 -070047 VersionedValue valueblob = table.getBackendMap().get(key);
48 assertNotNull(valueblob);
49 assertArrayEquals(value, valueblob.getValue());
50 assertEquals(version, valueblob.getVersion());
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070051 }
52
53 public void assertKeyNotInTable(final byte[] key) {
Ray Milkey269ffb92014-04-03 14:43:30 -070054 VersionedValue valueblob = table.getBackendMap().get(key);
55 assertNull(valueblob);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070056 }
57
58 @Test
59 public void testGetInitialVersion() {
Ray Milkey269ffb92014-04-03 14:43:30 -070060 final long version1 = HZTable.getInitialVersion();
61 assertNotEquals(HZClient.VERSION_NONEXISTENT, version1);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070062
Ray Milkey269ffb92014-04-03 14:43:30 -070063 final long version2 = HZTable.getInitialVersion();
64 assertNotEquals(HZClient.VERSION_NONEXISTENT, version2);
65 assertNotEquals(version1, version2);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070066 }
67
68 @Test
69 public void testGetNextVersion() {
Ray Milkey269ffb92014-04-03 14:43:30 -070070 final long nextVersion = HZTable.getNextVersion(1);
71 assertNotEquals(nextVersion, HZClient.VERSION_NONEXISTENT);
72 assertNotEquals(nextVersion, 1);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070073
Ray Milkey269ffb92014-04-03 14:43:30 -070074 final long nextVersion1 = HZTable.getNextVersion(Long.MAX_VALUE);
75 assertNotEquals(nextVersion1, HZClient.VERSION_NONEXISTENT);
76 assertNotEquals(nextVersion1, Long.MAX_VALUE);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070077
Ray Milkey269ffb92014-04-03 14:43:30 -070078 final long nextVersion11 = HZTable.getNextVersion(HZClient.VERSION_NONEXISTENT - 1);
79 assertNotEquals(nextVersion11, HZClient.VERSION_NONEXISTENT);
80 assertNotEquals(nextVersion11, HZClient.VERSION_NONEXISTENT - 1);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070081 }
82
83 @Ignore // nothing to test for now
84 @Test
85 public void testHZTable() {
Ray Milkey269ffb92014-04-03 14:43:30 -070086 fail("Not yet implemented");
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070087 }
88
89 @Test
90 public void testGetTableName() {
Ray Milkey269ffb92014-04-03 14:43:30 -070091 assertEquals(TEST_TABLE_NAME, table.getTableName());
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070092 }
93
94 @Test
95 public void testVERSION_NONEXISTENT() {
Ray Milkey269ffb92014-04-03 14:43:30 -070096 assertEquals(HZClient.VERSION_NONEXISTENT, table.VERSION_NONEXISTENT());
Yuta HIGUCHI6a643132014-03-18 22:39:27 -070097 }
98
99 @Test
100 public void testGetTableId() {
Ray Milkey269ffb92014-04-03 14:43:30 -0700101 // for Hazelcast implementation IKVTableID is table itself
102 assertEquals(table, table.getTableId());
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700103 }
104
105 @Test
106 public void testCreate() throws ObjectExistsException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700107 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
108 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700109
Ray Milkey269ffb92014-04-03 14:43:30 -0700110 final long version = table.create(key, value);
111 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700112
Ray Milkey269ffb92014-04-03 14:43:30 -0700113 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700114 }
115
116 @Test(expected = ObjectExistsException.class)
117 public void testCreateConflict() throws ObjectExistsException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700118 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
119 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700120
Ray Milkey269ffb92014-04-03 14:43:30 -0700121 final long version = table.create(key, value);
122 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700123
Ray Milkey269ffb92014-04-03 14:43:30 -0700124 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700125
Ray Milkey269ffb92014-04-03 14:43:30 -0700126 table.create(key, value);
127 fail("Should have thrown exception");
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700128 }
129
130 @Test
131 public void testForceCreate() {
Ray Milkey269ffb92014-04-03 14:43:30 -0700132 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
133 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700134
Ray Milkey269ffb92014-04-03 14:43:30 -0700135 final long version = table.forceCreate(key, value);
136 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
137 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700138
139
Ray Milkey269ffb92014-04-03 14:43:30 -0700140 final long version1 = table.forceCreate(key, value);
141 assertNotEquals(HZClient.VERSION_NONEXISTENT, version1);
142 assertNotEquals(version, version1);
143 assertEntryInTable(key, value, version1);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700144 }
145
146 @Test
147 public void testRead() throws ObjectDoesntExistException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700148 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
149 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700150
Ray Milkey269ffb92014-04-03 14:43:30 -0700151 // put data to read
152 final long version = table.forceCreate(key, value);
153 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
154 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700155
Ray Milkey269ffb92014-04-03 14:43:30 -0700156 // test body
157 final IKVEntry readValue = table.read(key);
158 assertArrayEquals(key, readValue.getKey());
159 assertArrayEquals(value, readValue.getValue());
160 assertEquals(version, readValue.getVersion());
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700161 }
162
163
164 @Test(expected = ObjectDoesntExistException.class)
165 public void testReadNotExist() throws ObjectDoesntExistException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700166 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700167
Ray Milkey269ffb92014-04-03 14:43:30 -0700168 table.read(key);
169 fail("Should have thrown exception");
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700170 }
171
172 @Test
173 public void testUpdateByteArrayByteArrayLongSuccess() throws ObjectDoesntExistException, WrongVersionException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700174 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
175 final byte[] oldValue = "OldValue".getBytes(StandardCharsets.UTF_8);
176 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700177
Ray Milkey269ffb92014-04-03 14:43:30 -0700178 // put data to update
179 final long oldVersion = table.forceCreate(key, oldValue);
180 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
181 assertEntryInTable(key, oldValue, oldVersion);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700182
Ray Milkey269ffb92014-04-03 14:43:30 -0700183 final long version = table.update(key, value, oldVersion);
184 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
185 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700186 }
187
188 @Test(expected = ObjectDoesntExistException.class)
189 public void testUpdateByteArrayByteArrayLongFailNoOldValue() throws ObjectDoesntExistException, WrongVersionException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700190 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
191 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700192
Ray Milkey269ffb92014-04-03 14:43:30 -0700193 final long oldVersion = 0xDEAD;
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700194
Ray Milkey269ffb92014-04-03 14:43:30 -0700195 final long version = table.update(key, value, oldVersion);
196 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
197 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700198 }
199
200 @Test(expected = WrongVersionException.class)
201 public void testUpdateByteArrayByteArrayLongFailWrongVersion() throws ObjectDoesntExistException, WrongVersionException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700202 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
203 final byte[] oldValue = "OldValue".getBytes(StandardCharsets.UTF_8);
204 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700205
Ray Milkey269ffb92014-04-03 14:43:30 -0700206 // put data to update
207 final long oldVersion = table.forceCreate(key, oldValue);
208 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
209 assertEntryInTable(key, oldValue, oldVersion);
210 // some one updates (from different thread/process in reality)
211 table.forceCreate(key, oldValue);
212 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700213
214
Ray Milkey269ffb92014-04-03 14:43:30 -0700215 table.update(key, value, oldVersion);
216 fail("Should have thrown exception");
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700217 }
218
219 @Test
220 public void testUpdateByteArrayByteArraySuccess() throws ObjectDoesntExistException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700221 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
222 final byte[] oldValue = "OldValue".getBytes(StandardCharsets.UTF_8);
223 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700224
Ray Milkey269ffb92014-04-03 14:43:30 -0700225 // put data to update
226 final long oldVersion = table.forceCreate(key, oldValue);
227 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
228 assertEntryInTable(key, oldValue, oldVersion);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700229
Ray Milkey269ffb92014-04-03 14:43:30 -0700230 final long version = table.update(key, value);
231 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
232 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700233 }
234
235 @Test(expected = ObjectDoesntExistException.class)
236 public void testUpdateByteArrayByteArrayFailNoOldValue() throws ObjectDoesntExistException, WrongVersionException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700237 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
238 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700239
Ray Milkey269ffb92014-04-03 14:43:30 -0700240 final long version = table.update(key, value);
241 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
242 assertEntryInTable(key, value, version);
243 fail("Should have thrown exception");
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700244 }
245
246 @Test
247 public void testUpdateByteArrayByteArraySuccessIgnoreVersion() throws ObjectDoesntExistException, WrongVersionException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700248 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
249 final byte[] oldValue = "OldValue".getBytes(StandardCharsets.UTF_8);
250 final byte[] value = "SomeValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700251
Ray Milkey269ffb92014-04-03 14:43:30 -0700252 // put data to update
253 final long oldVersion = table.forceCreate(key, oldValue);
254 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
255 assertEntryInTable(key, oldValue, oldVersion);
256 // someone updates (from different thread/process in reality)
257 table.forceCreate(key, oldValue);
258 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700259
260
Ray Milkey269ffb92014-04-03 14:43:30 -0700261 final long version = table.update(key, value);
262 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
263 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700264 }
265
266 @Test
267 public void testDelete() throws ObjectDoesntExistException, WrongVersionException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700268 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
269 final byte[] oldValue = "OldValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700270
Ray Milkey269ffb92014-04-03 14:43:30 -0700271 // put data to delete
272 final long oldVersion = table.forceCreate(key, oldValue);
273 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
274 assertEntryInTable(key, oldValue, oldVersion);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700275
Ray Milkey269ffb92014-04-03 14:43:30 -0700276 long version = table.delete(key, oldVersion);
277 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
278 assertEquals(oldVersion, version);
279 assertKeyNotInTable(key);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700280 }
281
282 @Test(expected = ObjectDoesntExistException.class)
283 public void testDeleteFailNoEntry() throws ObjectDoesntExistException, WrongVersionException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700284 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700285
Ray Milkey269ffb92014-04-03 14:43:30 -0700286 final long oldVersion = 0xDEAD;
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700287
Ray Milkey269ffb92014-04-03 14:43:30 -0700288 try {
289 table.delete(key, oldVersion);
290 } catch (ObjectDoesntExistException | WrongVersionException e) {
291 assertKeyNotInTable(key);
292 throw e;
293 }
294 fail("Should have thrown exception");
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700295 }
296
297 @Test(expected = WrongVersionException.class)
298 public void testDeleteFailWrongVersion() throws ObjectDoesntExistException, WrongVersionException {
Ray Milkey269ffb92014-04-03 14:43:30 -0700299 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
300 final byte[] oldValue = "OldValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700301
Ray Milkey269ffb92014-04-03 14:43:30 -0700302 // put data to delete
303 final long oldVersion = table.forceCreate(key, oldValue);
304 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
305 assertEntryInTable(key, oldValue, oldVersion);
306 // someone updates (from different thread/process in reality)
307 final long latestVersion = table.forceCreate(key, oldValue);
308 assertNotEquals(HZClient.VERSION_NONEXISTENT, latestVersion);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700309
Ray Milkey269ffb92014-04-03 14:43:30 -0700310 try {
311 table.delete(key, oldVersion);
312 } catch (ObjectDoesntExistException | WrongVersionException e) {
313 assertEntryInTable(key, oldValue, latestVersion);
314 throw e;
315 }
316 fail("Should have thrown exception");
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700317 }
318
319
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700320 @Test
321 public void testForceDelete() {
Ray Milkey269ffb92014-04-03 14:43:30 -0700322 final byte[] key = name.getMethodName().getBytes(StandardCharsets.UTF_8);
323 final byte[] oldValue = "OldValue".getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700324
Ray Milkey269ffb92014-04-03 14:43:30 -0700325 // put data to delete
326 final long oldVersion = table.forceCreate(key, oldValue);
327 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
328 assertEntryInTable(key, oldValue, oldVersion);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700329
Ray Milkey269ffb92014-04-03 14:43:30 -0700330 long version = table.forceDelete(key);
331 assertNotEquals(HZClient.VERSION_NONEXISTENT, oldVersion);
332 assertEquals(oldVersion, version);
333 assertKeyNotInTable(key);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700334 }
335
336 @Test
337 public void testGetAllEntries() {
Ray Milkey269ffb92014-04-03 14:43:30 -0700338 final int DATASETSIZE = 100;
339 final Map<byte[], VersionedValue> testdata = new TreeMap<>(ByteArrayComparator.BYTEARRAY_COMPARATOR);
340 for (int i = 0; i < DATASETSIZE; ++i) {
341 final byte[] key = (name.getMethodName() + i).getBytes(StandardCharsets.UTF_8);
342 final byte[] value = ("Value" + i).getBytes(StandardCharsets.UTF_8);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700343
Ray Milkey269ffb92014-04-03 14:43:30 -0700344 // put data to delete
345 final long version = table.forceCreate(key, value);
346 assertNotEquals(HZClient.VERSION_NONEXISTENT, version);
347 assertEntryInTable(key, value, version);
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700348
Ray Milkey269ffb92014-04-03 14:43:30 -0700349 testdata.put(key, new VersionedValue(value, version));
350 }
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700351
Ray Milkey269ffb92014-04-03 14:43:30 -0700352 Iterable<IKVEntry> datastore = table.getAllEntries();
353 for (IKVEntry entry : datastore) {
354 VersionedValue expectedValue = testdata.get(entry.getKey());
355 assertNotNull(expectedValue);
356 assertArrayEquals(expectedValue.getValue(), entry.getValue());
357 assertEquals(expectedValue.getVersion(), entry.getVersion());
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700358
Ray Milkey269ffb92014-04-03 14:43:30 -0700359 testdata.remove(entry.getKey());
360 }
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700361
Ray Milkey269ffb92014-04-03 14:43:30 -0700362 assertTrue(testdata.isEmpty());
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700363 }
364
365 @Test
366 public void testToString() {
Ray Milkey269ffb92014-04-03 14:43:30 -0700367 assertEquals("[HZTable " + TEST_TABLE_NAME + "]", table.toString());
Yuta HIGUCHI6a643132014-03-18 22:39:27 -0700368 }
369
370}