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
57a10073
Commit
57a10073
authored
Feb 03, 2015
by
Harish Butani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore result structType name differences when checking GremlinQueryResults
parent
9853d9d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
GremlinTest.scala
.../scala/org/apache/hadoop/metadata/query/GremlinTest.scala
+5
-4
No files found.
typesystem/src/test/scala/org/apache/hadoop/metadata/query/GremlinTest.scala
View file @
57a10073
package
org.apache.hadoop.metadata.query
import
com.thinkaurelius.titan.core.TitanGraph
import
org.apache.hadoop.metadata.json._
import
org.apache.hadoop.metadata.query.Expressions._
import
org.apache.hadoop.metadata.types.TypeSystem
import
org.json4s.NoTypeHints
import
org.junit.runner.RunWith
import
org.scalatest._
import
org.scalatest.junit.JUnitRunner
import
org.json4s.native.Serialization.writePretty
@RunWith
(
classOf
[
JUnitRunner
])
class
GremlinTest
extends
FunSuite
with
BeforeAndAfterAll
{
...
...
@@ -25,10 +22,14 @@ class GremlinTest extends FunSuite with BeforeAndAfterAll {
g
.
shutdown
()
}
val
STRUCT_NAME_REGEX
=
(
TypeUtils
.
TEMP_STRUCT_NAME_PREFIX
+
"\\d+"
).
r
def
validateJson
(
r
:
GremlinQueryResult
,
expected
:
String
=
null
)
:
Unit
=
{
val
rJ
=
r
.
toJson
if
(
expected
!=
null
)
{
Assertions
.
assert
(
rJ
==
expected
)
val
a
=
STRUCT_NAME_REGEX
.
replaceAllIn
(
rJ
,
""
)
val
b
=
STRUCT_NAME_REGEX
.
replaceAllIn
(
expected
,
""
)
Assertions
.
assert
(
a
==
b
)
}
else
{
println
(
rJ
)
}
...
...
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