Commit f6acb086 by Ashutosh Mestry

ATLAS-2888: Change marker fix for server name. Unit test fix.

parent 6f747203
...@@ -26,6 +26,7 @@ import org.apache.atlas.model.impexp.AtlasExportRequest; ...@@ -26,6 +26,7 @@ import org.apache.atlas.model.impexp.AtlasExportRequest;
import org.apache.atlas.model.impexp.AtlasExportResult; import org.apache.atlas.model.impexp.AtlasExportResult;
import org.apache.atlas.model.instance.AtlasEntity; import org.apache.atlas.model.instance.AtlasEntity;
import org.apache.atlas.model.instance.AtlasObjectId; 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.model.typedef.AtlasTypesDef;
import org.apache.atlas.repository.graph.AtlasGraphProvider; import org.apache.atlas.repository.graph.AtlasGraphProvider;
import org.apache.atlas.repository.store.bootstrap.AtlasTypeDefStoreInitializer; import org.apache.atlas.repository.store.bootstrap.AtlasTypeDefStoreInitializer;
...@@ -84,9 +85,11 @@ public class ExportServiceTest extends ExportImportTestBase { ...@@ -84,9 +85,11 @@ public class ExportServiceTest extends ExportImportTestBase {
@Inject @Inject
private ExportImportAuditService auditService; private ExportImportAuditService auditService;
@Inject
private AtlasEntityStoreV2 entityStore;
private DeleteHandlerV1 deleteHandler = mock(SoftDeleteHandlerV1.class);; private DeleteHandlerV1 deleteHandler = mock(SoftDeleteHandlerV1.class);;
private AtlasEntityChangeNotifier mockChangeNotifier = mock(AtlasEntityChangeNotifier.class); private AtlasEntityChangeNotifier mockChangeNotifier = mock(AtlasEntityChangeNotifier.class);
private AtlasEntityStoreV2 entityStore;
@BeforeTest @BeforeTest
public void setupTest() throws IOException, AtlasBaseException { public void setupTest() throws IOException, AtlasBaseException {
...@@ -106,11 +109,12 @@ public class ExportServiceTest extends ExportImportTestBase { ...@@ -106,11 +109,12 @@ public class ExportServiceTest extends ExportImportTestBase {
typeDefStore.createTypesDef(typesToCreate); typeDefStore.createTypesDef(typesToCreate);
} }
AtlasEntity.AtlasEntitiesWithExtInfo hrDept = TestUtilsV2.createDeptEg2(); AtlasEntity.AtlasEntitiesWithExtInfo deptEg2 = TestUtilsV2.createDeptEg2();
AtlasEntityStream entityStream = new AtlasEntityStream(deptEg2);
AtlasEntityStream entityStream = new AtlasEntityStream(hrDept); EntityMutationResponse emr = entityStore.createOrUpdate(entityStream, false);
entityStore.createOrUpdate(entityStream, false); assertNotNull(emr);
LOG.debug("==> setupSampleData: ", AtlasEntity.dumpObjects(hrDept.getEntities(), null).toString()); assertNotNull(emr.getCreatedEntities());
assertTrue(emr.getCreatedEntities().size() > 0);
} }
@AfterClass @AfterClass
......
...@@ -213,7 +213,7 @@ public class ImportServiceTest extends ExportImportTestBase { ...@@ -213,7 +213,7 @@ public class ImportServiceTest extends ExportImportTestBase {
} }
@DataProvider(name = "stocks-legacy") @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"); return getZipSource("stocks.zip");
} }
...@@ -254,7 +254,7 @@ public class ImportServiceTest extends ExportImportTestBase { ...@@ -254,7 +254,7 @@ public class ImportServiceTest extends ExportImportTestBase {
} }
@DataProvider(name = "stocks-glossary") @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"); return getZipSource("stocks-glossary.zip");
} }
...@@ -298,12 +298,12 @@ public class ImportServiceTest extends ExportImportTestBase { ...@@ -298,12 +298,12 @@ public class ImportServiceTest extends ExportImportTestBase {
} }
@DataProvider(name = "relationshipLineage") @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"); return getZipSource("rel-lineage.zip");
} }
@DataProvider(name = "tag-prop-2") @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"); return getZipSource("tag-prop-2.zip");
} }
...@@ -316,7 +316,7 @@ public class ImportServiceTest extends ExportImportTestBase { ...@@ -316,7 +316,7 @@ public class ImportServiceTest extends ExportImportTestBase {
} }
@DataProvider(name = "relationship") @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"); return getZipSource("stocks-rel-2.zip");
} }
......
...@@ -84,14 +84,14 @@ public class ReplicationEntityAttributeTest extends ExportImportTestBase { ...@@ -84,14 +84,14 @@ public class ReplicationEntityAttributeTest extends ExportImportTestBase {
@Inject @Inject
AtlasServerService atlasServerService; AtlasServerService atlasServerService;
private AtlasEntityChangeNotifier mockChangeNotifier = mock(AtlasEntityChangeNotifier.class); @Inject
private AtlasEntityStoreV2 entityStore; private AtlasEntityStoreV2 entityStore;
private ZipSource zipSource; private ZipSource zipSource;
@BeforeClass @BeforeClass
public void setup() throws IOException, AtlasBaseException { public void setup() throws IOException, AtlasBaseException {
basicSetup(typeDefStore, typeRegistry); basicSetup(typeDefStore, typeRegistry);
entityStore = new AtlasEntityStoreV2(deleteHandler, typeRegistry, mockChangeNotifier, graphMapper);
createEntities(entityStore, ENTITIES_SUB_DIR, new String[]{"db", "table-columns"}); createEntities(entityStore, ENTITIES_SUB_DIR, new String[]{"db", "table-columns"});
AtlasType refType = typeRegistry.getType("Referenceable"); AtlasType refType = typeRegistry.getType("Referenceable");
......
...@@ -605,7 +605,7 @@ public class ClassificationPropagationTest { ...@@ -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); FileInputStream fs = ZipFileResourceTestUtils.getFileInputStream(fileName);
return new ZipSource(fs); return new ZipSource(fs);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment