Search in sources :

Example 6 with RangerAtlasEntity

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

the class TestHbaseResourceMapper method testHbaseResourceFromMissingColumnName.

@Test
public void testHbaseResourceFromMissingColumnName() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(ENTITY_ATTRIBUTE_QUALIFIED_NAME, COLUMN_FAMILY_QUALIFIED_NAME);
    RangerAtlasEntity entity = getHbaseColumnEntity(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 7 with RangerAtlasEntity

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

the class TestHdfsResourceMapper method testHdfsResourceFromQualifiedNameAndClusterNameFromDefault.

@Test
public void testHdfsResourceFromQualifiedNameAndClusterNameFromDefault() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, PATH);
    RangerAtlasEntity entity = getHdfsPathEntity(entAttribs);
    RangerServiceResource resource = resourceMapperWithDefaultClusterName.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 8 with RangerAtlasEntity

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

the class TestHdfsResourceMapper method testHdfsResourceFromMissingAttribs.

@Test
public void testHdfsResourceFromMissingAttribs() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    RangerAtlasEntity entity = getHdfsPathEntity(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 9 with RangerAtlasEntity

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

the class TestHdfsResourceMapper method testHdfsResourceFromPathAndQualifiedName.

@Test
public void testHdfsResourceFromPathAndQualifiedName() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_PATH, PATH);
    entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, QUALIFIED_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 10 with RangerAtlasEntity

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

the class TestHiveResourceMapper method testHiveTable.

@Test
public void testHiveTable() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(AtlasHiveResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, TABLE_QUALIFIED_NAME);
    RangerAtlasEntity entity = getHiveTableEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertTableResource(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