@@ -0,0 +1,1866 @@
+package org.apache.pig.tools.grunt;%0A%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport org.apache.pig.ExecType;%0Aimport org.apache.pig.PigServer;%0Aimport org.apache.pig.tools.grunt.GruntParser.ExplainState;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class TestGruntParser %7B%0A    private GruntParser parser;%0A    static PigServer pig;%0A    %0A    @Before%0A    public void setup() throws IOException %7B%0A        pig = new PigServer(ExecType.LOCAL);%0A    %7D%0A    %0A    @Test%0A    public void testProcessRemove() throws IOException %7B%0A        File tmpFile = File.createTempFile(%22TestGruntParser%22, %22testProcessRemove%22);%0A        String dummyScript = %22%22;%0A        parser = new GruntParser(new ByteArrayInputStream(dummyScript.getBytes()));%0A        parser.setParams(pig);%0A        %0A        //Delete existing file and check that it doesn't exist%0A        parser.processRemove(tmpFile.getAbsolutePath(), %22%22);%0A        assertFalse(tmpFile.exists());%0A        %0A        //Delete non-existing file and check for exception%0A        try %7B%0A            parser.processRemove(tmpFile.getAbsolutePath(), %22%22);%0A            fail(%22processRemove should throw exception when deleting missing file.%22);%0A        %7D catch (IOException e) %7B%0A            //Yay%0A        %7D%0A        %0A        //Delete non-existing file with force, no exception%0A        parser.processRemove(tmpFile.getAbsolutePath(), %22force%22);%0A        %0A        //Ensure that remove isn't processed when in explain mode%0A        tmpFile = File.createTempFile(%22TestGruntParser%22, %22testProcessRemove%22);%0A        parser.setExplainState(new ExplainState(%22%22,%22%22,%22%22,false,%22%22));%0A        parser.processRemove(tmpFile.getAbsolutePath(), %22force%22);%0A        assertTrue(tmpFile.exists());%0A    %7D%0A%7D%0A

Add support for removing s3 files