当前位置: 首页>>代码示例>>Java>>正文


Java SimpleTypes类代码示例

本文整理汇总了Java中org.apache.flink.api.java.typeutils.runtime.AbstractGenericTypeSerializerTest.SimpleTypes的典型用法代码示例。如果您正苦于以下问题:Java SimpleTypes类的具体用法?Java SimpleTypes怎么用?Java SimpleTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SimpleTypes类属于org.apache.flink.api.java.typeutils.runtime.AbstractGenericTypeSerializerTest包,在下文中一共展示了SimpleTypes类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSimpleTypesObjects

import org.apache.flink.api.java.typeutils.runtime.AbstractGenericTypeSerializerTest.SimpleTypes; //导入依赖的package包/类
@Test
public void testSimpleTypesObjects() {
	SimpleTypes a = new SimpleTypes();
	SimpleTypes b = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes c = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes d = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes e = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes f = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes g = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	
	runTests(new SimpleTypes[] {a, b, c}, new SimpleTypes[] {d, e, f, g});
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:19,代码来源:AbstractGenericArraySerializerTest.java

示例2: testTuple5CustomObjects

import org.apache.flink.api.java.typeutils.runtime.AbstractGenericTypeSerializerTest.SimpleTypes; //导入依赖的package包/类
@Test
public void testTuple5CustomObjects() {
	Random rnd = new Random(807346528946L);
	
	SimpleTypes a = new SimpleTypes();
	SimpleTypes b = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes c = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes d = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes e = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes f = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes g = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	
	ComplexNestedObject1 o1 = new ComplexNestedObject1(5626435);
	ComplexNestedObject1 o2 = new ComplexNestedObject1(76923);
	ComplexNestedObject1 o3 = new ComplexNestedObject1(-1100);
	ComplexNestedObject1 o4 = new ComplexNestedObject1(0);
	ComplexNestedObject1 o5 = new ComplexNestedObject1(44);
	
	ComplexNestedObject2 co1 = new ComplexNestedObject2(rnd);
	ComplexNestedObject2 co2 = new ComplexNestedObject2();
	ComplexNestedObject2 co3 = new ComplexNestedObject2(rnd);
	ComplexNestedObject2 co4 = new ComplexNestedObject2(rnd);
	
	Book b1 = new Book(976243875L, "The Serialization Odysse", 42);
	Book b2 = new Book(0L, "Debugging byte streams", 1337);
	Book b3 = new Book(-1L, "Low level interfaces", 0xC0FFEE);
	Book b4 = new Book(Long.MAX_VALUE, "The joy of bits and bytes", 0xDEADBEEF);
	Book b5 = new Book(Long.MIN_VALUE, "Winnign a prize for creative test strings", 0xBADF00);
	Book b6 = new Book(-2L, "Distributed Systems", 0xABCDEF0123456789L);
	
	ArrayList<String> list = new ArrayList<String>();
	list.add("A");
	list.add("B");
	list.add("C");
	list.add("D");
	list.add("E");
	
	BookAuthor ba1 = new BookAuthor(976243875L, list, "Arno Nym");
	
	ArrayList<String> list2 = new ArrayList<String>();
	BookAuthor ba2 = new BookAuthor(987654321L, list2, "The Saurus");
	
	
	@SuppressWarnings("unchecked")
	Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>[] testTuples = new Tuple5[] {
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(a, b1, o1, ba1, co1),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(b, b2, o2, ba2, co2),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(c, b3, o3, ba1, co3),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(d, b2, o4, ba1, co4),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(e, b4, o5, ba2, co4),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(f, b5, o1, ba2, co4),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(g, b6, o4, ba1, co2)
	};
	
	runTests(-1, testTuples);
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:63,代码来源:TupleSerializerTest.java

示例3: testTuple5CustomObjects

import org.apache.flink.api.java.typeutils.runtime.AbstractGenericTypeSerializerTest.SimpleTypes; //导入依赖的package包/类
@Test
public void testTuple5CustomObjects() {
	Random rnd = new Random(807346528946L);
	
	SimpleTypes a = new SimpleTypes();
	SimpleTypes b = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes c = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes d = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes e = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes f = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	SimpleTypes g = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(),
			StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble());
	
	ComplexNestedObject1 o1 = new ComplexNestedObject1(5626435);
	ComplexNestedObject1 o2 = new ComplexNestedObject1(76923);
	ComplexNestedObject1 o3 = new ComplexNestedObject1(-1100);
	ComplexNestedObject1 o4 = new ComplexNestedObject1(0);
	ComplexNestedObject1 o5 = new ComplexNestedObject1(44);
	
	ComplexNestedObject2 co1 = new ComplexNestedObject2(rnd);
	ComplexNestedObject2 co2 = new ComplexNestedObject2();
	ComplexNestedObject2 co3 = new ComplexNestedObject2(rnd);
	ComplexNestedObject2 co4 = new ComplexNestedObject2(rnd);
	
	Book b1 = new Book(976243875L, "The Serialization Odysse", 42);
	Book b2 = new Book(0L, "Debugging byte streams", 1337);
	Book b3 = new Book(-1L, "Low level interfaces", 0xC0FFEE);
	Book b4 = new Book(Long.MAX_VALUE, "The joy of bits and bytes", 0xDEADBEEF);
	Book b5 = new Book(Long.MIN_VALUE, "Winnign a prize for creative test strings", 0xBADF00);
	Book b6 = new Book(-2L, "Distributed Systems", 0xABCDEF0123456789L);
	
	ArrayList<String> list = new ArrayList<String>();
	list.add("A");
	list.add("B");
	list.add("C");
	list.add("D");
	list.add("E");
	
	BookAuthor ba1 = new BookAuthor(976243875L, list, "Arno Nym");
	
	ArrayList<String> list2 = new ArrayList<String>();
	BookAuthor ba2 = new BookAuthor(987654321L, list2, "The Saurus");
	
	
	@SuppressWarnings("unchecked")
	Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>[] testTuples = new Tuple5[] {
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(a, b1, o1, ba1, co1),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(b, b2, o2, ba2, co2),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(c, b3, o3, ba1, co3),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(d, b2, o4, ba1, co4),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(e, b4, o5, ba2, co4),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(f, b5, o1, ba2, co4),
			new Tuple5<SimpleTypes, Book, ComplexNestedObject1, BookAuthor, ComplexNestedObject2>(g, b6, o4, ba1, co2)
	};
	
	runTests(testTuples);
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:63,代码来源:TupleSerializerTest.java


注:本文中的org.apache.flink.api.java.typeutils.runtime.AbstractGenericTypeSerializerTest.SimpleTypes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。