Skip to content

Commit

Permalink
Merge changes from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lawrey committed Jan 5, 2024
1 parent d41da0d commit cebde5f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.core.io.IORuntimeException;
import net.openhft.chronicle.core.io.InvalidMarshallableException;
import net.openhft.chronicle.core.time.SystemTimeProvider;
import net.openhft.chronicle.wire.converter.NanoTime;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.function.BiConsumer;

import static net.openhft.chronicle.core.time.SystemTimeProvider.CLOCK;

/**
* The {@code VanillaMessageHistory} class is an implementation of {@link MessageHistory} that
* provides an array-backed history of messages.
Expand Down
32 changes: 1 addition & 31 deletions src/test/java/net/openhft/chronicle/wire/LongConversionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,44 +83,14 @@ public void method() {
assertEquals("to[74565]\n", sw.toString().replaceAll("\r", ""));
}


// Test case to check the method using OxHexadecimalLongConverter
@Test
public void oxmethod() {

// Initializing a new Wire instance with an elastic heap-allocated buffer
Wire wire = new TextWire(Bytes.allocateElasticOnHeap(64))
.useTextDocuments();

// Creating a method writer for the OxWriteWithLong interface
LongConversionTest.OxWriteWithLong write = wire.methodWriter(LongConversionTest.OxWriteWithLong.class);
assertSame(write, write.to(0x12345));

// Asserting the wire's string representation
assertEquals("to: 0x12345\n", wire.toString());

// Setting up a StringWriter to capture logging output
StringWriter sw = new StringWriter();
LongConversionTest.OxWriteWithLong read = Mocker.logging(LongConversionTest.OxWriteWithLong.class, "", sw);
wire.methodReader(read).readOne();

// NOTE: Mocker which is in Core, ignores the LongConverter
assertEquals("to[74565]\n", sw.toString().replaceAll("\r", ""));
}

// Interface for method writers that use HexadecimalLongConverter
interface WriteWithLong {
LongConversionTest.WriteWithLong to(@LongConversion(HexadecimalLongConverter.class) int x);
}

// Interface for method writers that use OxHexadecimalLongConverter
interface OxWriteWithLong {
LongConversionTest.OxWriteWithLong to(@LongConversion(OxHexadecimalLongConverter.class) int x);
}

// Static class representing a holder for various types of Long values
static class LongHolder extends SelfDescribingMarshallable {
@LongConversion(UnsignedLongConverter.class)
@LongConversion(Base32LongConverter.class)
long unsigned; // Represents unsigned long value
@LongConversion(HexadecimalLongConverter.class)
long hex; // Represents a hexadecimal long value
Expand Down

This file was deleted.

0 comments on commit cebde5f

Please sign in to comment.