()
| 891 | } |
| 892 | |
| 893 | @Test |
| 894 | public void returnCodeTest2() throws Exception { |
| 895 | PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE)); |
| 896 | w.println("A = load 'non-existine.file' as (a0, a1);"); |
| 897 | w.println("B = load 'data' as (b0, b1);"); |
| 898 | w.println("C = join B by b0, A by a0 using 'repl';"); |
| 899 | w.println("store C into '" + OUTPUT_FILE + "';"); |
| 900 | w.close(); |
| 901 | |
| 902 | try { |
| 903 | String[] args = { "-x", execType, PIG_FILE }; |
| 904 | PigStats stats = PigRunner.run(args, null); |
| 905 | |
| 906 | assertTrue(!stats.isSuccessful()); |
| 907 | assertTrue(stats.getReturnCode() != 0); |
| 908 | //Currently, even if failed, spark engine will add a failed OutputStats, |
| 909 | // see: SparkPigStats.addFailJobStats() |
| 910 | if (execType.equals("spark")) { |
| 911 | assertTrue(stats.getOutputStats().size() == 1); |
| 912 | assertTrue(stats.getOutputStats().get(0).isSuccessful() == false); |
| 913 | } else { |
| 914 | assertTrue(stats.getOutputStats().size() == 0); |
| 915 | } |
| 916 | |
| 917 | } finally { |
| 918 | new File(PIG_FILE).delete(); |
| 919 | Util.deleteFile(cluster, OUTPUT_FILE); |
| 920 | } |
| 921 | } |
| 922 | |
| 923 | |
| 924 | @Test //PIG-1893 |
nothing calls this directly
no test coverage detected