Repository: vxquery
Updated Branches:
  refs/heads/master dae8391e4 -> 1f831267a


More tests for SimpleObjectUnionConstructor


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/1f831267
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/1f831267
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/1f831267

Branch: refs/heads/master
Commit: 1f831267afa4d7f84b4c4f8bbbbd18dcd52248aa
Parents: dae8391
Author: riyafa <[email protected]>
Authored: Tue Jul 26 20:46:58 2016 +0530
Committer: riyafa <[email protected]>
Committed: Tue Jul 26 20:46:58 2016 +0530

----------------------------------------------------------------------
 .../SimpleObjectUnionScalarEvaluator.java       |  2 +-
 .../Queries/XQuery/Json/Object/q17_object.xq    | 20 ++++++++++++++++++++
 .../test/resources/cat/JsonObjectQueries.xml    |  5 +++++
 3 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/1f831267/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/jsonitem/SimpleObjectUnionScalarEvaluator.java
----------------------------------------------------------------------
diff --git 
a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/jsonitem/SimpleObjectUnionScalarEvaluator.java
 
b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/jsonitem/SimpleObjectUnionScalarEvaluator.java
index 960cea4..4eaf8f7 100644
--- 
a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/jsonitem/SimpleObjectUnionScalarEvaluator.java
+++ 
b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/jsonitem/SimpleObjectUnionScalarEvaluator.java
@@ -64,7 +64,7 @@ public class SimpleObjectUnionScalarEvaluator extends 
AbstractObjectConstructorS
                     op.getKeys(tempTvp);
                     addPairs(tempTvp, tempValue);
                 }
-            } else {
+            } else if (arg.getTag() == ValueTag.OBJECT_TAG) {
                 op = (ObjectPointable) 
ObjectPointable.FACTORY.createPointable();
                 arg.getValue(op);
                 addPairs(tempTvp, tempValue);

http://git-wip-us.apache.org/repos/asf/vxquery/blob/1f831267/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Object/q17_object.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Object/q17_object.xq 
b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Object/q17_object.xq
new file mode 100644
index 0000000..77dcc2c
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Json/Object/q17_object.xq
@@ -0,0 +1,20 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+   
+     http://www.apache.org/licenses/LICENSE-2.0
+   
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License. :)
+
+(: Json Object Query :)
+(: Issue VXQUERY-212 :)
+{| { "Captain" : "Kirk" , 123456 : "NUM"} , { "Captain" : "Soft"} |}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/1f831267/vxquery-xtest/src/test/resources/cat/JsonObjectQueries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/JsonObjectQueries.xml 
b/vxquery-xtest/src/test/resources/cat/JsonObjectQueries.xml
index 1968853..fcb01e7 100644
--- a/vxquery-xtest/src/test/resources/cat/JsonObjectQueries.xml
+++ b/vxquery-xtest/src/test/resources/cat/JsonObjectQueries.xml
@@ -100,4 +100,9 @@
         <query name="q16_object" date="2016-07-16"/>
         <output-file compare="Text">q16_object.txt</output-file>
     </test-case>
+    <test-case name="json-object-q17" FilePath="Json/Object/" Creator="Riyafa 
Abdul Hameed">
+        <description>Object.</description>
+        <query name="q17_object" date="2016-07-26"/>
+        <expected-error>JNDY0003</expected-error>
+    </test-case>
 </test-group>
\ No newline at end of file

Reply via email to