Search in sources :

Example 11 with TupleBuilder

use of org.bboxdb.tools.converter.tuple.TupleBuilder in project bboxdb by jnidzwetzki.

the class TestTupleBuilder method testSyntheticTupleBuilder.

/**
 * Test the syntetic tuple builder
 * @throws ParseException
 */
@Test
public void testSyntheticTupleBuilder() throws ParseException {
    final TupleBuilder tupleBuilder = TupleBuilderFactory.getBuilderForFormat(TupleBuilderFactory.Name.SYNTHETIC);
    final Tuple tuple = tupleBuilder.buildTuple("1", SYNTHETIC_TEST_LINE);
    Assert.assertTrue(tuple != null);
    Assert.assertEquals(Integer.toString(1), tuple.getKey());
    final BoundingBox exptectedBox = new BoundingBox(51.47015078569419, 58.26664175357267, 49.11808592466023, 52.72529828070016);
    Assert.assertEquals(exptectedBox, tuple.getBoundingBox());
    Assert.assertEquals("e1k141dox9rayxo544y9", new String(tuple.getDataBytes()));
}
Also used : TupleBuilder(org.bboxdb.tools.converter.tuple.TupleBuilder) BoundingBox(org.bboxdb.commons.math.BoundingBox) Tuple(org.bboxdb.storage.entity.Tuple) Test(org.junit.Test)

Aggregations

Tuple (org.bboxdb.storage.entity.Tuple)11 TupleBuilder (org.bboxdb.tools.converter.tuple.TupleBuilder)11 Test (org.junit.Test)10 BoundingBox (org.bboxdb.commons.math.BoundingBox)8 SimpleDateFormat (java.text.SimpleDateFormat)5 Date (java.util.Date)5 BufferedWriter (java.io.BufferedWriter)3 File (java.io.File)3 FileWriter (java.io.FileWriter)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 TupleFileReader (org.bboxdb.tools.TupleFileReader)3 RandomAccessFile (java.io.RandomAccessFile)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1