@@ -0,0 +1,2685 @@
+/*%0A * Copyright 2016 higherfrequencytrading.com%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage net.openhft.chronicle.wire;%0A%0Aimport net.openhft.chronicle.bytes.Bytes;%0Aimport net.openhft.chronicle.core.io.IORuntimeException;%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Apublic class TextWireCompatibilityTest %7B%0A%0A    @Test%0A    public void testAddFieldsInTheMiddle() %7B%0A        TextWire wire = new TextWire(Bytes.elasticHeapByteBuffer(100));%0A        wire.getValueOut().object(new SubIncompatibleObject());%0A        System.out.println(wire.toString());%0A        Assert.assertNotNull(wire.getValueIn().object());%0A    %7D%0A%0A    public static class SuperIncompatibleObject implements Marshallable %7B%0A        @Override%0A        public void readMarshallable(@NotNull WireIn wire) throws IORuntimeException %7B%0A            Assert.assertEquals(1, wire.read(() -%3E %22a%22).int32());%0A            String missingValue = wire.read(() -%3E %22c%22).text();%0A            if (missingValue != null) %7B%0A                System.err.println(%22expected null, had: %3C%22 + missingValue + %22%3E%22);%0A            %7D%0A        %7D%0A%0A        @Override%0A        public void writeMarshallable(@NotNull WireOut wire) %7B%0A            wire.write(() -%3E %22a%22).int32(1);%0A        %7D%0A    %7D%0A%0A    public static class SubIncompatibleObject extends SuperIncompatibleObject %7B%0A        @Override%0A        public void readMarshallable(@NotNull WireIn wire) throws IORuntimeException %7B%0A            super.readMarshallable(wire);%0A            Assert.assertEquals(TextWireCompatibilityTest.class, wire.read(() -%3E %22b%22).typeLiteral());%0A            Assert.assertNotNull(wire.read(() -%3E %22object%22).object());%0A            Assert.assertNotNull(wire.read(() -%3E %22object2%22).object());%0A        %7D%0A%0A        @Override%0A        public void writeMarshallable(@NotNull WireOut wire) %7B%0A            super.writeMarshallable(wire);%0A            wire.write(() -%3E %22b%22).typeLiteral(TextWireCompatibilityTest.class);%0A            wire.write(() -%3E %22object%22).object(new SimpleObject());%0A            wire.write(() -%3E %22object2%22).object(new SimpleObject());%0A        %7D%0A    %7D%0A%0A    public static class SimpleObject implements Marshallable %7B%0A    %7D%0A%7D%0A

Add TextWireCompatibilityTest, failing because of bugs