diff --git a/CHANGES.txt b/CHANGES.txt index b06db1714..ed5cced97 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,8 @@ Gora Change Log +* GORA-229 Use @Ignore for unimplemented functionality to identify absent tests (Apostolos Giannakidis via lewismc) + * GORA-258 writeCapacUnits gets value from wrong attribute (Apostolos Giannakidis via lewismc) * GORA-256 Add Solr store to gora-tutorial (Scott Stults via lewismc) diff --git a/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java b/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java index 8995ebf44..95d2fae4d 100644 --- a/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java +++ b/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java @@ -24,6 +24,7 @@ import org.apache.gora.store.DataStoreFactory; import org.apache.gora.store.DataStoreTestBase; import org.apache.hadoop.conf.Configuration; +import org.junit.Ignore; /** * @@ -45,8 +46,8 @@ protected DataStore createWebPageDataStore() throws IOException //Until GORA-66 is resolved this test will always fail, so //do not run it + @Ignore("skipped until GORA-66 is resolved") @Override public void testDeleteByQueryFields() throws IOException { - return; } } diff --git a/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/PartitionTest.java b/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/PartitionTest.java index ffafcb0f4..3fcc04df4 100644 --- a/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/PartitionTest.java +++ b/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/PartitionTest.java @@ -20,11 +20,11 @@ import java.io.DataOutputStream; import java.io.IOException; -import junit.framework.Assert; - import org.apache.gora.accumulo.encoders.Encoder; import org.apache.gora.accumulo.encoders.SignedBinaryEncoder; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * @@ -47,17 +47,17 @@ static long encl(long l) { @Test public void test1() { - Assert.assertEquals(encl(0x006f000000000000l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {0x00, 0x6f})); - Assert.assertEquals(encl(1l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {0, 0, 0, 0, 0, 0, 0, 0})); - Assert.assertEquals(encl(0x106f000000000001l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {0x10, 0x6f, 0, 0, 0, 0, 0, 0})); - Assert.assertEquals( + assertEquals(encl(0x006f000000000000l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {0x00, 0x6f})); + assertEquals(encl(1l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {0, 0, 0, 0, 0, 0, 0, 0})); + assertEquals(encl(0x106f000000000001l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {0x10, 0x6f, 0, 0, 0, 0, 0, 0})); + assertEquals( encl(-1l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xfe})); - Assert.assertEquals(encl(0x8000000000000001l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {(byte) 0x80, 0, 0, 0, 0, 0, 0, 0})); - Assert.assertEquals( + assertEquals(encl(0x8000000000000001l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {(byte) 0x80, 0, 0, 0, 0, 0, 0, 0})); + assertEquals( encl(0x8000000000000000l), (long) AccumuloStore.followingKey(encoder, Long.class, new byte[] {(byte) 0x7f, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, @@ -67,7 +67,7 @@ public void test1() { try { AccumuloStore.followingKey(encoder, Long.class, new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff}); - Assert.assertTrue(false); + assertTrue(false); } catch (IllegalArgumentException iea) { } @@ -75,19 +75,19 @@ public void test1() { @Test public void test2() { - Assert.assertEquals(encl(0x00ffffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {0x01})); - Assert.assertEquals(encl(0x006effffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {0x00, 0x6f})); - Assert.assertEquals(encl(0xff6effffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0xff, 0x6f})); - Assert.assertEquals(encl(0xfffeffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0xff, (byte) 0xff})); - Assert.assertEquals(encl(0l), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0, 0, 0, 0, 0, 0, 0, 0})); + assertEquals(encl(0x00ffffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {0x01})); + assertEquals(encl(0x006effffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {0x00, 0x6f})); + assertEquals(encl(0xff6effffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0xff, 0x6f})); + assertEquals(encl(0xfffeffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0xff, (byte) 0xff})); + assertEquals(encl(0l), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0, 0, 0, 0, 0, 0, 0, 0})); - Assert.assertEquals(encl(0x7effffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0x7f})); - Assert.assertEquals(encl(0x7fffffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0x80})); - Assert.assertEquals(encl(0x80ffffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0x81})); + assertEquals(encl(0x7effffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0x7f})); + assertEquals(encl(0x7fffffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0x80})); + assertEquals(encl(0x80ffffffffffffffl), (long) AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0x81})); try { AccumuloStore.lastPossibleKey(encoder, Long.class, new byte[] {(byte) 0, 0, 0, 0, 0, 0, 0}); - Assert.assertTrue(false); + assertTrue(false); } catch (IllegalArgumentException iea) { } diff --git a/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java b/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java index b7ee02afa..ebaf39535 100644 --- a/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java +++ b/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/HexEncoderTest.java @@ -17,7 +17,7 @@ package org.apache.gora.accumulo.util; import org.apache.gora.accumulo.encoders.HexEncoder; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; import org.junit.Test; /** @@ -29,12 +29,12 @@ public class HexEncoderTest { public void testByte() { HexEncoder encoder = new HexEncoder(); - Assert.assertEquals("12", new String(encoder.encodeByte((byte) 0x12))); - Assert.assertEquals("f2", new String(encoder.encodeByte((byte) 0xf2))); + assertEquals("12", new String(encoder.encodeByte((byte) 0x12))); + assertEquals("f2", new String(encoder.encodeByte((byte) 0xf2))); byte b = Byte.MIN_VALUE; while (b != Byte.MAX_VALUE) { - Assert.assertEquals(b, encoder.decodeByte(encoder.encodeByte(b))); + assertEquals(b, encoder.decodeByte(encoder.encodeByte(b))); b++; } } @@ -43,12 +43,12 @@ public void testByte() { public void testShort() { HexEncoder encoder = new HexEncoder(); - Assert.assertEquals("1234", new String(encoder.encodeShort((short) 0x1234))); - Assert.assertEquals("f234", new String(encoder.encodeShort((short) 0xf234))); + assertEquals("1234", new String(encoder.encodeShort((short) 0x1234))); + assertEquals("f234", new String(encoder.encodeShort((short) 0xf234))); short s = Short.MIN_VALUE; while (s != Short.MAX_VALUE) { - Assert.assertEquals(s, encoder.decodeShort(encoder.encodeShort(s))); + assertEquals(s, encoder.decodeShort(encoder.encodeShort(s))); s++; } } diff --git a/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/SignedBinaryEncoderTest.java b/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/SignedBinaryEncoderTest.java index 309ce9799..16d54a796 100644 --- a/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/SignedBinaryEncoderTest.java +++ b/gora-accumulo/src/test/java/org/apache/gora/accumulo/util/SignedBinaryEncoderTest.java @@ -19,11 +19,11 @@ import java.util.ArrayList; import java.util.Collections; -import junit.framework.Assert; - import org.apache.gora.accumulo.encoders.SignedBinaryEncoder; import org.apache.hadoop.io.Text; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * @@ -38,10 +38,10 @@ public void testShort() { while (true) { byte[] enc = encoder.encodeShort(s); - Assert.assertEquals(s, encoder.decodeShort(enc)); + assertEquals(s, encoder.decodeShort(enc)); Text current = new Text(enc); if (prev != null) - Assert.assertTrue(prev.compareTo(current) < 0); + assertTrue(prev.compareTo(current) < 0); prev = current; s++; if (s == Short.MAX_VALUE) @@ -57,10 +57,10 @@ private void testInt(int start, int finish) { while (true) { byte[] enc = encoder.encodeInt(i); - Assert.assertEquals(i, encoder.decodeInt(enc)); + assertEquals(i, encoder.decodeInt(enc)); Text current = new Text(enc); if (prev != null) - Assert.assertTrue(prev.compareTo(current) < 0); + assertTrue(prev.compareTo(current) < 0); prev = current; i++; if (i == finish) @@ -83,10 +83,10 @@ private void testLong(long start, long finish) { while (true) { byte[] enc = encoder.encodeLong(l); - Assert.assertEquals(l, encoder.decodeLong(enc)); + assertEquals(l, encoder.decodeLong(enc)); Text current = new Text(enc); if (prev != null) - Assert.assertTrue(prev.compareTo(current) < 0); + assertTrue(prev.compareTo(current) < 0); prev = current; l++; if (l == finish) @@ -124,9 +124,9 @@ public void testDouble() { for (int i = 0; i < testData.size(); i++) { byte[] enc = encoder.encodeDouble(testData.get(i)); - Assert.assertEquals(testData.get(i), encoder.decodeDouble(enc)); + assertEquals(testData.get(i), (Double) encoder.decodeDouble(enc)); if (i > 1) { - Assert.assertTrue("Checking " + testData.get(i) + " > " + testData.get(i - 1), + assertTrue("Checking " + testData.get(i) + " > " + testData.get(i - 1), new Text(enc).compareTo(new Text(encoder.encodeDouble(testData.get(i - 1)))) > 0); } } @@ -155,9 +155,9 @@ public void testFloat() { for (int i = 0; i < testData.size(); i++) { byte[] enc = encoder.encodeFloat(testData.get(i)); - Assert.assertEquals(testData.get(i), encoder.decodeFloat(enc)); + assertEquals(testData.get(i), (Float)encoder.decodeFloat(enc)); if (i > 1) { - Assert.assertTrue("Checking " + testData.get(i) + " > " + testData.get(i - 1), + assertTrue("Checking " + testData.get(i) + " > " + testData.get(i - 1), new Text(enc).compareTo(new Text(encoder.encodeFloat(testData.get(i - 1)))) > 0); } } diff --git a/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java b/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java index 989a6decf..7620aabe2 100644 --- a/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java +++ b/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java @@ -26,79 +26,91 @@ import java.io.IOException; import org.apache.gora.cassandra.GoraCassandraTestDriver; -import org.apache.gora.cassandra.store.CassandraStore; import org.apache.gora.examples.generated.Employee; import org.apache.gora.examples.generated.WebPage; import org.apache.gora.store.DataStore; import org.apache.gora.store.DataStoreFactory; import org.apache.gora.store.DataStoreTestBase; import org.apache.hadoop.conf.Configuration; -import org.junit.After; import org.junit.Before; -import org.junit.Test; +import org.junit.Ignore; /** * Test for CassandraStore. */ public class TestCassandraStore extends DataStoreTestBase{ - + private Configuration conf; - + static { setTestDriver(new GoraCassandraTestDriver()); } - + @Before public void setUp() throws Exception { super.setUp(); } - + @SuppressWarnings("unchecked") @Override protected DataStore createEmployeeDataStore() throws IOException { return DataStoreFactory.getDataStore(CassandraStore.class, String.class, Employee.class, conf); } - + @SuppressWarnings("unchecked") @Override protected DataStore createWebPageDataStore() throws IOException { return DataStoreFactory.getDataStore(CassandraStore.class, String.class, WebPage.class, conf); } - + public GoraCassandraTestDriver getTestDriver() { return (GoraCassandraTestDriver) testDriver; } - + // ============================================================================ - //We need to skip the following tests for a while until we fix some issues.. - + //We need to skip the following tests for a while until we fix some issues.. + + @Ignore("skipped until some bugs are fixed") @Override public void testGetWebPageDefaultFields() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testQuery() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testQueryStartKey() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testQueryEndKey() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testQueryKeyRange() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testQueryWebPageSingleKeyDefaultFields() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testDelete() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testDeleteByQuery() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testDeleteByQueryFields() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testGetPartitions() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testGetRecursive() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testGetDoubleRecursive() throws IOException{} + @Ignore("skipped until some bugs are fixed") @Override public void testGetNested() throws IOException {} + @Ignore("skipped until some bugs are fixed") @Override public void testGet3UnionField() throws IOException {} // ============================================================================ @@ -106,11 +118,10 @@ public void testGet3UnionField() throws IOException {} public static void main(String[] args) throws Exception { TestCassandraStore test = new TestCassandraStore(); - test.setUpClass(); + setUpClass(); test.setUp(); - + test.tearDown(); - test.tearDownClass(); + tearDownClass(); } - } diff --git a/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java b/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java index 651ee294e..b3dd161d6 100644 --- a/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java +++ b/gora-core/src/main/java/org/apache/gora/persistency/Persistent.java @@ -182,4 +182,4 @@ public interface Persistent extends Cloneable{ Persistent clone(); -} +} \ No newline at end of file diff --git a/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java b/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java index fe11d9e2f..e5170c28f 100644 --- a/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java +++ b/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java @@ -105,6 +105,7 @@ protected void setProperties(Properties properties) { (Class>)dataStoreClass, keyClass, persistentClass, conf); dataStores.add(dataStore); + log.info("Datastore for "+persistentClass+" was added."); return dataStore; } diff --git a/gora-core/src/test/java/org/apache/gora/avro/TestPersistentDatumReader.java b/gora-core/src/test/java/org/apache/gora/avro/TestPersistentDatumReader.java index afb81c7d2..a81fd3be5 100644 --- a/gora-core/src/test/java/org/apache/gora/avro/TestPersistentDatumReader.java +++ b/gora-core/src/test/java/org/apache/gora/avro/TestPersistentDatumReader.java @@ -20,15 +20,11 @@ import java.io.IOException; -import junit.framework.Assert; - import org.apache.avro.util.Utf8; -import org.apache.gora.avro.PersistentDatumReader; import org.apache.gora.examples.WebPageDataCreator; import org.apache.gora.examples.generated.Employee; import org.apache.gora.examples.generated.WebPage; import org.apache.gora.memory.store.MemStore; -import org.apache.gora.persistency.Persistent; import org.apache.gora.persistency.impl.PersistentBase; import org.apache.gora.query.Query; import org.apache.gora.query.Result; @@ -37,6 +33,8 @@ import org.apache.gora.store.DataStoreTestUtil; import org.apache.hadoop.conf.Configuration; import org.junit.Test; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertEquals; /** * Test case for {@link PersistentDatumReader}. @@ -53,8 +51,8 @@ private void testClone(PersistentBase persistent) throws IOException { } private void assertClone(PersistentBase persistent, PersistentBase cloned) { - Assert.assertNotNull("cloned object is null", cloned); - Assert.assertEquals("cloned object is not equal to original object", persistent, cloned); + assertNotNull("cloned object is null", cloned); + assertEquals("cloned object is not equal to original object", persistent, cloned); } @Test @@ -101,6 +99,6 @@ public void testCloneWebPage() throws Exception { testClone(page); tested++; } - Assert.assertEquals(WebPageDataCreator.URLS.length, tested); + assertEquals(WebPageDataCreator.URLS.length, tested); } } diff --git a/gora-core/src/test/java/org/apache/gora/avro/store/TestAvroStore.java b/gora-core/src/test/java/org/apache/gora/avro/store/TestAvroStore.java index 7f5416dd0..c8071f078 100644 --- a/gora-core/src/test/java/org/apache/gora/avro/store/TestAvroStore.java +++ b/gora-core/src/test/java/org/apache/gora/avro/store/TestAvroStore.java @@ -24,8 +24,6 @@ import java.io.IOException; -import junit.framework.Assert; - import org.apache.gora.avro.store.AvroStore.CodecType; import org.apache.gora.examples.generated.Employee; import org.apache.gora.examples.generated.WebPage; @@ -40,6 +38,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import static org.junit.Assert.assertEquals; /** * Test case for {@link AvroStore}. @@ -147,7 +146,7 @@ public static void testQueryWebPages(DataStore store) DataStoreTestUtil.assertWebPage(page, URL_INDEXES.get(page.getUrl().toString())); i++; } - Assert.assertEquals(i, URLS.length); + assertEquals(i, URLS.length); } } diff --git a/gora-core/src/test/java/org/apache/gora/mapreduce/MapReduceTestUtils.java b/gora-core/src/test/java/org/apache/gora/mapreduce/MapReduceTestUtils.java index 409fe186f..f8374032e 100644 --- a/gora-core/src/test/java/org/apache/gora/mapreduce/MapReduceTestUtils.java +++ b/gora-core/src/test/java/org/apache/gora/mapreduce/MapReduceTestUtils.java @@ -32,7 +32,8 @@ import org.apache.gora.store.DataStore; import org.apache.gora.store.impl.DataStoreBase; import org.apache.hadoop.conf.Configuration; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; public class MapReduceTestUtils { @@ -59,7 +60,7 @@ public static void testCountQuery(DataStore dataStore, Configur log.info("finished count query job"); //assert results - Assert.assertEquals(WebPageDataCreator.URLS.length, result); + assertEquals(WebPageDataCreator.URLS.length, result); } public static void testWordCount(Configuration conf, DataStore inStore, DataStore i private static void assertTokenCount(DataStore outStore, String token, int count) throws Exception { TokenDatum datum = outStore.get(token, null); - Assert.assertNotNull("token:" + token + " cannot be found in datastore", datum); - Assert.assertEquals("count for token:" + token + " is wrong", count, datum.getCount()); + assertNotNull("token:" + token + " cannot be found in datastore", datum); + assertEquals("count for token:" + token + " is wrong", count, datum.getCount()); } } diff --git a/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java b/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java index f16ed1bc7..eba040097 100644 --- a/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java +++ b/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputFormat.java @@ -22,11 +22,7 @@ import java.util.Arrays; import java.util.List; -import junit.framework.Assert; - import org.apache.gora.examples.generated.Employee; -import org.apache.gora.mapreduce.GoraInputFormat; -import org.apache.gora.mapreduce.GoraInputSplit; import org.apache.gora.mock.persistency.MockPersistent; import org.apache.gora.mock.query.MockQuery; import org.apache.gora.mock.store.MockDataStore; @@ -34,6 +30,7 @@ import org.apache.hadoop.mapreduce.InputSplit; import org.apache.hadoop.mapreduce.Job; import org.junit.Test; +import static org.junit.Assert.assertTrue; public class TestGoraInputFormat { @@ -60,11 +57,11 @@ public List getInputSplits() public void testGetSplits() throws IOException, InterruptedException { List splits = getInputSplits(); - Assert.assertTrue(splits.size() > 0); + assertTrue(splits.size() > 0); InputSplit split = splits.get(0); PartitionQuery query = ((GoraInputSplit)split).getQuery(); - Assert.assertTrue(Arrays.equals(Employee._ALL_FIELDS, query.getFields())); + assertTrue(Arrays.equals(Employee._ALL_FIELDS, query.getFields())); } } \ No newline at end of file diff --git a/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputSplit.java b/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputSplit.java index 31f5337a7..5bf505043 100644 --- a/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputSplit.java +++ b/gora-core/src/test/java/org/apache/gora/mapreduce/TestGoraInputSplit.java @@ -21,9 +21,6 @@ import java.io.IOException; import java.util.List; -import junit.framework.Assert; - -import org.apache.gora.mapreduce.GoraInputSplit; import org.apache.gora.mock.persistency.MockPersistent; import org.apache.gora.mock.query.MockQuery; import org.apache.gora.mock.store.MockDataStore; @@ -31,6 +28,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.TestWritable; import org.junit.Test; +import static org.junit.Assert.assertEquals; /** * Test case for {@link GoraInputSplit}. @@ -44,7 +42,7 @@ public class TestGoraInputSplit { MockDataStore store = MockDataStore.get(); MockQuery query = store.newQuery(); - List> partitions = + List> partitions = store.getPartitions(query); return partitions; } @@ -54,11 +52,11 @@ public void testGetLocations() throws IOException { List> partitions = getPartitions(); - int i=0;; + int i=0; for(PartitionQuery partition : partitions) { GoraInputSplit split = new GoraInputSplit(conf, partition); - Assert.assertEquals(split.getLocations().length, 1); - Assert.assertEquals(split.getLocations()[0], MockDataStore.LOCATIONS[i++]); + assertEquals(split.getLocations().length, 1); + assertEquals(split.getLocations()[0], MockDataStore.LOCATIONS[i++]); } } diff --git a/gora-core/src/test/java/org/apache/gora/mapreduce/TestPersistentSerialization.java b/gora-core/src/test/java/org/apache/gora/mapreduce/TestPersistentSerialization.java index 9af9c357f..47841a18d 100644 --- a/gora-core/src/test/java/org/apache/gora/mapreduce/TestPersistentSerialization.java +++ b/gora-core/src/test/java/org/apache/gora/mapreduce/TestPersistentSerialization.java @@ -18,15 +18,10 @@ package org.apache.gora.mapreduce; -import junit.framework.Assert; - import org.apache.avro.util.Utf8; import org.apache.gora.examples.WebPageDataCreator; import org.apache.gora.examples.generated.Employee; import org.apache.gora.examples.generated.WebPage; -import org.apache.gora.mapreduce.PersistentDeserializer; -import org.apache.gora.mapreduce.PersistentSerialization; -import org.apache.gora.mapreduce.PersistentSerializer; import org.apache.gora.memory.store.MemStore; import org.apache.gora.query.Result; import org.apache.gora.store.DataStoreFactory; @@ -34,6 +29,7 @@ import org.apache.gora.util.TestIOUtils; import org.apache.hadoop.conf.Configuration; import org.junit.Test; +import static org.junit.Assert.assertEquals; /** Test class for {@link PersistentSerialization}, {@link PersistentSerializer} * and {@link PersistentDeserializer} @@ -85,7 +81,7 @@ public void testSerdeWebPage() throws Exception { TestIOUtils.testSerializeDeserialize(page); i++; } - Assert.assertEquals(WebPageDataCreator.URLS.length, i); + assertEquals(WebPageDataCreator.URLS.length, i); } @Test diff --git a/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java b/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java index e595c3a85..a049a511d 100644 --- a/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java +++ b/gora-core/src/test/java/org/apache/gora/persistency/TestListGenericArray.java @@ -18,11 +18,9 @@ package org.apache.gora.persistency; -import org.apache.avro.Schema; -import org.apache.avro.generic.GenericData; +import org.apache.avro.Schema; import org.apache.avro.util.Utf8; -import org.apache.gora.persistency.ListGenericArray; -import org.junit.Assert; +import static org.junit.Assert.assertFalse; import org.junit.Test; /** @@ -41,7 +39,7 @@ public void testHashCode() { catch (StackOverflowError e) { stackOverflowError = true; } - Assert.assertFalse(stackOverflowError); + assertFalse(stackOverflowError); } @Test @@ -54,6 +52,6 @@ public void testCompareTo() { } catch (StackOverflowError e) { stackOverflowError = true; } - Assert.assertFalse(stackOverflowError); + assertFalse(stackOverflowError); } } diff --git a/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java b/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java index 2fad42492..806743aca 100644 --- a/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java +++ b/gora-core/src/test/java/org/apache/gora/persistency/impl/TestPersistentBase.java @@ -28,7 +28,10 @@ import org.apache.gora.store.DataStoreFactory; import org.apache.gora.store.DataStoreTestUtil; import org.apache.hadoop.conf.Configuration; -import org.junit.Assert; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + import org.junit.Test; /** @@ -40,7 +43,7 @@ public class TestPersistentBase { public void testGetFields() { WebPage page = new WebPage(); String[] fields = page.getFields(); - Assert.assertArrayEquals(WebPage._ALL_FIELDS, fields); + assertArrayEquals(WebPage._ALL_FIELDS, fields); } @Test @@ -48,7 +51,7 @@ public void testGetField() { WebPage page = new WebPage(); for(int i=0; i createWebPageDataStore() throws IOException; - + /** junit annoyingly forces BeforeClass to be static, so this method * should be called from a static block @@ -67,7 +66,7 @@ protected static void setTestDriver(GoraTestDriver driver) { } private static boolean setUpClassCalled = false; - + @BeforeClass public static void setUpClass() throws Exception { if(testDriver != null && !setUpClassCalled) { @@ -88,12 +87,12 @@ public static void tearDownClass() throws Exception { @Before public void setUp() throws Exception { //There is an issue in JUnit 4 tests in Eclipse where TestSqlStore static - //methods are not called BEFORE setUpClass. I think this is a bug in + //methods are not called BEFORE setUpClass. I think this is a bug in //JUnitRunner in Eclipse. Below is a workaround for that problem. if(!setUpClassCalled) { - setUpClass(); + setUpClass(); } - + log.info("setting up test"); if(testDriver != null) { employeeStore = testDriver.createDataStore(String.class, Employee.class); @@ -131,7 +130,9 @@ public void testCreateSchema() throws Exception { assertSchemaExists("Employee"); } + // Override this to assert that schema is created correctly + public void assertSchemaExists(String schemaName) throws Exception { } @@ -184,7 +185,7 @@ public void testPutNested() throws IOException, Exception { webPageStore.createSchema(); WebPage page = webPageStore.newPersistent(); - Metadata metadata = new Metadata(); + Metadata metadata = new Metadata(); metadata.setVersion(1); metadata.putToData(new Utf8("foo"), new Utf8("baz")); @@ -196,9 +197,9 @@ public void testPutNested() throws IOException, Exception { page = webPageStore.get(revUrl); metadata = page.getMetadata(); - Assert.assertNotNull(metadata); - Assert.assertEquals(1, metadata.getVersion()); - Assert.assertEquals(new Utf8("baz"), metadata.getData().get(new Utf8("foo"))); + assertNotNull(metadata); + assertEquals(1, metadata.getVersion()); + assertEquals(new Utf8("baz"), metadata.getData().get(new Utf8("foo"))); } @Test @@ -301,7 +302,7 @@ public void testGetDoubleRecursive() throws IOException, Exception { log.info("test method: testGetDoubleRecursive") ; DataStoreTestUtil.testGetEmployeeDoubleRecursive(employeeStore) ; } - + @Test /** * Tests put and get a record with a nested record (not recursive) @@ -313,7 +314,7 @@ public void testGetNested() throws IOException, Exception { log.info("test method: testGetNested") ; DataStoreTestUtil.testGetEmployeeNested(employeeStore) ; } - + @Test /** * Tests put and get a record with a 3 types union, and @@ -325,7 +326,7 @@ public void testGet3UnionField() throws IOException, Exception { log.info("test method: testGet3UnionField") ; DataStoreTestUtil.testGetEmployee3UnionField(employeeStore) ; } - + @Test public void testGetWithFields() throws IOException, Exception { log.info("test method: testGetWithFields"); diff --git a/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java b/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java index 4a959537b..a89da20ac 100644 --- a/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java +++ b/gora-core/src/test/java/org/apache/gora/store/DataStoreTestUtil.java @@ -36,7 +36,11 @@ import java.util.Map; import java.util.Set; -import junit.framework.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertNull; import org.apache.avro.generic.GenericArray; import org.apache.avro.util.Utf8; @@ -44,15 +48,14 @@ import org.apache.gora.examples.generated.Employee; import org.apache.gora.examples.generated.Metadata; import org.apache.gora.examples.generated.WebPage; -import org.apache.gora.persistency.BeanFactory; import org.apache.gora.persistency.Persistent; import org.apache.gora.persistency.impl.BeanFactoryImpl; import org.apache.gora.query.PartitionQuery; import org.apache.gora.query.Query; import org.apache.gora.query.Result; -import org.apache.gora.store.DataStore; import org.apache.gora.util.ByteUtils; import org.apache.gora.util.StringUtils; +import org.junit.Test; /** * Test utilities for DataStores. This utility class provides everything @@ -76,11 +79,11 @@ public static void testNewPersistent( T obj1 = dataStore.newPersistent(); T obj2 = dataStore.newPersistent(); - Assert.assertEquals(dataStore.getPersistentClass(), + assertEquals(dataStore.getPersistentClass(), obj1.getClass()); - Assert.assertNotNull(obj1); - Assert.assertNotNull(obj2); - Assert.assertFalse( obj1 == obj2 ); + assertNotNull(obj1); + assertNotNull(obj2); + assertFalse( obj1 == obj2 ); } public static Employee createEmployee( @@ -142,10 +145,10 @@ public static void testSchemaExists( DataStore dataStore) throws IOException, Exception { dataStore.createSchema(); - Assert.assertTrue(dataStore.schemaExists()); + assertTrue(dataStore.schemaExists()); dataStore.deleteSchema(); - Assert.assertFalse(dataStore.schemaExists()); + assertFalse(dataStore.schemaExists()); } public static void testGetEmployee(DataStore dataStore) @@ -158,7 +161,7 @@ public static void testGetEmployee(DataStore dataStore) Employee after = dataStore.get(ssn, Employee._ALL_FIELDS); - Assert.assertEquals(employee, after); + assertEquals(employee, after); } @@ -173,8 +176,8 @@ public static void testGetEmployeeRecursive(DataStore dataStor dataStore.put(ssn, employee); dataStore.flush(); Employee after = dataStore.get(ssn, Employee._ALL_FIELDS); - Assert.assertEquals(employee, after); - Assert.assertEquals(boss, after.getBoss()) ; + assertEquals(employee, after); + assertEquals(boss, after.getBoss()) ; } public static void testGetEmployeeDoubleRecursive(DataStore dataStore) @@ -191,9 +194,9 @@ public static void testGetEmployeeDoubleRecursive(DataStore da dataStore.put(ssn, employee); dataStore.flush(); Employee after = dataStore.get(ssn, Employee._ALL_FIELDS); - Assert.assertEquals(employee, after); - Assert.assertEquals(boss, after.getBoss()) ; - Assert.assertEquals(uberBoss, ((Employee)after.getBoss()).getBoss()) ; + assertEquals(employee, after); + assertEquals(boss, after.getBoss()) ; + assertEquals(uberBoss, ((Employee)after.getBoss()).getBoss()) ; } public static void testGetEmployeeNested(DataStore dataStore) @@ -213,8 +216,8 @@ public static void testGetEmployeeNested(DataStore dataStore) dataStore.put(ssn, employee); dataStore.flush(); Employee after = dataStore.get(ssn, Employee._ALL_FIELDS); - Assert.assertEquals(employee, after); - Assert.assertEquals(webpage, after.getWebpage()) ; + assertEquals(employee, after); + assertEquals(webpage, after.getWebpage()) ; } public static void testGetEmployee3UnionField(DataStore dataStore) @@ -227,14 +230,14 @@ public static void testGetEmployee3UnionField(DataStore dataSt dataStore.put(ssn, employee); dataStore.flush(); Employee after = dataStore.get(ssn, Employee._ALL_FIELDS); - Assert.assertEquals(employee, after); - Assert.assertEquals("Real boss", ((Utf8)after.getBoss()).toString()) ; + assertEquals(employee, after); + assertEquals("Real boss", ((Utf8)after.getBoss()).toString()) ; } public static void testGetEmployeeNonExisting(DataStore dataStore) throws IOException, Exception { Employee employee = dataStore.get("_NON_EXISTING_SSN_FOR_EMPLOYEE_"); - Assert.assertNull(employee); + assertNull(employee); } public static void testGetEmployeeWithFields(DataStore dataStore) @@ -262,7 +265,7 @@ public static void testGetEmployeeWithFields(DataStore dataSto expected.put(index, employee.get(index)); } - Assert.assertEquals(expected, after); + assertEquals(expected, after); } } @@ -300,7 +303,7 @@ public static void testEmptyUpdateEmployee(DataStore dataStore dataStore.flush(); employee = dataStore.get(Long.toString(ssn + 1)); - Assert.assertNull(employee); + assertNull(employee); } public static void testUpdateEmployee(DataStore dataStore) @@ -334,9 +337,9 @@ public static void testUpdateEmployee(DataStore dataStore) for (int i = 0; i < 1; i++) { String key = Long.toString(ssn + i); Employee employee = dataStore.get(key); - Assert.assertEquals(now - 18L * YEAR_IN_MS, employee.getDateOfBirth()); - Assert.assertEquals("John Doe " + (i + 5), employee.getName().toString()); - Assert.assertEquals(120000, employee.getSalary()); + assertEquals(now - 18L * YEAR_IN_MS, employee.getDateOfBirth()); + assertEquals("John Doe " + (i + 5), employee.getName().toString()); + assertEquals(120000, employee.getSalary()); } } @@ -384,21 +387,21 @@ public static void testUpdateWebPage(DataStore dataStore) for (int i = 0; i < urls.length; i++) { WebPage webPage = dataStore.get(urls[i]); - Assert.assertEquals(content + i, ByteUtils.toString( toByteArray(webPage.getContent()) )); - Assert.assertEquals(10, webPage.getParsedContent().size()); + assertEquals(content + i, ByteUtils.toString( toByteArray(webPage.getContent()) )); + assertEquals(10, webPage.getParsedContent().size()); int j = 0; for (Utf8 pc : webPage.getParsedContent()) { - Assert.assertEquals(parsedContent + i + "," + j, pc.toString()); + assertEquals(parsedContent + i + "," + j, pc.toString()); j++; } int count = 0; for (j = 1; j < urls.length; j += 2) { Utf8 link = webPage.getOutlinks().get(new Utf8(anchor + j)); - Assert.assertNotNull(link); - Assert.assertEquals(urls[j], link.toString()); + assertNotNull(link); + assertEquals(urls[j], link.toString()); count++; } - Assert.assertEquals(count, webPage.getOutlinks().size()); + assertEquals(count, webPage.getOutlinks().size()); } for (int i = 0; i < urls.length; i++) { @@ -416,49 +419,49 @@ public static void testUpdateWebPage(DataStore dataStore) int count = 0; for (int j = 0; j < urls.length; j++) { Utf8 link = webPage.getOutlinks().get(new Utf8(anchor + j)); - Assert.assertNotNull(link); - Assert.assertEquals(urls[j], link.toString()); + assertNotNull(link); + assertEquals(urls[j], link.toString()); count++; } } } public static void assertWebPage(WebPage page, int i) throws Exception{ - Assert.assertNotNull(page); + assertNotNull(page); - Assert.assertEquals(URLS[i], page.getUrl().toString()); + assertEquals(URLS[i], page.getUrl().toString()); // 'content' is optional if (page.getContent() != null) { - Assert.assertTrue("content error:" + new String( toByteArray(page.getContent()) ) + + assertTrue("content error:" + new String( toByteArray(page.getContent()) ) + " actual=" + CONTENTS[i] + " i=" + i , Arrays.equals( toByteArray(page.getContent() ) , CONTENTS[i].getBytes())); GenericArray parsedContent = page.getParsedContent(); - Assert.assertNotNull(parsedContent); - Assert.assertTrue(parsedContent.size() > 0); + assertNotNull(parsedContent); + assertTrue(parsedContent.size() > 0); int j=0; String[] tokens = CONTENTS[i].split(" "); for(Utf8 token : parsedContent) { - Assert.assertEquals(tokens[j++], token.toString()); + assertEquals(tokens[j++], token.toString()); } } else { // when page.getContent() is null - Assert.assertTrue(CONTENTS[i] == null) ; + assertTrue(CONTENTS[i] == null) ; GenericArray parsedContent = page.getParsedContent(); - Assert.assertNotNull(parsedContent); - Assert.assertTrue(parsedContent.size() == 0); + assertNotNull(parsedContent); + assertTrue(parsedContent.size() == 0); } if(LINKS[i].length > 0) { - Assert.assertNotNull(page.getOutlinks()); - Assert.assertTrue(page.getOutlinks().size() > 0); + assertNotNull(page.getOutlinks()); + assertTrue(page.getOutlinks().size() > 0); for(int k=0; k store query.setFields(fields); query.setKey(URLS[i]); Result result = query.execute(); - Assert.assertTrue(result.next()); + assertTrue(result.next()); WebPage page = result.get(); assertWebPage(page, i); - Assert.assertFalse(result.next()); + assertFalse(result.next()); } } @@ -539,7 +542,7 @@ public static void testQueryWebPageKeyRange(DataStore store, int expectedLength = (setEndKeys ? j+1: sortedUrls.size()) - (setStartKeys ? i: 0); - Assert.assertEquals(expectedLength, r); + assertEquals(expectedLength, r); if(!setEndKeys) break; } @@ -597,7 +600,7 @@ public static void assertNumResults(Queryquery actualNumResults++; } result.close(); - Assert.assertEquals(numResults, actualNumResults); + assertEquals(numResults, actualNumResults); } public static void testGetPartitions(DataStore store) @@ -610,11 +613,11 @@ public static void testGetPartitions(DataStore store , Query query) throws IOException, Exception { List> partitions = store.getPartitions(query); - Assert.assertNotNull(partitions); - Assert.assertTrue(partitions.size() > 0); + assertNotNull(partitions); + assertTrue(partitions.size() > 0); for(PartitionQuery partition:partitions) { - Assert.assertNotNull(partition); + assertNotNull(partition); } assertPartitions(store, query, partitions); @@ -630,43 +633,43 @@ public static void assertPartitions(DataStore store, //execute query and count results Result result = store.execute(query); - Assert.assertNotNull(result); + assertNotNull(result); while(result.next()) { - Assert.assertNotNull(result.getKey()); - Assert.assertNotNull(result.get()); + assertNotNull(result.getKey()); + assertNotNull(result.get()); results.put(result.getKey(), result.get().hashCode()); //keys are not reused, so this is safe count++; } result.close(); - Assert.assertTrue(count > 0); //assert that results is not empty - Assert.assertEquals(count, results.size()); //assert that keys are unique + assertTrue(count > 0); //assert that results is not empty + assertEquals(count, results.size()); //assert that keys are unique for(PartitionQuery partition:partitions) { - Assert.assertNotNull(partition); + assertNotNull(partition); result = store.execute(partition); - Assert.assertNotNull(result); + assertNotNull(result); while(result.next()) { - Assert.assertNotNull(result.getKey()); - Assert.assertNotNull(result.get()); + assertNotNull(result.getKey()); + assertNotNull(result.get()); partitionResults.put(result.getKey(), result.get().hashCode()); partitionsCount++; } result.close(); - Assert.assertEquals(partitionsCount, partitionResults.size()); //assert that keys are unique + assertEquals(partitionsCount, partitionResults.size()); //assert that keys are unique } - Assert.assertTrue(partitionsCount > 0); - Assert.assertEquals(count, partitionsCount); + assertTrue(partitionsCount > 0); + assertEquals(count, partitionsCount); for(Map.Entry r : results.entrySet()) { Integer p = partitionResults.get(r.getKey()); - Assert.assertNotNull(p); - Assert.assertEquals(r.getValue(), p); + assertNotNull(p); + assertEquals(r.getValue(), p); } } @@ -676,11 +679,11 @@ public static void testDelete(DataStore store) throws IOExcepti int deletedSoFar = 0; for(String url : URLS) { - Assert.assertTrue(store.delete(url)); + assertTrue(store.delete(url)); store.flush(); //assert that it is actually deleted - Assert.assertNull(store.get(url)); + assertNull(store.get(url)); //assert that other records are not deleted assertNumResults(store.newQuery(), URLS.length - ++deletedSoFar); @@ -765,17 +768,17 @@ public static void testDeleteByQueryFields(DataStore store) //assert that data is deleted for (int i = 0; i < SORTED_URLS.length; i++) { WebPage page = store.get(SORTED_URLS[i]); - Assert.assertNotNull(page); + assertNotNull(page); - Assert.assertNotNull(page.getUrl()); - Assert.assertEquals(page.getUrl().toString(), SORTED_URLS[i]); - Assert.assertEquals(0, page.getOutlinks().size()); - Assert.assertEquals(0, page.getParsedContent().size()); + assertNotNull(page.getUrl()); + assertEquals(page.getUrl().toString(), SORTED_URLS[i]); + assertEquals(0, page.getOutlinks().size()); + assertEquals(0, page.getParsedContent().size()); if(page.getContent() != null) { System.out.println("url:" + page.getUrl().toString()); System.out.println( "limit:" + page.getContent().limit()); } else { - Assert.assertNull(page.getContent()); + assertNull(page.getContent()); } } @@ -801,18 +804,18 @@ public static void testDeleteByQueryFields(DataStore store) //assert that data is deleted for (int i = 0; i < URLS.length; i++) { WebPage page = store.get(URLS[i]); - Assert.assertNotNull(page); + assertNotNull(page); if( URLS[i].compareTo(startKey) < 0 || URLS[i].compareTo(endKey) >= 0) { //not deleted assertWebPage(page, i); } else { //deleted - Assert.assertNull(page.getUrl()); - Assert.assertNotNull(page.getOutlinks()); - Assert.assertNotNull(page.getParsedContent()); - Assert.assertNotNull(page.getContent()); - Assert.assertTrue(page.getOutlinks().size() > 0); - Assert.assertTrue(page.getParsedContent().size() > 0); + assertNull(page.getUrl()); + assertNotNull(page.getOutlinks()); + assertNotNull(page.getParsedContent()); + assertNotNull(page.getContent()); + assertTrue(page.getOutlinks().size() > 0); + assertTrue(page.getParsedContent().size() > 0); } } diff --git a/gora-core/src/test/java/org/apache/gora/store/TestDataStoreFactory.java b/gora-core/src/test/java/org/apache/gora/store/TestDataStoreFactory.java index 470018494..5f3436c1a 100644 --- a/gora-core/src/test/java/org/apache/gora/store/TestDataStoreFactory.java +++ b/gora-core/src/test/java/org/apache/gora/store/TestDataStoreFactory.java @@ -20,7 +20,9 @@ import java.util.Properties; -import junit.framework.Assert; +import static junit.framework.Assert.assertNotNull; +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotSame; import org.apache.gora.avro.store.DataFileAvroStore; import org.apache.gora.mock.persistency.MockPersistent; @@ -42,23 +44,23 @@ public void setUp() { public void testGetDataStore() throws GoraException { DataStore dataStore = DataStoreFactory.getDataStore("org.apache.gora.mock.store.MockDataStore" , String.class, MockPersistent.class, conf); - Assert.assertNotNull(dataStore); + assertNotNull(dataStore); } @Test public void testGetClasses() throws GoraException { DataStore dataStore = DataStoreFactory.getDataStore("org.apache.gora.mock.store.MockDataStore" , String.class, MockPersistent.class, conf); - Assert.assertNotNull(dataStore); - Assert.assertEquals(String.class, dataStore.getKeyClass()); - Assert.assertEquals(MockPersistent.class, dataStore.getPersistentClass()); + assertNotNull(dataStore); + assertEquals(String.class, dataStore.getKeyClass()); + assertEquals(MockPersistent.class, dataStore.getPersistentClass()); } @Test public void testGetDataStore2() throws GoraException { DataStore dataStore = DataStoreFactory.getDataStore(MockDataStore.class , String.class, MockPersistent.class, conf); - Assert.assertNotNull(dataStore); + assertNotNull(dataStore); } @Test @@ -70,8 +72,8 @@ public void testGetDataStore3() throws GoraException { DataStore dataStore3 = DataStoreFactory.getDataStore("org.apache.gora.mock.store.MockDataStore" , String.class, MockPersistent.class, conf); - Assert.assertNotSame(dataStore1, dataStore2); - Assert.assertNotSame(dataStore1, dataStore3); + assertNotSame(dataStore1, dataStore2); + assertNotSame(dataStore1, dataStore3); } @Test @@ -79,8 +81,8 @@ public void testReadProperties() throws GoraException{ //indirect testing DataStore dataStore = DataStoreFactory.getDataStore(String.class, MockPersistent.class, conf); - Assert.assertNotNull(dataStore); - Assert.assertEquals(MockDataStore.class, dataStore.getClass()); + assertNotNull(dataStore); + assertEquals(MockDataStore.class, dataStore.getClass()); } @Test @@ -91,15 +93,15 @@ public void testFindProperty() { String fooValue = DataStoreFactory.findProperty(properties, store , "foo_property", "foo_default"); - Assert.assertEquals("foo_value", fooValue); + assertEquals("foo_value", fooValue); String bazValue = DataStoreFactory.findProperty(properties, store , "baz_property", "baz_default"); - Assert.assertEquals("baz_value", bazValue); + assertEquals("baz_value", bazValue); String barValue = DataStoreFactory.findProperty(properties, store , "bar_property", "bar_default"); - Assert.assertEquals("bar_value", barValue); + assertEquals("bar_value", barValue); } } diff --git a/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java b/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java index 97bd568ed..0414aa766 100644 --- a/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java +++ b/gora-core/src/test/java/org/apache/gora/store/WSDataStoreTestBase.java @@ -20,18 +20,18 @@ import java.io.IOException; -import junit.framework.Assert; +import org.junit.BeforeClass; +import org.junit.Before; +import org.junit.AfterClass; +import org.junit.After; +import org.junit.Test; +import org.junit.Ignore; +import static org.junit.Assert.assertTrue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.gora.GoraTestDriver; import org.apache.gora.persistency.Persistent; -import org.apache.gora.store.DataStore; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; /** * A base class for {@link DataStore} tests. This is just a convenience @@ -148,14 +148,15 @@ public void testDeleteSchema() throws IOException, Exception { log.info("test method: testDeleteSchema"); assertDeleteSchema(); } - + + public void assertDeleteSchema(){ } @Test public void testSchemaExists() throws Exception { log.info("test method: testSchemaExists"); - Assert.assertTrue(dataStore.schemaExists()); + assertTrue(dataStore.schemaExists()); } @Test @@ -164,6 +165,7 @@ public void testPut() throws IOException, Exception { assertPut(); } + public void assertPut() throws IOException { } @@ -179,6 +181,7 @@ public void testPutArray() throws IOException, Exception { assertPutArray(); } + public void assertPutArray() throws IOException { } @@ -190,6 +193,7 @@ public void testPutBytes() throws IOException, Exception { assertPutBytes(contentBytes); } + @Ignore public void assertPutBytes(byte[] contentBytes) throws IOException { } @@ -199,6 +203,7 @@ public void testPutMap() throws IOException, Exception { assertPutMap(); } + @Ignore public void assertPutMap() throws IOException { } @@ -208,9 +213,11 @@ public void testUpdate() throws IOException, Exception { assertTestUpdateDataStore(); } + @Ignore public void assertTestUpdateDataStore(){ } - + + @Ignore @Test public void testEmptyUpdate() throws IOException, Exception { } @@ -220,7 +227,8 @@ public void testGet() throws IOException, Exception { log.info("test method: testGet"); assertTestGetDataStore(); } - + + @Ignore public void assertTestGetDataStore() throws IOException { } @@ -234,7 +242,8 @@ public void testQuery() throws IOException, Exception { log.info("test method: testQuery"); assertTestQueryDataStore(); } - + + @Ignore public void assertTestQueryDataStore() throws IOException { } @@ -254,6 +263,7 @@ public void testQueryKeyRange() throws IOException, Exception { assertTestQueryKeyRange(); } + @Ignore public void assertTestQueryKeyRange(){} @Test @@ -261,6 +271,8 @@ public void testDelete() throws IOException, Exception { log.info("test method: testDelete"); assertTestDeleteDataStore(); } + + @Ignore public void assertTestDeleteDataStore(){} @Test @@ -268,6 +280,8 @@ public void testDeleteByQuery() throws IOException, Exception { log.info("test method: testDeleteByQuery"); assertTestDeleteByQueryDataStore(); } + + @Ignore public void assertTestDeleteByQueryDataStore(){ } diff --git a/gora-core/src/test/java/org/apache/gora/util/TestIOUtils.java b/gora-core/src/test/java/org/apache/gora/util/TestIOUtils.java index baafac0d8..30efd8ca6 100644 --- a/gora-core/src/test/java/org/apache/gora/util/TestIOUtils.java +++ b/gora-core/src/test/java/org/apache/gora/util/TestIOUtils.java @@ -27,20 +27,18 @@ import java.io.IOException; import java.util.Arrays; -import junit.framework.Assert; - import org.apache.avro.ipc.ByteBufferInputStream; import org.apache.avro.ipc.ByteBufferOutputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.gora.mapreduce.GoraMapReduceUtils; -import org.apache.gora.util.IOUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.DataInputBuffer; import org.apache.hadoop.io.DataOutputBuffer; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.junit.Test; +import static org.junit.Assert.assertEquals; /** * Test case for {@link IOUtils} class. @@ -122,13 +120,13 @@ public static void testSerializeDeserialize(T... objects) throws Exception { log.info("Before: " + before); log.info("After : " + after); - Assert.assertEquals(before, after); + assertEquals(before, after); } //assert that the end of input is reached try { long skipped = dis.skip(1); - Assert.assertEquals(0, skipped); + assertEquals(0, skipped); }catch (EOFException expected) { //either should throw exception or return 0 as skipped } @@ -204,10 +202,10 @@ private void testNullFieldsWith( Object ... values ) throws IOException { boolean[] ret = IOUtils.readNullFieldsInfo(in); //assert - Assert.assertEquals(values.length, ret.length); + assertEquals(values.length, ret.length); for(int i=0; i static { setTestDriver(new GoraDynamoDBTestDriver()); } - + @Before public void setUp() throws Exception { setPersistentKeyClass(DynamoDBKey.class); setPersistentValClass(person.class); super.setUp(); } - + public GoraDynamoDBTestDriver getTestDriver() { return (GoraDynamoDBTestDriver) testDriver; } - + //============================================================================ - //We need to skip the following tests for a while until we fix some issues.. + //We need to skip the following tests for a while until we fix some issues.. + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testQueryStartKey() throws IOException { log.info("test method: TestQueryStartKey SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testQueryEndKey() throws IOException { log.info("test method: TestQueryEndKey SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testDeleteByQueryFields() throws IOException { log.info("test method: TestDeleteByQueryFields SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testNewInstance() throws IOException, Exception { log.info("test method: TestNewInstance SKIPPED."); - } + } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testAutoCreateSchema() throws Exception { log.info("test method: TestAutoCreateSchema SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testTruncateSchema() throws Exception { log.info("test method: TestTruncateSchema SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testPutNested() throws IOException, Exception { log.info("test method: TestPutNested SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testPutArray() throws IOException, Exception { log.info("test method: TestPutArray SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testPutBytes() throws IOException, Exception { - log.info("test method: TestPutBytes SKIPPED."); + log.info("test method: TestPutBytes SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testPutMap() throws IOException, Exception { log.info("test method: TestPutMap SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testEmptyUpdate() throws IOException, Exception { - log.info("test method: TestEmptyUpdate SKIPPED."); + log.info("test method: TestEmptyUpdate SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testDeleteSchema() throws IOException, Exception { log.info("test method: TestDeleteSchema SKIPPED."); } + @Ignore("Needs to be skipped for a while until some issues are fixed") @Override public void testGetWithFields() throws IOException, Exception { - log.info("test method: TestGetWithFields SKIPPED."); + log.info("test method: TestGetWithFields SKIPPED."); } -//============================================================================ - +//========================================================================== + /** * Tests deleting items using a query */ @@ -143,7 +154,7 @@ public void assertTestDeleteByQueryDataStore(){ e.printStackTrace(); } } - + /** * Tests updating a specific item */ @@ -163,28 +174,28 @@ public void assertTestUpdateDataStore(){ e.printStackTrace(); } } - + /** * Method to test deleting a schema - + */ @Override public void assertDeleteSchema(){ try { log.info("test method: TestDeleteSchema using DynamoDB store."); - dataStore.deleteSchema(); + dataStore.deleteSchema(); } catch (Exception e) { log.error("error in test method: testDeleteSchema."); e.printStackTrace(); } } -*/ + /** * Method to verify if a schema exists or not */ @Override public void assertSchemaExists(String schemaName) throws Exception { log.info("test method: TestSchemaExists using DynamoDB store."); - Assert.assertTrue(dataStore.schemaExists()); + assertTrue(dataStore.schemaExists()); } /** @@ -204,10 +215,10 @@ public void assertPut(){ dataStore.put(dKey, p2); } catch (Exception e) { log.error("error in test method: testPut."); - e.printStackTrace(); + e.printStackTrace(); } } - + /** * Method to query the data store */ @@ -223,18 +234,18 @@ public void assertTestQueryDataStore(){ query.setKey(dKey); Result queryResult = dataStore.execute(query); processQueryResult(queryResult); - } catch (Exception e) { - log.error("error in test method: testQuery."); + } catch (Exception e) { + log.error("error in test method: testQuery."); e.printStackTrace(); } } - + /** * Method to query items into the data store */ @Override public void assertTestQueryKeyRange(){ - log.info("test method: testQueryKeyRange using specific data store."); + log.info("test method: testQueryKeyRange using specific data store."); try { DynamoDBKey dKey = new DynamoDBKey(); DynamoDBKey startKey = new DynamoDBKey(); @@ -255,7 +266,7 @@ public void assertTestQueryKeyRange(){ e.printStackTrace(); } } - + /** * Method to get an specific object using a key */ @@ -277,7 +288,7 @@ public void assertTestGetDataStore(){ e.printStackTrace(); } } - + /** * Method to delete items into the data store */ @@ -294,21 +305,21 @@ public void assertTestDeleteDataStore() { p1.setFirstName("Joao"); p1.setLastName("Velasco"); dataStore.put(dKey, p1); - Assert.assertTrue(dataStore.delete(dKey)); + assertTrue(dataStore.delete(dKey)); dKey.setRangeKey("10/10/1000"); - Assert.assertFalse(dataStore.delete(dKey)); + assertFalse(dataStore.delete(dKey)); }catch (Exception e) { log.error("error in test method: testDeleteDataStore."); e.printStackTrace(); + } } - } - + /** * Method to create the data store */ @Override protected DataStore createDataStore() { - log.info("Creating DynamoDB data store."); + log.info("Creating DynamoDB data store."); try { dataStore = getTestDriver().getDataStore(); dataStore.createSchema(); @@ -316,9 +327,9 @@ protected DataStore createDataStore() { log.error("error while creating DynamoDB data store"); e.printStackTrace(); } - return dataStore; - } - + return dataStore; + } + /** * Processes query results from an query execution * @param pQueryResult @@ -328,15 +339,15 @@ private void processQueryResult(Result pQueryResult){ log.debug("Processing tests results."); while(pQueryResult.next()) printPersonInfo(pQueryResult.get()); - } catch (IOException e) { - log.error("error while processing tests results."); - e.printStackTrace(); - } catch (Exception e) { - log.error("error while processing tests results."); - e.printStackTrace(); + } catch (IOException e) { + log.error("error while processing tests results."); + e.printStackTrace(); + } catch (Exception e) { + log.error("error while processing tests results."); + e.printStackTrace(); + } } - } - + /** * Method to generate persisten objects * @param key @@ -354,24 +365,24 @@ private person buildPerson(String key, String pRangeKey, String pFirstName, Stri newPerson.setLastName(pLastName); newPerson.setVisitedplaces(new HashSet()); for(String place : places) - newPerson.getVisitedplaces().add(place); - return newPerson; - } - + newPerson.getVisitedplaces().add(place); + return newPerson; + } + /** * Method to print the object returned from Get method * @param pPerson */ private void printPersonInfo(person pPerson){ - System.out.println( "Origin:\t" + pPerson.getHashKey() + - "\n Birthday:\t" + pPerson.getRangeKey() + - "\n FirstName:" + pPerson.getFirstName() + - "\n LastName:" + pPerson.getLastName() + - "\n Visited Places:"); + log.info("Origin:\t" + pPerson.getHashKey() + + "\n Birthday:\t" + pPerson.getRangeKey() + + "\n FirstName:" + pPerson.getFirstName() + + "\n LastName:" + pPerson.getLastName() + + "\n Visited Places:"); for(String place : pPerson.getVisitedplaces()) - System.out.println("\t" + place); + log.info("\t" + place); } - + public static void main(String[] args) throws Exception { TestDynamoDBStore test = new TestDynamoDBStore(); try{ diff --git a/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java b/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java index c6305a8c4..dc080dec0 100644 --- a/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java +++ b/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java @@ -18,31 +18,30 @@ package org.apache.gora.hbase.store; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.Properties; - -import junit.framework.Assert; - import org.apache.avro.util.Utf8; -import org.apache.commons.lang.ArrayUtils; -import org.apache.gora.examples.WebPageDataCreator; import org.apache.gora.examples.generated.Employee; import org.apache.gora.examples.generated.WebPage; import org.apache.gora.hbase.GoraHBaseTestDriver; import org.apache.gora.store.DataStore; import org.apache.gora.store.DataStoreFactory; import org.apache.gora.store.DataStoreTestBase; -import org.apache.gora.store.DataStoreTestUtil; -import org.apache.gora.util.GoraException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.util.Bytes; +import org.junit.Ignore; import org.junit.Test; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Arrays; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertNotNull; + /** * Test case for HBaseStore. */ @@ -79,11 +78,11 @@ protected DataStore createWebPageDataStore() public GoraHBaseTestDriver getTestDriver() { return (GoraHBaseTestDriver) testDriver; } - + @Override public void assertSchemaExists(String schemaName) throws Exception { HBaseAdmin admin = getTestDriver().getHbaseUtil().getHBaseAdmin(); - Assert.assertTrue(admin.tableExists(schemaName)); + assertTrue(admin.tableExists(schemaName)); } @Override @@ -92,11 +91,11 @@ public void assertPutArray() throws IOException { Get get = new Get(Bytes.toBytes("com.example/http")); org.apache.hadoop.hbase.client.Result result = table.get(get); - Assert.assertEquals(result.getFamilyMap(Bytes.toBytes("parsedContent")).size(), 4); - Assert.assertTrue(Arrays.equals(result.getValue(Bytes.toBytes("parsedContent") + assertEquals(result.getFamilyMap(Bytes.toBytes("parsedContent")).size(), 4); + assertTrue(Arrays.equals(result.getValue(Bytes.toBytes("parsedContent") ,Bytes.toBytes(0)), Bytes.toBytes("example"))); - Assert.assertTrue(Arrays.equals(result.getValue(Bytes.toBytes("parsedContent") + assertTrue(Arrays.equals(result.getValue(Bytes.toBytes("parsedContent") ,Bytes.toBytes(3)), Bytes.toBytes("example.com"))); table.close(); } @@ -115,8 +114,8 @@ public void assertPutBytes(byte[] contentBytes) throws IOException { org.apache.hadoop.hbase.client.Result result = table.get(get); byte[] actualBytes = result.getValue(Bytes.toBytes("content"), null); - Assert.assertNotNull(actualBytes); - Assert.assertTrue(Arrays.equals(contentBytes, actualBytes)); + assertNotNull(actualBytes); + assertTrue(Arrays.equals(contentBytes, actualBytes)); table.close(); // Since "content" is an optional field, we are forced to reopen the DataStore @@ -129,13 +128,13 @@ public void assertPutBytes(byte[] contentBytes) throws IOException { webPageStore.close() ; webPageStore = testDriver.createDataStore(String.class, WebPage.class); page = webPageStore.get("com.example/http") ; - Assert.assertNull(page.getContent()) ; + assertNull(page.getContent()) ; // Check directly with HBase table = new HTable("WebPage"); get = new Get(Bytes.toBytes("com.example/http")); result = table.get(get); actualBytes = result.getValue(Bytes.toBytes("content"), null); - Assert.assertNull(actualBytes); + assertNull(actualBytes); table.close(); // Test writing+reading an empty bytes field. FIELD in HBASE MUST become EMPTY (byte[0]) @@ -145,16 +144,15 @@ public void assertPutBytes(byte[] contentBytes) throws IOException { webPageStore.close() ; webPageStore = testDriver.createDataStore(String.class, WebPage.class); page = webPageStore.get("com.example/http") ; - Assert.assertTrue(Arrays.equals("".getBytes(),page.getContent().array())) ; + assertTrue(Arrays.equals("".getBytes(),page.getContent().array())) ; // Check directly with HBase table = new HTable("WebPage"); get = new Get(Bytes.toBytes("com.example/http")); result = table.get(get); actualBytes = result.getValue(Bytes.toBytes("content"), null); - Assert.assertNotNull(actualBytes); - Assert.assertEquals(0, actualBytes.length) ; + assertNotNull(actualBytes); + assertEquals(0, actualBytes.length) ; table.close(); - } /** @@ -180,8 +178,8 @@ public void assertTopLevelUnions() throws Exception { byte[] bytesRead = result.getValue(Bytes.toBytes("content"), null); - Assert.assertNotNull(bytesRead) ; - Assert.assertTrue(Arrays.equals(bytesRead, contentBytes)); + assertNotNull(bytesRead) ; + assertTrue(Arrays.equals(bytesRead, contentBytes)); } /** @@ -208,8 +206,8 @@ public void assertTopLevelUnionsNull() throws Exception { byte[] contentBytes = result.getValue(Bytes.toBytes("content"), null); - Assert.assertNull(webPageStore.get("com.example/http", new String[]{"content"})) ; - Assert.assertTrue(contentBytes == null || contentBytes.length == 0) ; + assertNull(webPageStore.get("com.example/http", new String[]{"content"})) ; + assertTrue(contentBytes == null || contentBytes.length == 0) ; } @Override @@ -220,39 +218,39 @@ public void assertPutMap() throws IOException { byte[] anchor2Raw = result.getValue(Bytes.toBytes("outlinks") , Bytes.toBytes("http://example2.com")); - Assert.assertNotNull(anchor2Raw); + assertNotNull(anchor2Raw); String anchor2 = Bytes.toString(anchor2Raw); - Assert.assertEquals("anchor2", anchor2); + assertEquals("anchor2", anchor2); table.close(); } + @Ignore("We need to skip this test since gora considers endRow inclusive, while its exclusive for HBase.") @Override public void testQueryEndKey() throws IOException { - //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. } + @Ignore("We need to skip this test since gora considers endRow inclusive, while its exclusive for HBase.") @Override public void testQueryKeyRange() throws IOException { - //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. - //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. + //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. } + @Ignore("We need to skip this test since gora considers endRow inclusive, while its exclusive for HBase.") @Override public void testDeleteByQuery() throws IOException { - //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. - //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. + //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. } public static void main(String[] args) throws Exception { TestHBaseStore test = new TestHBaseStore(); - test.setUpClass(); + setUpClass(); test.setUp(); test.testQuery(); test.tearDown(); - test.tearDownClass(); + tearDownClass(); } } diff --git a/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java b/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java index 18fd11aaf..138015a9e 100644 --- a/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java +++ b/gora-hbase/src/test/java/org/apache/gora/hbase/util/TestHBaseByteInterface.java @@ -30,8 +30,7 @@ import org.apache.avro.util.Utf8; import org.apache.gora.examples.generated.Employee; import org.apache.gora.examples.generated.Metadata; -import org.apache.gora.examples.generated.TokenDatum; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; import org.junit.Test; public class TestHBaseByteInterface { @@ -58,10 +57,10 @@ public void testEncodingDecoding() throws Exception { Employee e2 = (Employee) HBaseByteInterface.fromBytes(Employee._SCHEMA, employerBytes); - Assert.assertEquals(name, e2.getName()); - Assert.assertEquals(dateOfBirth, e2.getDateOfBirth()); - Assert.assertEquals(salary, e2.getSalary()); - Assert.assertEquals(ssn, e2.getSsn()); + assertEquals(name, e2.getName()); + assertEquals(dateOfBirth, e2.getDateOfBirth()); + assertEquals(salary, e2.getSalary()); + assertEquals(ssn, e2.getSsn()); //metadata @@ -75,7 +74,7 @@ public void testEncodingDecoding() throws Exception { Metadata m2 = (Metadata) HBaseByteInterface.fromBytes(Metadata._SCHEMA, datumBytes); - Assert.assertEquals(value, m2.getFromData(key)); + assertEquals(value, m2.getFromData(key)); } } @@ -109,7 +108,7 @@ public Integer call() { // check results for (Future result : results) { - Assert.assertEquals(0, (int) result.get()); + assertEquals(0, (int) result.get()); } }