Search in sources :

Example 1 with AtlasClientV2

use of org.apache.atlas.AtlasClientV2 in project incubator-atlas by apache.

the class BaseResourceIT method setUp.

@BeforeClass
public void setUp() throws Exception {
    //set high timeouts so that tests do not fail due to read timeouts while you
    //are stepping through the code in a debugger
    ApplicationProperties.get().setProperty("atlas.client.readTimeoutMSecs", "100000000");
    ApplicationProperties.get().setProperty("atlas.client.connectTimeoutMSecs", "100000000");
    Configuration configuration = ApplicationProperties.get();
    atlasUrls = configuration.getStringArray(ATLAS_REST_ADDRESS);
    if (atlasUrls == null || atlasUrls.length == 0) {
        atlasUrls = new String[] { "http://localhost:21000/" };
    }
    if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
        atlasClientV1 = new AtlasClient(atlasUrls, new String[] { "admin", "admin" });
        atlasClientV2 = new AtlasClientV2(atlasUrls, new String[] { "admin", "admin" });
    } else {
        atlasClientV1 = new AtlasClient(atlasUrls);
        atlasClientV2 = new AtlasClientV2(atlasUrls);
    }
}
Also used : AtlasClientV2(org.apache.atlas.AtlasClientV2) Configuration(org.apache.commons.configuration.Configuration) AtlasClient(org.apache.atlas.AtlasClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with AtlasClientV2

use of org.apache.atlas.AtlasClientV2 in project incubator-atlas by apache.

the class TypedefsJerseyResourceIT method setUp.

@BeforeClass
public void setUp() throws Exception {
    super.setUp();
    typeDefinitions = createHiveTypesV2();
    if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
        clientV2 = new AtlasClientV2(atlasUrls, new String[] { "admin", "admin" });
    } else {
        clientV2 = new AtlasClientV2(atlasUrls);
    }
}
Also used : AtlasClientV2(org.apache.atlas.AtlasClientV2) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

AtlasClientV2 (org.apache.atlas.AtlasClientV2)2 BeforeClass (org.testng.annotations.BeforeClass)2 AtlasClient (org.apache.atlas.AtlasClient)1 Configuration (org.apache.commons.configuration.Configuration)1