@@ -0,0 +1,2015 @@
+/*%0D%0A * jETeL/CloverETL - Java based ETL application framework.%0D%0A * Copyright (c) Javlin, a.s. (info@cloveretl.com)%0D%0A *  %0D%0A * This library is free software; you can redistribute it and/or%0D%0A * modify it under the terms of the GNU Lesser General Public%0D%0A * License as published by the Free Software Foundation; either%0D%0A * version 2.1 of the License, or (at your option) any later version.%0D%0A *%0D%0A * This library is distributed in the hope that it will be useful,%0D%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0D%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0D%0A * Lesser General Public License for more details.%0D%0A *%0D%0A * You should have received a copy of the GNU Lesser General Public%0D%0A * License along with this library; if not, write to the Free Software%0D%0A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA%0D%0A */%0D%0Apackage org.jetel.data;%0D%0A%0D%0Aimport org.jetel.metadata.DataFieldMetadata;%0D%0Aimport org.jetel.metadata.DataFieldType;%0D%0Aimport org.jetel.metadata.DataRecordMetadata;%0D%0Aimport org.jetel.test.CloverTestCase;%0D%0A%0D%0A/**%0D%0A * @author Kokon (info@cloveretl.com)%0D%0A *         (c) Javlin, a.s. (www.cloveretl.com)%0D%0A *%0D%0A * @created 13. 4. 2015%0D%0A */%0D%0Apublic class DataRecordFactoryTest extends CloverTestCase %7B%0D%0A%0D%0A%09public void testNewRecord() %7B%0D%0A%09%09try %7B%0D%0A%09%09%09DataRecordFactory.newRecord(null);%0D%0A%09%09%09assertTrue(false);%0D%0A%09%09%7D catch (NullPointerException e) %7B%0D%0A%09%09%09//correct%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09DataRecordMetadata metadata = new DataRecordMetadata(%22record%22);%0D%0A%09%09metadata.addField(new DataFieldMetadata(%22field1%22, DataFieldType.STRING, %22;%22));%0D%0A%09%09metadata.addField(new DataFieldMetadata(%22field2%22, DataFieldType.INTEGER, %22;%22));%0D%0A%09%09metadata.getField(1).setDefaultValueStr(%22123%22);%0D%0A%09%09metadata.getField(1).setNullable(false);%0D%0A%09%09DataRecord record = DataRecordFactory.newRecord(metadata);%0D%0A%09%09assertNotNull(record);%0D%0A%09%09//test the record is initialized and reset%0D%0A%09%09assertNull(record.getField(%22field1%22).getValue());%0D%0A%09%09assertEquals(123, record.getField(%22field2%22).getValue());%0D%0A%09%7D%0D%0A%09%0D%0A%7D%0D%0A

test added [CLO-6014 DataRecordFactory should return already initialized record]