Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger (www.helger.com) philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package com.helger.appbasics.exchange;
import static org.junit.Assert.assertEquals;
Test class for class com.helger.appbasics.exchange.bulkexport.ExportRecord.

Author(s):
Philip Helger
public final class ExportRecordTest
  @Test
  public void testAddFieldTyped ()
  {
    final ExportRecord aRecordWithAllTypes = new ExportRecord ().addField ("Hallo")
                                                                .addField (PDTFactory.getCurrentLocalTime ())
                                                                .addField (PDTFactory.getCurrentLocalDate ())
                                                                .addField (PDTFactory.getCurrentLocalDateTime ())
                                                                .addField (PDTFactory.getCurrentDateTime ())
                                                                .addField (true)
                                                                .addField (.)
                                                                .addField (4711)
                                                                .addField (Integer.valueOf (-34))
                                                                .addField (-123456789012345L)
                                                                .addField (Long.valueOf (.))
                                                                .addField (new BigInteger ("1234512345123451234512345123451234512345123451234512345"))
                                                                .addField (3.1415)
                                                                .addField (Double.valueOf (.))
                                                                .addField (new BigDecimal ("12345123451234512345123451234512345123451234512345.12345"));
    assertEquals (15, aRecordWithAllTypes.getFieldCount ());
  }
  @Test
  public void testAddFieldUntyped ()
  {
    final ExportRecord aRecordWithAllTypes = new ExportRecord ().addField ((Object"Hallo")
                                                                .addField ((Object) PDTFactory.getCurrentLocalTime ())
                                                                .addField ((Object) PDTFactory.getCurrentLocalDate ())
                                                                .addField ((Object) PDTFactory.getCurrentLocalDateTime ())
                                                                .addField ((Object) PDTFactory.getCurrentDateTime ())
                                                                .addField ((Object.)
                                                                .addField ((Object) Integer.valueOf (-34))
                                                                .addField ((Object) Long.valueOf (.))
                                                                .addField ((Objectnew BigInteger ("1234512345123451234512345123451234512345123451234512345"))
                                                                .addField ((Object) Double.valueOf (.))
                                                                .addField ((Objectnew BigDecimal ("12345123451234512345123451234512345123451234512345.12345"));
    assertEquals (11, aRecordWithAllTypes.getFieldCount ());
  }
New to GrepCode? Check out our FAQ X