use of org.pentaho.metastore.stores.memory.MemoryMetaStoreElement in project pentaho-kettle by pentaho.
the class PurRepositoryMetaStoreTest method testDataNodeConversion.
@Test
public void testDataNodeConversion() throws Exception {
IMetaStoreElement expected = new MemoryMetaStoreElement();
expected.setName("parent");
expected.addChild(new MemoryMetaStoreAttribute("date", new Date()));
expected.addChild(new MemoryMetaStoreAttribute("long", 32L));
expected.addChild(new MemoryMetaStoreAttribute("double", 3.2));
expected.addChild(new MemoryMetaStoreAttribute("string", "value"));
MemoryMetaStoreAttribute collection = new MemoryMetaStoreAttribute("collection", "collection-value");
for (int i = 0; i < 10; i++) {
collection.addChild(new MemoryMetaStoreAttribute("key-" + i, "value-" + i));
}
expected.addChild(collection);
DataNode dataNode = new DataNode("test");
metaStore.elementToDataNode(expected, dataNode);
IMetaStoreElement verify = new MemoryMetaStoreElement();
metaStore.dataNodeToElement(dataNode, verify);
assertEquals(expected.getName(), verify.getName());
validate(expected, verify);
}
Aggregations