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

Method setUp

test/org/apache/pig/test/TestCompressedFiles.java:51–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 private File gzFile;
50
51 @Before
52 public void setUp() throws Exception {
53 datFile = File.createTempFile("compTest", ".dat");
54 gzFile = File.createTempFile("compTest", ".gz");
55 FileOutputStream dat = new FileOutputStream(datFile);
56 GZIPOutputStream gz = new GZIPOutputStream(new FileOutputStream(gzFile));
57 Random rand = new Random();
58 for(int i = 0; i < 1024; i++) {
59 StringBuffer sb = new StringBuffer();
60 int x = rand.nextInt();
61 int y = rand.nextInt();
62 sb.append(x);
63 sb.append('\t');
64 sb.append(y);
65 sb.append('\n');
66 byte bytes[] = sb.toString().getBytes();
67 dat.write(bytes);
68 gz.write(bytes);
69 }
70 dat.close();
71 gz.close();
72 }
73
74 @After
75 public void tearDown() throws Exception {

Callers

nothing calls this directly

Calls 7

appendMethod · 0.65
getBytesMethod · 0.65
closeMethod · 0.65
createTempFileMethod · 0.45
nextIntMethod · 0.45
toStringMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected