Example usage for javax.imageio.metadata IIOMetadataNode IIOMetadataNode

List of usage examples for javax.imageio.metadata IIOMetadataNode IIOMetadataNode

Introduction

In this page you can find the example usage for javax.imageio.metadata IIOMetadataNode IIOMetadataNode.

Prototype

IIOMetadataNode

Source Link

Usage

From source file:org.pentaho.big.data.kettle.plugins.hbase.input.HBaseInputMetaTest.java

@Test
public void testLoadXmlDoesntBubleUpException() throws Exception {
    KettleLogStore.init();/*w  w w  .ja va  2s. c  o m*/
    ClusterInitializationException exception = new ClusterInitializationException(new Exception());
    hBaseInputMeta.setNamedCluster(namedCluster);
    when(namedClusterServiceLocator.getService(namedCluster, HBaseService.class)).thenThrow(exception);
    when(namedClusterService.getClusterTemplate()).thenReturn(namedCluster);

    IIOMetadataNode node = new IIOMetadataNode();
    IIOMetadataNode child = new IIOMetadataNode("disable_wal");
    IIOMetadataNode grandChild = new IIOMetadataNode();
    grandChild.setNodeValue("N");
    child.appendChild(grandChild);
    node.appendChild(child);

    hBaseInputMeta.loadXML(node, new ArrayList<>(), metaStore);

    ServiceStatus serviceStatus = hBaseInputMeta.getServiceStatus();
    assertNotNull(serviceStatus);
    assertFalse(serviceStatus.isOk());
    assertEquals(exception, serviceStatus.getException());
}

From source file:org.pentaho.big.data.kettle.plugins.hbase.input.HBaseInputMetaTest.java

@Test
public void testLoadXmlServiceStatusOk() throws Exception {
    KettleLogStore.init();/*from www .  j a va2 s.co  m*/
    hBaseInputMeta.setNamedCluster(namedCluster);
    when(namedClusterServiceLocator.getService(namedCluster, HBaseService.class)).thenReturn(hBaseService);
    when(namedClusterService.getClusterTemplate()).thenReturn(namedCluster);
    when(hBaseService.getHBaseValueMetaInterfaceFactory())
            .thenReturn(mock(HBaseValueMetaInterfaceFactory.class));
    MappingFactory mappingFactory = mock(MappingFactory.class);
    when(hBaseService.getMappingFactory()).thenReturn(mappingFactory);
    when(mappingFactory.createMapping()).thenReturn(mock(Mapping.class));

    IIOMetadataNode node = new IIOMetadataNode();
    IIOMetadataNode child = new IIOMetadataNode("disable_wal");
    IIOMetadataNode grandChild = new IIOMetadataNode();
    grandChild.setNodeValue("N");
    child.appendChild(grandChild);
    node.appendChild(child);

    hBaseInputMeta.loadXML(node, new ArrayList<>(), metaStore);

    ServiceStatus serviceStatus = hBaseInputMeta.getServiceStatus();
    assertNotNull(serviceStatus);
    assertTrue(serviceStatus.isOk());
}