MCPcopy Create free account
hub / github.com/apache/pig / testPigStorage

Method testPigStorage

test/org/apache/pig/test/TestUTF8.java:48–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46 }
47
48 @Test
49 public void testPigStorage() throws Exception{
50
51 File f1 = File.createTempFile("tmp", "");
52 PrintWriter pw = new PrintWriter(f1, "UTF-8");
53 pw.println("中文");
54 pw.println("にほんご");
55 pw.println("한국어");
56 pw.println("ภาษาไทย");
57 pw.close();
58
59 pigServer.registerQuery("a = load '"
60 + Util.encodeEscape(Util.generateURI(f1.toString(), pigServer.getPigContext()))
61 + "' using " + PigStorage.class.getName() + "();");
62 Iterator<Tuple> iter = pigServer.openIterator("a");
63
64 assertEquals(DataType.toString(iter.next().get(0)), "中文");
65 assertEquals(DataType.toString(iter.next().get(0)), "にほんご");
66 assertEquals(DataType.toString(iter.next().get(0)), "한국어");
67 assertEquals(DataType.toString(iter.next().get(0)), "ภาษาไทย");
68
69 f1.delete();
70 }
71
72 @Test
73 public void testScriptParser() throws Throwable {

Callers

nothing calls this directly

Calls 14

encodeEscapeMethod · 0.95
generateURIMethod · 0.95
toStringMethod · 0.95
openIteratorMethod · 0.80
closeMethod · 0.65
getMethod · 0.65
deleteMethod · 0.65
createTempFileMethod · 0.45
registerQueryMethod · 0.45
toStringMethod · 0.45
getPigContextMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected