git commit: Modify test so as to not introduce a Java 1.7 dependency
Repository: phoenix Updated Branches: refs/heads/3.0 3f853bd71 -> e1ba4dec4 Modify test so as to not introduce a Java 1.7 dependency Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/e1ba4dec Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/e1ba4dec Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/e1ba4dec Branch: refs/heads/3.0 Commit: e1ba4dec494940dbd108f4a2c358f467b0156cd8 Parents: 3f853bd Author: James Taylor Authored: Wed Aug 27 22:49:31 2014 -0700 Committer: James Taylor Committed: Wed Aug 27 22:53:12 2014 -0700 -- .../RoundFloorCeilExpressionsTest.java | 35 +--- 1 file changed, 15 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/e1ba4dec/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java -- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java b/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java index 4757e5b..f8a7391 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java @@ -17,19 +17,21 @@ */ package org.apache.phoenix.expression; -import java.math.BigDecimal; +import static org.apache.phoenix.schema.PDataType.DECIMAL; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import java.math.BigDecimal; import java.sql.Date; import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.phoenix.compile.KeyPart; import org.apache.phoenix.expression.function.CeilDateExpression; @@ -44,9 +46,7 @@ import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; import org.apache.phoenix.query.KeyRange; import org.apache.phoenix.schema.IllegalDataException; import org.apache.phoenix.schema.PDataType; -import static org.apache.phoenix.schema.PDataType.DECIMAL; import org.apache.phoenix.util.DateUtil; -import static org.junit.Assert.assertFalse; import org.junit.Test; /** @@ -233,22 +233,17 @@ public class RoundFloorCeilExpressionsTest { * @param scale the scale to round the decimal to * @return the expression containing the above parameters */ -public Expression getExpression(byte[] key, int scale) { -try { -LiteralExpression decimalLiteral = LiteralExpression.newConstant(DECIMAL.toObject(key), DECIMAL); -switch(this) { -case ROUND: -return RoundDecimalExpression.create(decimalLiteral, scale); -case FLOOR: -return FloorDecimalExpression.create(decimalLiteral, scale); -case CEIL: -return CeilDecimalExpression.create(decimalLiteral, scale); -default: -throw new AssertionError("Unknown RoundingType"); -} -} -catch (SQLException ex) { -throw new AssertionError("Should never happen when creating decimal literal", ex); +public Expression getExpression(byte[] key, int scale) throws SQLException { +LiteralExpression decimalLiteral = LiteralExpression.newConstant(DECIMAL.toObject(key), DECIMAL); +switch(this) { +case ROUND: +return RoundDecimalExpression.create(decimalLiteral, scale); +case FLOOR: +return FloorDecimalExpression.create(decimalLiteral, scale); +case CEIL: +return CeilDecimalExpression.create(decimalLiteral, scale); +default: +throw new AssertionError("Unknown RoundingType"); } } }
git commit: Modify test so as to not introduce a Java 1.7 dependency
Repository: phoenix Updated Branches: refs/heads/master e8c2664e7 -> bd174c1c9 Modify test so as to not introduce a Java 1.7 dependency Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/bd174c1c Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/bd174c1c Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/bd174c1c Branch: refs/heads/master Commit: bd174c1c936398ad2b4b4c59d5ab6a9289c37afe Parents: e8c2664 Author: James Taylor Authored: Wed Aug 27 22:49:31 2014 -0700 Committer: James Taylor Committed: Wed Aug 27 22:52:04 2014 -0700 -- .../RoundFloorCeilExpressionsTest.java | 35 +--- 1 file changed, 15 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/bd174c1c/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java -- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java b/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java index 4757e5b..f8a7391 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java @@ -17,19 +17,21 @@ */ package org.apache.phoenix.expression; -import java.math.BigDecimal; +import static org.apache.phoenix.schema.PDataType.DECIMAL; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import java.math.BigDecimal; import java.sql.Date; import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.phoenix.compile.KeyPart; import org.apache.phoenix.expression.function.CeilDateExpression; @@ -44,9 +46,7 @@ import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; import org.apache.phoenix.query.KeyRange; import org.apache.phoenix.schema.IllegalDataException; import org.apache.phoenix.schema.PDataType; -import static org.apache.phoenix.schema.PDataType.DECIMAL; import org.apache.phoenix.util.DateUtil; -import static org.junit.Assert.assertFalse; import org.junit.Test; /** @@ -233,22 +233,17 @@ public class RoundFloorCeilExpressionsTest { * @param scale the scale to round the decimal to * @return the expression containing the above parameters */ -public Expression getExpression(byte[] key, int scale) { -try { -LiteralExpression decimalLiteral = LiteralExpression.newConstant(DECIMAL.toObject(key), DECIMAL); -switch(this) { -case ROUND: -return RoundDecimalExpression.create(decimalLiteral, scale); -case FLOOR: -return FloorDecimalExpression.create(decimalLiteral, scale); -case CEIL: -return CeilDecimalExpression.create(decimalLiteral, scale); -default: -throw new AssertionError("Unknown RoundingType"); -} -} -catch (SQLException ex) { -throw new AssertionError("Should never happen when creating decimal literal", ex); +public Expression getExpression(byte[] key, int scale) throws SQLException { +LiteralExpression decimalLiteral = LiteralExpression.newConstant(DECIMAL.toObject(key), DECIMAL); +switch(this) { +case ROUND: +return RoundDecimalExpression.create(decimalLiteral, scale); +case FLOOR: +return FloorDecimalExpression.create(decimalLiteral, scale); +case CEIL: +return CeilDecimalExpression.create(decimalLiteral, scale); +default: +throw new AssertionError("Unknown RoundingType"); } } }
git commit: Modify test so as to not introduce a Java 1.7 dependency
Repository: phoenix Updated Branches: refs/heads/4.0 2f8957019 -> 13903e055 Modify test so as to not introduce a Java 1.7 dependency Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/13903e05 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/13903e05 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/13903e05 Branch: refs/heads/4.0 Commit: 13903e055f301226bf12c0e256cf4c4f767bd88c Parents: 2f89570 Author: James Taylor Authored: Wed Aug 27 22:49:31 2014 -0700 Committer: James Taylor Committed: Wed Aug 27 22:49:31 2014 -0700 -- .../RoundFloorCeilExpressionsTest.java | 35 +--- 1 file changed, 15 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/13903e05/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java -- diff --git a/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java b/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java index 4757e5b..f8a7391 100644 --- a/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java +++ b/phoenix-core/src/test/java/org/apache/phoenix/expression/RoundFloorCeilExpressionsTest.java @@ -17,19 +17,21 @@ */ package org.apache.phoenix.expression; -import java.math.BigDecimal; +import static org.apache.phoenix.schema.PDataType.DECIMAL; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import java.math.BigDecimal; import java.sql.Date; import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; +import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.phoenix.compile.KeyPart; import org.apache.phoenix.expression.function.CeilDateExpression; @@ -44,9 +46,7 @@ import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; import org.apache.phoenix.query.KeyRange; import org.apache.phoenix.schema.IllegalDataException; import org.apache.phoenix.schema.PDataType; -import static org.apache.phoenix.schema.PDataType.DECIMAL; import org.apache.phoenix.util.DateUtil; -import static org.junit.Assert.assertFalse; import org.junit.Test; /** @@ -233,22 +233,17 @@ public class RoundFloorCeilExpressionsTest { * @param scale the scale to round the decimal to * @return the expression containing the above parameters */ -public Expression getExpression(byte[] key, int scale) { -try { -LiteralExpression decimalLiteral = LiteralExpression.newConstant(DECIMAL.toObject(key), DECIMAL); -switch(this) { -case ROUND: -return RoundDecimalExpression.create(decimalLiteral, scale); -case FLOOR: -return FloorDecimalExpression.create(decimalLiteral, scale); -case CEIL: -return CeilDecimalExpression.create(decimalLiteral, scale); -default: -throw new AssertionError("Unknown RoundingType"); -} -} -catch (SQLException ex) { -throw new AssertionError("Should never happen when creating decimal literal", ex); +public Expression getExpression(byte[] key, int scale) throws SQLException { +LiteralExpression decimalLiteral = LiteralExpression.newConstant(DECIMAL.toObject(key), DECIMAL); +switch(this) { +case ROUND: +return RoundDecimalExpression.create(decimalLiteral, scale); +case FLOOR: +return FloorDecimalExpression.create(decimalLiteral, scale); +case CEIL: +return CeilDecimalExpression.create(decimalLiteral, scale); +default: +throw new AssertionError("Unknown RoundingType"); } } }