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;
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
......
......@@ -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");
}
......
......@@ -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");
......
......@@ -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);
}
......
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