Repository: marmotta
Updated Branches:
  refs/heads/develop 8f32c8179 -> e17047295


trying to make the ldpath-functions-date tests more robust


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

Branch: refs/heads/develop
Commit: e17047295eb8ca3d49d4292ef891f0f0d05aa5f9
Parents: 23b6404
Author: Jakob Frank <[email protected]>
Authored: Fri Oct 31 13:02:55 2014 +0100
Committer: Jakob Frank <[email protected]>
Committed: Fri Oct 31 13:05:52 2014 +0100

----------------------------------------------------------------------
 .../marmotta/ldpath/model/functions/date/DateFunctionsTest.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/e1704729/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
----------------------------------------------------------------------
diff --git 
a/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
 
b/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
index ea8c9e8..e79d52c 100644
--- 
a/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
+++ 
b/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
@@ -47,7 +47,7 @@ public class DateFunctionsTest extends AbstractTestBase {
 
     @Before
     public void loadData() throws RepositoryException, RDFParseException, 
IOException {
-        final int delta = 60 * 60 * 24 * 365;
+        final int day = 60 * 60 * 24, delta = day * 365;
         now = new Date(1000*(System.currentTimeMillis() / 1000));
         first = new Date(now.getTime() - 1000l * delta);
 
@@ -64,7 +64,7 @@ public class DateFunctionsTest extends AbstractTestBase {
 
             final Random rnd = new Random();
             for (int i = 0; i < 20; i++) {
-                Date d = new Date(first.getTime() + rnd.nextInt(delta) * 
1000l);
+                Date d = new Date(first.getTime() + (day + 
rnd.nextInt(delta-2)) * 1000l);
                 con.add(vF.createStatement(uri, prop, 
vF.createLiteral(DateUtils.getXMLCalendar(d))));
             }
 

Reply via email to