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
1b5d4260
Commit
1b5d4260
authored
May 27, 2015
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added integration test for utf8 names
parent
aa27c1bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
6 deletions
+36
-6
Main.java
webapp/src/main/java/org/apache/hadoop/metadata/Main.java
+4
-0
EntityJerseyResourceIT.java
...hadoop/metadata/web/resources/EntityJerseyResourceIT.java
+32
-6
No files found.
webapp/src/main/java/org/apache/hadoop/metadata/Main.java
View file @
1b5d4260
...
@@ -39,6 +39,7 @@ public final class Main {
...
@@ -39,6 +39,7 @@ public final class Main {
private
static
final
String
APP_PATH
=
"app"
;
private
static
final
String
APP_PATH
=
"app"
;
private
static
final
String
APP_PORT
=
"port"
;
private
static
final
String
APP_PORT
=
"port"
;
private
static
final
String
METADATA_HOME
=
"metadata.home"
;
private
static
final
String
METADATA_HOME
=
"metadata.home"
;
private
static
final
String
METADATA_LOG_DIR
=
"metadata.log.dir"
;
/**
/**
* Prevent users from constructing this.
* Prevent users from constructing this.
...
@@ -87,6 +88,9 @@ public final class Main {
...
@@ -87,6 +88,9 @@ public final class Main {
if
(
System
.
getProperty
(
METADATA_HOME
)
==
null
)
{
if
(
System
.
getProperty
(
METADATA_HOME
)
==
null
)
{
System
.
setProperty
(
METADATA_HOME
,
"target"
);
System
.
setProperty
(
METADATA_HOME
,
"target"
);
}
}
if
(
System
.
getProperty
(
METADATA_LOG_DIR
)
==
null
)
{
System
.
setProperty
(
METADATA_LOG_DIR
,
"target/logs"
);
}
}
}
public
static
String
getProjectVersion
(
PropertiesConfiguration
buildConfiguration
)
{
public
static
String
getProjectVersion
(
PropertiesConfiguration
buildConfiguration
)
{
...
...
webapp/src/test/java/org/apache/hadoop/metadata/web/resources/EntityJerseyResourceIT.java
View file @
1b5d4260
...
@@ -21,6 +21,7 @@ package org.apache.hadoop.metadata.web.resources;
...
@@ -21,6 +21,7 @@ package org.apache.hadoop.metadata.web.resources;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.ImmutableList
;
import
com.sun.jersey.api.client.ClientResponse
;
import
com.sun.jersey.api.client.ClientResponse
;
import
com.sun.jersey.api.client.WebResource
;
import
com.sun.jersey.api.client.WebResource
;
import
org.apache.commons.lang.RandomStringUtils
;
import
org.apache.hadoop.metadata.MetadataServiceClient
;
import
org.apache.hadoop.metadata.MetadataServiceClient
;
import
org.apache.hadoop.metadata.typesystem.Referenceable
;
import
org.apache.hadoop.metadata.typesystem.Referenceable
;
import
org.apache.hadoop.metadata.typesystem.Struct
;
import
org.apache.hadoop.metadata.typesystem.Struct
;
...
@@ -231,8 +232,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
...
@@ -231,8 +232,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
method
(
HttpMethod
.
GET
,
ClientResponse
.
class
);
.
method
(
HttpMethod
.
GET
,
ClientResponse
.
class
);
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Response
.
Status
.
BAD_REQUEST
.
getStatusCode
());
Response
.
Status
.
BAD_REQUEST
.
getStatusCode
());
String
responseAsString
=
clientResponse
.
getEntity
(
String
.
class
);
String
responseAsString
=
clientResponse
.
getEntity
(
String
.
class
);
Assert
.
assertNotNull
(
responseAsString
);
Assert
.
assertNotNull
(
responseAsString
);
...
@@ -349,8 +349,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
...
@@ -349,8 +349,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
method
(
HttpMethod
.
POST
,
ClientResponse
.
class
,
traitInstanceAsJSON
);
.
method
(
HttpMethod
.
POST
,
ClientResponse
.
class
,
traitInstanceAsJSON
);
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Response
.
Status
.
BAD_REQUEST
.
getStatusCode
());
Response
.
Status
.
BAD_REQUEST
.
getStatusCode
());
}
}
@Test
(
dependsOnMethods
=
"testAddTrait"
)
@Test
(
dependsOnMethods
=
"testAddTrait"
)
...
@@ -389,8 +388,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
...
@@ -389,8 +388,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
method
(
HttpMethod
.
DELETE
,
ClientResponse
.
class
);
.
method
(
HttpMethod
.
DELETE
,
ClientResponse
.
class
);
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Assert
.
assertEquals
(
clientResponse
.
getStatus
(),
Response
.
Status
.
BAD_REQUEST
.
getStatusCode
());
Response
.
Status
.
BAD_REQUEST
.
getStatusCode
());
String
responseAsString
=
clientResponse
.
getEntity
(
String
.
class
);
String
responseAsString
=
clientResponse
.
getEntity
(
String
.
class
);
Assert
.
assertNotNull
(
responseAsString
);
Assert
.
assertNotNull
(
responseAsString
);
...
@@ -400,6 +398,34 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
...
@@ -400,6 +398,34 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
Assert
.
assertNotNull
(
response
.
get
(
MetadataServiceClient
.
STACKTRACE
));
Assert
.
assertNotNull
(
response
.
get
(
MetadataServiceClient
.
STACKTRACE
));
}
}
private
String
random
()
{
return
RandomStringUtils
.
random
(
10
);
}
@Test
public
void
testUTF8
()
throws
Exception
{
String
classType
=
random
();
String
attrName
=
random
();
String
attrValue
=
random
();
HierarchicalTypeDefinition
<
ClassType
>
classTypeDefinition
=
TypesUtil
.
createClassTypeDef
(
classType
,
ImmutableList
.<
String
>
of
(),
TypesUtil
.
createUniqueRequiredAttrDef
(
attrName
,
DataTypes
.
STRING_TYPE
));
TypesDef
typesDef
=
TypeUtils
.
getTypesDef
(
ImmutableList
.<
EnumTypeDefinition
>
of
(),
ImmutableList
.<
StructTypeDefinition
>
of
(),
ImmutableList
.<
HierarchicalTypeDefinition
<
TraitType
>>
of
(),
ImmutableList
.
of
(
classTypeDefinition
));
createType
(
typesDef
);
Referenceable
instance
=
new
Referenceable
(
classType
);
instance
.
set
(
attrName
,
attrValue
);
Id
guid
=
createInstance
(
instance
);
ClientResponse
response
=
getEntityDefinition
(
guid
.
_getId
());
String
definition
=
getEntityDefinition
(
response
);
Referenceable
getReferenceable
=
InstanceSerialization
.
fromJsonReferenceable
(
definition
,
true
);
Assert
.
assertEquals
(
getReferenceable
.
get
(
attrName
),
attrValue
);
}
private
void
createHiveTypes
()
throws
Exception
{
private
void
createHiveTypes
()
throws
Exception
{
HierarchicalTypeDefinition
<
ClassType
>
databaseTypeDefinition
=
HierarchicalTypeDefinition
<
ClassType
>
databaseTypeDefinition
=
TypesUtil
.
createClassTypeDef
(
DATABASE_TYPE
,
TypesUtil
.
createClassTypeDef
(
DATABASE_TYPE
,
...
...
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