// Path: core/src/main/java/fixio/fixprotocol/DataType.java
// public enum DataType {
//     INT,
//     CHAR,
//     MULTIPLECHARVALUE,
//     STRING,
//     FLOAT,
//     BOOLEAN,
//     AMT,
//     QTY,
//     PRICE,
//     PRICEOFFSET,
//     SEQNUM,
//     LENGTH,
//     NUMINGROUP,
//     MONTHYEAR,
//     UTCTIMESTAMP,
//     UTCDATEONLY,
//     UTCTIMEONLY,
//     PERCENTAGE,
//     CURRENCY,
//     COUNTRY,
//     LANGUAGE,
//     EXCHANGE,
//     LOCALMKTDATE,
//     MULTIPLESTRINGVALUE,
//     TZTIMEONLY,
//     TZTIMESTAMP,
//     XMLDATA,
//     DATA
// }
// 
// Path: core/src/main/java/fixio/netty/pipeline/FixClock.java
// public static FixClock systemUTC() {
//     return INSTANCE;
// }


import fixio.fixprotocol.DataType;
import fixio.fixprotocol.FieldType;
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import static fixio.netty.pipeline.FixClock.systemUTC;
import static java.nio.charset.StandardCharsets.US_ASCII;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
import static org.apache.commons.lang3.RandomStringUtils.randomAscii;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
    }

    @Test(expected = IllegalArgumentException.class)
    @Parameters({"XXX", "", "-"})
    public void testFailValueOfIncorrectBoolean(String value) {
        FieldFactory.valueOf(FieldType.PossDupFlag.tag(), value.getBytes(US_ASCII));
    }

    @Test
    public void testValueOfUtcTimestampWithMillis() {
        String value = "19980604-08:03:31.537";
        UTCTimestampField field = FieldFactory.valueOf(FieldType.OrigTime.tag(), value.getBytes(US_ASCII));

        assertEquals("tagnum", FieldType.OrigTime.tag(), field.getTagNum());
        assertEquals("value", ZonedDateTime.of(LocalDate.of(1998, 6, 4), LocalTime.of(8, 3, 31, (int) TimeUnit.MILLISECONDS.toNanos(537)), systemUTC().getZone()).toInstant().toEpochMilli(), field.getValue().toInstant().toEpochMilli());
    }

    @Test
    public void testValueOfUtcTimestampNoMillis() {
        String value = "19980604-08:03:31";
        UTCTimestampField field = FieldFactory.valueOf(FieldType.OrigTime.tag(), value.getBytes(US_ASCII));

        assertEquals("tagnum", FieldType.OrigTime.tag(), field.getTagNum());
        assertEquals("value", ZonedDateTime.of(LocalDate.of(1998, 6, 4), LocalTime.of(8, 3, 31), systemUTC().getZone()).toInstant().toEpochMilli(), field.getValue().toInstant().toEpochMilli());
    }

    @Test
    @Parameters({"200303", "20030320", "200303w2"})
    public void testFromStringValueMonthYear(final String value) {
        final int tag = FieldType.MaturityMonthYear.tag();
// Path: core/src/main/java/fixio/fixprotocol/DataType.java
// public enum DataType {
//     INT,
//     CHAR,
//     MULTIPLECHARVALUE,
//     STRING,
//     FLOAT,
//     BOOLEAN,
//     AMT,
//     QTY,
//     PRICE,
//     PRICEOFFSET,
//     SEQNUM,
//     LENGTH,
//     NUMINGROUP,
//     MONTHYEAR,
//     UTCTIMESTAMP,
//     UTCDATEONLY,
//     UTCTIMEONLY,
//     PERCENTAGE,
//     CURRENCY,
//     COUNTRY,
//     LANGUAGE,
//     EXCHANGE,
//     LOCALMKTDATE,
//     MULTIPLESTRINGVALUE,
//     TZTIMEONLY,
//     TZTIMESTAMP,
//     XMLDATA,
//     DATA
// }
// 
// Path: core/src/main/java/fixio/netty/pipeline/FixClock.java
// public static FixClock systemUTC() {
//     return INSTANCE;
// }


// Path: core/src/test/java/fixio/fixprotocol/fields/FieldFactoryTest.java
import fixio.fixprotocol.DataType;
import fixio.fixprotocol.FieldType;
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import static fixio.netty.pipeline.FixClock.systemUTC;
import static java.nio.charset.StandardCharsets.US_ASCII;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
import static org.apache.commons.lang3.RandomStringUtils.randomAscii;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

    }

    @Test(expected = IllegalArgumentException.class)
    @Parameters({"XXX", "", "-"})
    public void testFailValueOfIncorrectBoolean(String value) {
        FieldFactory.valueOf(FieldType.PossDupFlag.tag(), value.getBytes(US_ASCII));
    }

    @Test
    public void testValueOfUtcTimestampWithMillis() {
        String value = "19980604-08:03:31.537";
        UTCTimestampField field = FieldFactory.valueOf(FieldType.OrigTime.tag(), value.getBytes(US_ASCII));

        assertEquals("tagnum", FieldType.OrigTime.tag(), field.getTagNum());
        assertEquals("value", ZonedDateTime.of(LocalDate.of(1998, 6, 4), LocalTime.of(8, 3, 31, (int) TimeUnit.MILLISECONDS.toNanos(537)), systemUTC().getZone()).toInstant().toEpochMilli(), field.getValue().toInstant().toEpochMilli());
    }

    @Test
    public void testValueOfUtcTimestampNoMillis() {
        String value = "19980604-08:03:31";
        UTCTimestampField field = FieldFactory.valueOf(FieldType.OrigTime.tag(), value.getBytes(US_ASCII));

        assertEquals("tagnum", FieldType.OrigTime.tag(), field.getTagNum());
        assertEquals("value", ZonedDateTime.of(LocalDate.of(1998, 6, 4), LocalTime.of(8, 3, 31), systemUTC().getZone()).toInstant().toEpochMilli(), field.getValue().toInstant().toEpochMilli());
    }

    @Test
    @Parameters({"200303", "20030320", "200303w2"})
    public void testFromStringValueMonthYear(final String value) {
        final int tag = FieldType.MaturityMonthYear.tag();
        StringField field = FieldFactory.fromStringValue(DataType.MONTHYEAR, tag, value);