// Path: core/src/main/java/fixio/netty/pipeline/FixClock.java
// public class FixClock extends Clock {
// 
//     private static final FixClock INSTANCE = new FixClock(Clock.system(FixConst.DEFAULT_ZONE_ID));
// 
//     private final Clock clock;
//     private final ZoneId zoneId;
//     private final long initialNanos;
//     private final Instant initialInstant;
// 
//     private FixClock(Clock clock) {
//         this.clock = clock;
//         this.zoneId = clock.getZone();
//         this.initialInstant = clock.instant();
//         this.initialNanos = System.nanoTime();
//     }
// 
//     public static FixClock systemUTC() {
//         return INSTANCE;
//     }
// 
//     @Override
//     public Instant instant() {
//         return initialInstant.plusNanos(System.nanoTime() - initialNanos);
//     }
// 
//     @Override
//     public ZoneId getZone() {
//         return zoneId;
//     }
// 
//     @Override
//     public FixClock withZone(final ZoneId zone) {
//         return new FixClock(clock.withZone(zone));
//     }
// 
//     public ZonedDateTime now() {
//         return ZonedDateTime.now(this);
//     }
// }


import fixio.netty.pipeline.FixClock;
import org.junit.Test;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoField;
import java.util.Random;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
/*
 * Copyright 2014 The FIX.io Project
 *
 * The FIX.io Project licenses this file to you 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 fixio.fixprotocol.fields;




public class UTCTimestampFieldTest {
    public static final int MILLIS = 537;
    public static final int MICROS = 537123;
    public static final int NANOS  = 537123456;
    public static final long PICOS = 537123456987L; // java time does not support picos
    //
    private static final String TIMESTAMP_NO_MILLIS = "19980604-08:03:31";
    private static final String TIMESTAMP_WITH_MILLIS = TIMESTAMP_NO_MILLIS+"."+MILLIS;
    private static final String TIMESTAMP_WITH_MICROS = TIMESTAMP_NO_MILLIS+"."+MICROS;
    private static final String TIMESTAMP_WITH_NANOS  = TIMESTAMP_NO_MILLIS+"."+NANOS;
    private static final String TIMESTAMP_WITH_PICOS  = TIMESTAMP_NO_MILLIS+"."+PICOS;
    //
// Path: core/src/main/java/fixio/netty/pipeline/FixClock.java
// public class FixClock extends Clock {
// 
//     private static final FixClock INSTANCE = new FixClock(Clock.system(FixConst.DEFAULT_ZONE_ID));
// 
//     private final Clock clock;
//     private final ZoneId zoneId;
//     private final long initialNanos;
//     private final Instant initialInstant;
// 
//     private FixClock(Clock clock) {
//         this.clock = clock;
//         this.zoneId = clock.getZone();
//         this.initialInstant = clock.instant();
//         this.initialNanos = System.nanoTime();
//     }
// 
//     public static FixClock systemUTC() {
//         return INSTANCE;
//     }
// 
//     @Override
//     public Instant instant() {
//         return initialInstant.plusNanos(System.nanoTime() - initialNanos);
//     }
// 
//     @Override
//     public ZoneId getZone() {
//         return zoneId;
//     }
// 
//     @Override
//     public FixClock withZone(final ZoneId zone) {
//         return new FixClock(clock.withZone(zone));
//     }
// 
//     public ZonedDateTime now() {
//         return ZonedDateTime.now(this);
//     }
// }


// Path: core/src/test/java/fixio/fixprotocol/fields/UTCTimestampFieldTest.java
import fixio.netty.pipeline.FixClock;
import org.junit.Test;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoField;
import java.util.Random;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

/*
 * Copyright 2014 The FIX.io Project
 *
 * The FIX.io Project licenses this file to you 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 fixio.fixprotocol.fields;




public class UTCTimestampFieldTest {
    public static final int MILLIS = 537;
    public static final int MICROS = 537123;
    public static final int NANOS  = 537123456;
    public static final long PICOS = 537123456987L; // java time does not support picos
    //
    private static final String TIMESTAMP_NO_MILLIS = "19980604-08:03:31";
    private static final String TIMESTAMP_WITH_MILLIS = TIMESTAMP_NO_MILLIS+"."+MILLIS;
    private static final String TIMESTAMP_WITH_MICROS = TIMESTAMP_NO_MILLIS+"."+MICROS;
    private static final String TIMESTAMP_WITH_NANOS  = TIMESTAMP_NO_MILLIS+"."+NANOS;
    private static final String TIMESTAMP_WITH_PICOS  = TIMESTAMP_NO_MILLIS+"."+PICOS;
    //
    private final ZonedDateTime testDate = ZonedDateTime.of(LocalDate.of(1998, 6, 4), LocalTime.of(8, 3, 31), FixClock.systemUTC().getZone());