@Override protected boolean getBooleanInternal(int columnIndex) { return values.get(columnIndex).getBool(); }
@Test public void int64ArrayTryGetBool() { Value value = Value.int64Array(Arrays.asList(1234L)); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Expected: BOOL actual: ARRAY<INT64>"); value.getBool(); }
@Test public void int64ArrayNullTryGetBool() { Value value = Value.int64Array((Iterable<Long>) null); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Expected: BOOL actual: ARRAY<INT64>"); value.getBool(); }
@Test public void int64TryGetBool() { Value value = Value.int64(1234); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Expected: BOOL actual: INT64"); value.getBool(); }
@Test public void int64NullTryGetBool() { Value value = Value.int64(null); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Expected: BOOL actual: INT64"); value.getBool(); }
@Test public void bool() { Value v = Value.bool(true); assertThat(v.getType()).isEqualTo(Type.bool()); assertThat(v.isNull()).isFalse(); assertThat(v.getBool()).isTrue(); assertThat(v.toString()).isEqualTo("true"); }
@Test public void boolWrapper() { Value v = Value.bool(Boolean.FALSE); assertThat(v.getType()).isEqualTo(Type.bool()); assertThat(v.isNull()).isFalse(); assertThat(v.getBool()).isFalse(); assertThat(v.toString()).isEqualTo("false"); }
@Test public void boolWrapperNull() { Value v = Value.bool(null); assertThat(v.getType()).isEqualTo(Type.bool()); assertThat(v.isNull()).isTrue(); assertThat(v.toString()).isEqualTo(NULL_STRING); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("null value"); v.getBool(); }
@Override protected boolean getBooleanInternal(int columnIndex) { return values.get(columnIndex).getBool(); }
switch (code) { case BOOL: writeNumber(orderedCode, part, (long) (val.getBool() ? 0 : 1)); break; case INT64: