()
| 109 | } |
| 110 | |
| 111 | @Test |
| 112 | public void testErrorLogFile() throws Exception { |
| 113 | PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE)); |
| 114 | w.println("A = load '" + INPUT_FILE + "' as (a0:int, a1:int, a2:int);"); |
| 115 | w.println("B = foreach A generate StringSize(a0);"); |
| 116 | w.println("store B into '" + OUTPUT_FILE + "';"); |
| 117 | w.close(); |
| 118 | |
| 119 | try { |
| 120 | String[] args = { "-x", "local", PIG_FILE }; |
| 121 | PigStats stats = PigRunner.run(args, null); |
| 122 | |
| 123 | assertTrue(!stats.isSuccessful()); |
| 124 | |
| 125 | Properties props = stats.getPigProperties(); |
| 126 | String logfile = props.getProperty("pig.logfile"); |
| 127 | File f = new File(logfile); |
| 128 | assertTrue(f.exists()); |
| 129 | } finally { |
| 130 | new File(PIG_FILE).delete(); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | @Test |
| 135 | public void testErrorLogFile2() throws Exception { |
nothing calls this directly
no test coverage detected