Remove ScalarType.isDateTimeCapable() ... (only used by CSV reader)

So the complexity cost doesn't justify itself against only being used
by CSV reader to validate when assigning a date/time format to a property
/ expression path.
This commit is contained in:
Rob Bygrave
2022-08-25 12:16:37 +12:00
parent 3092b59622
commit 10c9b2addd
29 changed files with 4 additions and 159 deletions
@@ -75,11 +75,6 @@ class ScalarTypeDurationTest {
assertEquals(Duration.ofSeconds(1234), duration);
}
@Test
void testIsDateTimeCapable() {
assertFalse(type.isDateTimeCapable());
}
@Test
void testConvertFromMillis() {
assertThrows(UnsupportedOperationException.class, () -> type.convertFromMillis(1000));
@@ -75,11 +75,6 @@ class ScalarTypeDurationWithNanosTest {
assertEquals(duration, val1);
}
@Test
void testIsDateTimeCapable() {
assertFalse(type.isDateTimeCapable());
}
@Test
void testConvertFromMillis() {
assertThrows(UnsupportedOperationException.class, () -> type.convertFromMillis(1000));
@@ -11,7 +11,8 @@ import java.sql.Timestamp;
import java.time.Instant;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
public class ScalarTypeInstantTest {
@@ -107,12 +108,6 @@ public class ScalarTypeInstantTest {
assertEquals(now, val1);
}
@Test
public void testIsDateTimeCapable() throws Exception {
assertTrue(type.isDateTimeCapable());
}
@Test
public void testConvertFromMillis() throws Exception {
@@ -77,11 +77,6 @@ public class ScalarTypeLocalTimeTest {
assertEquals(localTime, val1);
}
@Test
public void testIsDateTimeCapable() {
assertFalse(type.isDateTimeCapable());
}
@Test
public void testConvertFromMillis() {
assertThrows(TextException.class, () -> type.convertFromMillis(1234));
@@ -74,11 +74,6 @@ public class ScalarTypeLocalTimeWithNanosTest {
assertEquals(localTime, val1);
}
@Test
public void testIsDateTimeCapable() {
assertFalse(type.isDateTimeCapable());
}
@Test
public void testConvertFromMillis() {
assertThrows(TextException.class, () -> type.convertFromMillis(1234));
@@ -6,7 +6,8 @@ import java.sql.Date;
import java.time.LocalDate;
import java.time.MonthDay;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
public class ScalarTypeMonthDayTest {
@@ -48,11 +49,6 @@ public class ScalarTypeMonthDayTest {
assertEquals(value, monthDay);
}
@Test
public void testIsDateTimeCapable() {
assertFalse(type.isDateTimeCapable());
}
@Test
public void testConvertFromMillis() {
assertThrows(RuntimeException.class, () -> type.convertFromMillis(1203));
@@ -26,11 +26,6 @@ public class ScalarTypePostgresHstoreTest {
assertTrue(hstore.isMutable());
}
@Test
public void testIsDateTimeCapable() {
assertFalse(hstore.isDateTimeCapable());
}
@Test
public void testIsDirty() {
Map<String, Object> emptyMap = new HashMap<>();
@@ -1,6 +1,5 @@
package io.ebeaninternal.server.type;
import io.ebean.text.TextException;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayInputStream;
@@ -71,11 +70,6 @@ class ScalarTypeYearTest {
assertEquals(Year.of(2013), year);
}
@Test
void testIsDateTimeCapable() {
assertFalse(type.isDateTimeCapable());
}
@Test
void testConvertFromMillis() {
assertThrows(UnsupportedOperationException.class, () -> type.convertFromMillis(1000));