Search in sources :

Example 26 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHbaseResourceMapper method testHbaseResourceFromMissingAttribs.

@Test
public void testHbaseResourceFromMissingAttribs() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    RangerAtlasEntity entity = getHbaseTableEntity(entAttribs);
    try {
        RangerServiceResource resource = resourceMapper.buildResource(entity);
        Assert.fail("expected exception. Found " + resource);
    } catch (Exception excp) {
    // ignore
    }
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Example 27 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHbaseResourceMapper method testHbaseNamespaceAndTable.

@Test
public void testHbaseNamespaceAndTable() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(ENTITY_ATTRIBUTE_QUALIFIED_NAME, TABLE_WITH_NAMESPACE_QUALIFIED_NAME);
    RangerAtlasEntity entity = getHbaseTableEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertTableWithNamespaceResource(resource);
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Example 28 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHbaseResourceMapper method testHbaseNamespace.

@Test
public void testHbaseNamespace() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(ENTITY_ATTRIBUTE_QUALIFIED_NAME, NAMESPACE_QUALIFIED_NAME);
    RangerAtlasEntity entity = getHbaseNamespaceEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertNamespaceResource(resource);
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Example 29 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHdfsResourceMapper method testHdfsResourceFromPathAndClusterName.

@Test
public void testHdfsResourceFromPathAndClusterName() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_PATH, PATH);
    entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_CLUSTER_NAME, CLUSTER_NAME);
    RangerAtlasEntity entity = getHdfsPathEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertServiceResource(resource);
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Example 30 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHdfsResourceMapper method testHdfsResourceFromQualifiedNameAndNameServiceId.

@Test
public void testHdfsResourceFromQualifiedNameAndNameServiceId() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, QUALIFIED_NAME);
    entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_NAME_SERVICE_ID, NAMESERVICE_ID);
    RangerAtlasEntity entity = getHdfsPathEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertFederatedServiceResource(resource);
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Aggregations

RangerAtlasEntity (org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity)40 RangerServiceResource (org.apache.ranger.plugin.model.RangerServiceResource)30 HashMap (java.util.HashMap)29 Test (org.junit.Test)28 ServiceTags (org.apache.ranger.plugin.util.ServiceTags)3 RangerTagDef (org.apache.ranger.plugin.model.RangerTagDef)2 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 RangerTag (org.apache.ranger.plugin.model.RangerTag)1 RangerTagAttributeDef (org.apache.ranger.plugin.model.RangerTagDef.RangerTagAttributeDef)1 RangerAtlasEntityWithTags (org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntityWithTags)1