Java Code Examples for net.openhft.chronicle.wire.Marshallable#fromString()
The following examples show how to use
net.openhft.chronicle.wire.Marshallable#fromString() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClusterTest.java From Chronicle-Network with Apache License 2.0 | 6 votes |
@Test public void testDeepCopy() { MyClusterContext cc = (MyClusterContext) new MyClusterContext().value(22).wireType(WireType.TEXT); String s = Marshallable.$toString(cc); MyClusterContext o = Marshallable.fromString(s); Assert.assertEquals(cc.value, o.value); MyClusterContext cc2 = cc.deepCopy(); Assert.assertEquals(cc.value, cc2.value); try (Cluster<HostDetails, ?, MyClusterContext<?>> c = new MyCluster("mine")) { c.clusterContext(cc); try (Cluster<HostDetails, ?, MyClusterContext<?>> c2 = c.deepCopy()) { MyClusterContext mcc = c2.clusterContext(); Assert.assertNotNull(mcc); Assert.assertEquals(22, mcc.value); } } }
Example 2
Source File: SingleChronicleQueueBuilderTest.java From Chronicle-Queue with Apache License 2.0 | 5 votes |
@Test public void testReadMarshallable() { SingleChronicleQueueBuilder builder = Marshallable.fromString("!net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder {\n" + " writeBufferMode: None,\n" + " readBufferMode: None,\n" + " wireType: BINARY_LIGHT,\n" + " path: " + DirectoryUtils.tempDir("marshallable") + " rollCycle: !net.openhft.chronicle.queue.RollCycles DAILY,\n" + " onRingBufferStats: !net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder$NoBytesRingBufferStats NONE,\n" + " timeProvider: !net.openhft.chronicle.core.time.SystemTimeProvider INSTANCE,\n" + "}\n"); builder.build().close(); }
Example 3
Source File: SingleChronicleQueueBuilderTest.java From Chronicle-Queue with Apache License 2.0 | 5 votes |
@Test public void testWriteMarshallable() { final SingleChronicleQueueBuilder builder = SingleChronicleQueueBuilder.single("test").rollCycle(HOURLY); builder.build().close(); String val = Marshallable.$toString(builder); System.err.println(val); SingleChronicleQueueBuilder builder2 = Marshallable.fromString(val); builder2.build().close(); }