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
29524aa0
Commit
29524aa0
authored
Apr 18, 2017
by
ashutoshm
Committed by
apoorvnaik
Apr 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1735: Coverity Scan Fixes for 4/13
Signed-off-by:
apoorvnaik
<
anaik@hortonworks.com
>
parent
be93da8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
AuthenticationUtil.java
.../main/java/org/apache/atlas/utils/AuthenticationUtil.java
+6
-1
ExportServiceTest.java
...org/apache/atlas/repository/impexp/ExportServiceTest.java
+6
-0
ZipSourceTest.java
...ava/org/apache/atlas/repository/impexp/ZipSourceTest.java
+3
-0
No files found.
common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java
View file @
29524aa0
...
@@ -54,7 +54,12 @@ public final class AuthenticationUtil {
...
@@ -54,7 +54,12 @@ public final class AuthenticationUtil {
try
{
try
{
Console
console
=
System
.
console
();
Console
console
=
System
.
console
();
username
=
console
.
readLine
(
"Enter username for atlas :- "
);
username
=
console
.
readLine
(
"Enter username for atlas :- "
);
password
=
new
String
(
console
.
readPassword
(
"Enter password for atlas :- "
));
char
[]
pwdChar
=
console
.
readPassword
(
"Enter password for atlas :- "
);
if
(
pwdChar
!=
null
)
{
password
=
new
String
(
pwdChar
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
print
(
"Error while reading "
);
System
.
out
.
print
(
"Error while reading "
);
System
.
exit
(
1
);
System
.
exit
(
1
);
...
...
repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java
View file @
29524aa0
...
@@ -253,6 +253,8 @@ public class ExportServiceTest {
...
@@ -253,6 +253,8 @@ public class ExportServiceTest {
while
(
zipSource
.
hasNext
())
{
while
(
zipSource
.
hasNext
())
{
AtlasEntity
entity
=
zipSource
.
next
();
AtlasEntity
entity
=
zipSource
.
next
();
Assert
.
assertNotNull
(
entity
);
Assert
.
assertEquals
(
entity
.
getStatus
(),
AtlasEntity
.
Status
.
ACTIVE
);
Assert
.
assertEquals
(
entity
.
getStatus
(),
AtlasEntity
.
Status
.
ACTIVE
);
Assert
.
assertTrue
(
expectedEntityTypes
.
contains
(
entity
.
getTypeName
()));
Assert
.
assertTrue
(
expectedEntityTypes
.
contains
(
entity
.
getTypeName
()));
}
}
...
@@ -266,6 +268,8 @@ public class ExportServiceTest {
...
@@ -266,6 +268,8 @@ public class ExportServiceTest {
Assert
.
assertTrue
(
zipSource
.
hasNext
());
Assert
.
assertTrue
(
zipSource
.
hasNext
());
AtlasEntity
entity
=
zipSource
.
next
();
AtlasEntity
entity
=
zipSource
.
next
();
Assert
.
assertNotNull
(
entity
);
Assert
.
assertTrue
(
entity
.
getTypeName
().
equals
(
"Department"
));
Assert
.
assertTrue
(
entity
.
getTypeName
().
equals
(
"Department"
));
Assert
.
assertEquals
(
entity
.
getStatus
(),
AtlasEntity
.
Status
.
ACTIVE
);
Assert
.
assertEquals
(
entity
.
getStatus
(),
AtlasEntity
.
Status
.
ACTIVE
);
verifyTypeDefs
(
zipSource
);
verifyTypeDefs
(
zipSource
);
...
@@ -277,6 +281,8 @@ public class ExportServiceTest {
...
@@ -277,6 +281,8 @@ public class ExportServiceTest {
Assert
.
assertTrue
(
zipSource
.
hasNext
());
Assert
.
assertTrue
(
zipSource
.
hasNext
());
AtlasEntity
entity
=
zipSource
.
next
();
AtlasEntity
entity
=
zipSource
.
next
();
Assert
.
assertNotNull
(
entity
);
Assert
.
assertTrue
(
entity
.
getTypeName
().
equals
(
"Department"
));
Assert
.
assertTrue
(
entity
.
getTypeName
().
equals
(
"Department"
));
Assert
.
assertEquals
(
entity
.
getStatus
(),
AtlasEntity
.
Status
.
ACTIVE
);
Assert
.
assertEquals
(
entity
.
getStatus
(),
AtlasEntity
.
Status
.
ACTIVE
);
verifyTypeDefs
(
zipSource
);
verifyTypeDefs
(
zipSource
);
...
...
repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java
View file @
29524aa0
...
@@ -49,6 +49,7 @@ public class ZipSourceTest {
...
@@ -49,6 +49,7 @@ public class ZipSourceTest {
@Test
(
dataProvider
=
"zipFileStocks"
)
@Test
(
dataProvider
=
"zipFileStocks"
)
public
void
examineContents_BehavesAsExpected
(
ZipSource
zipSource
)
throws
IOException
,
AtlasBaseException
{
public
void
examineContents_BehavesAsExpected
(
ZipSource
zipSource
)
throws
IOException
,
AtlasBaseException
{
List
<
String
>
creationOrder
=
zipSource
.
getCreationOrder
();
List
<
String
>
creationOrder
=
zipSource
.
getCreationOrder
();
Assert
.
assertNotNull
(
creationOrder
);
Assert
.
assertNotNull
(
creationOrder
);
Assert
.
assertEquals
(
creationOrder
.
size
(),
4
);
Assert
.
assertEquals
(
creationOrder
.
size
(),
4
);
...
@@ -98,6 +99,8 @@ public class ZipSourceTest {
...
@@ -98,6 +99,8 @@ public class ZipSourceTest {
List
<
String
>
creationOrder
=
zipSource
.
getCreationOrder
();
List
<
String
>
creationOrder
=
zipSource
.
getCreationOrder
();
for
(
int
i
=
0
;
i
<
creationOrder
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
creationOrder
.
size
();
i
++)
{
AtlasEntity
e
=
zipSource
.
next
();
AtlasEntity
e
=
zipSource
.
next
();
Assert
.
assertNotNull
(
e
);
Assert
.
assertEquals
(
e
.
getGuid
(),
creationOrder
.
get
(
i
));
Assert
.
assertEquals
(
e
.
getGuid
(),
creationOrder
.
get
(
i
));
}
}
...
...
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