Loading src/adql/query/ADQLQuery.java +7 −6 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package adql.query; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2016 - UDS/Centre de Données astronomiques de Strasbourg (CDS), * Copyright 2012-2017 - UDS/Centre de Données astronomiques de Strasbourg (CDS), * Astronomisches Rechen Institut (ARI) */ Loading @@ -35,6 +35,7 @@ import adql.query.operand.ADQLColumn; import adql.query.operand.ADQLOperand; import adql.query.operand.function.DefaultUDF; import adql.query.operand.function.geometry.BoxFunction; import adql.query.operand.function.geometry.CentroidFunction; import adql.query.operand.function.geometry.CircleFunction; import adql.query.operand.function.geometry.PointFunction; import adql.query.operand.function.geometry.PolygonFunction; Loading @@ -46,7 +47,7 @@ import adql.search.ISearchHandler; * <p>The resulting object of the {@link ADQLParser} is an object of this class.</p> * * @author Grégory Mantelet (CDS;ARI) * @version 1.4 (03/2016) * @version 1.4 (02/2017) */ public class ADQLQuery implements ADQLObject { Loading Loading @@ -333,7 +334,7 @@ public class ADQLQuery implements ADQLObject { else{ if (operand instanceof ADQLColumn && ((ADQLColumn)operand).getDBLink() != null) col = ((ADQLColumn)operand).getDBLink(); if (col == null) else col = new DefaultDBColumn(item.getName(), null); } Loading @@ -345,7 +346,7 @@ public class ADQLQuery implements ADQLObject { ((DefaultDBColumn)col).setDatatype(type); } // CASE: Point type: else if (operand instanceof PointFunction) else if (operand instanceof PointFunction || operand instanceof CentroidFunction) ((DefaultDBColumn)col).setDatatype(new DBType(DBDatatype.POINT)); // CASE: Region type: else if (operand instanceof RegionFunction || operand instanceof CircleFunction || operand instanceof BoxFunction || operand instanceof PolygonFunction) Loading test/adql/TestADQLObjectPosition.java→test/adql/query/TestADQLObjectPosition.java +1 −1 Original line number Diff line number Diff line package adql; package adql.query; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; Loading test/adql/TestADQLQuery.java→test/adql/query/TestADQLQuery.java +8 −10 Original line number Diff line number Diff line package adql; package adql.query; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; Loading @@ -14,13 +14,6 @@ import org.junit.Test; import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.FunctionDef; import adql.query.ADQLObject; import adql.query.ADQLOrder; import adql.query.ADQLQuery; import adql.query.ClauseADQL; import adql.query.ClauseConstraints; import adql.query.ClauseSelect; import adql.query.SelectItem; import adql.query.constraint.Comparison; import adql.query.constraint.ComparisonOperator; import adql.query.constraint.ConstraintsGroup; Loading @@ -39,7 +32,10 @@ import adql.query.operand.function.MathFunctionType; import adql.query.operand.function.SQLFunction; import adql.query.operand.function.SQLFunctionType; import adql.query.operand.function.geometry.BoxFunction; import adql.query.operand.function.geometry.CentroidFunction; import adql.query.operand.function.geometry.CircleFunction; import adql.query.operand.function.geometry.GeometryFunction; import adql.query.operand.function.geometry.GeometryFunction.GeometryValue; import adql.query.operand.function.geometry.PointFunction; import adql.query.operand.function.geometry.PolygonFunction; import adql.query.operand.function.geometry.RegionFunction; Loading Loading @@ -195,8 +191,10 @@ public class TestADQLQuery { try{ select.clear(); select.add(new PointFunction(new StringConstant(""), new ADQLColumn("ra"), new ADQLColumn("dec"))); assertEquals(1, query.getResultingColumns().length); assertEquals(DBDatatype.POINT, query.getResultingColumns()[0].getDatatype().type); select.add(new CentroidFunction(new GeometryValue<GeometryFunction>(new ADQLColumn("aRegion")))); assertEquals(2, query.getResultingColumns().length); for(int i = 0; i < 2; i++) assertEquals(DBDatatype.POINT, query.getResultingColumns()[i].getDatatype().type); }catch(Exception ex){ ex.printStackTrace(); fail("The POINT function is well defined. This error should have occurred."); Loading test/adql/TestIdentifierField.java→test/adql/query/TestIdentifierField.java +1 −1 Original line number Diff line number Diff line package adql; package adql.query; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; Loading test/adql/TestIN.java→test/adql/query/constraint/TestIN.java +1 −1 Original line number Diff line number Diff line package adql; package adql.query.constraint; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; Loading Loading
src/adql/query/ADQLQuery.java +7 −6 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package adql.query; * You should have received a copy of the GNU Lesser General Public License * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * * Copyright 2012-2016 - UDS/Centre de Données astronomiques de Strasbourg (CDS), * Copyright 2012-2017 - UDS/Centre de Données astronomiques de Strasbourg (CDS), * Astronomisches Rechen Institut (ARI) */ Loading @@ -35,6 +35,7 @@ import adql.query.operand.ADQLColumn; import adql.query.operand.ADQLOperand; import adql.query.operand.function.DefaultUDF; import adql.query.operand.function.geometry.BoxFunction; import adql.query.operand.function.geometry.CentroidFunction; import adql.query.operand.function.geometry.CircleFunction; import adql.query.operand.function.geometry.PointFunction; import adql.query.operand.function.geometry.PolygonFunction; Loading @@ -46,7 +47,7 @@ import adql.search.ISearchHandler; * <p>The resulting object of the {@link ADQLParser} is an object of this class.</p> * * @author Grégory Mantelet (CDS;ARI) * @version 1.4 (03/2016) * @version 1.4 (02/2017) */ public class ADQLQuery implements ADQLObject { Loading Loading @@ -333,7 +334,7 @@ public class ADQLQuery implements ADQLObject { else{ if (operand instanceof ADQLColumn && ((ADQLColumn)operand).getDBLink() != null) col = ((ADQLColumn)operand).getDBLink(); if (col == null) else col = new DefaultDBColumn(item.getName(), null); } Loading @@ -345,7 +346,7 @@ public class ADQLQuery implements ADQLObject { ((DefaultDBColumn)col).setDatatype(type); } // CASE: Point type: else if (operand instanceof PointFunction) else if (operand instanceof PointFunction || operand instanceof CentroidFunction) ((DefaultDBColumn)col).setDatatype(new DBType(DBDatatype.POINT)); // CASE: Region type: else if (operand instanceof RegionFunction || operand instanceof CircleFunction || operand instanceof BoxFunction || operand instanceof PolygonFunction) Loading
test/adql/TestADQLObjectPosition.java→test/adql/query/TestADQLObjectPosition.java +1 −1 Original line number Diff line number Diff line package adql; package adql.query; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; Loading
test/adql/TestADQLQuery.java→test/adql/query/TestADQLQuery.java +8 −10 Original line number Diff line number Diff line package adql; package adql.query; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; Loading @@ -14,13 +14,6 @@ import org.junit.Test; import adql.db.DBType; import adql.db.DBType.DBDatatype; import adql.db.FunctionDef; import adql.query.ADQLObject; import adql.query.ADQLOrder; import adql.query.ADQLQuery; import adql.query.ClauseADQL; import adql.query.ClauseConstraints; import adql.query.ClauseSelect; import adql.query.SelectItem; import adql.query.constraint.Comparison; import adql.query.constraint.ComparisonOperator; import adql.query.constraint.ConstraintsGroup; Loading @@ -39,7 +32,10 @@ import adql.query.operand.function.MathFunctionType; import adql.query.operand.function.SQLFunction; import adql.query.operand.function.SQLFunctionType; import adql.query.operand.function.geometry.BoxFunction; import adql.query.operand.function.geometry.CentroidFunction; import adql.query.operand.function.geometry.CircleFunction; import adql.query.operand.function.geometry.GeometryFunction; import adql.query.operand.function.geometry.GeometryFunction.GeometryValue; import adql.query.operand.function.geometry.PointFunction; import adql.query.operand.function.geometry.PolygonFunction; import adql.query.operand.function.geometry.RegionFunction; Loading Loading @@ -195,8 +191,10 @@ public class TestADQLQuery { try{ select.clear(); select.add(new PointFunction(new StringConstant(""), new ADQLColumn("ra"), new ADQLColumn("dec"))); assertEquals(1, query.getResultingColumns().length); assertEquals(DBDatatype.POINT, query.getResultingColumns()[0].getDatatype().type); select.add(new CentroidFunction(new GeometryValue<GeometryFunction>(new ADQLColumn("aRegion")))); assertEquals(2, query.getResultingColumns().length); for(int i = 0; i < 2; i++) assertEquals(DBDatatype.POINT, query.getResultingColumns()[i].getDatatype().type); }catch(Exception ex){ ex.printStackTrace(); fail("The POINT function is well defined. This error should have occurred."); Loading
test/adql/TestIdentifierField.java→test/adql/query/TestIdentifierField.java +1 −1 Original line number Diff line number Diff line package adql; package adql.query; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; Loading
test/adql/TestIN.java→test/adql/query/constraint/TestIN.java +1 −1 Original line number Diff line number Diff line package adql; package adql.query.constraint; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; Loading