@@ -330,7 +330,7 @@ d,seven,twelve,day,month,date,duration,guid
330330 }
331331 }
332332
333- protected void validateResults (ResultSet rs ) throws Exception
333+ protected void validateResults (Results rs ) throws Exception
334334 {
335335 }
336336 }
@@ -368,7 +368,7 @@ d,seven,twelve,day,month,date,duration,guid
368368 }
369369
370370 @Override
371- protected void validateResults (ResultSet rs ) throws Exception
371+ protected void validateResults (Results rs ) throws Exception
372372 {
373373 assertTrue(" Expected one row: " + _sql, rs. next());
374374 Object o = rs. getObject(1 );
@@ -667,8 +667,8 @@ d,seven,twelve,day,month,date,duration,guid
667667
668668 private void verifyType(ColumnInfo column, JdbcType expectedType, @Nullable String expectedFormat)
669669 {
670- assertEquals(" Type discrepancy for " + column.getName(), column.getJdbcType(), expectedType );
671- assertEquals(" Format discrepancy for " + column.getName(), column.getFormat(), expectedFormat );
670+ assertEquals(" Type discrepancy for " + column.getName(), expectedType, column.getJdbcType());
671+ assertEquals(" Format discrepancy for " + column.getName(), expectedFormat, column.getFormat());
672672 }
673673 },
674674
@@ -702,6 +702,9 @@ d,seven,twelve,day,month,date,duration,guid
702702 new MethodSqlTest(" SELECT concat(' concat' , concat(' in' , concat(' the' , ' hat' ))) FROM R WHERE rowid= 1 " , JdbcType.VARCHAR, " concatinthehat" ),
703703 new MethodSqlTest(" SELECT contextPath()" , JdbcType.VARCHAR, () -> new ActionURL().getContextPath()),
704704 new MethodSqlTest(" SELECT CONVERT (123 , VARCHAR ) FROM R WHERE rowid= 1 " , JdbcType.VARCHAR, " 123 " ),
705+ new MethodSqlTest(" SELECT CONVERT (' +infinity' , DOUBLE )" , JdbcType.DOUBLE, Double.POSITIVE_INFINITY),
706+ new MethodSqlTest(" SELECT CONVERT (' -infinity' , DOUBLE )" , JdbcType.DOUBLE, Double.NEGATIVE_INFINITY),
707+ new MethodSqlTest(" SELECT CONVERT (' nan' , DOUBLE )" , JdbcType.DOUBLE, Double.NaN),
705708 new MethodSqlTest(" SELECT COUNT (R . twelve) as cnt FROM R " , JdbcType.INTEGER),
706709 // TODO: cos
707710 // TODO: cot
@@ -835,7 +838,40 @@ d,seven,twelve,day,month,date,duration,guid
835838 new SqlTest(" WITH v AS (SELECT column1, column2 FROM (VALUES (CAST (' 1' as VARCHAR ), CAST (' 1' as INTEGER )), (' two' , 2 )) as v_) SELECT column1 as txt, column2 as i FROM v WHERE column1 = ' two' " , 2, 1),
836839
837840 // regression test: field reference in sub-select (https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=43580)
838- new SqlTest(" SELECT (SELECT a. title), a. parent. rowid FROM core. containers a" , 2, 1)
841+ new SqlTest(" SELECT (SELECT a. title), a. parent. rowid FROM core. containers a" , 2, 1),
842+
843+ // Column annotations
844+ new SqlTest(" SELECT 1 AS name @title = ' New Label' " )
845+ {
846+ @Override
847+ protected void validateResults(Results rs) throws Exception
848+ {
849+ assertEquals(" New Label " , rs.getColumn(1).getLabel());
850+ assertFalse(rs.getColumn(1).isHidden());
851+ assertNull(rs.getColumn(1).getFormat());
852+ }
853+ },
854+ new SqlTest(" SELECT 1 AS name @hidden ' ")
855+ {
856+ @Override
857+ protected void validateResults(Results rs) throws Exception
858+ {
859+ assertEquals("Name", rs.getColumn(1).getLabel());
860+ assertTrue(rs.getColumn(1).isHidden());
861+ assertNull(rs.getColumn(1).getFormat());
862+ }
863+ },
864+ new SqlTest("SELECT 1 AS name @format=' 0.00 ' ")
865+ {
866+ @Override
867+ protected void validateResults(Results rs) throws Exception
868+ {
869+ assertEquals("Name", rs.getColumn(1).getLabel());
870+ assertFalse(rs.getColumn(1).isHidden());
871+ assertEquals("0.00", rs.getColumn(1).getFormat());
872+ }
873+ }
874+
839875 );
840876
841877 List<SqlTest> postgres = List.of(
0 commit comments