mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 17:45:08 +08:00
Support to auto-generate Java files from flatbuffer (#3749)
* auto gen flatbuffers for Java * Add auto_gen_tool.py * Refine * Add a comment * address comments. * Address comments. * Addressed * Refine * Address comments * Fix typo * Add exception * Address comments. * Refine * Fix lint * Fix * Fix lint and address comment. * Fix lint error
This commit is contained in:
committed by
Philipp Moritz
parent
d2cf8561f2
commit
8674606e26
@@ -2,6 +2,7 @@ package org.ray.api.test;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
@@ -79,4 +80,20 @@ public class UniqueIdTest {
|
||||
Assert.assertEquals("FCFCFDFE123456789ABCDEF123456789ABCDEF00".toLowerCase(), putId.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUniqueIdsAndByteBufferInterConversion() {
|
||||
final int len = 5;
|
||||
UniqueId[] ids = new UniqueId[len];
|
||||
for (int i = 0; i < len; ++i) {
|
||||
ids[i] = UniqueId.randomId();
|
||||
}
|
||||
|
||||
ByteBuffer temp = UniqueIdUtil.concatUniqueIds(ids);
|
||||
UniqueId[] res = UniqueIdUtil.getUniqueIdsFromByteBuffer(temp);
|
||||
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Assert.assertEquals(ids[i], res[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user