Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
8cd74965
Commit
8cd74965
authored
5 years ago
by
nikhilbonte
Committed by
nixonrodrigues
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3283 Export-import UTs are getting skipped
Signed-off-by:
nixonrodrigues
<
nixon@apache.org
>
parent
08b76391
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
16 deletions
+17
-16
ExportIncrementalTest.java
...apache/atlas/repository/impexp/ExportIncrementalTest.java
+8
-6
ExportSkipLineageTest.java
...apache/atlas/repository/impexp/ExportSkipLineageTest.java
+2
-1
ImportServiceTest.java
...org/apache/atlas/repository/impexp/ImportServiceTest.java
+0
-4
IncrementalExportEntityProviderTest.java
...epository/impexp/IncrementalExportEntityProviderTest.java
+2
-0
ReplicationEntityAttributeTest.java
...las/repository/impexp/ReplicationEntityAttributeTest.java
+2
-2
ZipFileResourceTestUtils.java
...che/atlas/repository/impexp/ZipFileResourceTestUtils.java
+3
-3
No files found.
repository/src/test/java/org/apache/atlas/repository/impexp/ExportIncrementalTest.java
View file @
8cd74965
...
...
@@ -66,11 +66,15 @@ public class ExportIncrementalTest extends ExportImportTestBase {
private
final
String
EXPORT_REQUEST_INCREMENTAL
=
"export-incremental"
;
private
final
String
EXPORT_REQUEST_CONNECTED
=
"export-connected"
;
private
AtlasClassificationType
classificationTypeT1
;
private
long
nextTimestamp
;
@BeforeClass
public
void
setup
()
throws
IOException
,
AtlasBaseException
{
basicSetup
(
typeDefStore
,
typeRegistry
);
RequestContext
.
get
().
setImportInProgress
(
true
);
classificationTypeT1
=
createNewClassification
();
createEntities
(
entityStore
,
ENTITIES_SUB_DIR
,
new
String
[]
{
"db"
,
"table-columns"
});
final
String
[]
entityGuids
=
{
DB_GUID
,
TABLE_GUID
};
verifyCreatedEntities
(
entityStore
,
entityGuids
,
2
);
...
...
@@ -108,8 +112,7 @@ public class ExportIncrementalTest extends ExportImportTestBase {
public
void
atT1_NewClassificationAttachedToTable_ReturnsChangedTable
()
throws
AtlasBaseException
{
final
int
expectedEntityCount
=
1
;
AtlasClassificationType
ct
=
createNewClassification
();
entityStore
.
addClassifications
(
TABLE_GUID
,
ImmutableList
.
of
(
ct
.
createDefaultValue
()));
entityStore
.
addClassifications
(
TABLE_GUID
,
ImmutableList
.
of
(
classificationTypeT1
.
createDefaultValue
()));
AtlasExportRequest
request
=
getIncrementalRequest
(
nextTimestamp
);
ZipSource
source
=
runExportWithParameters
(
exportService
,
request
);
...
...
@@ -127,7 +130,7 @@ public class ExportIncrementalTest extends ExportImportTestBase {
}
private
AtlasClassificationType
createNewClassification
()
{
createTypes
(
typeDefStore
,
ENTITIES_SUB_DIR
,
"types
D
ef-new-classification"
);
createTypes
(
typeDefStore
,
ENTITIES_SUB_DIR
,
"types
d
ef-new-classification"
);
return
typeRegistry
.
getClassificationTypeByName
(
"T1"
);
}
...
...
@@ -151,7 +154,6 @@ public class ExportIncrementalTest extends ExportImportTestBase {
long
postUpdateTableEntityTimestamp
=
tableEntity
.
getEntity
().
getUpdateTime
().
getTime
();
assertEquals
(
preExportTableEntityTimestamp
,
postUpdateTableEntityTimestamp
);
nextTimestamp
=
updateTimesampForNextIncrementalExport
(
source
);
}
@Test
(
dependsOnMethods
=
"atT2_NewClassificationAttachedToColumn_ReturnsChangedColumn"
)
...
...
@@ -179,7 +181,7 @@ public class ExportIncrementalTest extends ExportImportTestBase {
return
request
;
}
catch
(
IOException
e
)
{
throw
new
SkipException
(
String
.
format
(
"getIncrementalRequest: '%s' could not be l
ao
ded."
,
EXPORT_REQUEST_INCREMENTAL
));
throw
new
SkipException
(
String
.
format
(
"getIncrementalRequest: '%s' could not be l
oa
ded."
,
EXPORT_REQUEST_INCREMENTAL
));
}
}
...
...
@@ -187,7 +189,7 @@ public class ExportIncrementalTest extends ExportImportTestBase {
try
{
return
TestResourceFileUtils
.
readObjectFromJson
(
ENTITIES_SUB_DIR
,
EXPORT_REQUEST_CONNECTED
,
AtlasExportRequest
.
class
);
}
catch
(
IOException
e
)
{
throw
new
SkipException
(
String
.
format
(
"getIncrementalRequest: '%s' could not be l
ao
ded."
,
EXPORT_REQUEST_CONNECTED
));
throw
new
SkipException
(
String
.
format
(
"getIncrementalRequest: '%s' could not be l
oa
ded."
,
EXPORT_REQUEST_CONNECTED
));
}
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/impexp/ExportSkipLineageTest.java
View file @
8cd74965
...
...
@@ -72,6 +72,7 @@ public class ExportSkipLineageTest extends ExportImportTestBase {
public
void
setup
()
throws
IOException
,
AtlasBaseException
{
loadBaseModel
(
typeDefStore
,
typeRegistry
);
loadHiveModel
(
typeDefStore
,
typeRegistry
);
RequestContext
.
get
().
setImportInProgress
(
true
);
entityStore
=
new
AtlasEntityStoreV2
(
deleteDelegate
,
typeRegistry
,
mockChangeNotifier
,
graphMapper
);
createEntities
(
entityStore
,
ENTITIES_SUB_DIR
,
new
String
[]{
"db"
,
"table-columns"
,
"table-view"
,
"table-table-lineage"
});
...
...
@@ -112,7 +113,7 @@ public class ExportSkipLineageTest extends ExportImportTestBase {
return
request
;
}
catch
(
IOException
e
)
{
throw
new
SkipException
(
String
.
format
(
"getRequest: '%s' could not be l
ao
ded."
,
filename
));
throw
new
SkipException
(
String
.
format
(
"getRequest: '%s' could not be l
oa
ded."
,
filename
));
}
}
}
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/impexp/ImportServiceTest.java
View file @
8cd74965
...
...
@@ -458,10 +458,6 @@ public class ImportServiceTest extends ExportImportTestBase {
assertEquals
(
importTransforms
.
getTransforms
().
get
(
"hive_table"
).
get
(
"qualifiedName"
).
size
(),
2
);
}
@Test
(
dataProvider
=
"empty-zip"
,
expectedExceptions
=
AtlasBaseException
.
class
)
public
void
importEmptyZip
(
ZipSource
zipSource
)
{
}
@Test
(
expectedExceptions
=
AtlasBaseException
.
class
)
public
void
importEmptyZip
()
throws
IOException
,
AtlasBaseException
{
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/impexp/IncrementalExportEntityProviderTest.java
View file @
8cd74965
...
...
@@ -19,6 +19,7 @@
package
org
.
apache
.
atlas
.
repository
.
impexp
;
import
org.apache.atlas.RequestContext
;
import
org.apache.atlas.TestModules
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.repository.graphdb.AtlasGraph
;
...
...
@@ -58,6 +59,7 @@ public class IncrementalExportEntityProviderTest extends ExportImportTestBase {
@BeforeClass
public
void
setup
()
throws
IOException
,
AtlasBaseException
{
basicSetup
(
typeDefStore
,
typeRegistry
);
RequestContext
.
get
().
setImportInProgress
(
true
);
createEntities
(
entityStore
,
ENTITIES_SUB_DIR
,
new
String
[]
{
"db"
,
"table-columns"
});
final
String
[]
entityGuids
=
{
DB_GUID
,
TABLE_GUID
};
verifyCreatedEntities
(
entityStore
,
entityGuids
,
2
);
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/impexp/ReplicationEntityAttributeTest.java
View file @
8cd74965
...
...
@@ -193,7 +193,7 @@ public class ReplicationEntityAttributeTest extends ExportImportTestBase {
REPLICATED_TO_CLUSTER_NAME
=
(
String
)
request
.
getOptions
().
get
(
OPTION_KEY_REPLICATED_TO
);
return
request
;
}
catch
(
IOException
e
)
{
throw
new
SkipException
(
String
.
format
(
"getExportRequestWithReplicationOption: '%s' could not be l
ao
ded."
,
EXPORT_REQUEST_FILE
));
throw
new
SkipException
(
String
.
format
(
"getExportRequestWithReplicationOption: '%s' could not be l
oa
ded."
,
EXPORT_REQUEST_FILE
));
}
}
...
...
@@ -203,7 +203,7 @@ public class ReplicationEntityAttributeTest extends ExportImportTestBase {
REPLICATED_FROM_CLUSTER_NAME
=
request
.
getOptions
().
get
(
AtlasImportRequest
.
OPTION_KEY_REPLICATED_FROM
);
return
request
;
}
catch
(
IOException
e
)
{
throw
new
SkipException
(
String
.
format
(
"getExportRequestWithReplicationOption: '%s' could not be l
ao
ded."
,
IMPORT_REQUEST_FILE
));
throw
new
SkipException
(
String
.
format
(
"getExportRequestWithReplicationOption: '%s' could not be l
oa
ded."
,
IMPORT_REQUEST_FILE
));
}
}
}
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/impexp/ZipFileResourceTestUtils.java
View file @
8cd74965
...
...
@@ -192,7 +192,7 @@ public class ZipFileResourceTestUtils {
try
{
return
TestResourceFileUtils
.
readObjectFromJson
(
entitiesSubDir
,
fileName
,
AtlasTypesDef
.
class
);
}
catch
(
IOException
e
)
{
throw
new
SkipException
(
String
.
format
(
"createTypes: '%s' could not be l
ao
ded."
,
fileName
));
throw
new
SkipException
(
String
.
format
(
"createTypes: '%s' could not be l
oa
ded."
,
fileName
));
}
}
...
...
@@ -201,7 +201,7 @@ public class ZipFileResourceTestUtils {
try
{
return
TestResourceFileUtils
.
readObjectFromJson
(
entitiesSubDir
,
fileName
,
AtlasEntity
.
AtlasEntityWithExtInfo
.
class
);
}
catch
(
IOException
e
)
{
throw
new
SkipException
(
String
.
format
(
"createTypes: '%s' could not be l
ao
ded."
,
fileName
));
throw
new
SkipException
(
String
.
format
(
"createTypes: '%s' could not be l
oa
ded."
,
fileName
));
}
}
...
...
@@ -220,7 +220,7 @@ public class ZipFileResourceTestUtils {
assertTrue
((
response
.
getCreatedEntities
()
!=
null
&&
response
.
getCreatedEntities
().
size
()
>
0
)
||
(
response
.
getMutatedEntities
()
!=
null
&&
response
.
getMutatedEntities
().
size
()
>
0
));
}
catch
(
AtlasBaseException
e
)
{
throw
new
SkipException
(
String
.
format
(
"createAtlasEntity: could not load '%s'."
,
atlasEntity
.
getEntity
().
getTypeName
()));
throw
new
SkipException
(
String
.
format
(
"createAtlasEntity: could not load
ed
'%s'."
,
atlasEntity
.
getEntity
().
getTypeName
()));
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment