當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。