Search in sources :

Example 1 with TdqCategories

use of org.talend.dataquality.semantic.broadcast.TdqCategories in project data-prep by Talend.

the class TransformAPITest method retrieveDictionary.

@Test
public void retrieveDictionary() throws Exception {
    // when
    final InputStream dictionary = given().when().expect().statusCode(200).log().ifError().get("/api/transform/dictionary").asInputStream();
    // then
    final ObjectInputStream ois = new ObjectInputStream(new GZIPInputStream(dictionary));
    final Object object = ois.readObject();
    Assert.assertEquals(TdqCategories.class, object.getClass());
    final TdqCategories serviceDictionary = (TdqCategories) object;
    // Test Lucene directory
    final Directory dictionaryDirectory = serviceDictionary.getDictionary().asDirectory();
    // creation.
    assertNotNull(dictionaryDirectory);
    // Test Lucene directory
    final Directory keywordDirectory = serviceDictionary.getKeyword().asDirectory();
    // creation.
    assertNotNull(keywordDirectory);
}
Also used : GZIPInputStream(java.util.zip.GZIPInputStream) TdqCategories(org.talend.dataquality.semantic.broadcast.TdqCategories) GZIPInputStream(java.util.zip.GZIPInputStream) ObjectInputStream(java.io.ObjectInputStream) InputStream(java.io.InputStream) ObjectInputStream(java.io.ObjectInputStream) Directory(org.apache.lucene.store.Directory) Test(org.junit.Test)

Aggregations

InputStream (java.io.InputStream)1 ObjectInputStream (java.io.ObjectInputStream)1 GZIPInputStream (java.util.zip.GZIPInputStream)1 Directory (org.apache.lucene.store.Directory)1 Test (org.junit.Test)1 TdqCategories (org.talend.dataquality.semantic.broadcast.TdqCategories)1