protected void createRelationship(AtlasRelationship relationship) throws AtlasBaseException { try { relationshipStore.create(relationship); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIP_ALREADY_EXISTS)) { throw e; } } }
protected void createRelationship(AtlasRelationship relationship) throws AtlasBaseException { try { relationshipStore.create(relationship); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIP_ALREADY_EXISTS)) { throw e; } } }
AtlasAuthorizationUtils.getRequestIpAddress(httpServletRequest)); } catch (AtlasBaseException excp) { if (excp.getAtlasErrorCode().equals(AtlasErrorCode.IMPORT_ATTEMPTING_EMPTY_ZIP)) { LOG.info(excp.getMessage()); return new AtlasImportResult();
@Test(dataProvider = "updateEnd2") public void testupdateVertexPreUpdateEnd2(AtlasRelationshipDef existingRelationshipDef,AtlasRelationshipDef newRelationshipDef) { try { AtlasRelationshipDefStoreV2.preUpdateCheck(existingRelationshipDef, newRelationshipDef); fail("expected error"); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_INVALID_END2_UPDATE)){ fail("unexpected AtlasErrorCode "+e.getAtlasErrorCode()); } } } @AfterClass
@Test(dataProvider = "updateRename") public void testupdateVertexPreUpdateRename(AtlasRelationshipDef existingRelationshipDef,AtlasRelationshipDef newRelationshipDef) { try { AtlasRelationshipDefStoreV2.preUpdateCheck(existingRelationshipDef, newRelationshipDef); fail("expected error"); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_INVALID_NAME_UPDATE)){ fail("unexpected AtlasErrorCode "+e.getAtlasErrorCode()); } } } @Test(dataProvider = "updateRelCat")
@Test(dataProvider = "updateRelCat") public void testupdateVertexPreUpdateRelcat(AtlasRelationshipDef existingRelationshipDef,AtlasRelationshipDef newRelationshipDef) { try { AtlasRelationshipDefStoreV2.preUpdateCheck(existingRelationshipDef, newRelationshipDef); fail("expected error"); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_INVALID_CATEGORY_UPDATE)){ fail("unexpected AtlasErrorCode "+e.getAtlasErrorCode()); } } } @Test(dataProvider = "updateEnd1")
@Test(dataProvider = "updateRelCat") public void testupdateVertexPreUpdateRelcat(AtlasRelationshipDef existingRelationshipDef,AtlasRelationshipDef newRelationshipDef) { try { AtlasRelationshipDefStoreV2.preUpdateCheck(existingRelationshipDef, newRelationshipDef); fail("expected error"); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_INVALID_CATEGORY_UPDATE)){ fail("unexpected AtlasErrorCode "+e.getAtlasErrorCode()); } } } @Test(dataProvider = "updateEnd1")
@Test(dataProvider = "updateEnd1") public void testupdateVertexPreUpdateEnd1(AtlasRelationshipDef existingRelationshipDef,AtlasRelationshipDef newRelationshipDef) { try { AtlasRelationshipDefStoreV2.preUpdateCheck(existingRelationshipDef, newRelationshipDef); fail("expected error"); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_INVALID_END1_UPDATE)){ fail("unexpected AtlasErrorCode "+e.getAtlasErrorCode()); } } }
@Test(dataProvider = "updateEnd1") public void testupdateVertexPreUpdateEnd1(AtlasRelationshipDef existingRelationshipDef,AtlasRelationshipDef newRelationshipDef) { try { AtlasRelationshipDefStoreV2.preUpdateCheck(existingRelationshipDef, newRelationshipDef); fail("expected error"); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_INVALID_END1_UPDATE)){ fail("unexpected AtlasErrorCode "+e.getAtlasErrorCode()); } } }
@Test(dataProvider = "updateRename") public void testupdateVertexPreUpdateRename(AtlasRelationshipDef existingRelationshipDef,AtlasRelationshipDef newRelationshipDef) { try { AtlasRelationshipDefStoreV2.preUpdateCheck(existingRelationshipDef, newRelationshipDef); fail("expected error"); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_INVALID_NAME_UPDATE)){ fail("unexpected AtlasErrorCode "+e.getAtlasErrorCode()); } } } @Test(dataProvider = "updateRelCat")
@Test(dataProvider = "updateEnd2") public void testupdateVertexPreUpdateEnd2(AtlasRelationshipDef existingRelationshipDef,AtlasRelationshipDef newRelationshipDef) { try { AtlasRelationshipDefStoreV2.preUpdateCheck(existingRelationshipDef, newRelationshipDef); fail("expected error"); } catch (AtlasBaseException e) { if (!e.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_INVALID_END2_UPDATE)){ fail("unexpected AtlasErrorCode "+e.getAtlasErrorCode()); } } } @AfterClass
fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_ASSOCIATION_AND_CONTAINER)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_NO_CONTAINER)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_AGGREGATION_NO_CONTAINER)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_MULTIPLE_PARENTS)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_END)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_END)) { fail("This call expected a different error");
fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_ASSOCIATION_AND_CONTAINER)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_NO_CONTAINER)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_AGGREGATION_NO_CONTAINER)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_COMPOSITION_MULTIPLE_PARENTS)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_END)) { fail("This call expected a different error"); fail("This call is expected to fail"); } catch (AtlasBaseException abe) { if (!abe.getAtlasErrorCode().equals(AtlasErrorCode.RELATIONSHIPDEF_LIST_ON_END)) { fail("This call expected a different error");