use of eu.esdihumboldt.hale.common.lookup.impl.LookupTableImpl in project hale by halestudio.
the class LookupTableTypeTest method testStringLookupJson.
/**
* Test if a simple lookup table containing only string values is the same
* when converted to JSON and back again.
*/
@Test
public void testStringLookupJson() {
Map<Value, Value> values = createStringLookup();
LookupTable org = new LookupTableImpl(values);
// converter
LookupTableType ltt = new LookupTableType();
// convert to Json
StringWriter writer = new StringWriter();
ltt.toJson(org, writer);
System.out.println(writer.toString());
// convert back
LookupTable conv = ltt.fromJson(new StringReader(writer.toString()), null);
checkTable(conv, values);
}
use of eu.esdihumboldt.hale.common.lookup.impl.LookupTableImpl in project hale by halestudio.
the class LookupTableTypeTest method testComplexLookupJson.
/**
* Test if a lookup table containing only complex values is the same when
* converted to JSON and back again.
*/
@Test
public void testComplexLookupJson() {
Map<Value, Value> values2 = createComplexLookup();
LookupTable org2 = new LookupTableImpl(values2);
// converter
LookupTableType ltt = new LookupTableType();
// convert to Json
StringWriter writer = new StringWriter();
ltt.toJson(org2, writer);
System.out.println(writer.toString());
// convert back
LookupTable conv = ltt.fromJson(new StringReader(writer.toString()), null);
checkTable(conv, values2);
}
Aggregations