Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 512CF200B12 for ; Sun, 12 Jun 2016 09:28:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4FDB7160A2C; Sun, 12 Jun 2016 07:28:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6EDE6160A06 for ; Sun, 12 Jun 2016 09:28:18 +0200 (CEST) Received: (qmail 40145 invoked by uid 500); 12 Jun 2016 07:28:17 -0000 Mailing-List: contact commits-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list commits@zest.apache.org Received: (qmail 40136 invoked by uid 99); 12 Jun 2016 07:28:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Jun 2016 07:28:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 685BDDFE61; Sun, 12 Jun 2016 07:28:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: niclas@apache.org To: commits@zest.apache.org Message-Id: <1272f01258ff4cb48da961f3f5df7c37@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: zest-java git commit: ZEST-124 - Fixed some of the refactoring bugs. Date: Sun, 12 Jun 2016 07:28:17 +0000 (UTC) archived-at: Sun, 12 Jun 2016 07:28:19 -0000 Repository: zest-java Updated Branches: refs/heads/develop 379100175 -> 00267a146 ZEST-124 - Fixed some of the refactoring bugs. Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/00267a14 Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/00267a14 Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/00267a14 Branch: refs/heads/develop Commit: 00267a1465170e8bbf54f959c0565d7be99c0683 Parents: 3791001 Author: Niclas Hedhman Authored: Sun Jun 12 15:28:10 2016 +0800 Committer: Niclas Hedhman Committed: Sun Jun 12 15:28:10 2016 +0800 ---------------------------------------------------------------------- .../zest/test/indexing/AbstractQueryTest.java | 34 +++++++++++--------- .../sql/postgresql/PostgreSQLQueryTest.java | 8 ++--- 2 files changed, 22 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zest-java/blob/00267a14/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java ---------------------------------------------------------------------- diff --git a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java b/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java index 8a0dc57..1175bc4 100644 --- a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java +++ b/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java @@ -22,6 +22,7 @@ package org.apache.zest.test.indexing; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; +import java.time.Instant; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneId; @@ -79,7 +80,6 @@ public abstract class AbstractQueryTest { @Structure Module moduleInstance; - private ZonedDateTime refDate; @Test public void showNetwork() @@ -573,35 +573,37 @@ public abstract class AbstractQueryTest { QueryBuilder qb = this.moduleInstance.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); - refDate = ZonedDateTime.of( 2010, 3, 4, 13, 24, 35, 0, UTC ); + Instant refInstant = ZonedDateTime.of( 2010, 3, 4, 13, 24, 35, 0, UTC ).toInstant(); + System.out.println( refInstant ); Query query = unitOfWork.newQuery( qb.where( - eq( person.instantValue(), refDate.toInstant() ) ) ); + eq( person.instantValue(), refInstant ) ) ); System.out.println( "*** script40_Date: " + query ); verifyUnorderedResults( query, "Jack Doe" ); } @Test - public void script41_Date() + public void script41_Instant() { QueryBuilder qb = this.moduleInstance.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); + Instant refInstant = ZonedDateTime.of( 2010, 3, 4, 13, 24, 35, 0, UTC ).toInstant(); Query query = unitOfWork.newQuery( qb.where( - ne( person.instantValue(), refDate.toInstant() ) ) ); - System.out.println( "*** script41_Date: " + query ); + ne( person.instantValue(), refInstant ) ) ); + System.out.println( "*** script41_Instant: " + query ); verifyUnorderedResults( query, "Joe Doe" ); } @Test - public void script42_Date() + public void script42_Instant() { QueryBuilder qb = this.moduleInstance.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); ZonedDateTime cetTime = ZonedDateTime.of( 2010, 3, 4, 14, 24, 35, 0, ZoneId.of( "CET" ) ); Query query = unitOfWork.newQuery( qb.where( ne( person.instantValue(), cetTime.toInstant() ) ) ); - System.out.println( "*** script42_Date: " + query ); + System.out.println( "*** script42_Instant: " + query ); verifyUnorderedResults( query, "Joe Doe" ); } @@ -704,9 +706,9 @@ public abstract class AbstractQueryTest { QueryBuilder qb = this.moduleInstance.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); - ZonedDateTime time = ZonedDateTime.of( 2010, 3, 4, 13, 24, 35, 0, ZoneId.of( "CET" ) ); + LocalDateTime time = LocalDateTime.of( 2010, 3, 4, 13, 23, 0 ); Query query = unitOfWork.newQuery( qb.where( - ne( person.localDateTimeValue(), time.toLocalDateTime() ) ) ); + ne( person.localDateTimeValue(), time ) ) ); System.out.println( "*** script42_LocalDateTime: " + query ); verifyUnorderedResults( query, "Joe Doe" ); @@ -733,7 +735,7 @@ public abstract class AbstractQueryTest QueryBuilder qb = this.moduleInstance.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); Query query = unitOfWork.newQuery( qb.where( - eq( person.localDateValue(), LocalDate.of( 2010,3,4 ) ) ) ); + eq( person.localDateValue(), LocalDate.of( 2010, 3, 4 ) ) ) ); System.out.println( "*** script40_LocalDate: " + query ); verifyUnorderedResults( query, "Jack Doe" ); @@ -745,7 +747,7 @@ public abstract class AbstractQueryTest QueryBuilder qb = this.moduleInstance.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); Query query = unitOfWork.newQuery( qb.where( - ne( person.localDateValue(), LocalDate.of( 2010,3,4 ) ) ) ); + ne( person.localDateValue(), LocalDate.of( 2010, 3, 4 ) ) ) ); System.out.println( "*** script41_LocalDate: " + query ); verifyUnorderedResults( query, "Joe Doe" ); @@ -756,7 +758,7 @@ public abstract class AbstractQueryTest { QueryBuilder qb = this.moduleInstance.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); - LocalDate time = ZonedDateTime.of(2010,3,4,13,24,35,0, ZoneId.of("CET")).toLocalDate(); + LocalDate time = ZonedDateTime.of( 2010, 3, 4, 13, 24, 35, 0, ZoneId.of( "CET" ) ).toLocalDate(); Query query = unitOfWork.newQuery( qb.where( ne( person.localDateValue(), time ) ) ); System.out.println( "*** script42_LocalDate: " + query ); @@ -769,10 +771,10 @@ public abstract class AbstractQueryTest { QueryBuilder qb = this.moduleInstance.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); - LocalDate start = ZonedDateTime.of(2010,3,4,13,24,35,0,UTC).toLocalDate(); - LocalDate end = ZonedDateTime.of(2010,3,4,13,24,35,0,UTC).toLocalDate(); + LocalDate start = ZonedDateTime.of( 2005, 3, 4, 13, 24, 35, 0, UTC ).toLocalDate(); + LocalDate end = ZonedDateTime.of( 2015, 3, 4, 13, 24, 35, 0, UTC ).toLocalDate(); Query query = unitOfWork.newQuery( qb.where( - and( gt( person.localDateValue(), start), + and( gt( person.localDateValue(), start ), lt( person.localDateValue(), end ) ) ) ); System.out.println( "*** script43_LocalDate: " + query ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/00267a14/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java ---------------------------------------------------------------------- diff --git a/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java b/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java index 013c498..503269f 100644 --- a/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java +++ b/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java @@ -158,9 +158,9 @@ public class PostgreSQLQueryTest @Test @Ignore( "NeSpecification is not supported by SQL Indexing" ) @Override - public void script41_Date() + public void script41_Instant() { - super.script41_Date(); + super.script41_Instant(); } @Test @@ -190,9 +190,9 @@ public class PostgreSQLQueryTest @Test @Ignore( "NeSpecification is not supported by SQL Indexing" ) @Override - public void script42_Date() + public void script42_Instant() { - super.script42_Date(); + super.script42_Instant(); } @Test