File tree Expand file tree Collapse file tree
driver-core/src/test/java/com/datastax/driver/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -347,6 +347,8 @@ public static Object getFixedValue(final DataType type) {
347347 return true ;
348348 case COUNTER :
349349 throw new UnsupportedOperationException ("Cannot 'getSomeValue' for counters" );
350+ case DURATION :
351+ return Duration .from ("1h20m3s" );
350352 case DECIMAL :
351353 return new BigDecimal ("3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679" );
352354 case DOUBLE :
Original file line number Diff line number Diff line change @@ -253,6 +253,8 @@ public void testPrimitiveDatatypes() throws Exception {
253253 case DOUBLE :
254254 alldatatypes .setDouble (index , ((Double ) sampleData ).doubleValue ());
255255 break ;
256+ case DURATION :
257+ alldatatypes .set (index , Duration .from (sampleData .toString ()), Duration .class );
256258 case FLOAT :
257259 alldatatypes .setFloat (index , ((Float ) sampleData ).floatValue ());
258260 break ;
@@ -322,8 +324,9 @@ public void testNonPrimitiveDatatypes() throws Exception {
322324 "WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor': '1'}" );
323325 session ().execute ("USE test_nonprimitive_datatypes" );
324326
325- // counters are not allowed inside collections
327+ // counters and durations are not allowed inside collections
326328 DATA_TYPE_PRIMITIVES .remove (DataType .counter ());
329+ DATA_TYPE_PRIMITIVES .remove (DataType .duration ());
327330
328331 // create UDT
329332 List <String > alpha_type_list = new ArrayList <String >();
You can’t perform that action at this time.
0 commit comments