- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {LocalDateTime l =
new LocalDateTime()
LocalDateTime.now()
DateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
- Smart code suggestions by Codota
}
@Test public void testSumWithNullValues() throws Exception { ValueMetaInterface metaA = new ValueMetaInteger(); metaA.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL ); ValueMetaInterface metaB = new ValueMetaInteger(); metaA.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL ); assertNull( ValueDataUtil.sum( metaA, null, metaB, null ) ); Long valueB = new Long( 2 ); ValueDataUtil.sum( metaA, null, metaB, valueB ); }
@Test public void testSumConvertingStorageTypeToNormal() throws Exception { ValueMetaInterface metaA = mock( ValueMetaInteger.class ); metaA.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING ); ValueMetaInterface metaB = new ValueMetaInteger(); metaB.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING ); Object valueB = "2"; when( metaA.convertData( metaB, valueB ) ).thenAnswer( new Answer<Long>() { @Override public Long answer( InvocationOnMock invocation ) throws Throwable { return new Long( 2 ); } } ); Object returnValue = ValueDataUtil.sum( metaA, null, metaB, valueB ); verify( metaA ).convertData( metaB, valueB ); assertEquals( 2L, returnValue ); assertEquals( metaA.getStorageType(), ValueMetaInterface.STORAGE_TYPE_NORMAL ); }
targetData = targetMeta.convertData( sourceMeta, sourceData ); if ( prevTargetData != null ) { prevTargetData = ValueDataUtil.sum( targetMeta, prevTargetData, targetMeta, targetData ); } else { prevTargetData = targetData;