atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shweth...@apache.org
Subject [1/2] incubator-atlas git commit: ATLAS-3 Mixed Index creation fails with Date types (suma.shivaprasad via shwethags)
Date Mon, 22 Jun 2015 11:22:25 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 901aca9d8 -> 6b33bcf64


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/6b33bcf6/repository/src/test/scala/org/apache/atlas/query/LineageQueryTest.scala
----------------------------------------------------------------------
diff --git a/repository/src/test/scala/org/apache/atlas/query/LineageQueryTest.scala b/repository/src/test/scala/org/apache/atlas/query/LineageQueryTest.scala
index 58f3d98..0b4dd2b 100755
--- a/repository/src/test/scala/org/apache/atlas/query/LineageQueryTest.scala
+++ b/repository/src/test/scala/org/apache/atlas/query/LineageQueryTest.scala
@@ -26,7 +26,7 @@ import org.scalatest.junit.JUnitRunner
 import org.scalatest.{Assertions, BeforeAndAfterAll, FunSuite}
 
 @RunWith(classOf[JUnitRunner])
-class LineageQueryTest extends FunSuite with BeforeAndAfterAll {
+class LineageQueryTest extends FunSuite with BeforeAndAfterAll with BaseGremlinTest {
 
     var g: TitanGraph = null
 
@@ -40,140 +40,134 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll {
         g.shutdown()
     }
 
-    val STRUCT_NAME_REGEX = (TypeUtils.TEMP_STRUCT_NAME_PREFIX + "\\d+").r
     val PREFIX_SPACES_REGEX = ("\\n\\s*").r
 
-    def validateJson(r: GremlinQueryResult, expected: String = null): Unit = {
-        val rJ = r.toJson
-        if (expected != null) {
-            var a = STRUCT_NAME_REGEX.replaceAllIn(rJ, "")
-            a = PREFIX_SPACES_REGEX.replaceAllIn(a, "")
-            var b = STRUCT_NAME_REGEX.replaceAllIn(expected, "")
-            b = PREFIX_SPACES_REGEX.replaceAllIn(b, "")
-            Assertions.assert(a == b)
-        } else {
-            println(rJ)
-        }
-    }
-
     test("testInputTables") {
         val r = QueryProcessor.evaluate(_class("LoadProcess").field("inputTables"), g)
         val x = r.toJson
-        validateJson(r, """{
-  "query":"LoadProcess inputTables",
-  "dataType":{
-    "superTypes":[
-
-    ],
-    "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.ClassType",
-    "typeName":"Table",
-    "attributeDefinitions":[
-      {
-        "name":"name",
-        "dataTypeName":"string",
-        "multiplicity":{
-          "lower":0,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      },
-      {
-        "name":"db",
-        "dataTypeName":"DB",
-        "multiplicity":{
-          "lower":1,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      },
-      {
-        "name":"sd",
-        "dataTypeName":"StorageDesc",
-        "multiplicity":{
-          "lower":1,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      }
-    ]
-  },
-  "rows":[
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"2048",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"512",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"256",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact"
-    },
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"4864",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"3840",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"256",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"time_dim",
-      "$traits$":{
-        "Dimension":{
-          "$typeName$":"Dimension"
-        }
-      }
-    },
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"8960",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"7424",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_daily_mv"
-    }
-  ]
-}""")
+        validateJson(r,"""{
+                         |  "query":"LoadProcess inputTables",
+                         |  "dataType":{
+                         |    "superTypes":[
+                         |
+                         |    ],
+                         |    "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.ClassType",
+                         |    "typeName":"Table",
+                         |    "attributeDefinitions":[
+                         |      {
+                         |        "name":"name",
+                         |        "dataTypeName":"string",
+                         |        "multiplicity":{
+                         |          "lower":0,
+                         |          "upper":1,
+                         |          "isUnique":false
+                         |        },
+                         |        "isComposite":false,
+                         |        "isUnique":false,
+                         |        "isIndexable":true,
+                         |        "reverseAttributeName":null
+                         |      },
+                         |      {
+                         |        "name":"db",
+                         |        "dataTypeName":"DB",
+                         |        "multiplicity":{
+                         |          "lower":1,
+                         |          "upper":1,
+                         |          "isUnique":false
+                         |        },
+                         |        "isComposite":false,
+                         |        "isUnique":false,
+                         |        "isIndexable":true,
+                         |        "reverseAttributeName":null
+                         |      },
+                         |      {
+                         |        "name":"sd",
+                         |        "dataTypeName":"StorageDesc",
+                         |        "multiplicity":{
+                         |          "lower":1,
+                         |          "upper":1,
+                         |          "isUnique":false
+                         |        },
+                         |        "isComposite":false,
+                         |        "isUnique":false,
+                         |        "isIndexable":true,
+                         |        "reverseAttributeName":null
+                         |      },
+                         |      {
+                         |        "name":"created",
+                         |        "dataTypeName":"date",
+                         |        "multiplicity":{
+                         |          "lower":0,
+                         |          "upper":1,
+                         |          "isUnique":false
+                         |        },
+                         |        "isComposite":false,
+                         |        "isUnique":false,
+                         |        "isIndexable":true,
+                         |        "reverseAttributeName":null
+                         |      }
+                         |    ]
+                         |  },
+                         |  "rows":[
+                         |    {
+                         |      "$typeName$":"Table",
+                         |      "$id$":{
+                         |        "$typeName$":"Table",
+                         |        "version":0
+                         |      },
+                         |      "created":"2014-12-11T02:35:58.440Z",
+                         |      "sd":{
+                         |        "$typeName$":"StorageDesc",
+                         |        "version":0
+                         |      },
+                         |      "db":{
+                         |        "$typeName$":"DB",
+                         |        "version":0
+                         |      },
+                         |      "name":"sales_fact"
+                         |    },
+                         |    {
+                         |      "$typeName$":"Table",
+                         |      "$id$":{
+                         |        "$typeName$":"Table",
+                         |        "version":0
+                         |      },
+                         |      "created":"2014-12-11T02:35:58.440Z",
+                         |      "sd":{
+                         |        "$typeName$":"StorageDesc",
+                         |        "version":0
+                         |      },
+                         |      "db":{
+                         |        "$typeName$":"DB",
+                         |        "version":0
+                         |      },
+                         |      "name":"time_dim",
+                         |      "$traits$":{
+                         |        "Dimension":{
+                         |          "$typeName$":"Dimension"
+                         |        }
+                         |      }
+                         |    },
+                         |    {
+                         |      "$typeName$":"Table",
+                         |      "$id$":{
+                         |        "$typeName$":"Table",
+                         |        "version":0
+                         |      },
+                         |      "created":"2014-12-11T02:35:58.440Z",
+                         |      "sd":{
+                         |        "$typeName$":"StorageDesc",
+                         |        "version":0
+                         |      },
+                         |      "db":{
+                         |        "$typeName$":"DB",
+                         |        "version":0
+                         |      },
+                         |      "name":"sales_fact_daily_mv"
+                         |    }
+                         |  ]
+                         |}
+          """.stripMargin)
     }
 
     test("testLoadProcessOut") {
@@ -184,153 +178,157 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll {
     test("testLineageAll") {
         val r = QueryProcessor.evaluate(_class("Table").loop(id("LoadProcess").field("outputTable")),
g)
         validateJson(r, """{
-  "query":"Table as _loop0 loop (LoadProcess outputTable)",
-  "dataType":{
-    "superTypes":[
-
-    ],
-    "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.ClassType",
-    "typeName":"Table",
-    "attributeDefinitions":[
-      {
-        "name":"name",
-        "dataTypeName":"string",
-        "multiplicity":{
-          "lower":0,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      },
-      {
-        "name":"db",
-        "dataTypeName":"DB",
-        "multiplicity":{
-          "lower":1,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      },
-      {
-        "name":"sd",
-        "dataTypeName":"StorageDesc",
-        "multiplicity":{
-          "lower":1,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      }
-    ]
-  },
-  "rows":[
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"8960",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"7424",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_daily_mv"
-    },
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"12800",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"11264",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_monthly_mv"
-    },
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"8960",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"7424",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_daily_mv"
-    },
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"12800",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"11264",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_monthly_mv"
-    },
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"12800",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"11264",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_monthly_mv"
-    }
-  ]
-}""")
+                          |  "query":"Table as _loop0 loop (LoadProcess outputTable)",
+                          |  "dataType":{
+                          |    "superTypes":[
+                          |
+                          |    ],
+                          |    "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.ClassType",
+                          |    "typeName":"Table",
+                          |    "attributeDefinitions":[
+                          |      {
+                          |        "name":"name",
+                          |        "dataTypeName":"string",
+                          |        "multiplicity":{
+                          |          "lower":0,
+                          |          "upper":1,
+                          |          "isUnique":false
+                          |        },
+                          |        "isComposite":false,
+                          |        "isUnique":false,
+                          |        "isIndexable":true,
+                          |        "reverseAttributeName":null
+                          |      },
+                          |      {
+                          |        "name":"db",
+                          |        "dataTypeName":"DB",
+                          |        "multiplicity":{
+                          |          "lower":1,
+                          |          "upper":1,
+                          |          "isUnique":false
+                          |        },
+                          |        "isComposite":false,
+                          |        "isUnique":false,
+                          |        "isIndexable":true,
+                          |        "reverseAttributeName":null
+                          |      },
+                          |      {
+                          |        "name":"sd",
+                          |        "dataTypeName":"StorageDesc",
+                          |        "multiplicity":{
+                          |          "lower":1,
+                          |          "upper":1,
+                          |          "isUnique":false
+                          |        },
+                          |        "isComposite":false,
+                          |        "isUnique":false,
+                          |        "isIndexable":true,
+                          |        "reverseAttributeName":null
+                          |      },
+                          |      {
+                          |        "name":"created",
+                          |        "dataTypeName":"date",
+                          |        "multiplicity":{
+                          |          "lower":0,
+                          |          "upper":1,
+                          |          "isUnique":false
+                          |        },
+                          |        "isComposite":false,
+                          |        "isUnique":false,
+                          |        "isIndexable":true,
+                          |        "reverseAttributeName":null
+                          |      }
+                          |    ]
+                          |  },
+                          |  "rows":[
+                          |    {
+                          |      "$typeName$":"Table",
+                          |      "$id$":{
+                          |        "id":"9216",
+                          |        "$typeName$":"Table",
+                          |        "version":0
+                          |      },
+                          |      "created":"2014-12-11T02:35:58.440Z",
+                          |      "sd":{
+                          |        "$typeName$":"StorageDesc",
+                          |        "version":0
+                          |      },
+                          |      "db":{
+                          |        "$typeName$":"DB",
+                          |        "version":0
+                          |      },
+                          |      "name":"sales_fact_daily_mv"
+                          |    },
+                          |    {
+                          |      "$typeName$":"Table",
+                          |      "$id$":{
+                          |        "$typeName$":"Table",
+                          |        "version":0
+                          |      },
+                          |      "created":"2014-12-11T02:35:58.440Z",
+                          |      "sd":{
+                          |        "$typeName$":"StorageDesc",
+                          |        "version":0
+                          |      },
+                          |      "db":{
+                          |        "$typeName$":"DB",
+                          |        "version":0
+                          |      },
+                          |      "name":"sales_fact_monthly_mv"
+                          |    },
+                          |    {
+                          |      "$typeName$":"Table",
+                          |      "$id$":{
+                          |        "$typeName$":"Table",
+                          |        "version":0
+                          |      },
+                          |      "created":"2014-12-11T02:35:58.440Z",
+                          |      "sd":{
+                          |        "$typeName$":"StorageDesc",
+                          |        "version":0
+                          |      },
+                          |      "db":{
+                          |        "$typeName$":"DB",
+                          |        "version":0
+                          |      },
+                          |      "name":"sales_fact_daily_mv"
+                          |    },
+                          |    {
+                          |      "$typeName$":"Table",
+                          |      "$id$":{
+                          |        "$typeName$":"Table",
+                          |        "version":0
+                          |      },
+                          |      "created":"2014-12-11T02:35:58.440Z",
+                          |      "sd":{
+                          |        "$typeName$":"StorageDesc",
+                          |        "version":0
+                          |      },
+                          |      "db":{
+                          |        "$typeName$":"DB",
+                          |        "version":0
+                          |      },
+                          |      "name":"sales_fact_monthly_mv"
+                          |    },
+                          |    {
+                          |      "$typeName$":"Table",
+                          |      "$id$":{
+                          |        "$typeName$":"Table",
+                          |        "version":0
+                          |      },
+                          |      "created":"2014-12-11T02:35:58.440Z",
+                          |      "sd":{
+                          |        "$typeName$":"StorageDesc",
+                          |        "version":0
+                          |      },
+                          |      "db":{
+                          |        "$typeName$":"DB",
+                          |        "version":0
+                          |      },
+                          |      "name":"sales_fact_monthly_mv"
+                          |    }
+                          |  ]
+                          |}""".stripMargin)
     }
 
     test("testLineageAllSelect") {
@@ -396,120 +394,127 @@ class LineageQueryTest extends FunSuite with BeforeAndAfterAll {
       "destTable":"sales_fact_monthly_mv"
     }
   ]
-}""")
+}""".stripMargin)
     }
 
     test("testLineageFixedDepth") {
         val r = QueryProcessor.evaluate(_class("Table").loop(id("LoadProcess").field("outputTable"),
int(1)), g)
         validateJson(r, """{
-  "query":"Table as _loop0 loop (LoadProcess outputTable) times 1",
-  "dataType":{
-    "superTypes":[
-
-    ],
-    "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.ClassType",
-    "typeName":"Table",
-    "attributeDefinitions":[
-      {
-        "name":"name",
-        "dataTypeName":"string",
-        "multiplicity":{
-          "lower":0,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      },
-      {
-        "name":"db",
-        "dataTypeName":"DB",
-        "multiplicity":{
-          "lower":1,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      },
-      {
-        "name":"sd",
-        "dataTypeName":"StorageDesc",
-        "multiplicity":{
-          "lower":1,
-          "upper":1,
-          "isUnique":false
-        },
-        "isComposite":false,
-        "isUnique":false,
-        "isIndexable":true,
-        "reverseAttributeName":null
-      }
-    ]
-  },
-  "rows":[
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"8960",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"7424",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_daily_mv"
-    },
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"8960",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"7424",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_daily_mv"
-    },
-    {
-      "$typeName$":"Table",
-      "$id$":{
-        "id":"12800",
-        "$typeName$":"Table",
-        "version":0
-      },
-      "sd":{
-        "id":"11264",
-        "$typeName$":"StorageDesc",
-        "version":0
-      },
-      "db":{
-        "id":"7168",
-        "$typeName$":"DB",
-        "version":0
-      },
-      "name":"sales_fact_monthly_mv"
-    }
-  ]
-}""")
+                          |  "query":"Table as _loop0 loop (LoadProcess outputTable) times
1",
+                          |  "dataType":{
+                          |    "superTypes":[
+                          |
+                          |    ],
+                          |    "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.ClassType",
+                          |    "typeName":"Table",
+                          |    "attributeDefinitions":[
+                          |      {
+                          |        "name":"name",
+                          |        "dataTypeName":"string",
+                          |        "multiplicity":{
+                          |          "lower":0,
+                          |          "upper":1,
+                          |          "isUnique":false
+                          |        },
+                          |        "isComposite":false,
+                          |        "isUnique":false,
+                          |        "isIndexable":true,
+                          |        "reverseAttributeName":null
+                          |      },
+                          |      {
+                          |        "name":"db",
+                          |        "dataTypeName":"DB",
+                          |        "multiplicity":{
+                          |          "lower":1,
+                          |          "upper":1,
+                          |          "isUnique":false
+                          |        },
+                          |        "isComposite":false,
+                          |        "isUnique":false,
+                          |        "isIndexable":true,
+                          |        "reverseAttributeName":null
+                          |      },
+                          |      {
+                          |        "name":"sd",
+                          |        "dataTypeName":"StorageDesc",
+                          |        "multiplicity":{
+                          |          "lower":1,
+                          |          "upper":1,
+                          |          "isUnique":false
+                          |        },
+                          |        "isComposite":false,
+                          |        "isUnique":false,
+                          |        "isIndexable":true,
+                          |        "reverseAttributeName":null
+                          |      },
+                          |      {
+                          |        "name":"created",
+                          |        "dataTypeName":"date",
+                          |        "multiplicity":{
+                          |          "lower":0,
+                          |          "upper":1,
+                          |          "isUnique":false
+                          |        },
+                          |        "isComposite":false,
+                          |        "isUnique":false,
+                          |        "isIndexable":true,
+                          |        "reverseAttributeName":null
+                          |      }
+                          |    ]
+                          |  },
+                          |  "rows":[
+                          |    {
+                          |      "$typeName$":"Table",
+                          |      "$id$":{
+                          |        "$typeName$":"Table",
+                          |        "version":0
+                          |      },
+                          |      "created":"2014-12-11T02:35:58.440Z",
+                          |      "sd":{
+                          |        "$typeName$":"StorageDesc",
+                          |        "version":0
+                          |      },
+                          |      "db":{
+                          |        "$typeName$":"DB",
+                          |        "version":0
+                          |      },
+                          |      "name":"sales_fact_daily_mv"
+                          |    },
+                          |    {
+                          |      "$typeName$":"Table",
+                          |      "$id$":{
+                          |        "$typeName$":"Table",
+                          |        "version":0
+                          |      },
+                          |      "created":"2014-12-11T02:35:58.440Z",
+                          |      "sd":{
+                          |        "$typeName$":"StorageDesc",
+                          |        "version":0
+                          |      },
+                          |      "db":{
+                          |        "$typeName$":"DB",
+                          |        "version":0
+                          |      },
+                          |      "name":"sales_fact_daily_mv"
+                          |    },
+                          |    {
+                          |      "$typeName$":"Table",
+                          |      "$id$":{
+                          |        "$typeName$":"Table",
+                          |        "version":0
+                          |      },
+                          |      "created":"2014-12-11T02:35:58.440Z",
+                          |      "sd":{
+                          |        "$typeName$":"StorageDesc",
+                          |        "version":0
+                          |      },
+                          |      "db":{
+                          |        "$typeName$":"DB",
+                          |        "version":0
+                          |      },
+                          |      "name":"sales_fact_monthly_mv"
+                          |    }
+                          |  ]
+                          |}""".stripMargin)
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/6b33bcf6/repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala
----------------------------------------------------------------------
diff --git a/repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala b/repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala
index d79758a..ec21886 100755
--- a/repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala
+++ b/repository/src/test/scala/org/apache/atlas/query/QueryTestsUtils.scala
@@ -28,7 +28,10 @@ import com.typesafe.config.{Config, ConfigFactory}
 import org.apache.atlas.typesystem.types._
 import org.apache.commons.configuration.{Configuration, ConfigurationException, MapConfiguration}
 import org.apache.commons.io.FileUtils
+import org.json.JSONObject
 import org.scalatest.{Assertions, BeforeAndAfterAll, FunSuite}
+import org.skyscreamer.jsonassert.JSONAssert
+
 
 trait GraphUtils {
 
@@ -96,7 +99,8 @@ object QueryTestsUtils extends GraphUtils {
             Array(
                 attrDef("name", DataTypes.STRING_TYPE),
                 new AttributeDefinition("db", "DB", Multiplicity.REQUIRED, false, null),
-                new AttributeDefinition("sd", "StorageDesc", Multiplicity.REQUIRED, false,
null)
+                new AttributeDefinition("sd", "StorageDesc", Multiplicity.REQUIRED, false,
null),
+                attrDef("created", DataTypes.DATE_TYPE)
             ))
 
         def loadProcessClsDef = new HierarchicalTypeDefinition[ClassType](classOf[ClassType],
"LoadProcess", null,
@@ -160,7 +164,9 @@ trait BaseGremlinTest {
     if (expected != null) {
       val a = STRUCT_NAME_REGEX.replaceAllIn(rJ, "")
       val b = STRUCT_NAME_REGEX.replaceAllIn(expected, "")
-      Assertions.assert(a == b)
+      val actualjsonObj = new JSONObject(a)
+      val expectedjsonObj = new JSONObject(b)
+      JSONAssert.assertEquals(expectedjsonObj, actualjsonObj, false)
     } else {
       println(rJ)
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/6b33bcf6/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
index 0d0c783..d1e8dbd 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
@@ -48,7 +48,7 @@ public class TypeSystem {
     private static ThreadLocal<SimpleDateFormat> dateFormat = new ThreadLocal() {
         @Override
         public SimpleDateFormat initialValue() {
-            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
             dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
             return dateFormat;
         }


Mime
View raw message