5353import com .google .common .collect .Iterables ;
5454import com .google .spanner .v1 .ResultSetStats ;
5555import java .math .BigDecimal ;
56- import java .math .BigInteger ;
5756import java .util .ArrayList ;
5857import java .util .Arrays ;
5958import java .util .Collections ;
@@ -427,6 +426,7 @@ public void bindDateNull() {
427426
428427 @ Test
429428 public void bindInterval () {
429+ assumeFalse ("Emulator does not yet support INTERVAL" , EmulatorSpannerHelper .isUsingEmulator ());
430430 Interval d = Interval .parseFromString ("P1Y2M3DT4H5M6.789123S" );
431431 Struct row = execute (Statement .newBuilder (selectValueQuery ).bind ("p1" ).to (d ), Type .interval ());
432432 assertThat (row .isNull (0 )).isFalse ();
@@ -435,6 +435,7 @@ public void bindInterval() {
435435
436436 @ Test
437437 public void bindIntervalNull () {
438+ assumeFalse ("Emulator does not yet support INTERVAL" , EmulatorSpannerHelper .isUsingEmulator ());
438439 Struct row =
439440 execute (
440441 Statement .newBuilder (selectValueQuery ).bind ("p1" ).to ((Interval ) null ), Type .interval ());
@@ -837,6 +838,7 @@ public void bindDateArrayNull() {
837838
838839 @ Test
839840 public void bindIntervalArray () {
841+ assumeFalse ("Emulator does not yet support INTERVAL" , EmulatorSpannerHelper .isUsingEmulator ());
840842 Interval d1 = Interval .parseFromString ("P-1Y-2M-3DT4H5M6.789123S" );
841843 Interval d2 = Interval .parseFromString ("P1Y2M3DT-4H-5M-6.789123S" );
842844 Struct row =
@@ -849,6 +851,7 @@ public void bindIntervalArray() {
849851
850852 @ Test
851853 public void bindIntervalArrayEmpty () {
854+ assumeFalse ("Emulator does not yet support INTERVAL" , EmulatorSpannerHelper .isUsingEmulator ());
852855 Struct row =
853856 execute (
854857 Statement .newBuilder (selectValueQuery )
@@ -861,6 +864,7 @@ public void bindIntervalArrayEmpty() {
861864
862865 @ Test
863866 public void bindIntervalArrayNull () {
867+ assumeFalse ("Emulator does not yet support INTERVAL" , EmulatorSpannerHelper .isUsingEmulator ());
864868 Struct row =
865869 execute (
866870 Statement .newBuilder (selectValueQuery ).bind ("p1" ).toIntervalArray (null ),
@@ -1019,6 +1023,7 @@ public void invalidAmbiguousFieldAccess() {
10191023 }
10201024
10211025 private Struct structValue () {
1026+ // TODO: Add test for interval once interval is supported in emulator.
10221027 return Struct .newBuilder ()
10231028 .set ("f_int" )
10241029 .to (10 )
@@ -1032,8 +1037,6 @@ private Struct structValue() {
10321037 .to (Date .fromYearMonthDay (1 , 3 , 1 ))
10331038 .set ("f_string" )
10341039 .to ("hello" )
1035- .set ("f_interval" )
1036- .to (Interval .fromMonthsDaysNanos (100 , 200 , BigInteger .valueOf (5000000L )))
10371040 .set ("f_bytes" )
10381041 .to (ByteArray .copyFrom ("bytes" ))
10391042 .build ();
@@ -1042,6 +1045,7 @@ private Struct structValue() {
10421045 @ Test
10431046 public void bindStruct () {
10441047 assumeFalse ("structs are not supported on POSTGRESQL" , dialect .dialect == Dialect .POSTGRESQL );
1048+ // TODO: Add test for interval once interval is supported in emulator.
10451049 Struct p = structValue ();
10461050 String query =
10471051 "SELECT "
@@ -1051,7 +1055,6 @@ public void bindStruct() {
10511055 + "@p.f_timestamp,"
10521056 + "@p.f_date,"
10531057 + "@p.f_string,"
1054- + "@p.f_interval,"
10551058 + "@p.f_bytes" ;
10561059
10571060 Struct row =
0 commit comments