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
709db096
Commit
709db096
authored
5 years ago
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3067: fixed failure in EntityJerseyResourceIT.testUTF8()
parent
bd31c505
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
EntityJerseyResourceIT.java
.../apache/atlas/web/integration/EntityJerseyResourceIT.java
+14
-2
EntityV2JerseyResourceIT.java
...pache/atlas/web/integration/EntityV2JerseyResourceIT.java
+15
-3
No files found.
webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
View file @
709db096
...
...
@@ -46,6 +46,8 @@ import org.testng.annotations.Test;
import
javax.ws.rs.core.MultivaluedMap
;
import
javax.ws.rs.core.Response
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
import
static
com
.
sun
.
jersey
.
api
.
client
.
ClientResponse
.
Status
.
BAD_REQUEST
;
...
...
@@ -818,11 +820,21 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
return
RandomStringUtils
.
random
(
10
);
}
private
String
randomUTF8
()
throws
Exception
{
String
ret
=
random
();
if
(!
StandardCharsets
.
UTF_8
.
equals
(
Charset
.
defaultCharset
()))
{
ret
=
new
String
(
ret
.
getBytes
(),
StandardCharsets
.
UTF_8
.
name
());
}
return
ret
;
}
@Test
public
void
testUTF8
()
throws
Exception
{
String
attrName
=
randomUTF8
();
String
attrValue
=
randomUTF8
();
String
classType
=
randomString
();
//Type names cannot be arbitrary UTF8 characters. See org.apache.atlas.type.AtlasTypeUtil#validateType()
String
attrName
=
random
();
String
attrValue
=
random
();
ClassTypeDefinition
classTypeDefinition
=
TypesUtil
.
createClassTypeDef
(
classType
,
null
,
Collections
.<
String
>
emptySet
(),
TypesUtil
.
createUniqueRequiredAttrDef
(
attrName
,
AtlasBaseTypeDef
.
ATLAS_TYPE_STRING
));
TypesDef
typesDef
=
new
TypesDef
(
Collections
.<
EnumTypeDefinition
>
emptyList
(),
Collections
.<
StructTypeDefinition
>
emptyList
(),
Collections
.<
TraitTypeDefinition
>
emptyList
(),
Collections
.
singletonList
(
classTypeDefinition
));
...
...
This diff is collapsed.
Click to expand it.
webapp/src/test/java/org/apache/atlas/web/integration/EntityV2JerseyResourceIT.java
View file @
709db096
...
...
@@ -46,6 +46,8 @@ import org.testng.Assert;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
import
static
org
.
testng
.
Assert
.*;
...
...
@@ -615,11 +617,21 @@ public class EntityV2JerseyResourceIT extends BaseResourceIT {
return
RandomStringUtils
.
random
(
10
);
}
private
String
randomUTF8
()
throws
Exception
{
String
ret
=
random
();
if
(!
StandardCharsets
.
UTF_8
.
equals
(
Charset
.
defaultCharset
()))
{
ret
=
new
String
(
ret
.
getBytes
(),
StandardCharsets
.
UTF_8
.
name
());
}
return
ret
;
}
@Test
public
void
testUTF8
()
throws
Exception
{
String
classType
=
randomString
();
String
attrName
=
random
();
String
attrValue
=
random
();
String
attrName
=
random
UTF8
();
String
attrValue
=
random
UTF8
();
AtlasEntityDef
classTypeDef
=
AtlasTypeUtil
.
createClassTypeDef
(
classType
,
Collections
.<
String
>
emptySet
(),
...
...
@@ -772,7 +784,7 @@ public class EntityV2JerseyResourceIT extends BaseResourceIT {
@Test
public
void
testDeleteEntityByUniqAttribute
()
throws
Exception
{
// Create database entity
AtlasEntity
hiveDB
=
createHiveDB
(
DATABASE_NAME
+
random
());
AtlasEntity
hiveDB
=
createHiveDB
(
DATABASE_NAME
+
random
UTF8
());
// Delete the database entity
EntityMutationResponse
deleteResponse
=
atlasClientV2
.
deleteEntityByAttribute
(
DATABASE_TYPE_V2
,
toMap
(
NAME
,
(
String
)
hiveDB
.
getAttribute
(
NAME
)));
...
...
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