ATLAS-2888: Change marker fix for server name. Unit test fix.
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/80dc1e5e Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/80dc1e5e Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/80dc1e5e Branch: refs/heads/branch-1.0 Commit: 80dc1e5e55a90e33e6dde41cfb2f0b5d22263621 Parents: 4f3e76c Author: Ashutosh Mestry <[email protected]> Authored: Mon Oct 1 22:08:30 2018 -0700 Committer: Ashutosh Mestry <[email protected]> Committed: Thu Nov 1 15:42:57 2018 -0700 ---------------------------------------------------------------------- .../atlas/repository/impexp/ExportServiceTest.java | 16 ++++++++++------ .../atlas/repository/impexp/ImportServiceTest.java | 10 +++++----- .../impexp/ReplicationEntityAttributeTest.java | 4 ++-- .../ClassificationPropagationTest.java | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/80dc1e5e/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java index 377bd67..7aa0b57 100644 --- a/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java @@ -26,6 +26,7 @@ import org.apache.atlas.model.impexp.AtlasExportRequest; import org.apache.atlas.model.impexp.AtlasExportResult; import org.apache.atlas.model.instance.AtlasEntity; import org.apache.atlas.model.instance.AtlasObjectId; +import org.apache.atlas.model.instance.EntityMutationResponse; import org.apache.atlas.model.typedef.AtlasTypesDef; import org.apache.atlas.repository.graph.AtlasGraphProvider; import org.apache.atlas.repository.store.bootstrap.AtlasTypeDefStoreInitializer; @@ -84,9 +85,11 @@ public class ExportServiceTest extends ExportImportTestBase { @Inject private ExportImportAuditService auditService; + @Inject + private AtlasEntityStoreV2 entityStore; + private DeleteHandlerV1 deleteHandler = mock(SoftDeleteHandlerV1.class);; private AtlasEntityChangeNotifier mockChangeNotifier = mock(AtlasEntityChangeNotifier.class); - private AtlasEntityStoreV2 entityStore; @BeforeTest public void setupTest() throws IOException, AtlasBaseException { @@ -106,11 +109,12 @@ public class ExportServiceTest extends ExportImportTestBase { typeDefStore.createTypesDef(typesToCreate); } - AtlasEntity.AtlasEntitiesWithExtInfo hrDept = TestUtilsV2.createDeptEg2(); - - AtlasEntityStream entityStream = new AtlasEntityStream(hrDept); - entityStore.createOrUpdate(entityStream, false); - LOG.debug("==> setupSampleData: ", AtlasEntity.dumpObjects(hrDept.getEntities(), null).toString()); + AtlasEntity.AtlasEntitiesWithExtInfo deptEg2 = TestUtilsV2.createDeptEg2(); + AtlasEntityStream entityStream = new AtlasEntityStream(deptEg2); + EntityMutationResponse emr = entityStore.createOrUpdate(entityStream, false); + assertNotNull(emr); + assertNotNull(emr.getCreatedEntities()); + assertTrue(emr.getCreatedEntities().size() > 0); } @AfterClass http://git-wip-us.apache.org/repos/asf/atlas/blob/80dc1e5e/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java b/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java index e0bbb11..a1d6cef 100644 --- a/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java @@ -213,7 +213,7 @@ public class ImportServiceTest extends ExportImportTestBase { } @DataProvider(name = "stocks-legacy") - public static Object[][] getDataFromLegacyStocks(ITestContext context) throws IOException { + public static Object[][] getDataFromLegacyStocks(ITestContext context) throws IOException, AtlasBaseException { return getZipSource("stocks.zip"); } @@ -254,7 +254,7 @@ public class ImportServiceTest extends ExportImportTestBase { } @DataProvider(name = "stocks-glossary") - public static Object[][] getDataFromGlossary(ITestContext context) throws IOException { + public static Object[][] getDataFromGlossary(ITestContext context) throws IOException, AtlasBaseException { return getZipSource("stocks-glossary.zip"); } @@ -298,12 +298,12 @@ public class ImportServiceTest extends ExportImportTestBase { } @DataProvider(name = "relationshipLineage") - public static Object[][] getImportWithRelationships(ITestContext context) throws IOException { + public static Object[][] getImportWithRelationships(ITestContext context) throws IOException, AtlasBaseException { return getZipSource("rel-lineage.zip"); } @DataProvider(name = "tag-prop-2") - public static Object[][] getImportWithTagProp2(ITestContext context) throws IOException { + public static Object[][] getImportWithTagProp2(ITestContext context) throws IOException, AtlasBaseException { return getZipSource("tag-prop-2.zip"); } @@ -316,7 +316,7 @@ public class ImportServiceTest extends ExportImportTestBase { } @DataProvider(name = "relationship") - public static Object[][] getImportWithRelationshipsWithLineage(ITestContext context) throws IOException { + public static Object[][] getImportWithRelationshipsWithLineage(ITestContext context) throws IOException, AtlasBaseException { return getZipSource("stocks-rel-2.zip"); } http://git-wip-us.apache.org/repos/asf/atlas/blob/80dc1e5e/repository/src/test/java/org/apache/atlas/repository/impexp/ReplicationEntityAttributeTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/ReplicationEntityAttributeTest.java b/repository/src/test/java/org/apache/atlas/repository/impexp/ReplicationEntityAttributeTest.java index 81b9106..1eccdbf 100644 --- a/repository/src/test/java/org/apache/atlas/repository/impexp/ReplicationEntityAttributeTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/impexp/ReplicationEntityAttributeTest.java @@ -84,14 +84,14 @@ public class ReplicationEntityAttributeTest extends ExportImportTestBase { @Inject AtlasServerService atlasServerService; - private AtlasEntityChangeNotifier mockChangeNotifier = mock(AtlasEntityChangeNotifier.class); + @Inject private AtlasEntityStoreV2 entityStore; + private ZipSource zipSource; @BeforeClass public void setup() throws IOException, AtlasBaseException { basicSetup(typeDefStore, typeRegistry); - entityStore = new AtlasEntityStoreV2(deleteHandler, typeRegistry, mockChangeNotifier, graphMapper); createEntities(entityStore, ENTITIES_SUB_DIR, new String[]{"db", "table-columns"}); AtlasType refType = typeRegistry.getType("Referenceable"); http://git-wip-us.apache.org/repos/asf/atlas/blob/80dc1e5e/repository/src/test/java/org/apache/atlas/repository/tagpropagation/ClassificationPropagationTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/tagpropagation/ClassificationPropagationTest.java b/repository/src/test/java/org/apache/atlas/repository/tagpropagation/ClassificationPropagationTest.java index 8459963..d5f36bc 100644 --- a/repository/src/test/java/org/apache/atlas/repository/tagpropagation/ClassificationPropagationTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/tagpropagation/ClassificationPropagationTest.java @@ -605,7 +605,7 @@ public class ClassificationPropagationTest { } } - public static ZipSource getZipSource(String fileName) throws IOException { + public static ZipSource getZipSource(String fileName) throws IOException, AtlasBaseException { FileInputStream fs = ZipFileResourceTestUtils.getFileInputStream(fileName); return new ZipSource(fs); }
