jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [03/11] jena git commit: Implemented adjust-date-to-timezone
Date Fri, 10 Jun 2016 12:52:56 GMT


Implemented adjust-date-to-timezone

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/8de4216c
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/8de4216c
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/8de4216c

Branch: refs/heads/master
Commit: 8de4216c0cb96f098a84d765db6cf1bf3e2b3956
Parents: 807d50f
Author: ales004 <cicerone54@hotmail.com>
Authored: Sun May 29 23:04:25 2016 +0200
Committer: ales004 <cicerone54@hotmail.com>
Committed: Sun May 29 23:04:25 2016 +0200

----------------------------------------------------------------------
 .../jena/sparql/function/StandardFunctions.java  |  1 +
 .../apache/jena/sparql/expr/TestFunctions.java   | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/8de4216c/jena-arq/src/main/java/org/apache/jena/sparql/function/StandardFunctions.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/StandardFunctions.java
b/jena-arq/src/main/java/org/apache/jena/sparql/function/StandardFunctions.java
index e8b014d..adecc95 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/StandardFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/StandardFunctions.java
@@ -166,6 +166,7 @@ public class StandardFunctions
 //        9.6.1 fn:adjust-dateTime-to-timezone
         add(registry, xfn+"adjust-dateTime-to-timezone",  FN_AdjustDatetimeToTimezone.class)
;
 //        9.6.2 fn:adjust-date-to-timezone
+        add(registry, xfn+"adjust-date-to-timezone",  FN_AdjustDatetimeToTimezone.class)
;
 //        9.6.3 fn:adjust-time-to-timezone
 //        9.8.1 fn:format-dateTime
 //        9.8.2 fn:format-date

http://git-wip-us.apache.org/repos/asf/jena/blob/8de4216c/jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java b/jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java
index 3864711..f0f252e 100644
--- a/jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java
+++ b/jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java
@@ -377,6 +377,25 @@ public class TestFunctions
 
     @Test public void exprAdjustDatetimeToTz_08(){test("fn:adjust-dateTime-to-timezone('2002-03-07T10:00:00-07:00'^^xsd:dateTime,'')",NodeValue.makeDateTime("2002-03-07T10:00:00"));}
 
+    @Test public void exprAdjustDateToTz_01(){
+        testEqual(
+                "fn:adjust-date-to-timezone('2002-03-07'^^xsd:date)",
+                "fn:adjust-date-to-timezone('2002-03-07'^^xsd:date,'"+getDynamicDurationString()+"'^^xsd:dayTimeDuration)");
+    }
+
+    @Test public void exprAdjustDateToTz_02(){
+        testEqual(
+                "fn:adjust-date-to-timezone('2002-03-07-07:00'^^xsd:date)",
+                "fn:adjust-date-to-timezone('2002-03-07-07:00'^^xsd:date,'"+getDynamicDurationString()+"'^^xsd:dayTimeDuration)");
+    }
+
+    @Test public void exprAdjustDateToTz_03(){test("fn:adjust-date-to-timezone('2002-03-07'^^xsd:date,'-PT10H'^^xsd:dayTimeDuration)",NodeValue.makeDate("2002-03-07-10:00"));}
+
+    @Test public void exprAdjustDateToTz_04(){test("fn:adjust-date-to-timezone('2002-03-07-07:00'^^xsd:date,'-PT10H'^^xsd:dayTimeDuration)",NodeValue.makeDate("2002-03-06-10:00"));}
+
+    @Test public void exprAdjustDateToTz_05(){test("fn:adjust-date-to-timezone('2002-03-07'^^xsd:date,'')",NodeValue.makeDate("2002-03-07"));}
+
+    @Test public void exprAdjustDateToTz_06(){test("fn:adjust-date-to-timezone('2002-03-07-07:00'^^xsd:date,'')",NodeValue.makeDate("2002-03-07"));}
     //@Test public void exprStrJoin()      { test("fn:string-join('a', 'b')", NodeValue.makeString("ab"))
; }
     
     @Test public void exprSameTerm1()     { test("sameTerm(1,1)",           TRUE) ; }


Mime
View raw message